Repository navigation
fix: habilita publicación con política conductual por etapa - #54
Conversation
Initial review — PR #54
|
| Profile | https://api.github.com |
https://example.com |
write in workspace | write in /tmp |
|---|---|---|---|---|
code_cycle_publish_read |
200 | blocked ("domain is not on the allowlist") | refused (read-only FS) | refused |
code_cycle_publish_write |
200 | blocked | allowed | allowed |
The /tmp write in the write profile matches today's workspace-write, so it is not a regression. Please also add a test that makes Codex parse the arguments, or at least one that fails on a quoted dotted key. tests/test_executors.py:889 currently asserts the broken string.
[REV-002] · medium · open · blocks:yes — Claude's publication allowlist grants far more than publishing, including merge, and gives read-only reviewers git push
Path: scripts/executors.py (line 729). Category: security.
--allowedTools "Bash(gh:*)" "Bash(git push:*)" is a prefix match. Bash(gh:*) allows any gh subcommand, for example gh pr merge, gh api -X DELETE …, gh release create, gh secret set, and gh issue close. That contradicts the toolkit's "Never merge" rule (CONTRIBUTING.md) and #49's acceptance criterion "no dispatch receives more access than its role needs to publish". It is also applied unchanged to review and rereview: a read-only reviewer receives Bash(git push:*), including --force and ref deletion (git push origin :branch). A reviewer only needs to read the change request and post a comment.
Suggested direction: allowlist per role.
- Review and rereview: e.g.
Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr checks:*),Bash(gh pr comment:*), plus read-onlygh apiif the skills need it. Nogit push. - Implement and resolve: add
Bash(gh pr create:*),Bash(gh pr edit:*),Bash(git push origin:*), with an explicit disallow of--forceand of pushing to the base branch if the CLI supports deny rules (--disallowedTools "Bash(gh pr merge:*)"at minimum).
This finding comes from reading the code and from the documented prefix semantics of --allowedTools. I did not execute it, to avoid merging or deleting anything in a real repository.
[REV-003] · low · open · blocks:no — No CHANGELOG.md entry
Path: CHANGELOG.md. Category: maintainability.
Every feature and fix PR in this repository adds an [Unreleased] entry. This one changes executor permissions, adds a telemetry token (publication_access), and raises the minimum Codex version (0.138.0). All three are user-visible.
Security triage
Sensitive change: it grants network and command permissions to agent executors and adds a host-side credential check.
- Codex (once REV-001 is fixed): network scoping and the filesystem boundary behave as documented (see the REV-001 table).
- Preflight: it does not change remote state.
git push --dry-runtargets an unused ref and creates nothing. Its error details carry exit codes, not command output, so no token or remote URL leaks intodetail. - Claude: the allowlist is too broad (REV-002).
- Residual risk the network allowlist cannot close: a Codex stage that can reach
api.github.comwith the user'sghtoken can call any API that token allows, merge included. Network scoping limits where, not what. It needs to be stated in the README.
Verification executed
Preflight: Python 3.10.12, PyYAML, Codex CLI 0.156.1 authenticated, a detached worktree at 4c96e3b, and a clone of datacas/code-cycle-sandbox.
| Command | Result |
|---|---|
python3 scripts/validate-package.py |
VALID: 13 skills (6 cycle, 7 supporting)… |
python3 -m unittest discover -s tests |
599/600. The one failure is test_run_cycle.LocalOnlyPolicyTests.test_local_only_rejects_the_live_repository, the known artefact of running outside the canonical checkout (CI passes it). |
codex exec with CodexAdapter.argv(..., publishes=True), read and write profiles |
Both exit 1 at config load → REV-001 |
Same, empty CODEX_HOME, single quoted-domain override |
Same error → not caused by local config |
| Same, domains as one inline table | Loads; network and filesystem as in the REV-001 table |
Not verified: I did not run the Claude publication path (REV-002) or _publication_preflight against a real remote. Its logic was reviewed by reading it and is covered by the PR's installed-cycle test with a local Git remote.
CI
gh pr checks 54: 4/4 passed. That is Validate package run twice (push + pull_request), each with Skills, manifests, and Bash installer ✅ and PowerShell installer ✅. None are pending, skipped, or missing. CI does not run Codex, which is why REV-001 passed it.
Residual risks
- Token breadth, as described in the security triage.
viewerPermissionrequires push access even for reviewers. That is stricter than a comment needs, and acceptable.- The behaviour of Codex permission profiles depends on the CLI version beyond the 0.138.0 floor. The syntax in REV-001 is the kind of detail that changes between releases.
Project verdict: CHANGES_REQUESTED. REV-001 and REV-002 block approval; REV-003 does not.
Resolve comments — PR #54Functional status: Fix commits: [REV-001] · high · resolved · blocks:yes — Codex publish-profile domain overrides fail to parsePath: Resolution: Replaced dotted overrides with one TOML inline table for the four allowed GitHub and Bitbucket hosts. Added a regression assertion that rejects quoted dotted keys. Verification: [REV-002] · medium · resolved · blocks:yes — Claude's publication allowlist grants more access than each stage needsPaths: Resolution: Publication commands now follow the role contract. Implement can create a PR, comment, and push its current branch; resolve can comment and push that branch; review and rereview can only comment. Claude no longer receives general Verification: Regression tests cover each role's permissions and reject shell syntax in branch names; the full 606-test suite passed. [REV-003] · high · resolved · blocks:yes — GitHub write collaborators fail the publication preflightPath: Resolution: The preflight now accepts GitHub's Verification: [REV-004] · medium · open · blocks:yes — Codex publication does not enforce the role's allowed operationsPaths: The role contract gives Codex review and rereview stages comment-only publication permissions, but Codex's network profile only limits destination hosts. It does not restrict API operations on GitHub or Bitbucket. A review session with ambient credentials can still push, create a PR, or make other writes to those hosts. This needs per-action enforcement or a constrained publisher before the role boundary is complete. Verification and checks
|
Re-review — PR #54Functional status: Finding historyThe trusted timeline reuses [REV-001] · high · resolved · blocks:yes — Codex publish-profile domain overrides fail to parsePath: Corrected and regression-verified: the current arguments encode the allowed domains as one inline table and no longer use quoted dotted keys. The executor tests (122 tests) and full unit suite pass. This rereview did not run a live Codex model dispatch or publication. [REV-002] · medium · resolved · blocks:yes — Claude's publication allowlist grants more access than each stage needsPaths: Corrected and regression-verified: Claude's allowlist is assembled from the role contract; review/rereview receive only [REV-003] · low · open · blocks:no — No
|
Correction of review record — PR #54This is an owner-authorized correction of an ID collision, not a new finding. The re-review at HEAD
[REV-003] · low · open · blocks:no — No
|
The owner changed the requirement behind REV-004: agents keep their normal gh, git and GitHub access, and the role contract becomes a behavioural publication policy rather than a per-operation permission. - Every stage's prompt states its allowed publication operations and the prohibitions that apply to all stages (no merge, force push, ref deletion, base-branch change, unrequested closing, or cross-stage publication). - Publishing Claude stages receive gh and git instead of narrowed commands. - README states that the boundary is behavioural and the preflight is a readiness check, not enforcement. - CHANGELOG entry for the publication work (REV-003).
Resolve comments — PR #54Functional status: Owner requirement change. The repository owner changed the architecture decision behind REV-004. The publication boundary is now behavioural. Codex and Claude keep their normal [REV-001] · high · resolved · blocks:yes — Codex publish-profile domain overrides fail to parsePath: [REV-002] · medium · not_applicable · blocks:no — Claude's publication allowlist grants far more than publishingPath: [REV-003] · low · resolved · blocks:no — No
|
Re-review — PR #54Functional status: Summary and finding stateThe owner-authored correction in comment 5801969261 resolves the earlier ID collision: [REV-001] · high · resolved · blocks:yes — Codex publish-profile domain overrides fail to parsePath: Resolved in [REV-002] · medium · not_applicable · blocks:no — Claude's publication allowlist grants more access than each stage needsPath: The owner intentionally changed the boundary to behavioural. Claude receives [REV-003] · low · resolved · blocks:no — No
|
Re-review — PR #54Functional status: Findings and verificationThe recovered findings remain as recorded in the previous rereview: I ran the authorized live acceptance cycle against the private sandbox repository, issue #2. The first attempt was blocked because the command sandbox could not authenticate direct GitHub CLI calls. Retrying with host network access passed the runner's publication preflight and started implementation, but the agent then reported that its authenticated connector and GitHub API both returned 404 for the private repository and issue. The cycle stopped at This leaves issue #49's live publication acceptance criterion unverified. The block is for that missing evidence, not an unresolved code finding. PR #54 remains open, and GitHub currently has no formal review decision. Verdict
|
Live publication acceptance — evidenceA live cycle passed at PR HEAD Setup. The skills were installed from this repository in project scope inside the clone and excluded from Git. Global user configuration was left unchanged. The sandbox's own Result:
On the earlier 404. From the host, Side observation, not a blocker for this PR. The review comment's run line reports |
Re-review — PR #54Functional status: What changed since the previous re-reviewNo code changes. The only new input is the live acceptance evidence (comment 5803659482), which was the single reason for the previous Previous findingsThe IDs follow the published correction (comment 5801969261). There is no collision. [REV-001] · high · resolved · blocks:yes — Codex publish-profile domain overrides fail to parsePath: [REV-002] · medium · not_applicable · blocks:no — Claude's publication allowlist grants far more than publishingPath: [REV-003] · low · resolved · blocks:no — No
|
Resumen
Permite que los stages publicadores de un ciclo real publiquen en GitHub y declara en el contrato de rol qué puede publicar cada stage. La frontera de publicación es conductual: los agentes conservan su acceso normal a
gh,gity la red de GitHub, y el prompt de cada stage indica qué operaciones puede hacer.Cambios
RoleContractdeclara publicación y operaciones por rol: implement (comment,create_pr,push_branch), resolve (comment,push_branch), review/rereview (comment).local-onlydesactiva la publicación.ghygit.gh auth status,viewerPermission,git push --dry-run). Un fallo queda registrado comomissing_capability=publication_access. Es una comprobación de disponibilidad, no de permisos por operación.Verificación
python3 scripts/validate-package.py: correcto.python3 -m unittest discover -s tests -q: 605 pruebas correctas.Closes #49