Skip to content

harness: copy-guard refuses a commit that copies the harness - #92

Merged
lneto merged 1 commit into
masterfrom
claude_bump_harness_6336a73
Nov 29, 2026
Merged

lneto merged 1 commit into
masterfrom
claude_bump_harness_6336a73

Conversation

@lneto

@lneto lneto commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

A copy of the harness's files in a project's tree, or in another harness the project installs, is a pin that no bump of the mount moves, so it falls behind with every merge of the harness. With this pull request a session's git commit that records such a copy is refused before it runs, by copy-guard.sh, which .claude/settings.json now runs before each shell command:

# a repository holding deps/harness, a plain directory of files copied from the harness's tree
git add deps/harness && git commit -m 'chore: carry the guards'
# copy-guard: this commit records copies of the harness's files (deps/harness/tools/checks/stage-guard.sh = tools/checks/stage-guard.sh); the harness reaches a project through its mount alone, ...

The mount's pre-commit, which the Checks workflow runs on every pull request, refuses a staged copy too, so a copy a merge or a cherry-pick brings in is named there. luaebpf's tree holds no copy, and its LICENSE-MIT, whose range is 2026, passes the other check the new pre-commit makes, which refuses a top-level licence whose copyright range ends before the current year. A session that opens a bump like this one now has its body read once by the lunatik-reader agent, where it was read up to three times.

This pull request moves the mount from 26f6db9 to 6336a73, which luainkernel/harness#92, luainkernel/harness#93 and luainkernel/harness#94 merged.

The mount moves from 26f6db9 to 6336a73. With luainkernel/harness#94
copy-guard.sh, which .claude/settings.json now runs before each shell
command, refuses a git commit that records a copy of the harness's
files, and the mount's pre-commit refuses a staged copy, so the Checks
run names one a merge or a cherry-pick brings in; luaebpf's tree holds
none. With luainkernel/harness#93 pre-commit refuses a top-level licence
whose copyright range ends before the current year, which luaebpf's 2026
passes, and with luainkernel/harness#92 the lunatik-reader agent reads
the body of a bump once, where it read it up to three times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added the complexity: small One line or one file, with a trivial or existing test label Nov 29, 2026
@lneto

lneto commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Note

This comment was written by an LLM, not a human.

Proof for head a55bca9.

Before, at the base 325042a with the mount at 26f6db9: .claude/settings.json runs no copy guard, and the mount carries none, so a session's commit of a copy of the harness's files goes through:

$ git show 325042a:.claude/settings.json | grep -c copy-guard
0
$ git -C harness cat-file -e 26f6db9:tools/checks/copy-guard.sh
fatal: Not a valid object name 26f6db9:tools/checks/copy-guard.sh

After, at the head with the mount at 6336a73: the settings run it before each shell command, and it refuses the commit of a copy and passes one of the repository's own code, in a scratch repository whose deps/harness/tools/checks/stage-guard.sh is a copy of the mount's:

$ git show HEAD:.claude/settings.json | grep -c copy-guard
1
$ jq -nc --arg c "git add deps/harness && git commit -m 'chore: carry the guards'" --arg d "$fixture" '{tool_name:"Bash",tool_input:{command:$c},cwd:$d}' | bash harness/tools/checks/copy-guard.sh; echo "exit $?"
copy-guard: this commit records copies of the harness's files (deps/harness/tools/checks/stage-guard.sh = tools/checks/stage-guard.sh); the harness reaches a project through its mount alone, ...
exit 2
$ jq -nc --arg c "git add own.lua && git commit -m 'feat: own code'" --arg d "$fixture" '{tool_name:"Bash",tool_input:{command:$c},cwd:$d}' | bash harness/tools/checks/copy-guard.sh; echo "exit $?"
exit 0

luaebpf's own tree holds no copy, and the mount's pre-commit passes over the bump, the licence check included:

$ git ls-files -s | awk '$1 != "160000" { split($0, a, "\t"); print $2 "\t" a[2] }' | bash harness/tools/checks/copies.sh .; echo "exit $?"
exit 0
$ bash harness/tools/checks/pre-commit; echo "exit $?"
exit 0

@lneto
lneto merged commit 6934ba8 into master Nov 29, 2026
2 checks passed
@lneto
lneto deleted the claude_bump_harness_6336a73 branch November 29, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: small One line or one file, with a trivial or existing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant