Skip to content

feat(permissions): a consent holds in every stage role (#500) - #502

Merged
datacas merged 6 commits into
mainfrom
feat/500-consent-all-roles
Nov 17, 2026
Merged

datacas merged 6 commits into
mainfrom
feat/500-consent-all-roles

Conversation

@datacas

@datacas datacas commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Closes #500

A consent was stored with the role of the stage that asked, so the same declared check was asked again in each role (up to three times per cycle). Owner decision: once approved, it holds for every role.

Change

  • An allow or a deny, exact or by pattern, applies in implement, resolve, review, rereview and verify. Matching compares the operation, working directory, Compose digest and check identity, never the role (same_operation, matching_answer, ConsentBroker.command_entries).
  • Entries stored before this change, under any role, keep matching. Resume grants apply in the first role that runs.
  • Revoking removes every stored copy of the decision, including one written under another role.
  • The question says: "The answer holds in every stage role."
  • Kept on purpose: a global (forever) grant never reaches review or rereview (load(allow_global=False) for those stages). The Git, gh, publication, credential, redirect and shell-syntax guards run on every command whatever the grant.

Documentation: docs/host-permissions.md, docs/configuration.md, docs/verification.md, the PA-14 rows of docs/capability-parity-audit.md, CHANGELOG.md and the M1 row of docs/ROADMAP_V2.md.

Verification

  • Full suite: 2622 tests, one failure (the PA-14 row classification cell), fixed; the six affected suites then pass (282 tests). CI runs the rest.
  • 10 new tests in test_compose_consent.py: cross-role allow (review, resolve, implement), cycle scope, denial across roles, changed command or configuration still asks, global grant not reaching reviewers, pre-existing entry, pattern grant, revocation (also a copy under another role) and the question text.
  • A Execute explicitly authorized Docker verification commands through a supported review route #398 test that asserted a rereview grant did not apply in implement now asserts the opposite.

Note: the M1 row of the roadmap is one line that #498 also edits; whichever merges second needs that line rebased.

Out of scope: the forever-for-review exclusion.

@datacas

datacas commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · schema:2

CHANGES_REQUESTED for head 5f6ae087. Reviewed the whole diff against main (10 files, +158 −38) and the acceptance criteria of #500.

The change does what #500 asks: matching ignores the role, old entries still match, revocation removes every copy, the question text says so, and the docs and parity audit are updated. One boundary the PR says it keeps is not kept on the resume-answer path.

  • REV-001 (medium, blocks): a --grant …=forever answer for a writer-role question reaches a review or rereview stage that runs first, for that run.
  • REV-002 (low): consent_role is now an unused import in scripts/cycle.py.

Security audit ran (authorization code changed). CI: 7 of 7 checks pass.

Review detail, security triage, verification, CI, residual risk

[REV-001] · medium · open · - · blocks:yes — A resume forever answer bypasses the "global grant never reaches review" rule

Path: scripts/grants.py:883 (ConsentBroker._resolve, the self.answers branch), reached from command_entries (scripts/grants.py:777).

command_entries passes allow_global=False for review and rereview, but _resolve only forwards that flag to store.load. The branch that applies a --grant answer returns before it, and apply_answer accepts forever for any grant whose own operation role is not review or rereview. Before this PR the role filter in command_entries hid that case. Removing the filter exposes it, so the invariant stated in the PR description, in docs/host-permissions.md and in #500 ("a forever grant still does not reach review") no longer holds there.

Observed (probe on this head, an operation shown for resolve, resumed with --grant <id>=forever, asked and operations populated as on resume):

  • command_entries("claude", "review") returns 1 entry; on main it returns 0.
  • A later fresh broker correctly denies review and allows implement, so only the run in which the answer is applied is affected.

Reach: a resume whose first dispatch is a review or rereview, and a forever answer to a question that was shown in a writing role. The reviewer then runs the allowed operation while judging an untrusted change.

Suggested fix: pass allow_global into the answers branch of _resolve, and when it is false treat a forever answer as this cycle or ignore it with a note, as apply_answer already does for a non-persisted global. Add a test next to test_a_global_answer_never_reaches_a_reviewer_but_reaches_the_writers that supplies the answer through answers= and asserts command_entries("claude", "review") is empty.

[REV-002] · low · open · - · blocks:no — Unused import after the role check was removed

Path: scripts/cycle.py:58. consent_role is imported and no longer used in that module (one occurrence).

Security triage

The deterministic minimum (CI and automation, secrets and keys, agent and toolkit configuration paths) matched no changed path, and .code-cycle.yml declares no security_review.always_when. The audit ran on reviewer judgement: scripts/grants.py and scripts/stage_permissions.py decide which commands a stage may run. I performed the audit directly with the cc-security-review criteria, not as a delegated pass.

  • Confirmed: REV-001.
  • Reviewed and not a finding: a repository or cycle scoped allow now reaches review stages. This is the owner decision recorded in A consent given for an exact operation applies in every stage role, not only the role that was asked #500 and is documented.
  • Reviewed and not a finding: the Git, gh, publication, credential, redirect and shell guards are untouched and still run before any grant (protected_reason is evaluated before the grant is built).
  • Reviewed and not a finding: revoke only removes entries of the same repository, executor and platform with an equal operation apart from the role.

Verification

  • python3 -m unittest tests.test_compose_consent: 64 tests, OK.
  • python3 -m unittest tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view: 325 tests, OK.
  • Probe for REV-001 on this head and on main, as described above (executed).
  • python3 scripts/validate-package.py printed two "possible private data" errors for untracked .worktree/* copies in this checkout. They are not in the PR diff and are unrelated to it.

Not verified: the full python3 -m unittest discover -s tests suite was not run locally; the CI jobs below ran it.

CI (parallel policy, read once)

Pass: Classify the change, Skills, manifests, and Bash installer, Windows test shard (windows-1 to windows-4), PowerShell installer. No check is pending, failed or skipped.

Residual risk

The new tests cover the stored-decision path in every role, including the global rule, but none covers a resume answer applied while a reviewer runs. That is how REV-001 passed CI.

)

REV-001: _resolve applied a --grant forever answer before honouring
allow_global=False, so a reviewer running first received a global grant.
The answer is still stored for the writing stages.
REV-002: drop the unused consent_role import in cycle.py.
@datacas

datacas commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:5f6ae087ddcb08a8ecef4be4683aa24aa00966ea · schema:2

RESOLVED at 41763a1a. REV-001 and REV-002 were both valid and are fixed; the checks of the new head have not started yet.

  • REV-001: _resolve now returns no decision for a forever resume answer when allow_global=False; the answer is still stored for the writing stages. Test: test_a_resume_forever_answer_never_reaches_a_reviewer_that_runs_first (fails on the previous head, passes now).
  • REV-002: removed the unused consent_role import in scripts/cycle.py.
  • 0 other findings; no thread to resolve.
Round history, verification, security, CI

[REV-001] · medium · resolved · valid · blocks:yes — A resume forever answer bypasses the "global grant never reaches review" rule

Fixed in scripts/grants.py (ConsentBroker._resolve, answers branch): after apply_answer stores the global answer, a stage with allow_global=False gets (None, None) and a note. Writers still receive it in the same run and in later runs.

[REV-002] · low · resolved · valid · blocks:no — Unused import after the role check was removed

Removed from scripts/cycle.py.

Verification (agent-reported)

  • python3 -m unittest tests.test_compose_consent: 65 tests, exit 0.
  • tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle: 456 tests, exit 0.
  • New test run on the previous scripts/grants.py: 1 failure (reproduces REV-001); with the fix: pass.
  • Not run: ruff and pyflakes (not installed here), the full discover suite (CI runs it).

Post-change review (parallel policy)

Fix delta 5f6ae087..41763a1a (3 files, +24 −1) reviewed directly, not as a delegated pass. No new findings.

Security

Audit by reviewer judgement (scripts/grants.py decides which commands a stage may run), performed directly. The change narrows what a reviewer receives; no guard was removed. Security: no new finding.

CI (parallel policy, read once)

Head 41763a1ac8e8adbb1f34e5fd73fc469a215202fe: no check reported yet (0 passed, 0 failed, 0 pending listed). Nothing is described as passed.

@datacas

datacas commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261117-002] · manual · unknown/gpt-6.1-sol→? · low · schema:2

CHANGES_REQUESTED for 41763a1ac8e8adbb1f34e5fd73fc469a215202fe.

  • REV-001 resolved: the resume-answer guard now excludes global decisions from reviewers; its regression test passes.
  • REV-002 resolved: the unused import is removed; the module compiles.
  • REV-003 open, high, blocks: an older allow from another role overrides an explicit review denial. A disposable policy-boundary reproduction confirms it.

Security audit completed. CI: 6 passed, 1 failed; the failing synchronization test passes locally in a Git clone. Its relation to this PR is unproven.

Finding history, reproduction, verification, security and CI

Reviewed the complete accumulated merge-base diff against main: 10 files, +182 −39, including documentation and tests. Also inspected the fix delta from the previous reviewed head 5f6ae087ddcb08a8ecef4be4683aa24aa00966ea. Reconstructed both historical findings from the complete provider comment history; the configured trusted author is datacas, and no review threads exist. No historical IDs were renumbered. Repository AGENTS.md and CONTRIBUTING.md conventions apply. This is a manual run with no runtime attempt token or frozen runtime plan supplied; no stage receipt was invented.

Historical run lines:

[CCR-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · schema:2

[CCT-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:5f6ae087ddcb08a8ecef4be4683aa24aa00966ea · schema:2

[REV-001] · medium · resolved · valid · blocks:yes — A resume forever answer bypasses the "global grant never reaches review" rule

Verified by executing tests.test_compose_consent.AllRolesConsentTests.test_a_resume_forever_answer_never_reaches_a_reviewer_that_runs_first: 1 test, exit 0. The answers branch in ConsentBroker._resolve checks allow_global=False; reviewer entries exclude the global answer while writers can retrieve its stored authorization. The original disposition remains valid.

[REV-002] · low · resolved · valid · blocks:no — Unused import after the role check was removed

Executed a source assertion that scripts/cycle.py has no consent_role occurrence and compiled that source with Python: exit 0. The original disposition remains valid.

[REV-003] · high · open · - · blocks:yes — Legacy role-scoped allows can override a denial for the same operation

Paths: scripts/grants.py:787–792 (command_entries) and scripts/stage_permissions.py:3933–3936 (matching_answer).

Matching now ignores the role, but stored entries retain their role-specific grant IDs. The broker emits all equivalent decisions, and matching_answer returns the first matching one. It does not reconcile conflicting decisions. This regresses a store where roles previously had independent authorizations and also affects a later denial made under another role.

Executed reproduction using the existing ComposeConsentCase, its fake Compose resolver and disposable consent store:

  1. Request the declared check under resolve; save a persistent allow.
  2. Construct the same operation with role: review using make_grant, and save deny through apply_answer.
  3. Create a fresh broker, build review command_entries, and evaluate the exact check through stage_permissions.check.

Observed entries: [('resolve', 'allow'), ('review', 'deny')]. Observed review_allowed_after_explicit_deny: True. An assertion requiring denial exits 1. Before this PR, role filtering prevented the resolve allow from matching review's denied operation.

Define deterministic supersession or conflict handling for the newly equivalent operation identities, preserving audit history and user decisions. Cover conflicting pre-existing entries and allow→deny / deny→allow across roles, including insertion-order reversal. A denied operation must not become allowed merely because a different role's entry was loaded first. This is an authorization finding, not a request to reinstate role-scoped consent or add a toolkit veto.

Verification — agent-reported

The final verification checkout is a separate Git clone at the reviewed SHA; the user's checkout and local roadmap edits were preserved. The first archive-only attempt was unsuitable for tests that inspect the repository's Git state: 456 tests produced 20 failures and 2 errors associated with missing Git metadata. Those results were not counted as product regressions; verification was rerun in a real clone.

Executed checks on the reviewed source:

  • The targeted resume/global regression: 1 test passed.
  • python3 -m unittest tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle: 456 tests passed, exit 0, in the final Git clone.
  • Package validator: exit 0, 16 skills valid.
  • REV-002 source assertion and compilation: exit 0.
  • New contradictory-consent boundary reproduction: exit 1, confirms REV-003. Uses the real broker and permission-policy evaluator with fake Compose configuration resolution; no Docker daemon or shared consent store is touched.
  • CI's failing tests.test_ci_policy.HeadMovedTests.test_the_new_head_is_synchronized_and_recorded_before_rereview: 1 test passed locally in the Git clone. The test file is identical to the base; no causal attribution is made from that alone.

The configured full python3 -m unittest discover -s tests suite was not rerun locally; the related permission/cycle suites were selected for this review. CI evidence remains separate and is not substituted for local execution. No BasedPyright check was claimed. No code was changed.

Verification version 2 (agent-reported; AC-1 = cross-role decisions, AC-2 = denial integrity, AC-3 = global-review exclusion, AC-4 = documentation/package coherence). No runtime-frozen identities were supplied. Every check below targets 41763a1ac8e8adbb1f34e5fd73fc469a215202fe:

{"head_sha":"41763a1ac8e8adbb1f34e5fd73fc469a215202fe","tests":{"version":2,"conclusion":"failed","checks":[
{"id":"configured-test","command":"python3 -m unittest discover -s tests","executor":"codex","profile":"manual","context":"project","required":true,"criteria":[],"level":"test","provenance":"project","reason":"configured test command","head_sha":"41763a1ac8e8adbb1f34e5fd73fc469a215202fe","result":"unverified","evidence":[],"cause":"Full suite not rerun locally; targeted permission/cycle coverage selected for this review. CI reported separately.","attempts":[]},
{"id":"permission-cycle-tests","command":"python3 -m unittest tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle","executor":"codex","profile":"manual","context":"project","required":true,"criteria":["AC-1","AC-2","AC-3"],"level":"test","provenance":"review","reason":"Changed authorization paths and related cycle regressions","head_sha":"41763a1ac8e8adbb1f34e5fd73fc469a215202fe","result":"pass","evidence":[{"exit_code":0,"executed":456}],"cause":"","attempts":[]},
{"id":"contradictory-consent-boundary","command":"python3 /tmp/cct-rereview-502/consent-conflict.py","executor":"codex","profile":"manual","context":"project","required":true,"criteria":["AC-2"],"level":"boundary","provenance":"review","reason":"Explicit denial must survive cross-role matching","head_sha":"41763a1ac8e8adbb1f34e5fd73fc469a215202fe","result":"fail","evidence":[{"exit_code":1,"executed":1}],"cause":"Older resolve allow overrides explicit review denial","attempts":[]},
{"id":"package-validation","command":"python3 scripts/validate-package.py","executor":"codex","profile":"manual","context":"project","required":true,"criteria":["AC-4"],"level":"static","provenance":"project","reason":"Repository package validation","head_sha":"41763a1ac8e8adbb1f34e5fd73fc469a215202fe","result":"pass","evidence":[{"exit_code":0,"executed":null}],"cause":"","attempts":[]}
]}}

Security

The deterministic minimum matched no changed CI, secret/key or agent-config path. Reviewer judgement required an authorization audit of grants.py, stage_permissions.py and dispatch context; the delegated review/security pass and parent verification completed on this head. Confirmed issue: REV-003. Global stored-decision exclusion and concrete command guards were inspected; the PR does not remove those guards. Cross-role repository/cycle consent is the explicit #500 requirement and is not itself a finding. Residual risk: current added tests cover isolated decisions, but miss conflicting legacy or later decisions.

CI of the exact reviewed head

gh pr checks 502 exited 1. Passed: Classify the change; PowerShell installer; Windows test shards windows-1, windows-2, windows-3 and windows-4. Failed: Skills, manifests, and Bash installer. None pending or skipped in the observed rollup.

The failed job's full-suite output reports 2634 tests, 1 failure and 1 skip. The failure is test_the_new_head_is_synchronized_and_recorded_before_rereview, stopped by a read-only ref audit before dispatch. It passes locally in a real Git clone. CI remains failed; this review does not classify that failure as a new code finding without a demonstrated link to the diff. See https://github.com/datacas/code-cycle-toolkit/actions/runs/44046307280/job/133912735748.

…ole (#500)

REV-003: matching_answer returned the first matching entry, so an older
allow stored under another role overrode an explicit denial. A denial now
wins whatever the order of the entries, and a later answer replaces an
opposite decision of another role in the store, keeping an audit record.
@datacas

datacas commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner Author

[CCR-20261117-003] · manual · unknown/gpt-6.1-sol→? · low · schema:2

CHANGES_REQUESTED for 28383d375fdf0f9d13afceb3085e9a5fa1db100d.

  • REV-003 remains open: legacy conflicting decisions now deny safely, but a later cycle approval is still masked by another role's repository denial. The same-role control succeeds; the cross-role resume fails.
  • 2 unchanged resolved findings: REV-001 and REV-002.

Security audit completed. No new finding IDs. See verification and exact-head CI details below.

Review history, partial fix, reproduction, verification and security

Reviewed the complete accumulated diff against the merge base of main: 10 files, +276 −43, 567 diff lines. Rechecked the original all-role consent change and documentation, not just the six-file fix delta from 41763a1ac8e8adbb1f34e5fd73fc469a215202fe. Repository AGENTS.md, CONTRIBUTING.md and trusted-author configuration apply; provider history is attributed to trusted datacas, with no review threads. No finding IDs were renumbered and no runtime attempt token was invented.

Historical run lines:

[CCR-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · schema:2

[CCT-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:5f6ae087ddcb08a8ecef4be4683aa24aa00966ea · schema:2

[CCR-20261117-002] · manual · unknown/gpt-6.1-sol→? · low · schema:2

[CCT-20261117-002] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:41763a1ac8e8adbb1f34e5fd73fc469a215202fe · schema:2

[REV-001] · medium · resolved · valid · blocks:yes — A resume forever answer bypasses the "global grant never reaches review" rule

Unchanged correction. The current AllRolesConsentTests execution includes the regression for a global resume answer when review runs first, plus stored-global exclusion for review/rereview. These execute successfully on the current head. The existing valid disposition is preserved.

[REV-002] · low · resolved · valid · blocks:no — Unused import after the role check was removed

Re-executed the assertion that scripts/cycle.py contains no consent_role occurrence and compiled the module source with Python: exit 0. The existing valid disposition is preserved.

[REV-003] · high · open · valid · blocks:yes — Legacy role-scoped allows can override a denial for the same operation

Partial correction: the original over-authorization reproduction now passes. matching_answer denies conflicting equivalent entries independently of their order, and ConsentStore.save supersedes opposite entries within the same stored scope. The newly added legacy-order and persistent-answer tests pass.

Still reproducible under mixed scopes: a newer, explicit cycle authorization is ineffective solely because an older repository denial was stored under another role. This is the unresolved conflict/supersession part of the same finding; its original title, severity and valid disposition are retained. The remaining observed failure prevents an authorized operation; it does not reproduce the earlier unauthorized allow.

Executed comparison using the real broker and permission evaluator, existing fake Compose resolver and a disposable store:

Earlier decision Later answer Review result
repository deny under resolve cycle allow under resolve allowed
repository deny under resolve cycle allow under review denied

The second case also reproduces through the actual resume-answer path: restore the review grant into operations, supply answers={grant.id: 'cycle'} and the matching previously asked fingerprint, call prepare_answers('claude', 'review'), then generate the command policy and call stage_permissions.check.

Observed effective entries: [('review', 'allow'), ('resolve', 'deny')]; the check remains denied. The assertion that the explicit cycle approval should authorize the same operation exits 1. The same-role control returns only resolve: allow and succeeds.

Locations: scripts/grants.py:998–1002 saves the cycle decision separately; command_entries at :799–814 emits the other-role repository denial too. scripts/stage_permissions.py:3940–3941 then applies deny-wins across decisions whose scope precedence has not been reconciled. _drop_equivalent handles entries within one store scope and cannot establish precedence across those role-specific IDs.

Resolve effective decisions by operation identity and scope before handing them to the policy evaluator. Preserve the repository denial for subsequent cycles while honoring the explicit authorization for the current cycle, exactly as the same-role path does. Add mixed-scope allow/deny tests through resume and a same-broker cache test. Do not reinstate role binding, erase the permanent denial, or introduce a new toolkit-only veto.

Also executed the cache variant: run-only deny under resolve, then persistent allow under review for the same operation. The existing broker still denies; a fresh broker allows. Store supersession alone does not reconcile _cycle_answers belonging to an equivalent other-role ID.

Historical stage receipts, carried verbatim from the provider history (no new attempt or approval is asserted by this review):

Verification — agent-reported

Executed in a separate Git clone at this exact head. No product files, source checkout, branches or shared consent data were changed.

  • python3 -m unittest tests.test_compose_consent.AllRolesConsentTests: 14 tests, exit 0.
  • python3 -m unittest tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle tests.test_ci_policy: 513 tests, exit 0.
  • python3 /tmp/cct-rereview-502/consent-conflict.py: original REV-003 reproduction, exit 0; review now denied as expected.
  • python3 /tmp/cct-rereview-502/mixed-scope.py: same-role baseline allowed; cross-role cycle authorization denied, exit 1.
  • python3 scripts/validate-package.py: exit 0; 16 skills valid.
  • REV-002 source assertion and compilation: exit 0.

Environment recovery: the initial configured full-suite attempt hit the sandbox's socket-creation restriction in installed-runtime tests. The same installation test failed at the previous reviewed head; rerunning it outside the sandbox passed (1 test, exit 0). The initial full-suite attempt was interrupted at its ten-minute limit (child exit -2), without a final test count; it is not reported as a completed test run or a product regression. The configured command was then rerun outside the sandbox.

python3 -m unittest discover -s tests completed outside the sandbox: 2637 tests in 641.379 seconds, OK (skipped=1), exit 0. The omitted test is not counted as executed evidence (2636 executed). The completed rerun took longer than the skill's default ten-minute budget; its observed successful result is reported rather than imposing a toolkit-only veto on an executable project check, following this repository's agent-capability-parity rule. The explicit mixed-scope reproduction is a separate check and still fails; the full suite does not cover it.

Exact-head CI snapshot

At the provider read for 28383d375fdf0f9d13afceb3085e9a5fa1db100d: Classify the change passed; Skills, manifests, and Bash installer and Windows test shards windows-1 through windows-4 were in progress (1 passed, 0 failed, 5 pending). PowerShell installer had not yet been reported. This snapshot is kept separate from local verification and was not polled for completion. No pending or absent check is claimed as passed. CI results from the previous head do not satisfy checks for this head.

Verification contract version 2

Agent-reported. Criterion labels retain the previous review mapping: AC-1 cross-role decisions, AC-2 denial/decision integrity, AC-3 global-review exclusion, AC-4 documentation/package coherence. No runtime-frozen plan was injected. Prior results remain in provider history and are not reused for this head.

{
  "head_sha": "28383d375fdf0f9d13afceb3085e9a5fa1db100d",
  "tests": {
    "version": 2,
    "conclusion": "failed",
    "checks": [
      {
        "id": "permission-ci-tests",
        "command": "python3 -m unittest tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle tests.test_ci_policy",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-1",
          "AC-2",
          "AC-3"
        ],
        "level": "test",
        "provenance": "review",
        "reason": "Expanded authorization and cycle regressions",
        "head_sha": "28383d375fdf0f9d13afceb3085e9a5fa1db100d",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 513
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "contradictory-consent-boundary",
        "command": "python3 /tmp/cct-rereview-502/consent-conflict.py",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-2"
        ],
        "level": "boundary",
        "provenance": "review",
        "reason": "Explicit denial must survive cross-role matching",
        "head_sha": "28383d375fdf0f9d13afceb3085e9a5fa1db100d",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 1
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "mixed-scope-consent-boundary",
        "command": "python3 /tmp/cct-rereview-502/mixed-scope.py",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-1",
          "AC-2"
        ],
        "level": "boundary",
        "provenance": "review",
        "reason": "Same-role and cross-role scope precedence must agree",
        "head_sha": "28383d375fdf0f9d13afceb3085e9a5fa1db100d",
        "result": "fail",
        "evidence": [
          {
            "exit_code": 1,
            "executed": 2
          }
        ],
        "cause": "An older repository denial under another role masks explicit later cycle authorization",
        "attempts": []
      },
      {
        "id": "package-validation",
        "command": "python3 scripts/validate-package.py",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-4"
        ],
        "level": "static",
        "provenance": "project",
        "reason": "Repository package validation",
        "head_sha": "28383d375fdf0f9d13afceb3085e9a5fa1db100d",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": null
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "configured-test",
        "command": "python3 -m unittest discover -s tests",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [],
        "level": "test",
        "provenance": "project",
        "reason": "configured test command",
        "head_sha": "28383d375fdf0f9d13afceb3085e9a5fa1db100d",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 2636,
            "skipped": 1,
            "total": 2637
          }
        ],
        "cause": "",
        "attempts": [
          {
            "result": "unverified",
            "cause": "Initial sandbox run hit socket restrictions and was interrupted at its ten-minute limit",
            "exit_code": -2
          },
          {
            "result": "pass",
            "cause": "Rerun outside the sandbox completed",
            "exit_code": 0
          }
        ]
      }
    ]
  }
}

Security

The deterministic minimum matches no changed CI, secrets/key or agent-configuration path. Reviewer judgement activates the authorization audit. The delegated review/security pass and parent boundary verification completed for this head. The former unauthorized-allow path is corrected; the remaining REV-003 issue concerns honoring the user's later scoped approval. Global-review exclusions, concrete command guards, persistence boundaries, revocation and audit preservation were inspected; no additional confirmed vulnerability was found. Persistent and cycle decisions intentionally reach all roles under #500. No new approval or merge authority is inferred from local checks.

@datacas

datacas commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner Author

[CCR-20261117-004] · manual · unknown/gpt-6.1-sol→? · low · schema:2

APPROVED for d3d4815a324fddfe4f71281cdc6113dbc3948105.

  • REV-003 resolved and verified: effective operation decisions now respect scope precedence; the earlier contradictory-consent and mixed-scope resume reproductions pass, as do cache and revocation regressions.
  • 2 unchanged resolved findings: REV-001 and REV-002.

No new findings. Security audit completed. CI: all 7 checks passed.

Review history, findings, verification, security and CI

Reviewed the complete accumulated merge-base diff against fetched main: 10 files, +388/-50, 716 raw diff lines. Also reviewed the five-file fix delta from 28383d375fdf0f9d13afceb3085e9a5fa1db100d. Repository AGENTS.md and CONTRIBUTING.md apply. All provider comments are by configured trusted author datacas; no review threads exist. No ID gaps or collisions. No runtime-frozen plan or attempt token was injected. Historical manual receipts are preserved below, not asserted as new attempts.

Historical runs

[CCR-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · schema:2

[CCT-20261117-001] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:5f6ae087ddcb08a8ecef4be4683aa24aa00966ea · schema:2

[CCR-20261117-002] · manual · unknown/gpt-6.1-sol→? · low · schema:2

[CCR-20261117-003] · manual · unknown/gpt-6.1-sol→? · low · schema:2

[CCT-20261117-002] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:41763a1ac8e8adbb1f34e5fd73fc469a215202fe · schema:2

[CCT-20261117-003] · manual · anthropic/claude-sonnet-5-5→? · unknown · triaged:28383d375fdf0f9d13afceb3085e9a5fa1db100d · schema:2

Findings

[REV-001] · medium · resolved · valid · blocks:yes — A resume forever answer bypasses the "global grant never reaches review" rule

Corrected and verified by execution. The current 17-test AllRolesConsentTests suite exercises stored and resume global exclusions for review/rereview, with writing roles still allowed; exit 0. Disposition remains valid.

[REV-002] · low · resolved · valid · blocks:no — Unused import after the role check was removed

Corrected and verified by execution. Source assertion confirms no consent_role occurrence in scripts/cycle.py; compilation of that source succeeds, exit 0. Disposition remains valid.

[REV-003] · high · resolved · valid · blocks:yes — Legacy role-scoped allows can override a denial for the same operation

Corrected and verified by execution. The original conflicting-decision reproduction denies review after an explicit denial (1 test, exit 0). The mixed-scope resume reproduction now allows the current cycle while retaining repository denial for the next cycle (1 test, exit 0). The current AllRolesConsentTests additionally pass legacy insertion-order conflicts, direct/resumed cycle precedence, opposite run-only cache replacement and cross-role revocation. Scope precedence is reconciled before policy evaluation; equal-precedence denial remains deterministic. No role binding or new toolkit veto was introduced. Disposition remains valid.

Historical receipts

Verification — agent-reported

All execution used a disposable Git clone at the exact reviewed head. No product code or user working files changed. The authorization boundary uses the real consent broker and policy evaluator with disposable stores and fake Compose configuration resolution; it verifies allowed and denied policy outcomes, not real Docker container execution. No dependency, database or service setup was needed.

  • Configured full suite: 2640 tests in 1272.384 seconds, OK (skipped=1), exit 0; 2639 executed.

  • Initial sandbox attempt: 2640 tests in 862.447 seconds, 13 failures, 8 errors, 1 skipped, exit 1. Five prerequisite tests raised PermissionError at socket.socket() in native_prerequisites.py:284; an independent installed-runtime launch reproduced the same traceback before dispatch, explaining its absent stage records and agent.pid. Authorized recovery reran the identical full command outside the sandbox, where all tests passed.

  • Historical permission-cycle command: 462 tests, exit 0.

  • The complete recovery took over ten minutes. This manual run reports its actual completion under the repository agent-capability-parity rule; no artificial timeout was imposed.

  • Expanded permission/cycle/CI-policy regression command: 516 tests, exit 0.

  • AllRolesConsentTests: 17 tests, exit 0.

  • Both original boundary commands: one test each, exit 0.

  • Package validator: 16 skills valid, exit 0.

  • REV-002 source assertion and compilation: exit 0.

The version-2 record retains the first recorded check identities, including codex/manual ownership; historical resolver reports used another executor label, which does not replace that identity. AC-1 cross-role decisions; AC-2 denial/decision integrity; AC-3 global-review exclusion; AC-4 documentation/package coherence. Historical results remain in provider history and are not reused for this head.

{
  "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
  "tests": {
    "version": 2,
    "conclusion": "verified",
    "checks": [
      {
        "id": "configured-test",
        "command": "python3 -m unittest discover -s tests",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [],
        "level": "test",
        "provenance": "project",
        "reason": "configured test command",
        "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 2639,
            "total": 2640,
            "skipped": 1
          }
        ],
        "cause": "",
        "attempts": [
          {
            "result": "fail",
            "exit_code": 1,
            "cause": "Sandbox socket creation denied; 2640 tests, 13 failures, 8 errors, 1 skipped; installed runtime dispatch stops at isolation_probe"
          },
          {
            "result": "pass",
            "exit_code": 0,
            "cause": "Authorized full rerun outside sandbox: 2640 tests in 1272.384s, 1 skipped"
          }
        ]
      },
      {
        "id": "permission-cycle-tests",
        "command": "python3 -m unittest tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-1",
          "AC-2",
          "AC-3"
        ],
        "level": "test",
        "provenance": "review",
        "reason": "Changed authorization paths and related cycle regressions",
        "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 462
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "contradictory-consent-boundary",
        "command": "python3 /tmp/cct-rereview-502/consent-conflict.py",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-2"
        ],
        "level": "boundary",
        "provenance": "review",
        "reason": "Explicit denial must survive cross-role matching",
        "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 1
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "package-validation",
        "command": "python3 scripts/validate-package.py",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-4"
        ],
        "level": "static",
        "provenance": "project",
        "reason": "Repository package validation",
        "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": null
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "permission-ci-tests",
        "command": "python3 -m unittest tests.test_compose_consent tests.test_grants tests.test_consent_variants tests.test_stage_permissions tests.test_command_permissions tests.test_host_permissions tests.test_permission_lifecycle tests.test_permission_view tests.test_cycle tests.test_ci_policy",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-1",
          "AC-2",
          "AC-3"
        ],
        "level": "test",
        "provenance": "review",
        "reason": "Expanded authorization and cycle regressions",
        "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 516
          }
        ],
        "cause": "",
        "attempts": []
      },
      {
        "id": "mixed-scope-consent-boundary",
        "command": "python3 /tmp/cct-rereview-502/mixed-scope.py",
        "executor": "codex",
        "profile": "manual",
        "context": "project",
        "required": true,
        "criteria": [
          "AC-1",
          "AC-2"
        ],
        "level": "boundary",
        "provenance": "review",
        "reason": "Same-role and cross-role scope precedence must agree",
        "head_sha": "d3d4815a324fddfe4f71281cdc6113dbc3948105",
        "result": "pass",
        "evidence": [
          {
            "exit_code": 0,
            "executed": 1
          }
        ],
        "cause": "",
        "attempts": []
      }
    ]
  }
}

Security

No changed path matches the mandatory CI/automation, secrets/keys or agent/toolkit configuration minimum. Reviewer judgement activates the authorization audit. Delegated cc-pr-review and cc-security-review completed for this head with no new findings. Checked exact/pattern matching, source precedence, deny ties, resume answers, cache supersession, revocation, global-review exclusions, executor/platform separation and audit retention. Concrete Git, gh, credential, redirect, publication and shell guards remain in force. Cross-role consent is the explicit owner decision in #500. No dependencies or migration were introduced. Residual limit: fake Compose resolution does not establish real Docker behavior.

Documentation

The owning host-permissions, configuration and verification pages describe all-role matching and scope precedence; the parity audit, changelog and roadmap are updated. The PR description identifies these documentation pages.

Exact-head CI (parallel policy)

  • Classify the change: SUCCESS
  • Skills, manifests, and Bash installer: SUCCESS
  • Windows test shard (windows-1): SUCCESS
  • Windows test shard (windows-2): SUCCESS
  • Windows test shard (windows-3): SUCCESS
  • Windows test shard (windows-4): SUCCESS
  • PowerShell installer: SUCCESS

7 passed, 0 failed, 0 pending, none cancelled or skipped. CI evidence is separate from local checks; no previous-head CI result was substituted.

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.

A consent given for an exact operation applies in every stage role, not only the role that was asked

1 participant