Repository navigation
[PROOF-P1-S1] Build the publish guard - #32
Merged
Merged
Conversation
…of must not publish scripts/proof-guard.py runs inside the project on one file and answers with a status: 0 when the file may be published, 1 when it is refused, with one sentence on stdout that names the reason and repeats nothing from inside the file, and 2 when the guard could not answer. A path is read from the folder the command runs in, and where it leads counts: a link is judged by the file at its end, and on a file system that ignores case a path in another case leads to the same file. It refuses a file outside the repository, one that is not there or is a folder, one inside .ck/ or .git/, one written by a pipeline command (the nine documents /ck:next looks for, each named with its command, and anything under docs/plan/, named /ck:plan), one git ignores, one that is not a .md file, one that is not UTF-8 text, and one with no words. Git is asked after ck's own rules, and the file is opened only for the last two: a file refused for where it is or for its name is never read. A tracked file that matches an ignore rule is not ignored, which is git's own reading; the security read decides whether that is enough. tests/pending/P1-S1.sh moves to tests/checks/. Its nine checks are as they were, except that the link check now asks for the reason at the link's end instead of any reason; eight are added for the choices the nine leave open. No folder under tests/fixtures/ was made: the check file builds the repository at run time, since two of the refusals cannot be committed as fixtures. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
d6veteran
marked this pull request as ready for review
October 13, 2026 15:09
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.
Stage P1-S1 of the staged plan
docs/plan/2026-10-12-any-document-as-a-proof.md.What it adds
scripts/proof-guard.py, run inside the project on one file:python3 scripts/proof-guard.py <file>.A path is read from the folder the command runs in, and where it leads counts, not how it is spelled: a link is judged by the file at its end, and on a file system that ignores case a path in another case leads to the same file.
Refused, in this order: outside the repository; not there, or a folder; inside
.ck/(the run cache) or.git/; written by a pipeline command (the nine documents/ck:nextlooks for, each named with its command, and anything underdocs/plan/, named/ck:plan); ignored by git; not a.mdfile; not UTF-8 text; no words. The file is opened only for the last two, so a file refused for where it is or for its name is never read.Two choices for the security read (P2-S1): a tracked file that matches an ignore rule counts as not ignored, which is git's own answer (
check-ignorewithout--no-index); and.git/is refused by path, since git does not report a file inside it as ignored.Checks
tests/pending/P1-S1.shmoves totests/checks/. The nine checks it was given are as they were, except that the link check now asks for the reason at the link's end instead of any reason. Eight are added for the choices the nine leave open: status 1 for a missing path or a folder and a failure for no file or two; an absolute path and one that wanders; a link to a folder, and a link judged by its end; a file holding only a byte order mark; a one-line sentence for a name with a line break in it; a plan deeper underdocs/plan/; a path in another case; a file inside.git/; and that an unreadable file is still refused for where it is or for its name.No
tests/fixtures/guard/folder was made: the check file builds its repository at run time, since a file git ignores and a file outside the repository cannot be committed as fixtures.Tested
bash tests/run.sh: 526 passed, 0 failed, 40 waiting for their three stages; Ruff clean over the five Python files.🤖 Generated with Claude Code