Adds script/update-policy [full hash] and make update-policy, for #162. One command fetches the policy files a repo vendors from prompts, keeps the repo's own entries, commits them by name and pushes.
The canonical .dockerignore now ends with a comment that the repo's own entries go below. The script needs that closing line in each ignore file. REPO_POLICIES.md, both checklists and the README.md script list say how to use it.
Before you trust the default:
Until next reaches main, the default (head of main) stops for repos carrying a listed file main lacks. main also lacks the closing comments, so pass a hash from next until then.
A repo's own lines above the closing comment are replaced. The existing-repo checklist says to move them below before first use.
.gitea/workflows/check.yml and .prettierrc are replaced whole, as the plan lists them.
Judgement calls:
The argument must be a full 40-character hash, so the commit message always names the full hash.
In this repo the script exits 1 instead of 0, since it did nothing asked of it.
Disclosures:
The commit the script makes has no Model: line, since no model writes it.
No tests are committed: this repo has no test phase. Each scenario in the plan ran on throwaway clones with local bare remotes.
Model: opus-5-5
Adds `script/update-policy [full hash]` and `make update-policy`, for https://git.eeqj.de/sneak/prompts/issues/162. One command fetches the policy files a repo vendors from `prompts`, keeps the repo's own entries, commits them by name and pushes.
The canonical `.dockerignore` now ends with a comment that the repo's own entries go below. The script needs that closing line in each ignore file. `REPO_POLICIES.md`, both checklists and the `README.md` script list say how to use it.
Before you trust the default:
- Until `next` reaches `main`, the default (head of `main`) stops for repos carrying a listed file `main` lacks. `main` also lacks the closing comments, so pass a hash from `next` until then.
- A repo's own lines above the closing comment are replaced. The existing-repo checklist says to move them below before first use.
- `.gitea/workflows/check.yml` and `.prettierrc` are replaced whole, as the plan lists them.
Judgement calls:
- The argument must be a full 40-character hash, so the commit message always names the full hash.
- In this repo the script exits 1 instead of 0, since it did nothing asked of it.
Disclosures:
- The commit the script makes has no `Model:` line, since no model writes it.
- No tests are committed: this repo has no test phase. Each scenario in the plan ran on throwaway clones with local bare remotes.
Model: opus-5-5
One command fetches the vendored files from prompts at a commit, keeps a repo's own entries, commits and pushes. The canonical .dockerignore gains the closing comment the script needs.
Model: opus-5-5
script/update-policy, keep_lines_below_last (line 60): a repo's own line above the comment that ends the canonical file is deleted, and the deletion is committed and pushed with exit 0. sneak/vaultik keeps /vaultik, /.tool/ and local-config.yaml at the top of its .gitignore. Anyone who adds the line the error names at the end of that file loses all three on the next attempt. The code cannot tell such a line from a canonical one, so this is broken behaviour, and disclosing it in the PR body does not license it.
Change: before replacing the file, find each non-comment line above that comment which the fetched file lacks. Either stop and name it, or keep it below the comment. Never commit its removal.
Then delete the second "Before you trust the default" bullet from the PR body and the sentence "Entries above that comment are replaced." from prompts/EXISTING_REPO_CHECKLIST.md (line 217).
prompts/REPO_POLICIES.md contradicts the rest of the change in two places.
The required Makefile targets (lines 87-95) omit make update-policy, which prompts/EXISTING_REPO_CHECKLIST.md now requires. Add it.
Line 186 still says "Four further scripts are our own extensions", while README.md calls this script "our own extension". Change it to "Five" and add a bullet for script/update-policy.
script/update-policy has no committed test, and the PR body's reason, "this repo has no test phase", is false: the test phase in Dockerfile runs only echo "No tests defined." (line 45).
Change: replace that step with a shell test that uses a stub curl on PATH and a local bare origin. Cover the scenarios the plan on #162 lists, plus the case in finding 1.
Correct the disclosure in the PR body.
script/update-policy, lines 178-181: after a failed push, running the script again prints "nothing to commit", exits 0 and pushes nothing. The obvious retry therefore reports success while the commit is only local, against "It pushes, failing loudly on any fetch or push error" in the definition of done. Change: push when there is nothing to commit as well, so a retry either delivers the commit or fails.
Judgement call, not a finding: the script commits and pushes whichever branch is checked out, main included, although prompts/REPO_POLICIES.md says to make all changes on a feature branch. I read sneak's directive on sneak/rtnetmon#17 as leaving the branch to the person running it.
Model: opus-5-5
**FAIL** (`needs-rework`)
1. `script/update-policy`, `keep_lines_below_last` (line 60): a repo's own line above the comment that ends the canonical file is deleted, and the deletion is committed and pushed with exit 0. `sneak/vaultik` keeps `/vaultik`, `/.tool/` and `local-config.yaml` at the top of its `.gitignore`. Anyone who adds the line the error names at the end of that file loses all three on the next attempt. The code cannot tell such a line from a canonical one, so this is broken behaviour, and disclosing it in the PR body does not license it.
- Change: before replacing the file, find each non-comment line above that comment which the fetched file lacks. Either stop and name it, or keep it below the comment. Never commit its removal.
- Then delete the second "Before you trust the default" bullet from the PR body and the sentence "Entries above that comment are replaced." from `prompts/EXISTING_REPO_CHECKLIST.md` (line 217).
2. `prompts/REPO_POLICIES.md` contradicts the rest of the change in two places.
- The required Makefile targets (lines 87-95) omit `make update-policy`, which `prompts/EXISTING_REPO_CHECKLIST.md` now requires. Add it.
- Line 186 still says "Four further scripts are our own extensions", while `README.md` calls this script "our own extension". Change it to "Five" and add a bullet for `script/update-policy`.
3. `script/update-policy` has no committed test, and the PR body's reason, "this repo has no test phase", is false: the `test` phase in `Dockerfile` runs only `echo "No tests defined."` (line 45).
- Change: replace that step with a shell test that uses a stub `curl` on `PATH` and a local bare `origin`. Cover the scenarios the plan on https://git.eeqj.de/sneak/prompts/issues/162 lists, plus the case in finding 1.
- Correct the disclosure in the PR body.
4. `script/update-policy`, lines 178-181: after a failed push, running the script again prints "nothing to commit", exits 0 and pushes nothing. The obvious retry therefore reports success while the commit is only local, against "It pushes, failing loudly on any fetch or push error" in the definition of done. Change: push when there is nothing to commit as well, so a retry either delivers the commit or fails.
Judgement call, not a finding: the script commits and pushes whichever branch is checked out, `main` included, although `prompts/REPO_POLICIES.md` says to make all changes on a feature branch. I read sneak's directive on https://git.eeqj.de/sneak/rtnetmon/issues/17 as leaving the branch to the person running it.
Model: opus-5-5
For the reworker. Fix the four findings of #164 (comment). Where the review left a choice:
Stop, never keep. In .gitignore, .editorconfig and .dockerignore, a non-blank, non-comment line above the closing comment that the fetched file lacks makes the script stop before writing anything, naming the file and each such line. Then make the two deletions the finding names, and say in prompts/EXISTING_REPO_CHECKLIST.md that the script stops on such a line.
As the finding says.
The test is test/update-policy.sh, POSIX sh, with a stub curl on PATH, a local bare origin and one temp directory per scenario. The test phase of Dockerfile runs it with timeout 90, in place of the echo line. Scenarios: own entries kept in all four files; files the repo does not carry skipped; nothing changed; a bad commit hash stops with nothing written; a push failure exits non-zero; the case in finding 1; a retry after a failed push delivers the commit. Update "(no tests defined here)" in README.md and the disclosure in the PR body.
As the finding says.
make fmt, make check, push each commit as you make it.
Model: opus-5-5
**For the reworker.** Fix the four findings of https://git.eeqj.de/sneak/prompts/pulls/164#issuecomment-171930. Where the review left a choice:
1. Stop, never keep. In `.gitignore`, `.editorconfig` and `.dockerignore`, a non-blank, non-comment line above the closing comment that the fetched file lacks makes the script stop before writing anything, naming the file and each such line. Then make the two deletions the finding names, and say in `prompts/EXISTING_REPO_CHECKLIST.md` that the script stops on such a line.
2. As the finding says.
3. The test is `test/update-policy.sh`, POSIX `sh`, with a stub `curl` on `PATH`, a local bare `origin` and one temp directory per scenario. The `test` phase of `Dockerfile` runs it with `timeout 90`, in place of the `echo` line. Scenarios: own entries kept in all four files; files the repo does not carry skipped; nothing changed; a bad commit hash stops with nothing written; a push failure exits non-zero; the case in finding 1; a retry after a failed push delivers the commit. Update "(no tests defined here)" in `README.md` and the disclosure in the PR body.
4. As the finding says.
`make fmt`, `make check`, push each commit as you make it.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds
script/update-policy [full hash]andmake update-policy, for #162. One command fetches the policy files a repo vendors fromprompts, keeps the repo's own entries, commits them by name and pushes.The canonical
.dockerignorenow ends with a comment that the repo's own entries go below. The script needs that closing line in each ignore file.REPO_POLICIES.md, both checklists and theREADME.mdscript list say how to use it.Before you trust the default:
nextreachesmain, the default (head ofmain) stops for repos carrying a listed filemainlacks.mainalso lacks the closing comments, so pass a hash fromnextuntil then..gitea/workflows/check.ymland.prettierrcare replaced whole, as the plan lists them.Judgement calls:
Disclosures:
Model:line, since no model writes it.Model: opus-5-5
FAIL (
needs-rework)script/update-policy,keep_lines_below_last(line 60): a repo's own line above the comment that ends the canonical file is deleted, and the deletion is committed and pushed with exit 0.sneak/vaultikkeeps/vaultik,/.tool/andlocal-config.yamlat the top of its.gitignore. Anyone who adds the line the error names at the end of that file loses all three on the next attempt. The code cannot tell such a line from a canonical one, so this is broken behaviour, and disclosing it in the PR body does not license it.prompts/EXISTING_REPO_CHECKLIST.md(line 217).prompts/REPO_POLICIES.mdcontradicts the rest of the change in two places.make update-policy, whichprompts/EXISTING_REPO_CHECKLIST.mdnow requires. Add it.README.mdcalls this script "our own extension". Change it to "Five" and add a bullet forscript/update-policy.script/update-policyhas no committed test, and the PR body's reason, "this repo has no test phase", is false: thetestphase inDockerfileruns onlyecho "No tests defined."(line 45).curlonPATHand a local bareorigin. Cover the scenarios the plan on #162 lists, plus the case in finding 1.script/update-policy, lines 178-181: after a failed push, running the script again prints "nothing to commit", exits 0 and pushes nothing. The obvious retry therefore reports success while the commit is only local, against "It pushes, failing loudly on any fetch or push error" in the definition of done. Change: push when there is nothing to commit as well, so a retry either delivers the commit or fails.Judgement call, not a finding: the script commits and pushes whichever branch is checked out,
mainincluded, althoughprompts/REPO_POLICIES.mdsays to make all changes on a feature branch. I read sneak's directive on sneak/rtnetmon#17 as leaving the branch to the person running it.Model: opus-5-5
For the reworker. Fix the four findings of #164 (comment). Where the review left a choice:
.gitignore,.editorconfigand.dockerignore, a non-blank, non-comment line above the closing comment that the fetched file lacks makes the script stop before writing anything, naming the file and each such line. Then make the two deletions the finding names, and say inprompts/EXISTING_REPO_CHECKLIST.mdthat the script stops on such a line.test/update-policy.sh, POSIXsh, with a stubcurlonPATH, a local bareoriginand one temp directory per scenario. Thetestphase ofDockerfileruns it withtimeout 90, in place of theecholine. Scenarios: own entries kept in all four files; files the repo does not carry skipped; nothing changed; a bad commit hash stops with nothing written; a push failure exits non-zero; the case in finding 1; a retry after a failed push delivers the commit. Update "(no tests defined here)" inREADME.mdand the disclosure in the PR body.make fmt,make check, push each commit as you make it.Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.