Skip to content

run_cycle pasa el ID de la PR a las etapas de revisión - #57

Merged
datacas merged 1 commit into
mainfrom
issue-50-change-request-id
Sep 23, 2026
Merged

datacas merged 1 commit into
mainfrom
issue-50-change-request-id

Conversation

@datacas

@datacas datacas commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Resumen

  • Pasa el change_request_id devuelto por implement a review, resolve y rereview; acepta pr_number como alias heredado.
  • Detiene el ciclo antes de review si falta un identificador válido.
  • Añade cobertura de regresión para el traspaso, el alias y el caso sin ID.

Verificación

  • python3 scripts/validate-package.py
  • python3 -m unittest discover -s tests — 615 pruebas aprobadas.
  • git diff --check

Closes #50

@datacas

datacas commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner Author

Initial review — PR #57 (run_cycle passes the change-request ID to review stages)

Verdict: APPROVED — no blocking findings, and every CI check on the reviewed head passes. (Updated: this comment first said BLOCKED while one check was still pending.)

Reviewed scope: full accumulated diff origin/main...7c96e74 (1 commit, 3 files: scripts/run_cycle.py, tests/fakes/fake_agent.py, tests/test_run_cycle.py), checked against issue #50 and its acceptance criteria. Conventions: CONTRIBUTING.md (no AGENTS.md/CLAUDE.md in the repo); output language English, taken from CONTRIBUTING.md.

Summary

The change does what #50 asks:

  • Reported.change_request_id reads change_request_id, falling back to the legacy pr_number. It accepts only a scalar of at most 128 characters drawn from [alnum #._:/-], and it rejects booleans.
  • compose() names the change request, with the work item in parentheses, for review, resolve and rereview. implement keeps its prompt.
  • run_cycle() stops before review with an explicit reason when implement returns no usable ID. The ID is not written to telemetry, and a test asserts that.
  • The tests cover the handoff across all three stages, the legacy alias, the missing-ID stop, and a rejected unsafe reference.

Findings

[REV-001] · low · open · blocks:no — No CHANGELOG entry for a behaviour change

CHANGELOG.md — run_cycle now changes the prompts it sends, and it adds a new stop condition before review. Every recent PR (#41–#54) added a line under ## [Unreleased], but this one does not. Suggest a ### Fixed entry.

[REV-002] · low · open · blocks:no — Stray extra blank line inside FunctionalStopTests

tests/test_run_cycle.py:384 — the diff adds a second blank line between two methods of the same class. That is unrelated to the change and would be flagged as E303 by pycodestyle. It is cosmetic only.

Security triage and audit

Triage: sensitive. The change inserts a value from another agent's untrusted output into the next stage's prompt. That is untrusted-input validation, so the audit ran, using the cc-security-review criteria inline.

  • Confirmed vulnerabilities: none. Newlines, spaces, backticks and other control characters are rejected, and the reference is wrapped in backticks, so it cannot break out of its position in the prompt or add instructions. The value never reaches telemetry.
  • Potential risk (not a finding): str.isalnum() also accepts non-ASCII letters and digits, such as ٤. That allows lookalike identifiers, but it cannot inject anything. An ASCII-only check (char.isascii() and char.isalnum()) would be stricter if wanted.

Executed verification (runtime evidence)

Command Result
python3 scripts/validate-package.py VALID: 13 skills (6 cycle, 7 supporting), shared sections in sync
python3 -m unittest discover -s tests Ran 615 tests … OK
python3 -m unittest tests.test_run_cycle.ChangeRequestHandoffTests tests.test_run_cycle.PromptContractTests -v 6 tests OK
git diff --check origin/main...HEAD clean
Direct probe of Reported.change_request_id / compose() "4", 4 → "4"; pr_number: True → None; "a`b", "4 x", a 129-character value → None; a PR URL → accepted; {"change_request_id": "bad\n", "pr_number": 9} → "bad", because the value is stripped before it is validated, which is harmless; compose("resolve", …, change_request_id="4") → Run cc-resolve-comments for change request `4` in o/r (work item API-7). …; implement prompt unchanged

Unverified: there was no real end-to-end run_cycle.py run against a live sandbox repository (acceptance criterion 1, "in a real cycle"). The fake-agent driver tests cover it, but not a live code host.

CI (head 7c96e74)

Workflow / job Event State
Validate package / Skills, manifests, and Bash installer push pass
Validate package / PowerShell installer push pass
Validate package / Skills, manifests, and Bash installer pull_request pass
Validate package / PowerShell installer pull_request pass (run 35927825240; it had been pending at first review)

All four checks defined for this PR pass on 7c96e74.

Residual risks

  • When change_request_id is present but rejected, the code silently falls back to pr_number. Skills emit both with the same value, so the risk is low.
  • The prompt now puts the change request before the work item. Downstream skills take it as the target, which is the intended fix, but that has not been observed in a live cycle.

Project review verdict: APPROVED — there are no blocking findings, and CI passes. REV-001 and REV-002 are optional.

@datacas
datacas merged commit f18293b into main Sep 23, 2026
4 checks passed
@datacas
datacas deleted the issue-50-change-request-id branch September 24, 2026 09:21
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.

run_cycle pasa el ID de la issue, no el de la PR, a las etapas de review, resolve y rereview

1 participant