Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/theme
@farming-labs/next
@farming-labs/nuxt
@farming-labs/nuxt-theme
@farming-labs/svelte
@farming-labs/svelte-theme
@farming-labs/tanstack-start
commit: |
There was a problem hiding this comment.
1 issue found across 19 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/docs/src/cli/doctor.ts">
<violation number="1" location="packages/docs/src/cli/doctor.ts:1076">
P2: Compaction freshness can be misreported when docs config falls back to static parsing, because compaction defaults are discarded as `{}` before state inspection.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| }); | ||
| const pages = await Promise.resolve(source.getPages()); | ||
| const coverage = buildCoverage(pages); | ||
| const compactionCoverage = buildCompactionCoverage( |
There was a problem hiding this comment.
P2: Compaction freshness can be misreported when docs config falls back to static parsing, because compaction defaults are discarded as {} before state inspection.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/docs/src/cli/doctor.ts, line 1076:
<comment>Compaction freshness can be misreported when docs config falls back to static parsing, because compaction defaults are discarded as `{}` before state inspection.</comment>
<file context>
@@ -933,11 +1073,20 @@ export async function inspectAgentReadiness(
});
const pages = await Promise.resolve(source.getPages());
const coverage = buildCoverage(pages);
+ const compactionCoverage = buildCompactionCoverage(
+ rootDir,
+ contentDir,
</file context>
Greptile SummaryThis PR implements a hash-based provenance system for generated Confidence Score: 5/5Safe to merge; all remaining findings are P2 style/UX suggestions with no correctness or data-integrity impact. The implementation is thorough and well-tested: the FNV-1a hash is cross-verified in tests, all five compaction states have integration test coverage, and all four framework server adapters are consistently updated to strip provenance. No P0/P1 defects were found. The two P2 observations (persistent 'warn' for intentionally modified files, and version-0 slipping past the guard) do not affect correctness under normal usage. packages/docs/src/cli/doctor.ts (compactionFreshnessScore modified-pages logic) and packages/docs/src/agent-provenance.ts (version validation guard). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["docs agent compact --stale"] --> B{selectAll or explicit pages}
B --> C["scanDocsPageTargets()"]
C --> D["For each page: inspectAgentCompactionState()"]
D --> E{agent.md exists?}
E -- No --> F["status: missing"]
E -- Yes --> G{provenance present?}
G -- No --> H["status: unknown"]
G -- Yes --> I{sourceKind?}
I -- agent-md --> J{outputModified?}
J -- Yes --> K["status: modified"]
J -- No --> L["status: unknown"]
I -- resolved-page --> M{sourceChanged or settingsChanged?}
M -- No, output matches --> N["status: fresh ✓"]
M -- Yes, output also changed --> O["status: stale-modified"]
M -- Yes, output unchanged --> P["status: stale"]
P --> Q["compressDocument()"]
O --> R["skip — manual edit wins"]
K --> R
H --> R
N --> S["skip — already fresh"]
F --> T{includeMissing + tokenBudget?}
T -- Yes --> Q
T -- No --> U["skip — otherMissing"]
Q --> V["serializeGeneratedAgentDocument()"]
V --> W["Write agent.md with provenance header"]
|
| if ( | ||
| !Number.isFinite(version) || |
There was a problem hiding this comment.
Number.isFinite(0) returns true, so a provenance block with version=0 would be accepted as valid. Since GENERATED_AGENT_PROVENANCE_VERSION = 1, this means a manually crafted or corrupted block with version 0 silently passes. Consider adding version > 0 (or version === GENERATED_AGENT_PROVENANCE_VERSION) to the guard so any out-of-range version falls through to undefined.
Summary by cubic
Add hash-based provenance to generated
agent.mdand a stale-only compaction flow to refresh only drifted pages.docs doctor --agentreports freshness, and servers strip the header before parsing.sourceHash,settingsHash,outputHash, andgeneratedAt; helpers export frompackages/docs(parseGeneratedAgentDocument,serializeGeneratedAgentDocument,stripGeneratedAgentProvenance).docs agent compactadds--staleand--include-missing:--include-missing, creates files for explicit pages or pages withagent.tokenBudget.agent.mdand prints concise skip/create/overwrite summaries.docs doctor --agentreports compaction freshness counts and gives targeted recommendations (e.g.,--stale,--include-missing).astro,nuxt,svelte,tanstack-start) strip the provenance header beforegray-matterparsing.Written for commit 74cd46b. Summary will update on new commits. Review in cubic