Skip to content

merged: a script sets agent-review from the review's record - #35

Merged
lneto merged 1 commit into
masterfrom
autonomous-merge
Nov 26, 2026
Merged

lneto merged 1 commit into
masterfrom
autonomous-merge

Conversation

@lneto

@lneto lneto commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

After a /clear, a harness pull request that review.js returned ready can no longer be merged by the session, and waits on the maintainer (#33). The auto mode classifier reads the conversation for his order to merge such pull requests, which a /clear leaves out, and without it refuses the session's write of the agent-review status that merge-guard.sh requires. tools/agent-review.sh writes that status only where the record Claude Code keeps of the review shows the pass, so a narrow permissions.allow rule can run it with no classifier:

# token: a file that holds a GitHub token allowed to write commit statuses
bash harness/tools/agent-review.sh luainkernel/harness 1fdae56 token
# agent-review: 1fdae56ae: review.js: ready, wf_1a941637-11a at high
# wf_1a941637-11a is the workflow run whose record shows the pass, high the effort its reviewer ran at

A head passes when the newest review review.js ran at high effort or above, of it or of a commit of its tree, returned it ready, and named, for each mechanism it kept past the smallest fix, the traced defect or the stated need that keeps it: a fold that leaves the tree as reviewed keeps the pass, and a later review that returns it not ready withdraws it. A bump of a project's mount merges on the status of the harness commit it pins, which a rebase merge put on the trunk under a new SHA. Such a commit passes when the pull request that merged as it passed: its head was reviewed so, or, for a pull request tools/complexity.sh calls small, which merges with no review, a comment of the session on it names that head as the proof of its change.

Sections 0 and 5 of the merged skill call the script where they spelled a gh api POST, and a head whose newest review returned it not ready gets no status. The pull request adds no permission rule, since the maintainer's own settings carry Bash(bash harness/tools/agent-review.sh *) and Bash(bash tools/agent-review.sh *). The script reads the token from the file it is handed, as a rule matches no command past a GH_TOKEN= assignment, and reads every review record on the machine, which took 8 to 22 seconds over 330 runs.

Closes #33

The auto mode classifier refused the session's own write of the
agent-review status three times on 2026-11-26, as "Undermining
Oversight", in a session started by /clear and continue: the
maintainer's order to merge harness pull requests was in its hand-off
and in no conversation (#33). tools/agent-review.sh writes the status
only on the record Claude Code keeps of the review, so a narrow
permissions.allow rule can let it run where the classifier refuses a
bare POST.

A head passes when the newest reviewer at high effort or above, the
agent a workflow labels review:<pr or branch>, of a run whose record
names the repository, on a tip whose tree is the head's, returned ready
with no mechanism kept without a source: a later review of the same
tree that returns it not ready withdraws the pass. The answer is the
reviewer's own, read in the run's journal.jsonl, since the run sets
ready to false when the reader fails the body, which pr-body-guard.sh
holds to its reader as the pull request opens; the effort is the one
its transcript records. A commit a rebase merge put on the trunk
passes on the head of the pull request that merged as it, since a base
that moved gives the trunk commit a tree no reviewer returned, or on
the proof a small one merged on, for which merge-guard.sh's proved()
moves into commands.sh as gh_proved.

It reads the token from a file it is handed, since an allow rule
matches no command past a GH_TOKEN= assignment.

Proved with a gh that forwards reads and withholds the POST: it set the
status on #21's head 1fdae56 and on edbd666, its merge, by the tree;
on 3050f3a and ff66033, the merges of #32 and #19 after master moved,
by their heads; on a18c331, #19's head; and on the merges of #28, #25
and #2 by their proofs. It refused 2d6b0f3, the merge of #20, whose one
review returned it not ready though a session had set the status on its
head, the merges of #24 and #4, which carry no proof, the trunk's first
commit, and a repository that lacks the commit. On copies of #21's
record it refused a reviewer at medium, one not ready, one with a
mechanism kept without a source and an agent not labelled review:, and
passed one at xhigh and one whose kept mechanism names a source; of
two runs of the tree, it refused a ready one followed by one not ready
and passed the reverse, and so of two reviewers of the tree in one
run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added the complexity: medium Several call sites, a new test, or a core path to audit label Nov 26, 2026
@lneto
lneto merged commit 81daee2 into master Nov 26, 2026
2 checks passed
lneto added a commit to luainkernel/lunatik that referenced this pull request Nov 26, 2026
The mount moves to luainkernel/harness@81daee2, which carries
luainkernel/harness#35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit to luainkernel/luaebpf that referenced this pull request Nov 26, 2026
The mount moves to luainkernel/harness@81daee2, which carries
luainkernel/harness#35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto
lneto deleted the autonomous-merge branch November 27, 2026 00:50
lneto added a commit that referenced this pull request Nov 27, 2026
The auto mode classifier refused the merge of luainkernel/lunatik#2744,
small, its CI passed and its proof posted, as "Destructive or Unwanted
Actions" in a session started by /clear and continue, and passed the
same command once the maintainer's words were in the conversation. A
merge on a proof sets no status before it runs, so nothing the session
does after a clear lets it through, and a small pull request waits on
him.

tools/merge.sh hands merge-guard.sh, as a hook input, the rebase merge
it runs, the head named, and runs it only where the guard exits 0, so a
narrow permissions.allow rule over it lets through what the guard
admits and nothing else: the command never carries MERGE_OK=1, which
the guard reads in the command alone, and the arguments are held to a
repository's name, a number and a full SHA. It reads the token from the
file it is handed, as tools/agent-review.sh does (#35), and prints
GitHub's answer, whose sha section 5 of the merged skill reads for the
status and the bumps. Sections 0 and 5 merge through it; a merge the
maintainer ordered in his own words keeps MERGE_OK=1 on the gh api call.
The merge-guard cases hold the guard to the command the script hands
it, the token in GH_TOKEN.

The rules go in the maintainer's own settings, not in a tracked file,
which would bind every session opened on the checkout.

Closes #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit that referenced this pull request Nov 27, 2026
The auto mode classifier refused the merge of luainkernel/lunatik#2744,
small, its CI passed and its proof posted, as "Destructive or Unwanted
Actions" in a session started by /clear and continue, and passed the
same command once the maintainer's words were in the conversation. A
merge on a proof sets no status before it runs, so nothing the session
does after a clear lets it through, and a small pull request waits on
him.

tools/merge.sh hands merge-guard.sh, as a hook input, the rebase merge
it runs, the head named, and runs it only where the guard exits 0, so a
narrow permissions.allow rule over it lets through what the guard
admits and nothing else: the command never carries MERGE_OK=1, which
the guard reads in the command alone, and the arguments are held to a
repository's name, a number and a full SHA. It reads the token from the
file it is handed, as tools/agent-review.sh does (#35), and prints
GitHub's answer, whose sha section 5 of the merged skill reads for the
status and the bumps. Sections 0 and 5 merge through it; a merge the
maintainer ordered in his own words keeps MERGE_OK=1 on the gh api call.
The merge-guard cases hold the guard to the command the script hands
it, the token in GH_TOKEN.

The rules go in the maintainer's own settings, not in a tracked file,
which would bind every session opened on the checkout, and each names
its script by the absolute path of the checkout sessions start in.
merge.sh runs the merge-guard.sh beside it, so a rule that matched the
relative `bash tools/merge.sh` in any directory would let a worktree
whose guard or script an edit changed decide a merge with no classifier;
the same holds of agent-review.sh, whose rules matched the relative
spelling since #35, and the skill now spells both from that checkout.

Closes #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit that referenced this pull request Nov 27, 2026
The auto mode classifier refused the merge of luainkernel/lunatik#2744,
small, its CI passed and its proof posted, as "Destructive or Unwanted
Actions" in a session started by /clear and continue, and passed the
same command once the maintainer's words were in the conversation. A
merge on a proof sets no status before it runs, so nothing the session
does after a clear lets it through, and a small pull request waits on
him.

tools/merge.sh hands merge-guard.sh, as a hook input, the rebase merge
it runs, the head named, and runs it only where the guard exits 0, so a
narrow permissions.allow rule over it lets through what the guard
admits and nothing else: the command never carries MERGE_OK=1, which
the guard reads in the command alone, and the arguments are held to a
repository's name, a number and a full SHA. It reads the token from the
file it is handed, as tools/agent-review.sh does (#35), and prints
GitHub's answer, whose sha section 5 of the merged skill reads for the
status and the bumps. Sections 0 and 5 merge through it; a merge the
maintainer ordered in his own words keeps MERGE_OK=1 on the gh api call.
The merge-guard cases hold the guard to the command the script hands
it, the token in GH_TOKEN.

The rules go in the maintainer's own settings, not in a tracked file,
which would bind every session opened on the checkout, and each names
its script by the absolute path of the checkout sessions start in.
merge.sh runs the merge-guard.sh beside it, so a rule that matched the
relative `bash tools/merge.sh` in any directory would let a worktree
whose guard or script an edit changed decide a merge with no classifier;
the same holds of agent-review.sh, whose rules matched the relative
spelling since #35, and the skill now spells both from that checkout.
The rule runs that checkout's tree as it stands, as its hooks do, so an
edit under its mount still decides a merge with no classifier.

Closes #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit that referenced this pull request Nov 27, 2026
The auto mode classifier refused the merge of luainkernel/lunatik#2744,
small, its CI passed and its proof posted, as "Destructive or Unwanted
Actions" in a session started by /clear and continue, and passed the
same command once the maintainer's words were in the conversation. A
merge on a proof sets no status before it runs, so nothing the session
does after a clear lets it through, and a small pull request waits on
him.

tools/merge.sh hands merge-guard.sh, as a hook input, the rebase merge
it runs, the head named, and runs it only where the guard exits 0, so a
narrow permissions.allow rule over it lets through what the guard
admits and nothing else: the command never carries MERGE_OK=1, which
the guard reads in the command alone, and the arguments are held to a
repository's name, a number and a full SHA. It reads the token from the
file it is handed, as tools/agent-review.sh does (#35), and prints
GitHub's answer, whose sha section 5 of the merged skill reads for the
status and the bumps. Sections 0 and 5 merge through it; a merge the
maintainer ordered in his own words keeps MERGE_OK=1 on the gh api call.
The merge-guard cases hold the guard to the command the script hands
it, the token in GH_TOKEN.

The rules go in the maintainer's own settings, not in a tracked file,
which would bind every session opened on the checkout, and each names
its script by the absolute path of the checkout sessions start in.
merge.sh runs the merge-guard.sh beside it, so a rule that matched the
relative `bash tools/merge.sh` in any directory would let a worktree
whose guard or script an edit changed decide a merge with no classifier;
the same holds of agent-review.sh, whose rules matched the relative
spelling since #35, and the skill now spells both from that checkout.
The rule runs that checkout's tree as it stands, as its hooks do, so an
edit under its mount still decides a merge with no classifier.

Closes #45

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

complexity: medium Several call sites, a new test, or a core path to audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

merged: the agent-review status is refused after a clear

1 participant