Skip to content

feat(cycle): scope authorized actions and stabilize native temp paths - #266

Merged
datacas merged 2 commits into
mainfrom
issue-141-authorized-actions
Oct 17, 2026
Merged

datacas merged 2 commits into
mainfrom
issue-141-authorized-actions

Conversation

@datacas

@datacas datacas commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Native stages now use isolated temporary directories with fixed helper names, and each writing, verification, or coordination skill states the actions its workflow already authorizes. Shared conventions preserve user decisions and each role's publication boundary, including explicit host Docker permission.

Work item: #141 — #141

Diagnosis

Classification: feature_request. Decision: implement. No defect reproduction is claimed. Code inspection confirmed that _native_review_scratch returned immediately for writing stages, while shared conventions lacked the requested role-specific authorization lists and stable helper instructions.

The invariant is that authorization stays within each skill's documented workflow, and every native dispatch owns one writable temporary directory outside its checkout for its entire lifetime. The implementation extends the existing scratch lifecycle, preserves Codex Git and network protections, and validates the instruction contracts rather than checking agents' filename choices at runtime.

Related searches were widened across authorization, TMPDIR, linked work, and merged changes: #135, #142, #182, #239, #240, #245, #264, and #265. Host approval guidance, answer recovery, optional auto-answering, and Orca temporary paths remain in their respective work items. No other open work item is claimed as implemented.

Work units

Unit Behaviour Files Tests Verification Rollback
WU-1 All native stages receive isolated code-cycle-tmp- directories, fixed helper instructions, preserved permission rules, and automatic cleanup scripts/executors.py, scripts/run_cycle.py, tests/test_executors.py, tests/test_run_cycle.py, docs/role-workspace-policy.md, docs/routing.md Native permission matrix, real subprocess helper writes and nonzero exits, concurrency, timeout/cancellation, Git/network rule preservation, all stage prompts 184 executor tests and 5 explicit boundary tests passed; full suite passed Dependent: revert WU-2 before reverting 07838101224ce755790f4c615fab5620b862c096, because its instruction contract expects this runtime support
WU-2 Five skills state scoped preauthorized actions; all shared conventions preserve user decisions, Docker grants, and stable helper names All 15 skills/*/SKILL.md files, scripts/validate-package.py, tests/test_validate_package.py, CONTRIBUTING.md, CHANGELOG.md Missing/expanded actions, unauthorized read-only lists, Docker permission, shared omissions, unstable helper instructions Package validator and full 1,483-test suite passed Independent: revert 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb

Verification

Agent-reported evidence; conclusion verified, boundary required.

Level Command Exit Executed
static python3 scripts/validate-package.py 0 —
test python3 -m unittest discover -s tests -p test_executors.py 0 184
test python3 -m unittest discover -s tests -v 0 1,483
boundary env PYTHONPATH=tests python3 -m unittest test_executors.NativeScratchTests test_executors.ReadOnlyVerificationTests.test_native_reviews_can_create_temporary_files_without_changing_checkout 0 5
static git diff --check 0 —

The first full-suite attempt exceeded the tool's two-minute limit; the complete rerun passed in 145.242 seconds. Tests use disposable repositories, configured test Git identities, and fake agents, matching the suite's CI assumptions without live model credentials. Actual model dispatch and Windows execution were not performed locally.

Compatibility

Rules matching the v0.6.1 temporary prefix <parent>/code-cycle-review-tmp-* must migrate to <parent>/code-cycle-tmp-*. Orca workers keep their existing lifecycle. Host Docker access still requires an explicit grant.

CI policy is parallel: this stage reads the pushed head's checks once; the cycle's CI gate owns the wait.

Closes #141

@datacas

datacas commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Native stages now use isolated temporary directories with fixed helper names, and each writing, verification, or coordination skill states the actions its workflow already authorizes. Shared conventions preserve user decisions and each role's publication boundary, including explicit host Docker permission.

Work item: #141 — #141

Diagnosis

Classification: feature_request. Decision: implement. No defect reproduction is claimed. Code inspection confirmed that _native_review_scratch returned immediately for writing stages, while shared conventions lacked the requested role-specific authorization lists and stable helper instructions.

The invariant is that authorization stays within each skill's documented workflow, and every native dispatch owns one writable temporary directory outside its checkout for its entire lifetime. The implementation extends the existing scratch lifecycle, preserves Codex Git and network protections, and validates the instruction contracts rather than checking agents' filename choices at runtime.

Related searches were widened across authorization, TMPDIR, linked work, and merged changes: #135, #142, #182, #239, #240, #245, #264, and #265. Host approval guidance, answer recovery, optional auto-answering, and Orca temporary paths remain in their respective work items. No other open work item is claimed as implemented.

Work units

Unit Behaviour Files Tests Verification Rollback
WU-1 All native stages receive isolated code-cycle-tmp- directories, fixed helper instructions, preserved permission rules, and automatic cleanup scripts/executors.py, scripts/run_cycle.py, tests/test_executors.py, tests/test_run_cycle.py, docs/role-workspace-policy.md, docs/routing.md Native permission matrix, real subprocess helper writes and nonzero exits, concurrency, timeout/cancellation, Git/network rule preservation, all stage prompts 184 executor tests and 5 explicit boundary tests passed; full suite passed Dependent: revert WU-2 before reverting 07838101224ce755790f4c615fab5620b862c096, because its instruction contract expects this runtime support
WU-2 Five skills state scoped preauthorized actions; all shared conventions preserve user decisions, Docker grants, and stable helper names All 15 skills/*/SKILL.md files, scripts/validate-package.py, tests/test_validate_package.py, CONTRIBUTING.md, CHANGELOG.md Missing/expanded actions, unauthorized read-only lists, Docker permission, shared omissions, unstable helper instructions Package validator and full 1,483-test suite passed Independent: revert 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb

Verification

Agent-reported evidence; conclusion verified, boundary required.

Level Command Exit Executed
static python3 scripts/validate-package.py 0 —
test python3 -m unittest discover -s tests -p test_executors.py 0 184
test python3 -m unittest discover -s tests -v 0 1,483
boundary env PYTHONPATH=tests python3 -m unittest test_executors.NativeScratchTests test_executors.ReadOnlyVerificationTests.test_native_reviews_can_create_temporary_files_without_changing_checkout 0 5
static git diff --check 0 —

The first full-suite attempt exceeded the tool's two-minute limit; the complete rerun passed in 145.242 seconds. Tests use disposable repositories, configured test Git identities, and fake agents, matching the suite's CI assumptions without live model credentials. Actual model dispatch and Windows execution were not performed locally.

Compatibility

Rules matching the v0.6.1 temporary prefix <parent>/code-cycle-review-tmp-* must migrate to <parent>/code-cycle-tmp-*. Orca workers keep their existing lifecycle. Host Docker access still requires an explicit grant.

CI policy is parallel: this stage reads the pushed head's checks once; the cycle's CI gate owns the wait.

Implementation result

Status: IMPLEMENTED. Head: 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb.

Routing: profile deep_coder, requested model openai/gpt-6.1-sol, effort medium, resolved model ?.

The single snapshot for this head reports 0 passed, 0 failed, and 5 pending:

Check State
Skills, manifests, and Bash installer pending
Windows test shard (windows-1) pending
Windows test shard (windows-2) pending
Windows test shard (windows-3) pending
Windows test shard (windows-4) pending

@datacas

datacas commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261017-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

Initial review — PR #266 (work item #141)

Status: REVIEW_PASSED_AWAITING_CI. Review complete for head 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb. No open finding blocks approval. This is not an approval: the CI gate waits for the checks (policy parallel).

Scope

Accumulated diff origin/main...head (merge base dc57efd, 1205 lines, SHA-256 aff44852…ed5fe5), read in full: scripts/executors.py, scripts/run_cycle.py, scripts/validate-package.py, 15 SKILL.md files, docs, CHANGELOG/CONTRIBUTING, and the three test files. Compared against the requirements of #141.

Findings

None.

  • Every native dispatch (Codex and Claude, writing or read-only) now gets a unique code-cycle-tmp-* TMPDIR outside the checkout, removed on success, failure, timeout and cancellation.
  • Codex read-only stages keep the :read-only extension. Writing stages append the directory to the existing filesystem table (Git protections kept) or use --add-dir on the legacy selector. Network and socket grants are untouched.
  • The five "Already authorized actions" lists match Stop asking what the cycle already has authorized; stable temp paths #141: no commit/push in cc-verify or the coordinators, no list on read-only skills, Docker still requires an explicit grant. The shared conventions grant no new capability.

Security triage

.code-cycle.yml declares no security_review.always_when, so the defaults apply. The deterministic rule found no match in paths or labels. My own reading fired: scripts/executors.py changes the sandbox write grants. Audit done on that surface:

  • The scratch directory is mkdtemp-created (0700), unique per dispatch, outside the checkout, and checked not to overlap it.
  • Only that directory is added as writable; Git metadata protections and the network allowlist are unchanged.
  • No new input reaches a command line beyond a path from tempfile, JSON-quoted in the Codex -c values.

No vulnerability or potential risk found.

Verification (executed in a disposable copy)

Command Result
python3 scripts/validate-package.py exit 0, valid
unittest test_executors.py 184 passed
unittest test_validate_package.py 70 passed
unittest test_run_cycle.py 210 passed
Probe of Codex argv per permission combination (write / publish-write / publish-read / read-only / legacy) Expected profile, scratch grant, and TMPDIR in each case

Unverified

  • Full 1,483-test suite not re-run here; the PR author reports it passed.
  • Real Codex/Claude dispatch and Windows execution not performed. On Windows, TMPDIR is not what tempfile reads (TEMP/TMP); this predates the PR for read-only stages and the Windows shards cover the tests.

CI (read once, not waited on)

Check State
Skills, manifests, and Bash installer pending
Windows test shard (windows-1) pending
Windows test shard (windows-2) pending
Windows test shard (windows-3) pending
Windows test shard (windows-4) pending

Residual risks

  • Permission rules matching the v0.6.1 prefix code-cycle-review-tmp-* must migrate to code-cycle-tmp-* (documented in CHANGELOG).
  • Agents following the fixed helper names is enforced by instruction contract and validator, not at runtime (stated design).

Verdict

No blocking findings on head 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb; awaiting CI.

ORCHESTRATION_RESULT (JSON)

ORCHESTRATION_RESULT
{"skill":"cc-initial-review","status":"REVIEW_PASSED_AWAITING_CI","issue_provider":"github","issue_id":"141","code_host":"github","change_request_id":"266","change_request_url":"https://github.com/datacas/code-cycle-toolkit/pull/266","pr_number":266,"issue_number":141,"head_sha":"6b8f0653c83ef0ab29c789b79cadfc724ebdabfb","reviewed_head_sha":"6b8f0653c83ef0ab29c789b79cadfc724ebdabfb","review_run_id":"CCR-20261017-001","reviewer":{"profile":"reviewer","provider":"anthropic","model_requested":"claude-sonnet-5-5","model_resolved":null,"effort":"high"},"findings":[],"blocking_findings":[],"checks":{"head_sha":"6b8f0653c83ef0ab29c789b79cadfc724ebdabfb","passed":0,"failed":0,"pending":5},"blocking":false}
END_ORCHESTRATION_RESULT

@datacas

datacas commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261017-002] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

Initial review — PR #266 (work item #141)

Status: REVIEW_PASSED_AWAITING_CI. Review complete for head 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb. No open finding blocks approval. This is not an approval: the CI gate waits for the checks (policy parallel).

Recovered attempt verification

Recovered attempt attempt-43852950acff4dffb0ce106303cb40ed (comment CCR-20261017-001, same head) claimed no finding IDs, so there is nothing to mark resolved, still_open, or not_applicable. verified_findings is empty. I re-derived its "no findings" conclusion independently below rather than copying it.

Scope

Accumulated diff origin/main...head (merge base dc57efd, 1205 lines, SHA-256 aff44852…ed5fe5, confirmed), read in full: scripts/executors.py, scripts/run_cycle.py, scripts/validate-package.py, 15 SKILL.md files, docs, CHANGELOG/CONTRIBUTING, and the three test files.

Findings

None.

  • _native_review_scratch now yields an isolated code-cycle-tmp-* TMPDIR for writing stages as well, with the existing outside-checkout and non-overlap checks.
  • Codex: read-only stages keep :read-only plus the single scratch grant. Writing stages with a named profile merge the scratch entry into the existing filesystem table (Git protections kept). Legacy workspace-write uses --add-dir. Network/socket options are untouched.
  • The five "Already authorized actions" lists contain no commit/push in cc-verify or the coordinators, no list on read-only skills, and Docker still requires an explicit grant. Shared conventions state they grant no capability.

Security triage

.code-cycle.yml declares no security_review.always_when; defaults apply and the deterministic rule matched no path or label. My own reading fired on scripts/executors.py (sandbox write grants), so the audit ran on that surface: the directory comes from tempfile, is per dispatch, outside the checkout, and is the only added writable root; the path is JSON-quoted in Codex -c values. No vulnerability or potential risk found.

Verification (executed in the disposable clone, bytecode writes disabled)

Command Result
python3 -I scripts/validate-package.py exit 0, valid
unittest discover -p test_executors.py 184 passed
unittest discover -p test_validate_package.py 70 passed
unittest discover -p test_run_cycle.py 210 passed
git status --porcelain after the run clean

Unverified

  • Full 1,483-test suite not re-run here; the PR author reports it passed.
  • Real Codex/Claude dispatch not performed. On Windows, tempfile reads TEMP/TMP, not TMPDIR; the Windows shards cover the tests.

CI (read once, not waited on)

Check State
Skills, manifests, and Bash installer pass
Windows test shard (windows-1) pass
Windows test shard (windows-2) pass
Windows test shard (windows-3) pass
Windows test shard (windows-4) pass
PowerShell installer pending

Residual risks

  • Permission rules matching the v0.6.1 prefix code-cycle-review-tmp-* must migrate to code-cycle-tmp-* (documented in CHANGELOG).
  • Agents following the fixed helper names is enforced by instruction contract and validator, not at runtime (stated design).

Verdict

No blocking findings on head 6b8f0653c83ef0ab29c789b79cadfc724ebdabfb. PowerShell installer has not finished, so the status is REVIEW_PASSED_AWAITING_CI; the CI gate decides.

ORCHESTRATION_RESULT (JSON)

ORCHESTRATION_RESULT
{"skill":"cc-initial-review","status":"REVIEW_PASSED_AWAITING_CI","issue_provider":"github","issue_id":"141","code_host":"github","change_request_id":"266","change_request_url":"https://github.com/datacas/code-cycle-toolkit/pull/266","pr_number":266,"issue_number":141,"head_sha":"6b8f0653c83ef0ab29c789b79cadfc724ebdabfb","reviewed_head_sha":"6b8f0653c83ef0ab29c789b79cadfc724ebdabfb","review_run_id":"CCR-20261017-002","reviewer":{"profile":"reviewer","provider":"anthropic","model_requested":"claude-sonnet-5-5","model_resolved":null,"effort":"high"},"verified_findings":[],"findings":[],"blocking_findings":[],"checks":{"head_sha":"6b8f0653c83ef0ab29c789b79cadfc724ebdabfb","passed":5,"failed":0,"pending":1},"blocking":false}
END_ORCHESTRATION_RESULT

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.

Stop asking what the cycle already has authorized; stable temp paths

1 participant