Repository navigation
Description
Problem
Stage results report verification as a bare claim, and the runtime records that claim as a test outcome.
cc-implement-issueandcc-resolve-commentsreturn"tests": { "passed": true }. There is no command, exit status, count, or scope.run_cycle._teststurns that boolean into thetests_passedtelemetry flag.cc-resolve-commentstells the agent to reportpassed: true"including the valid case where no test is required because every resolution is a justified no-code decision" (SKILL.md:487). So "nothing needed to run" and "tests ran and passed" become the same row.cc-verifyreports in prose (Verified / Failures / Not verified / Conclusion) and has no machine-readable form. Its four-valued conclusion is lost when a cycle skill summarises it as one boolean.
Several things already hold and must be reused, not rebuilt:
- a non-zero executor exit is
FAILEDwhatever its output says (executors.NativeAdapter.dispatch); - dispatch
outcomeand functionalstatusare separate facts (run_cyclemodule docstring); ran: falseis not a failure (Telemetría del driver: registrar duration_ms y no contar como tests fallidos una implementación que no los ejecutó #53);- the agent's
reasonis displayed and never stored; cc-rereviewnever marks asresolveda fix that is present but unverified;cc-verify's rules: "Reading code does not count as verification."
Current behavior
tests_passed = true in telemetry means only "the agent said so". There is no way to separate a claim from executed evidence, or a skipped suite from a green one.
Existing architecture involved
skills/cc-verify/SKILL.md: Output formatskills/cc-implement-issue,skills/cc-resolve-comments:testsobject and prosescripts/run_cycle.py:_testsscripts/telemetry.py:FIELD_SPECS,OUTCOME_FIELDSscripts/stats.py: the test verification sectiondocs/verification.md
Proposed behavior
Name the evidence levels in docs/verification.md. Every recorded verification outcome carries the level it rests on, and a weaker level is never counted as a stronger one:
Level (basis token) |
What it is | Example | Who produced it |
|---|---|---|---|
claimed |
a statement with no executed command attached | "tests": {"passed": true} |
the agent |
agent_reported |
an executed command, its exit status and counts, as reported by the agent | pytest tests/test_x.py → exit 0, 14 run |
the agent; auditable in the comment, not proof |
runtime_observed |
a fact the runtime observed itself | the executor's exit code, the head SHA, a command the runtime ran | the runtime |
externally_verified |
a fact held by a system the agent doesn't control | code-host checks on the pushed head SHA, read by the runtime | the code host |
The verdict (functional status) sits on top of these. It is a separate fact and not a fifth level.
What tests_passed = true must never mean is "the agent wrote that it ran npm test". So:
- the level is recorded beside every test outcome, in the same row;
cc-statsreports test outcomes per level, and says "verified" only forruntime_observedandexternally_verified;agent_reportedis shown as "reported", andclaimedas "claimed".
This takes one token, not four new fields.
Where each level comes from today:
claimedandagent_reportedboth come from the stage result. Whether theevidencelist is present, and consistent, decides which of the two it is.runtime_observedis currently limited to dispatch facts. No test result reaches this level until the runtime runs a check itself, which is out of scope here.externally_verifiedarrives when the runtime reads the check state of the head SHA from the code host. Checks that an agent reports copying fromgh pr checksareagent_reported. Wait for the pushed head's CI before a resolution or implementation reports success #77 owns waiting for checks; this issue defines what level its data gets, depending on who read it.
Changes:
cc-verifyends its report with a machine-readable evidence list and its conclusion as a token:verified | verified_with_reservations | not_verified | failed. The conclusion is the agent's judgement; the level says what it rests on.- The
testsobject in the implement and resolve results gains optional keys:"tests": { "ran": true, "passed": true, "conclusion": "verified_with_reservations", "evidence": [ { "level": "static", "command": "ruff check .", "exit_code": 0, "executed": null }, { "level": "test", "command": "pytest tests/test_x.py", "exit_code": 0, "executed": 14 } ] }
passedstays for compatibility. - A no-code resolution reports
"ran": false, "reason": "no_code_change", neverpassed: true. - Runtime (
_tests):passedwith a consistent evidence list (at least onetestentry exited 0 and none exited non-zero) →tests_passedwithtests_basis = agent_reported;passedwithout evidence →tests_passedwithtests_basis = claimed;- evidence that contradicts
passed(for examplepassed: truewith a non-zero entry) →tests_passed = false,agent_reported.
Fail closed: a contradiction resolves to the failing reading.
- The published comment or PR Verification section lists the same entries and says they were agent-reported.
Scope
cc-verify output, the tests object and prose in the two writing skills, run_cycle._tests, telemetry, stats, docs.
Non-goals
- The runtime does not re-run tests. The runtime cannot prove that an agent-reported command ran; that limitation is documented. Agent evidence is auditable, not proof.
- Commands, paths, or output are never stored in telemetry. They live in the comment and the result only.
- CI checks are left to Wait for the pushed head's CI before a resolution or implementation reports success #77, which owns waiting for the pushed head's checks and filling
checks_passed/failed. This issue must not duplicate it. - No new skill or framework, and no change to review verdicts.
Design constraints
- Fail closed: missing or contradictory evidence never becomes
verifiedortests_passed = true, and a weaker level is never reported as a stronger one. - Unknown is not zero: no
testsobject → nothing recorded. - Telemetry holds closed tokens and counts only (
telemetry.FIELD_SPECS).
Acceptance criteria
passed: truewith a failing evidence entry →tests_passed = false,tests_basis = agent_reported.passed: truewith no evidence →tests_basis = claimed, andcc-statsshows it as a claim, never as verified.passed: truewith consistent evidence →tests_basis = agent_reported, shown as "reported", not "verified".- No row has
tests_passedwithouttests_basis(enforced by the telemetry gate). docs/verification.mddefines the four levels, andcc-statssays "verified" only forruntime_observedandexternally_verified.ran: false, reason: no_code_change→ nothing recorded as passed.cc-resolve-commentsno longer instructspassed: truefor no-code resolutions.cc-verifydocuments the evidence list and the conclusion tokens.
Tests / verification
Unit tests for _tests covering every case above, an installed-cycle test with a scripted implement result carrying evidence, and a stats test for the new conclusion breakdown.
Dependencies
None. Coordinate with #77 on the shared tests/checks result keys. Land the runtime part after PR #74.
Telemetry / schema impact
Bump SCHEMA_VERSION (next free).
- New verdict field
tests_basis(token):claimed | agent_reported | runtime_observed | externally_verified. It is required whenevertests_passedis written. - New verdict field
verification(token): the agent's conclusion,verified | verified_with_reservations | not_verified | failed. tests_passedkeeps its name. Older rows have notests_basisand are read asclaimed, which is what they were.
Backwards compatibility
The new keys are additive and passed is kept. Older installed skills that send only passed: true are recorded with tests_basis = claimed. That is a deliberate, visible change in the stats, noted in CHANGELOG.md.
Suggested implementation areas
skills/cc-verify/SKILL.md, skills/cc-implement-issue/SKILL.md, skills/cc-resolve-comments/SKILL.md, scripts/run_cycle.py, scripts/telemetry.py, scripts/stats.py, tests/test_run_cycle.py, tests/test_cycle_outcomes.py, tests/test_stats.py, docs/verification.md, docs/telemetry.md.
Activity
[-]Verification results carry evidence, not claims: back tests_passed with executed commands[/-][+]Verification results carry their evidence level: claimed, agent-reported, runtime-observed, externally verified[/+]feat(verification): record test evidence levels (#85) (#104)