Skip to content

fix(publication): route GitHub operations through gh - #96

Merged
datacas merged 2 commits into
mainfrom
issue-76-gh-publication-routing
Sep 25, 2026
Merged

datacas merged 2 commits into
mainfrom
issue-76-gh-publication-routing

Conversation

@datacas

@datacas datacas commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route GitHub change-request reads and writes through authenticated gh across the four publishing skills and runtime prompts.
  • Retry GitHub publication after connector HTTP 403/404 responses with gh, and name the failed tool if blocked.
  • Document the publication boundary and cover the prompt contract with a test.

Issue: #76

Verification

  • python3 scripts/validate-package.py
  • python3 -m unittest discover -s tests -v

@datacas

datacas commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

Code Cycle initial review — PR #96

[CCR-20260925-001] · manual · anthropic/?→claude-opus-5-5 · ? · schema:1

Verdict: APPROVED. Reviewed head 11de73763d1a89f75134122fcf8e38220a3dc470. There are no blocking findings, and all 4 checks pass.

Summary and scope

This PR implements issue #76. When the code host is GitHub and gh is authenticated, the change-request operations run through gh. A connector or MCP tool is used only as a fallback. If another tool returns HTTP 403 or 404, the stage retries once with gh and names the tool that failed.

Reviewed diff: 73508f5..11de737, the merge-base with main to the head, 7 files, +43/−1:

  • skills/cc-{implement-issue,initial-review,rereview,resolve-comments}/SKILL.md: the same rule, placed under Provider context. This section is not one of the byte-compared shared sections, and the four copies match apart from one scope phrase per skill.
  • scripts/cycle.py: publication_policy() adds the rule to every publishing stage's prompt, next to the existing policy text.
  • tests/test_cycle.py: covers the new text in the review, resolve, rereview and implement prompts.
  • docs/routing.md: adds a paragraph under Publication boundary.

Every acceptance criterion in #76 is met: the rule is in all four skills, the validator passes, a test asserts that the prompt names gh, and the rule is documented under Publication boundary.

Findings

[REV-001] · low · open · - · blocks:no — No CHANGELOG.md [Unreleased] entry

Path: CHANGELOG.md

The last three merged PRs (#93, #94, #95) each added an entry under [Unreleased]. This PR changes what the skills do and what the runtime prompt says, but it adds no entry. CONTRIBUTING.md asks for a changelog entry only in the release checklist, so this does not block the PR. Without an entry, the next release notes will leave out this change.

[REV-002] · low · open · - · blocks:no — Directly invoked passes still publish without the gh-first rule

Paths: skills/cc-pr-review/SKILL.md (around lines 60 and 272), and cc-security-review / cc-verify when invoked directly.

CONTRIBUTING.md allows a directly invoked pass to publish its own comment, and cc-pr-review does this with gh pr comment / gh pr review. #76 names only the four cycle skills, so this is outside the issue's scope. The problem it fixes can still happen, though: a directly invoked cc-pr-review on a host that prefers connectors can pick a connector whose permissions differ from gh's and get the same 403. Either add the same paragraph to those passes or record the gap as a follow-up.

Security triage

.code-cycle.yml declares no security_review.always_when rule, so the defaults applied, and no labels or paths matched them. The audit ran because of the reviewer's own reading: the change decides which authenticated identity carries out remote writes after a permission denial, and that is part of the authorization and publication boundary.

Result: no confirmed vulnerability.

  • The policy text changes only which tool runs an operation. The allowed and denied operations and PUBLICATION_PROHIBITIONS stay the same, and the new text comes before the prohibitions in the prompt. Test test_each_stage_is_told_its_publication_policy confirms that every stage still gets "Never merge, force-push, delete remote refs".
  • Stages with no publication permissions keep the "publishes nothing" branch unchanged. They do not get the rule, which is correct because they publish nothing.
  • Potential risk (not a vulnerability): after a 403, the stage retries with a different identity. A connector's 403 can be a deliberate restriction, and gh may hold broader scopes. Three things limit this: the retry happens once and only for the same operation, gh is the identity the runtime preflight already checked, and the stage's publication policy still applies. See Residual risks.

Commands run

Command Result
python3 scripts/validate-package.py (PR head) VALID: 14 skills (6 cycle, 8 supporting), shared sections in sync, cross-agent manifests aligned
python3 -m unittest discover -s tests (PR head) OK
python3 -m unittest -v tests.test_cycle, publication and policy tests all 6 ok, including test_each_stage_is_told_its_publication_policy
PR head merged with the current origin/main (29ad33d) in a temporary worktree, then validator + full suite merges cleanly; VALID; Ran 699 tests … OK

Verification was by execution for the runtime prompt (cycle.py) and for the validator's shared-section checks.

Unverified

  • Whether agents follow the skill text: the four SKILL.md paragraphs are instructions to agents, not code, so this was checked by reading only. Confirming it would need a real Codex publishing stage in which a connector returns a 403, which this environment cannot run.
  • The Codex connector scenario from Allow Claude in read-only roles via isolated worktrees #74 was not reproduced.

CI

gh pr checks 96 → 4 passed, 0 failed, 0 pending. The checks are the two Validate package workflow runs, each with the jobs Skills, manifests, and Bash installer and PowerShell installer. The PR's check rollup shows no expected check missing. release.yml runs only on main, so it does not apply to this PR. The PR is not a draft. Merge state is BEHIND main by one commit (#95); it is mergeable, and the merged tree passed the validator and the full test suite locally.

Residual risks

  • The 403/404 fallback trusts that gh's identity is allowed to perform the operation the connector was refused. That holds under the runtime preflight, but in a manual run nothing checks it before the retry. The BLOCKED report that names the failed tool is what makes the retry auditable.
  • The rule is enforced by the prompt, not by the runtime. The publication_policy() docstring already says this, and it applies to the new rule as well.
  • REV-002 leaves directly invoked passes exposed to the Allow Claude in read-only roles via isolated worktrees #74 failure mode.

Verdict

APPROVED: the reviewed head equals the current head, every check passed, and no open finding has blocks:yes. REV-001 and REV-002 are optional follow-ups.

@datacas

datacas commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

Code Cycle rereview — PR #96

[CCR-20260925-002] · manual · anthropic/?→claude-opus-5-5 · ? · schema:1

Previous run: CCR-20260925-001, on 11de73763d1a89f75134122fcf8e38220a3dc470.

Verdict: APPROVED. Reviewed head 24cd982e5587166c4534f7383604f8b7550fe643. There are no blocking findings, all 4 checks pass, and the merge state is CLEAN.

What changed since the previous review

There is one new commit, 24cd982 "Merge branch 'main' into issue-76-gh-publication-routing", which is the GitHub Update branch merge. It brings in 29ad33d (#95) from main.

  • The merge needed no manual conflict resolution: git show --cc 24cd982 shows no combined hunks.
  • The merge-base with main is now 29ad33d, which is also the current origin/main.
  • The PR's accumulated diff (29ad33d..24cd982) touches the same 7 files, +43/−1. Its +/- lines are byte-for-byte identical to the diff reviewed in CCR-20260925-001. Only the hunk offsets changed, because run_cycle: resume an existing change request (--from review|resolve|rereview --pr N) #95 also edited scripts/cycle.py.

I re-read the whole accumulated diff. The review from CCR-20260925-001 still stands, and I found no new findings.

Previous findings

[REV-001] · low · open · - · blocks:no — No CHANGELOG.md [Unreleased] entry

Path: CHANGELOG.md. Still reproducible: the accumulated diff does not touch CHANGELOG.md.

[REV-002] · low · open · - · blocks:no — Directly invoked passes still publish without the gh-first rule

Paths: skills/cc-pr-review/SKILL.md, plus cc-security-review and cc-verify when invoked directly. Still reproducible: none of these files is in the accumulated diff, and cc-pr-review has no connector or gh-first rule.

Neither finding blocks approval. Both remain optional follow-ups.

Security triage

.code-cycle.yml declares no security_review.always_when rule, so the defaults applied, and no labels or paths matched them. The audit ran again because of the reviewer's own reading: the change decides which authenticated identity carries out remote writes after a permission denial.

Result: no confirmed vulnerability, unchanged from the previous review. The code that came in from main (#95, the run_cycle --from … --pr N resume) does not change publication_policy() or PUBLICATION_PROHIBITIONS. test_each_stage_is_told_its_publication_policy still passes.

Commands run (at 24cd982, in a temporary worktree)

Command Result
Compare the +/- lines of 73508f5..11de737 with those of 29ad33d..24cd982 identical
python3 scripts/validate-package.py VALID: 14 skills (6 cycle, 8 supporting), shared sections in sync, cross-agent manifests aligned
python3 -m unittest discover -s tests Ran 699 tests … OK
python3 -m unittest tests.test_cycle.RoleWorkspacePolicyTests.test_each_stage_is_told_its_publication_policy OK

Unverified

These are unchanged from the previous review:

CI

gh pr checks 96 at 24cd982: 4 passed, 0 failed, 0 pending. The checks are the two Validate package runs, each with the jobs Skills, manifests, and Bash installer and PowerShell installer. The PR is not a draft, and mergeStateStatus is CLEAN. Right after the update, the state briefly read BLOCKED while those checks were still pending.

Residual risks

These are unchanged:

Verdict

APPROVED: the reviewed head equals the current head (24cd982), every check passed, every previous finding was classified, and no open finding has blocks:yes.

@datacas
datacas merged commit 9e4d43b into main Sep 25, 2026
4 checks passed
@datacas
datacas deleted the issue-76-gh-publication-routing branch October 6, 2026 07:53
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