Repository navigation
fix: attribute Claude stage refusals to the refusing layer and keep completed work (#550) - #555
Conversation
…ep completed work (#550) A hook deny also appears in Claude's permission_denials, so every toolkit-hook refusal was recorded a second time as claude_permission, without the hook's rule, operation or intent; that record kept a published implementation BLOCKED. Entries answered by the hook are no longer recorded again. An inherited MCP tool the host refused is judged with the stage's refusals as a host limit and never becomes a question. Before the cycle records its change request, an implement stage may name its own branch's open pull request by number. Refs #550
native procedure host-permissions: a hook deny is attributed to toolkit_hook and not recorded again as claude_permission; implement may name its branch's open pull request by number; an inherited MCP denial is judged as an auxiliary host limit. capability-parity-audit: PA-53 (converted by #550) and PA-36/PA-52 updates. native-parity-runs and run.py: a dispatch mode that runs claude -p with the stage hook and --allowedTools and reports the refusing layer. Refs #550
|
Implement stage for #550: published at
|
Native verification (#550 AC-1/AC-3) — commit 3862376Run outside any cycle with this branch's
All 9 rows pass. Every refusal comes from the toolkit hook with a consent question; Claude lists each hook |
[CCR-20261130-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2Initial review of #555 at The attribution fix in
Security: audit ran, no confirmed vulnerability. CI: 7/7 passed. Local: validate-package, basedpyright and the full suite (2832 tests) pass. Findings, evidence, security, verification, CI[REV-001] · medium · open · - · blocks:yes — Inherited MCP denials can become an unattended consent questionPaths: This change adds That is the #486 review case: a review returning Evidence: code inspection of the path above. There is no runtime reproduction, because this read-only stage cannot add a test. Fix: exclude host-limit MCP records from the unattended decision, for example in [REV-002] · low · open · - · blocks:no — Native #550 procedure omits the own-PR publication formsPaths: AC-1 asks that native parity cover each command the issue reports, and that list includes Fix: add the own-PR forms to the procedure, or state that PA-53 is pinned only by unit tests. Then record the native run. Acceptance criteria
Security triage and auditThe deterministic rule did not fire:
Verification (this stage, head
|
| Check | Result |
|---|---|
python3 scripts/validate-package.py |
pass, exit 0: VALID: 16 skills (7 cycle, 9 supporting) … |
basedpyright |
pass, exit 0: 0 errors, 0 warnings, 0 notes |
python3 -m unittest discover -s tests |
pass, exit 0: Ran 2832 tests in 944.461s, OK (skipped=1). It ran past the 600 s foreground limit, and the harness moved it to the background, where it completed. |
python3 -m unittest |
not run separately: same discovery as the previous row |
CI (head 3862376, read once, parallel policy)
The "Validate package" workflow passed all 7 checks: Classify the change; Skills, manifests, and Bash installer; Windows test shards 1–4; PowerShell installer.
Residual risk
REV-001 is based on code inspection, not on a runtime reproduction. The native evidence for PA-53 is missing.
…estion (#550) REV-001: a review awaiting CI or an unreconciled BLOCKED stage journaled an unattended_denial decision for an mcp__ host denial. The toolkit can neither grant nor deny an inherited tool, so it is now classified and journaled as claude_permission but never pending. REV-002: the native dispatch procedure does not cover PA-53; say that it is pinned by unit tests, record the 2026-11-30 native run, and keep the PA rows in order.
[CCT-20261130-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:386237650557502628158c5d55b4da3392da794c · schema:2Resolution of #555 at
Local: full suite 2834 OK; basedpyright 0 errors; validate-package VALID. CI: 2 pending at Findings, verification, CI, history[CCR-20261130-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2[REV-001] · medium · resolved · valid · blocks:yes — Inherited MCP denials can become an unattended consent questionPaths: Cause: Fix: the unattended-decision condition now skips tools with the [REV-002] · low · resolved · valid · blocks:no — Native #550 procedure omits the own-PR publication formsPaths: The PA-53 baseline row no longer claims native coverage. It names Verification (agent-reported, head
|
| Check | Result |
|---|---|
python3 -m unittest tests.test_claude_stage_refusals.UnattendedHostLimitTests, before the fix |
fail, exit 1: 2 failures, because mcp__serena__find_symbol appears in unattended_denial |
python3 -m unittest tests.test_claude_stage_refusals |
pass, exit 0: 16 tests OK |
python3 -m unittest discover -s tests (configured-test) |
pass, exit 0: Ran 2834 tests in 650.702s, OK (skipped=1). The run exceeded the 600 s foreground limit; the harness moved it to the background, where it completed |
basedpyright |
pass, exit 0: 0 errors, 0 warnings, 0 notes |
python3 scripts/validate-package.py |
pass, exit 0: VALID: 16 skills |
Environment: the local run shares Python and Git with CI. The tests set their own Git identity, so they rely on neither the user's global ~/.gitconfig nor cached credentials.
Post-change review and security
- Delta reviewed:
3862376..e3c3e8a, under the parallel policy. The base is an ancestor of the head. No new findings. - Security: the deterministic rule did not fire, because no changed path matches the mandatory minimum.
cc-security-reviewran because the plan requires it. The change removes only a pending question that could not be answered. The hook, the host denials, the grants and the consent boundaries are unchanged, and nothing is widened.
CI (head e3c3e8a7176fad9603271f10360c847d7f777bf4, read once)
Still pending: "Classify the change" and "Skills, manifests, and Bash installer". None has passed or failed yet.
[CCR-20261130-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2Rereview of #555 at
No new findings. Security: audit ran, no confirmed vulnerability. Local: full suite 2834 OK; validate-package VALID; basedpyright 0 errors. CI: 5 passed, 1 pending (not waited on). Findings, verification, security, CI, history[CCR-20261130-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2[CCT-20261130-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:386237650557502628158c5d55b4da3392da794c · schema:2[REV-001] · medium · resolved · valid · blocks:yes — Inherited MCP denials can become an unattended consent questionPaths: Verified by execution at [REV-002] · low · resolved · valid · blocks:no — Native #550 procedure omits the own-PR publication formsPaths: Verified in the current diff: the PA-53 baseline row names Acceptance criteria
SecurityThe deterministic rule did not fire (no changed path matches the mandatory minimum).
Verification (agent-reported, head
|
| Check | Result |
|---|---|
configured-test: python3 -m unittest discover -s tests |
pass, exit 0: Ran 2834 tests in 769.394s, OK (skipped=1). It exceeded the 600 s foreground limit; the harness moved it to the background, where it completed |
rev-001-regression: python3 -m unittest tests.test_claude_stage_refusals |
pass, exit 0: Ran 16 tests in 3.236s, OK |
validate-package: python3 scripts/validate-package.py |
pass, exit 0: VALID: 16 skills (7 cycle, 9 supporting) … |
basedpyright |
pass, exit 0: 0 errors, 0 warnings, 0 notes |
CI (head e3c3e8a, read once, parallel policy)
"Validate package": Classify the change, Skills, manifests, and Bash installer, and Windows test shards 1, 2 and 4 passed; Windows test shard 3 pending. Not waited on; the cycle's CI gate decides.
Closes #550
Work item: GitHub issue #550 — #550
Diagnosis
Symptom. In the #486 cycle (PR #549) and the #503 cycle (PR #554), Claude implement stages that had finished and published ended
BLOCKED(stage_not_completed/HUMAN_INTERVENTION). Every refusal appeared in the journal asclaude_permission.Hypothesis in the issue. The dispatch's
--allowedTools(Claude's permission layer) refused read-only commands and the stage's own publication.Reproduction.
tests/test_claude_stage_refusals.pybuilds a Claudestream-jsonfrom the real hook's answers and runs it throughClaudeAdapter.extra_artifacts,denial_recordsand the cycle runtime. On the base scripts (f79a121),python3 -m unittest tests.test_claude_stage_refusalsfails 5 tests and errors on 1, with the reported stop:HUMAN_INTERVENTION … refused by claude_permission: git grep -n "def require_security" -- scripts … refused by claude_permission: gh pr edit 442 … --body-file $TMPDIR/report.md. With the fix, all 13 pass.Layer that refused each reported command (AC-3).
git grep -n "def require_security" -- scripts,git grep -n -F "prefix=\"diff-",git grep -n -e … -e "tasks/",git grep -n "def receipt_problem"grep -n "def \(stage|…\)" …,grep -rn "exactly one attributable" …,grep -n "import yaml" …git diff --output=$TMPDIR/wip.diff$expansion: consent under #524gh pr view 549 … --jq '.headRefOid',… --jq ".comments[-1].url"--jq: consent under #524 (--jq .headRefOidunquoted runs)git ls-files … | head -200; wc -l …;): shell-operation consentgit --versionprintenv CODE_CYCLE_STAGE_ROLEprintenv TMPDIR/GIT_SSH*are free: consentgit grep -n -A3/-B/-o/-i -E <simple>gh pr edit 549 --body-file $TMPDIR/report.md,gh pr comment 554 --body-file $TMPDIR/pr-comment.mdmcp__serena__find_symbolSo the hook refused every reported Bash command (
[layer=toolkit_hook],COMMAND_PERMISSION_IDpresent:test_the_refusals_come_from_the_toolkit_hook). The dispatch's--allowedToolsadmits each of them once it is allowed or granted (test_each_reported_command_runs_or_asks_and_claude_admits_it_once_decided).Cause (corrected). "Both recorded twice as
claude_permission" (AC-3's third option). Claude also lists a hook'sdenyin its finalpermission_denials.extra_artifactsadded each of those entries as a second refusal withlayer=claude_permission, without the hook's rule, operation orgh pr editintent. The runtime classified that copy asunknown(no intent forgh pr edit), so_reconcile_blockedkept the published stageBLOCKED. The journal then showedclaude_permissionfor refusals the hook had made. A second, smaller cause: the hook vetoed naming the stage's own PR by number before the cycle recorded it (#486receipt,#503comment).Invariant. One refusal yields one record, attributed to the layer that refused it. A refusal that did not prevent the published, verified work never turns it into
BLOCKED.Related work (widened search: bug label, recurrence of #524/#464/#486): #524, #464, #406, #486, #516, #450, #503 (PR #554), #551. No duplicate found; nothing else closed by this change.
Fix shape. Restore the invariant where it breaks:
ClaudeAdapter.extra_artifactsdropspermission_denialsentries whosetool_use_idthe hook answered. It does not add a new filter or state.claude_permission, classifiedauxiliary_denial(host limit). They never produce a grant (operation()rejects them), so Review recovery fails after an unreadable result or a stage-local permission stop: rereviews of the same head repeat and the CI gate never runs #486's "neither hides nor pre-approves" stands._check_ghlets implement name a PR number only when GitHub reports it, at call time, as this repository's open PR for the checkout's branch. Any doubt keeps the refusal. This equals the baregh pr edittarget, so nothing is widened.The #524 consent-free set is unchanged:
test_524_consent_boundaries_are_keptpins it.Work units
WU-1scripts/executors.py,scripts/command_permissions.py,scripts/stage_permissions.py,scripts/windows-test-shards.json,tests/test_claude_stage_refusals.pytests.test_claude_stage_refusals(14)1b747ef,5fa7f6c,3862376)WU-2run.py dispatch)docs/host-permissions.md,docs/capability-parity-audit.md,docs/native-parity-runs.md,docs/native-parity/run.pypython3 scripts/validate-package.pyWU-1(commit13541d2)Verification (agent-reported)
All on head
386237650557502628158c5d55b4da3392da794cunless noted.configured-test(AC-1–AC-4)python3 -m unittest discover -s tests13541d2, failed 2 tests: the new module was not assigned to a Windows shard. Fixed in3862376.validate-packagepython3 scripts/validate-package.pyVALID: 16 skills …basedpyrightbasedpyright3862376)unit-550(AC-1–AC-4)python3 -m unittest tests.test_claude_stage_refusalsaffected-suitespython3 -m unittest tests.test_command_permissions tests.test_stage_dispatch tests.test_stage_permissions tests.test_read_parity tests.test_stage_recovery tests.test_cycle_journal tests.test_executors1b747ef)native-claude-dispatch-550(AC-1, AC-3)python3 docs/native-parity/run.py dispatchclaude -p, because the stage hook refusesclaudeand the host refuses MCP and documentation tools. To be run by a person outside a cycle.docs-reviewed(AC-5)Security review (
cc-security-review, required by the plan) found no confirmed vulnerability. Notes:_SAFE_REPOSITORY. It requires the PR to be open, in this repository (fork heads are excluded), and on the cycle branch, falling back to the checkout's branch only when the runtime fixed none. That is the same target as the baregh pr edit.tool_use_idis deduplicated only when the hook's marker answered that call. A call Claude denied never ran, so no command output can supply the marker.Environment shared with CI: Python stdlib,
gitwith test-local identity, fixturegh. Not shared: this host's sandbox and the dispatchTMPDIR.Native parity (AC-1) — not verified here. Inside this dispatched stage, the hook refuses
claudeand the host refuses MCP. A person must runpython3 docs/native-parity/run.py setupandpython3 docs/native-parity/run.py dispatchoutside a cycle (procedure indocs/native-parity-runs.md#550-which-layer-refuses-a-dispatched-claude-stage). That run is also the native proof that Claude lists hook denials inpermission_denials. The fix is correct either way: it only removes entries the hook answered.Documentation reviewed
docs/host-permissions.md(attribution, implement row, inherited MCP),docs/capability-parity-audit.md(PA-53 new toolkit-veto row converted here; PA-36 and PA-52 notes),docs/native-parity-runs.mdanddocs/native-parity/run.py(Claude's permission layer refuses read-only commands and the stage's own publication in dispatched stages, and the completed stage ends BLOCKED (regression of #524/#464) #550 procedure).docs/README.md(no page added),README.md,CONTRIBUTING.md,AGENTS.md,SECURITY.md, the issue and PR templates, andskills/cc-host-permissions/SKILL.md(its description of--allowedToolsplus the hook stays accurate).docs/ROADMAP_V2.md: no issue, milestone or priority changed.