Skip to content

feat(ci): wait for the pushed head's checks before reporting success - #97

Merged
datacas merged 1 commit into
mainfrom
issue-77-wait-for-head-ci
Sep 25, 2026
Merged

datacas merged 1 commit into
mainfrom
issue-77-wait-for-head-ci

Conversation

@datacas

@datacas datacas commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • cc-implement-issue and cc-resolve-comments share a new section, Checks of the pushed head, that the validator keeps byte-identical in both. Before pushing, the stage tests the way CI will, with no reliance on the global Git identity or other state only the developer's machine has. After pushing, it waits for the checks of the pushed SHA, up to the repository's timeout or about 15 minutes.
  • The checks decide the status:
    • all required checks pass: the local result stands;
    • a failure within the stage's scope: the stage fixes it and pushes again, at most two rounds;
    • a failure outside the stage's scope: PARTIALLY_RESOLVED for a resolution, BLOCKED for an implementation;
    • still pending at the timeout: the pending checks are named and never reported as passed.
  • The structured result gains a checks key with the head SHA, the passed/failed/pending counts and the named items.
  • The runtime (_checks in run_cycle.py) records checks_passed, checks_failed and the new checks_pending on the verdict row only when all three counts are reported and they describe the stage's own head_sha. This is telemetry schema 6.
  • cc-stats adds CI on stage heads: green, failed, pending or without checks, grouped by the status the stage claimed (for example, RESOLVED 1 of 2 green).
  • Documented in docs/verification.md → CI reporting, docs/telemetry.md, docs/instrumentation.md, CONTRIBUTING.md (duplicated sections table) and CHANGELOG.md.

Closes #77

Verification

  • python3 scripts/validate-package.py → VALID, shared sections in sync
  • python3 -m unittest discover -s tests → 705 tests OK (new: ReportedChecks, driver verdict test, two cc-stats tests)
  • Environment: the new tests use temporary SQLite stores and pure functions. They create no commits and don't depend on the global Git identity or any user config.

cc-implement-issue and cc-resolve-comments share a new section, Checks of
the pushed head: test CI-like before pushing, wait for the checks of the
pushed SHA (repository timeout or ~15 min), let failures decide the status,
and report the final head's checks in the summary and a checks result key.
The runtime records checks_passed/failed/pending on the verdict row for the
stage's own head (telemetry schema 6), and cc-stats reports CI on stage heads.

Closes #77
@datacas

datacas commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260925-001] · ? · ?/?→? · ? · schema:1

Review summary

APPROVED — I reviewed the accumulated diff from merge base through head 0d2626ba89ddb89e0a116a4e21a6bad2a0e7883f. The change matches issue #77 and adds one medium, non-blocking telemetry correctness finding.

The review covered the two pushed-head workflow sections, the runtime check-count ingestion, telemetry schema and validation, cc-stats aggregation, documentation, and related tests. Repository guidance from CONTRIBUTING.md was applied; no AGENTS.md or CLAUDE.md is present.

Findings

[REV-001] · medium · open · - · blocks:no — Check counts can be recorded without proving they match the result head

Path: scripts/run_cycle.py:859-862

_checks rejects different SHAs only when both checks.head_sha and the result's head_sha are strings. If the result SHA is absent, complete counts are still recorded. I reproduced this with a payload containing checks.head_sha and counts but no top-level head_sha; the function returned all three checks_* fields. The shared workflow contract says the check SHA must be the result's own SHA. As written, telemetry can associate checks from an unverified commit with the stage's reported outcome. Require both SHAs and equality, or omit the counts.

Security triage

The deterministic rule did not fire: .code-cycle.yml has no security_review.always_when rule. Reviewer judgment did activate the audit because the change makes code-host check results part of implementation and resolution status. The security review covered the changed runtime, telemetry, stats, and workflow skill surfaces; it found no confirmed security issue.

Verification

  • python3 -m unittest discover -s tests -p 'test_cycle_outcomes.py' — 26 tests passed.
  • python3 -m unittest discover -s tests -p 'test_stats.py' — 20 tests passed.
  • python3 scripts/validate-package.py — VALID; shared sections are in sync.
  • python3 -m unittest discover -s tests — 705 tests passed.
  • Candidate finding reproduction — _checks({"checks":{"head_sha":"a…","passed":2,"failed":0,"pending":0}}) recorded counts without a result head_sha.

CI

All current checks passed on reviewed head 0d2626ba89ddb89e0a116a4e21a6bad2a0e7883f: two runs of Skills, manifests, and Bash installer, and two runs of PowerShell installer. No pending, failed, cancelled, or skipped checks were reported.

Residual risk

The full local suite and current CI are green, but neither catches the missing-result-SHA case in REV-001. No runtime service or database setup was needed for the relevant tests.

Verdict

APPROVED — the reviewed head has no open finding that blocks approval; REV-001 remains open and non-blocking.

@datacas
datacas merged commit d30a6ef into main Sep 25, 2026
4 checks passed
@datacas
datacas deleted the issue-77-wait-for-head-ci 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.

Wait for the pushed head's CI before a resolution or implementation reports success

1 participant