Commit the site-audit builder, with the audited notes as its only hand input - #265
Merged
Merged
Conversation
…d input _fleet/data/site_audit.json was written by a script that existed only in a session scratchpad, so each refresh had to rewrite it from the skill's prose and nothing checked that the rewrite derived each field the same way (#238). scripts/fleet/build_site_audit.py now derives every mechanical field from the snapshot, mech_stats.json and check_cards.figure(), appends the sentence saying whether each live copy still matches its pin, and refuses a card that differs from its figure at the pin or exceeds its site. The audited notes and scope move to _fleet/audit_notes.json, the builder's only hand-written input. Run in memory against the #120 snapshot and the live sites, it reproduces the committed audit exactly, key order and notes included, except CellStructureMech, whose site has grown from 577 to 584 since the audit was written. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 25, 2026
build() had no test, so its notes refusal, UTC commit dates, CLAW entry and order could regress unnoticed; an offline test now covers them (#266). The refusal names only the notes actually missing and the file read (#267). The WRONG remedy says to re-derive figure_at_pin with the builder, never edit it (#268). Step 1 gives the revisions.json layout and pin-time format the builder reads, and the builder refuses a pin time the nightly would report as AUDIT (#269). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 25, 2026
…y derived field AUDIT's remedy said to fix site_audit.json by hand, though figure_at_pin and the pin time are derived; it now says to regenerate the audit with the builder (#273). A commit date with no offset is refused instead of being read as local time, and step 1 says to use the committer date with its offset (#274). The tests now check local_date under a non-UTC zone, each hash against its own copy, a data source's page hash, readme_url and merged_prs (#275). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rebuilding from the failing audit reproduces a bad pin time, and a missing audit or a Mech with no entry has no pins to rebuild from. The remedy now says where each comes from: rebuild for figure_at_pin, the last builder-written audit or the PR body for the pins, a full refresh for a new Mech (#276). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
git log needs -- before a path that may be deleted, and the refresh PR body has no pin time, so the AUDIT remedy now names only the last builder-written audit. A malformed audit is covered, and card_records is named as the one audit field a WRONG fix edits (#277). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #238, closes #266, closes #267, closes #268, closes #269, closes #273, closes #274, closes #275, closes #276, closes #277.
_fleet/data/site_audit.jsonwas written bybuild_site_audit.py, a script that existed only in the #120 session's scratchpad. Each refresh had to rewrite it from the update skill's prose, and nothing checked that the rewrite derived each field the same way. That mattered once #212 made the nightly check depend on the audit'sfigure_at_pinand pin time.What changes
The builder: new
scripts/fleet/build_site_audit.py --snapshot "$SNAP". It derives:$SNAP/revisions.json;mech_stats.json, after checking it was counted at the pins;figure_at_pin, throughcheck_cards.figure()on the served file and on its committed copy at the pin (read withgit showfrom the snapshot clone);It refuses to write when a card differs from its figure at the pin, when a site states fewer records than its card, when stats weren't counted at the pin, when a source has no committed copy and isn't declared in
check_cards.NO_PIN_COPY, when notes are missing (naming only those), when the pin time is unreadable or in the future, or when a commit date has no offset (build_site_audit's missing-notes refusal always names culturebotai-claw and the default notes path #267, The update skill no longer specifies pinned_at_utc's format or revisions.json's layout, which the audit builder reads unchecked #269, build_site_audit reads a commit_date with no offset as local time, while pin_time reads one as UTC #274).The notes: the audited notes and scope move to the new
_fleet/audit_notes.json, the builder's only hand-written input.Docs: step 7 of the update skill now runs the builder instead of describing it. Step 1 gives the
revisions.jsonlayout the builder reads (The update skill no longer specifies pinned_at_utc's format or revisions.json's layout, which the audit builder reads unchecked #269)._fleet/README.mddescribes the audit and its builder. The WRONG remedy, in the README and incheck_cards.py's closing line, now says to re-derivefigure_at_pin, never edit it (The WRONG remedy says to hand-edit figure_at_pin, which the audit builder now derives #268). AUDIT's remedy is split by cause: rebuild forfigure_at_pin, the last builder-written audit for the pins, a full refresh for a new Mech (check_cards: AUDIT's remedy says to fix site_audit.json by hand, though figure_at_pin and the pin time are derived #273, The AUDIT remedy loops when the pin time or the audit itself is what is broken #276).Evidence
build()was run in memory, without writing, against the Refresh the X-Mech page from the Mechs as they are now, and add the skill that does it #120 snapshot and the live sites. It reproduces the committedsite_audit.jsonexactly, key order and notes included, for all eleven repositories. The only exception is CellStructureMech's live hash andsite_figure_at_check: its site has grown from 577 to 584 since the audit was written. Every pin-derived field matches.python3 -m unittest discover -s tests: 86 tests pass. The new offlineSiteAuditBuilderTestsuse fakes for fetch andgit show, and cover:build()as a whole: key order, UTC commit dates, the CLAW entry, sorting, the notes refusal and bad pin times (build_site_audit.build() has no test: the notes refusal, commit-date conversion, CLAW entry and sort are unchecked #266);local_dateunder a non-UTC zone, each hash against its own copy,readme_urlandmerged_prs(Site-audit builder tests: local_date, the at-pin hash, a data source's page hash, readme_url and merged_prs are unchecked #275);audit_notes.json.assemble_page.py --checkreports current.site_audit.jsonitself is unchanged.🤖 Generated with Claude Code