Skip to content

KNOWN-LIMITS 82 half one: patch-target classifier (proposal for a CORE sitting patch) - #92

Merged
githubscum merged 1 commit into
mainfrom
lotor-lane/l82-patch-targets
Nov 15, 2026
Merged

githubscum merged 1 commit into
mainfrom
lotor-lane/l82-patch-targets

Conversation

@githubscum

Copy link
Copy Markdown
Owner

WO: WO-L82-01 + WO-L82-02 (lane run 78). Addresses: KNOWN-LIMITS 82 (patch-file laundering past the self-mod gate), sitting queue Item E. Half one of two.

Nothing under the core directories changes in this PR. It adds:

  • proposals/l82-patch-targets/patch-apply.js: patchApplyTargets(cmd, cwd, readFile). It finds git apply / git am / patch in any segment, including behind env assignments, wrappers (sudo, env, command, exec, nohup, time, nice, xargs) and sh|bash|pwsh -c|-Command re-entry. It reads the patch and returns its write targets, and fails closed when the source can't be read (missing file, stdin, pipe, <(...), $(...), backticks, xargs). Heredoc patches are parsed inline. Browse-only forms (--check, --stat, am --abort, ...) return null.
  • test/l82-patch-targets.test.js: 21 cases.
  • proposals/l82-patch-targets/README.md: the half-two integration plan (generated patch into the policy module, stamp coverage including firstBraceGroup/matchableCommand, cwd plumbing, rehearsal test) and the doubts.
  • The two work orders, kept for the record.

Executor: glm-5.3-flash:cloud for both WOs. Receipt read: the executor transcripts show only glm-5.3-flash (49 and 73 turns). ike wrote the WOs, the README and the probe, and no code.

Tested:

  • node --test test/l82-patch-targets.test.js: 21/21.
  • Independent probe of 34 variants the WOs don't name (quoting, backslash and drive paths, git.exe, --no-pager, -c k=v, -R, --include=, subshell parens, $(...)/backtick/pipe fail-closed, wrappers, nested bash -c 'cd w; git apply x', negatives like npm version patch, git add -p, sudo ls): 34/34.
  • npm test: 1400 tests, 1395 pass, 0 fail.

Eval: none of E1-E6 applies (this is gate trust, not v3 granularity).

What a reviewer should doubt:

  1. The wrapper list is an enumeration, and an unlisted wrapper hides the verb. That is the fail-open direction this limit is about. Ideas for the sitting: doas, stdbuf, timeout, chronic, git -c alias.x='!git apply' x, and git aliases generally.
  2. Relative-after-cd (cd src; patch -p1 < x.diff with b/chain/... targets) is not closed. Same pre-existing weakness as the rest of the matcher.
  3. The self-mod matcher will read disk at gate time (one file per patch command). The signed token binds the command string, not the patch bytes. Binding the patch digest into the receipt is a half-two option.
  4. Quoted patch paths with spaces fail closed. That over-gates by one signature.

No new KNOWN-LIMITS entry. Limit 82's text stays "not staged" until half two lands.

🤖 Generated with Claude Code

patchApplyTargets finds git apply / git am / patch (behind env assignments,
wrappers and sh -c re-entry), reads the patch, returns its write targets,
and fails closed when the source cannot be read. Nothing under the core
directories changes; the README holds the half-two integration plan.
Written by glm-5.3-flash (WO-L82-01, WO-L82-02), probed by ike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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