Replace script/update-policy with a short wget-and-commit script (closes #165) #181

Merged
clawbot merged 5 commits from issue-165-simple-update-policy into next 2026-11-18 23:23:50 +01:00
5 Commits
Author SHA1 Message Date
sneak e34c7bf42d test/update-policy.sh: make the older copy shorter than the new script
check / check (push) Successful in 13s
The script moves each fetched file into place so that the running
script is replaced, never rewritten in place: rewritten in place, the
shell would read the new file's tail as commands. The test's older copy
was the new script plus a line, so it was longer, and that tail was
empty: writing the files with cat instead of mv left the tests green.
The older copy is now the new script without its comment lines, and the
test fails without the mv.

Model: opus-5-5
2026-11-18 22:01:04 +00:00
sneak d8a4a2733a test/update-policy.sh: check that other staged changes stay out of the commit
check / check (push) Successful in 12s
The script commits only the listed paths, but no test staged anything
else, so dropping the pathspec from its git commit left the tests green
while the commit swept in whatever the person had staged. The first
scenario now stages a change to README.md and checks that the commit
holds only the listed files and that the change is still staged.

Model: opus-5-5
2026-11-18 21:44:44 +00:00
sneak 6378311ac5 script/update-policy: put the code in a main function
check / check (push) Successful in 1m27s
The script ran its code at the top level. prompts/CODE_STYLEGUIDE.md
says to put all shell code in functions, with a main called at the
bottom, and every other script in script/ does. The code now sits in
main(), and the last line calls it.

Model: opus-5-5
2026-11-18 21:31:09 +00:00
sneak 29496c2586 test/update-policy.sh: make the stub wget drop the execute bit
check / check (push) Successful in 11s
The stub wget copied each file with cp, which keeps the source's
execute bit, so the "script not executable" assertion could not fail:
removing the chmod 755 from script/update-policy left the tests green.
Real wget writes a new file without the execute bit. The stub now
writes with cat, as wget does, and the test fails without the chmod.

Model: opus-5-5
2026-11-18 21:15:46 +00:00
sneak 47b35661a2 Replace script/update-policy with a short wget-and-commit script (closes #165)
check / check (push) Successful in 13s
The script fetches a fixed list of three files from the main branch of
prompts with wget: docs/REPO_POLICIES.md, docs/CODE_STYLEGUIDE.md and
itself. It moves them into place and commits them. It does not push. It
stops before anything is replaced when a fetch fails, when a listed file
has uncommitted changes, and when REPO_POLICIES.md is still at the repo
root. It runs under busybox.

The line-keeping rules, the hash argument and the push are gone. The
policies and checklists say so, and name docs/REPO_POLICIES.md as the
file's place.

Model: opus-5-5
2026-11-18 20:56:57 +00:00