Skip to content

Every Resync Hand-Rolls the Verbatim Section Re-Vendor, the One Apply Step With No Tested Tool Behind It #1401

Closed

Description

@ptr727

scripts/carry.py propagates manifest-owned trees (#797), and the audit reports a stale
section inside a mixed file precisely enough to name it. Between those two there is nothing.
RESYNC.md section 3 says to re-vendor the verbatim sections, and every resync writes its own
one-off code to do it.

That is the step the AGENTS.md-overwrite incident happened on, and it is the only step in the
apply order with no tested tool behind it.

Evidence, from the 2.0.577 resync pilot on Utilities (PR ptr727/Utilities#466)

audit run 2026-09-07T02:37:02Z | hub f8e7491.

Eight sections were stale across two files. I wrote a throwaway replacer and, separately, a
throwaway verifier asserting the result. The verifier caught a defect in the replacer on its
first run
: rebuilding the file as preamble + "\n".join(sections) dropped the single newline
between the preamble and the first heading, silently deleting one blank line from both
AGENTS.md and GOVERNANCE.md.

That defect is invisible in review. It is one blank line in a 563-line diff, it breaks no
Markdown renderer, and no linter in the gate set flags it. It would have shipped, and the next
audit would have reported both files as drift again for a reason nobody could see. The only
thing that caught it was an assertion written before the edit was trusted.

A resync that hand-rolls this each time gets the assertion only when whoever runs it happens to
write one.
That is the argument for a hub tool rather than for more care.

What the tool needs to do

A carry.py-shaped subcommand, taking the repository name and a target worktree:

  1. Read spec/files.json for the file's declared sections and their fidelity.
  2. Replace only verbatim sections, in place, leaving the preamble, the section set, the section
    order, and every intent section byte-identical.
  3. Refuse rather than guess when a declared verbatim section is absent from the target, since that
    is a standup question rather than a drift question.
  4. Preserve the target's line endings, which are not the hub's on every repo.
  5. Assert the postcondition itself and exit non-zero when it fails, the way carry.py apply
    already re-compares digests after writing.

Point 5 is the one that matters. A tool that writes without asserting reproduces the defect above
with more authority.

Interaction with the overwrite guard

This narrows what the carried-instruction-file-guard skill has to catch by hand rather than
replacing it. A tool that can only touch declared verbatim sections cannot delete a repository's
local additions, because a local addition is by definition not one of them. The guard's probe
still owns the intent half, where nothing mechanical can judge.

The two throwaway scripts from the pilot are a starting shape rather than a proposal, and the
postcondition assertions are the part worth keeping. Filed per RESYNC.md section 2, which
directs a missing capability found during a resync here rather than into a chat log.

Activity

  1. added a commit that references this issue on Sep 7, 2026
    6d7a267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions