fix: make agent compaction freshness mtime-independent - #488
Merged
Conversation
The compaction source document embedded a last_updated date derived from file mtime whenever a page had no explicit lastmod frontmatter (no docs page sets one), so agent compact --check only passed when the checkout day matched the generation day. That broke the freshness and local-readiness checks on main starting Aug 17, the first push after the Aug 14 provenance refresh. - Drop the mtime-derived lastModified fallback from the compaction source document; only explicit frontmatter lastmod contributes a last_updated line. Add a regression test that shifts page mtimes and asserts freshness is unaffected. - Re-stamp provenance sourceHash on all 49 generated agent.md pages; content is unchanged (a full cloud re-compaction was measured to regress golden-task quality from 22/22 to 9/22, so the curated output is kept, matching the #479 refresh approach). - Re-record the 4 drifted review-manifest entries and add reviewed entries for /docs/cli, /docs/reference, and /docs/token-efficiency, whose sources gained #485/#487 review-workflow coverage that the preserved compacted output does not yet fold in.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/farmjs
@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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
freshness(agent-freshness.yml) andlocal-readiness(agent-surface-smoke.yml) checks have been red onmainsince Aug 17.Root cause: the compaction source document embedded a
last_updateddate derived from file mtime whenever a page had no explicitlastmodfrontmatter — and no docs page sets one. Since every fresh checkout (includingactions/checkout) stamps mtimes with the checkout time,agent compact --checkcould only pass on the same calendar day the content was generated. It passed Aug 14–16 by coincidence and broke on the first push after the Aug 14 provenance refresh (#485), flagging all 49 generated pages as stale and all 4 review-manifest entries as invalid, even though only the pages touched by #485/#487 had actually changed.Fix
lastModifiedfallback from the compaction source document (buildResolvedPageSourceDocument); only explicit frontmatterlastmodcontributes alast_updatedline, so source hashes are stable across checkouts. Regression test included (shifts page mtimes by 400 days and asserts freshness is unaffected).sourceHashon all 49 generatedagent.mdpages — content unchanged, only the two header lines per file. A full cloud re-compaction was measured to regress golden-task quality from 22/22 (99.5/100) to 9/22, so the curated output is kept, matching the approach of the Refresh agent content provenance and add freshness CI #479 refresh./docs/configurationgenuinely changed in docs(cli): add docs for agent compact review workflow #485; the three customization pages drifted only via the hashing fix), and add reviewed entries for/docs/cli,/docs/reference,/docs/token-efficiency, whose sources gained docs(cli): add docs for agent compact review workflow #485/fix: create require lazily so server bundles load when import.meta.url is undefined #487 review-workflow coverage that the preserved compacted output does not yet fold in. The next edit to those pages will correctly demand a re-review.Verification
agent compact --check: exits 0 — 46 fresh, 7 reviewed, 0 invalid/orphaned/stale/modified — and still passes after touching everypage.mdxmtime (the failure mode that broke CI).local-readinesssteps run locally:doctor --agent --ci --fail-on failexits 0 (golden tasks 22/22 at 99.5/100, task completeness 30/30) andcheck-agent-readiness-report.mjspasses with 0 unexpected warnings.vitest:cli/agent.test.ts29/29 (incl. new regression test),agent-provenance.test.ts,cli/doctor.test.ts66/66.Follow-up
Fold #485's review-workflow coverage into the curated
agent.mdfor/docs/cli,/docs/reference, and/docs/token-efficiency, then re-review those entries.Summary by cubic
Makes agent compaction freshness independent of file mtimes so CI stays green. Previously the compaction source document injected a last_updated from file mtime when lastmod was missing; now only explicit frontmatter lastmod contributes, stabilizing source hashes across checkouts.
Review focus
Rollout and verification
agent compact --checknow passes across days and after mtime changes; local readiness checks and tests pass, including the new regression test.Written for commit 044c704. Summary will update on new commits.