Skip to content

A document move never changes source or costs a battery: cite by file name (doc-path-check); the battery skips sources already green - #2633

Merged
ehartford merged 3 commits into
mainfrom
no-doc-paths-in-source
Oct 25, 2026
Merged

ehartford merged 3 commits into
mainfrom
no-doc-paths-in-source

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Moving a document must never change source or cost a battery (#2632 did both). Two commits:

  1. Source cites a document by its file name, never its path. All 310 docs/…md paths in src, build, lib, tools, rt and test become the file name (17 of them still pointed at docs/proposals after docs: the stdlib sourcing plan moves to docs/completed #2632; several at docs/mut.md, gone since an earlier restructure). doc-path-check, in the gate's fixed list, refuses a path except where the program reads or writes the file (with_for_ai.md; the bundle-root line written into every promoted corpus, which moves only with a re-promotion under D112; the corpora; tools/docs_restructure.w's table; the green-identity test's path data). Rule in CLAUDE.md's editing protocol.
  2. The battery exits GREEN without running when the committed sources already have a published green (:sources-green, the seed digest and full HEAD keyed so a cached answer is never another commit's; one lookup, ret_green_commit, behind :install-user, require-last-green and sources-green). A docs-only change finds its parent's green.

This PR changes software, so it takes one battery; the skip is then verified with a docs-only commit on top. Battery: seed-driven, posted below when green.

Eric Hartford added 3 commits October 25, 2026 12:30
…eck refuses a path

Moving one proposal to docs/completed changed 31 source files (#2632) because source spelled the document's directory, and directories are what move. Every `docs/…md` path in src, build, lib, tools, rt and test (310 sites: comments, compiler diagnostics, the corpus shapes units' header text, test comments; 17 still pointed at docs/proposals after #2632, several at docs/mut.md, which no longer exists) is now the file name alone. `doc-path-check`, in the gate's fixed list, refuses a path outside the files the program itself reads or writes: with_for_ai.md (the init templates and the AGENTS/CLAUDE agreement check read it), the bundle-root line build/corpus.w writes into every promoted corpus (it changes only with a re-promotion, D112), the corpora themselves, tools/docs_restructure.w's move table and the green-identity test's path data. behav_std_os asserts a file that is not a document. The rule is in CLAUDE.md's editing protocol.
…ready have a published green

A docs-only change has the same inputs as its parent (the green is keyed on the committed tree without docs/ and top-level *.md, D49), so a battery over it has nothing to bless; #2632 ran one anyway. tools/battery.w now asks `:sources-green` first (the seed's digest and the full HEAD as keyed inputs, so a cached answer is never another commit's; it builds nothing): on a green it writes GREEN with the recording commit to status.txt and exits. The lookup is one function, ret_green_commit, behind :install-user, require-last-green and sources-green.
… every bundle's key

The battery found it: rewriting three comments in src/FnAbi.w changed the ABI hash (abi-hash-check), which keys every .wo bundle on every host. FnAbi.w is restored to main's bytes and the ABI's two sources are exempt from doc-path-check; their citations change only with the ABI itself.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery green on da09619, seed-driven under nightly-20261025-local-1-c88f3eeff0bc (an earlier run was red on three load timeouts in untouched tests, load average 35; they pass alone). The skip, verified: a local docs-only commit on top made tools/battery.w exit GREEN in 9 s without running ("these sources are green: recorded at commit da09619…"); that commit was dropped, never pushed.

@ehartford
ehartford marked this pull request as ready for review October 25, 2026 16:53
@ehartford
ehartford merged commit a261b65 into main Oct 25, 2026
@ehartford
ehartford deleted the no-doc-paths-in-source branch October 25, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant