Skip to content

feat(verification): record test evidence levels (#85) - #104

Merged
datacas merged 4 commits into
mainfrom
issue-85-verification-evidence-level
Sep 28, 2026
Merged

datacas merged 4 commits into
mainfrom
issue-85-verification-evidence-level

Conversation

@datacas

@datacas datacas commented Sep 28, 2026

Copy link
Copy Markdown
Owner

What changes

Test telemetry now carries an evidence basis beside each tests_passed value. The runtime classifies bare booleans as claimed, accepts consistent command evidence as agent_reported, and fails closed on contradictory evidence. The agent's conclusion stays separate. cc-stats breaks outcomes down by evidence level and reports agent conclusions separately. The verification skills now require evidence in results and published summaries; no-code resolutions report ran: false with reason: no_code_change.

Diagnosis

Work units

Unit Behaviour Files Tests Verification Rollback
WU-1 Carry test evidence levels and separate agent conclusions through runtime, telemetry, skills, docs, and stats scripts/run_cycle.py, scripts/cycle.py, scripts/telemetry.py, scripts/stats.py, verification skills, docs test_cycle_outcomes.py, test_installed_cycle.py, test_stats.py, full suite Package validator and full unittest suite passed independent: reverting this commit restores the previous behavior; no migration or backfill is required

Verification

These command results are agent-reported. The runtime did not independently observe the commands executing.

Level Command Result
static rtk proxy python3 scripts/validate-package.py exit 0; 14 skills and shared sections validated
static rtk git diff --check exit 0
test rtk proxy python3 -m unittest discover -s tests -p 'test_cycle_outcomes.py' -v exit 0; 30 tests
test rtk proxy python3 -m unittest discover -s tests -p 'test_stats.py' -v exit 0; 23 tests
test rtk proxy python3 -m unittest discover -s tests -p 'test_installed_cycle.py' -v exit 0; 9 tests
test rtk proxy python3 -m unittest discover -s tests -v exit 0; 787 tests

Closes #85 — #85

@datacas

datacas commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Initial review — PR #104

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

Verdict: CHANGES_REQUESTED — reviewed head fd9db15822956fab22c00588fd6cea01a104dfcd against merge-base with origin/main.

Summary and scope

The PR adds tests_basis (evidence level) and a separate verification conclusion to telemetry schema 8, classifies structured test results in run_cycle._tests, enforces the outcome/basis pair at the telemetry write gate, and reports outcomes by evidence level in cc-stats. Reviewed the full accumulated diff (16 files, +457/−77): scripts/{run_cycle,cycle,telemetry,stats}.py, the four affected skills, docs, and tests. The design is sound: agent-supplied tests_basis is never trusted, older rows read as claimed, and the pairing gate is symmetric. One gap remains against the PR's own stated invariant.

Findings

[REV-001] · medium · open · - · blocks:yes — A contradictory conclusion token does not fail closed

scripts/run_cycle.py:1068 (_tests). The PR's invariant says contradictory evidence is never promoted, and docs/verification.md says "Missing or contradictory evidence never becomes a verified test outcome". But _tests checks only the evidence list and ignores the agent's own conclusion. A result with passed: true, conclusion: "failed" (or "not_verified"), and one successful test entry is recorded as tests_passed: true, tests_basis: agent_reported. The agent contradicts itself, and the runtime keeps the stronger reading.

Observed at runtime:

_tests({'tests': {'ran': True, 'passed': True, 'conclusion': 'failed', 'evidence': [<test, exit 0>]}})
→ {'verification': 'failed', 'tests_passed': True, 'tests_basis': 'agent_reported'}

Suggested direction: when conclusion is failed or not_verified, record tests_passed: false, or at least avoid recording a passing outcome. Add a test for each case.

[REV-002] · low · open · - · blocks:no — The cycle row can pair one stage's conclusion with another stage's test outcome

scripts/cycle.py:493-497. tests_passed/tests_basis and verification are updated independently. If one stage reports conclusion: failed and a later stage reports a legacy passed: true with no conclusion, the cycle outcome carries verification: failed beside that later tests_passed: true, tests_basis: claimed. stats.aggregate also keeps the last value of each field separately for every cycle, so it can show the same mismatch. Consider resetting verification whenever a new test outcome is recorded. Found by code inspection; not executed.

Security triage

The deterministic rule (security_review.always_when is absent, so built-in defaults apply) matched no changed path, filename, or label. My own reading found no change to authentication, authorization, secrets, dependencies, CI, or deployment configuration. Agent payload values reach telemetry only through whitelisted tokens (TEST_BASES, VERIFICATION_CONCLUSIONS). Not a sensitive change: the security audit was skipped after triage.

Executed verification

Command Result
python3 scripts/validate-package.py exit 0; VALID: 14 skills (6 cycle, 8 supporting), shared sections in sync, cross-agent manifests aligned
python3 -m unittest discover -s tests Ran 787 tests — OK
security_gate.evaluate(<changed files>, []) required=False, no matches
Direct _tests(...) calls with contradictory conclusions Reproduced REV-001 (output above)

Unverified items

  • REV-002 is based on code inspection only; no multi-stage cycle was replayed.

CI

All checks on the head succeeded. Both runs of the Validate package workflow reported:

  • Skills, manifests, and Bash installer: SUCCESS (×2)
  • PowerShell installer: SUCCESS (×2)

No pending, skipped, or missing checks.

Residual risk

Evidence remains agent-reported by design: runtime_observed and externally_verified are declared but have no producer yet. Stats will show them only after a follow-up work item, such as #86, adds one.

Verdict

CHANGES_REQUESTED: REV-001 blocks approval.

@datacas

datacas commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Review triage — PR #104

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

[CCT-20260928-001] · manual · ?/?→? · ? · triaged:fd9db15822956fab22c00588fd6cea01a104dfcd · schema:1

Every finding below was evaluated against head fd9db15822956fab22c00588fd6cea01a104dfcd, with merge base 808d31bdfebbb492f432d14914cfe14fc0e2fac9. The configured trusted author is datacas; the complete PR history contains one trusted review comment, no untrusted comments, and no inline review threads. The finding IDs and original severity, title, and blocking flag are preserved. Dispositions are frozen at this triage commit.

Findings

[REV-001] · medium · open · valid · blocks:yes — A contradictory conclusion token does not fail closed

Path: scripts/run_cycle.py (_tests).

Disposition: valid. At the triaged head, _tests preserves a recognized conclusion such as failed or not_verified, then independently records passed: true when the command evidence is successful. The resulting tests_passed: true contradicts the agent's own conclusion and violates the fail-closed verification contract.

Planned resolution: prevent a positive test outcome when the reported conclusion is failed or not_verified, and add regression coverage for both tokens with successful command evidence.

[REV-002] · low · open · valid · blocks:no — The cycle row can pair one stage's conclusion with another stage's test outcome

Path: scripts/cycle.py (CycleOutcome.record_verdict); scripts/stats.py (aggregate).

Disposition: valid. At the triaged head, the cycle recorder updates tests_passed/tests_basis and verification independently, and stats independently retain each last value per cycle. A later stage can therefore leave a test outcome paired with a stale conclusion from an earlier stage, as described in the initial review.

Planned resolution: treat the test outcome and its conclusion as one latest stage report in cycle reconstruction and stats aggregation, clearing the counterpart when a later report omits it. Add regression coverage for the multi-stage case.

Security triage

No repository security_review.always_when rule or sensitive PR label is configured. The default sensitivity review treats input validation as security-relevant; these fixes change validation of agent-supplied result payloads, so cc-security-review will run after the changes.

@datacas

datacas commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Additional review triage — PR #104

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

[CCT-20260928-002] · manual · ?/?→? · ? · triaged:c061c703d8673cb2b275b71229e920a6774a4981 · schema:1

The mandatory delegated cc-code-review pass found this additional issue in the post-fix working tree. I evaluated it against head c061c703d8673cb2b275b71229e920a6774a4981, after the fixes for REV-001 and REV-002 and before changing this finding.

[REV-003] · high · open · valid · blocks:yes — A non-string conclusion can crash the cycle parser

Path: scripts/run_cycle.py:1091 (_tests).

Disposition: valid. The new negative-conclusion check performs set membership on conclusion without first requiring a string. A malformed agent result such as {"passed": true, "conclusion": []} raises TypeError instead of ignoring the invalid token, which can abort cycle result processing.

Planned resolution: guard the membership check with the same string-type validation used when storing the conclusion, and add a regression test for an unhashable value.

@datacas

datacas commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Resolution summary — PR #104

Functional status: RESOLVED. All three valid findings are fixed, regression-tested, committed, and pushed. The PR remains open and unmerged.

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

[CCT-20260928-001] · manual · ?/?→? · ? · triaged:fd9db15822956fab22c00588fd6cea01a104dfcd · schema:1

[CCT-20260928-002] · manual · ?/?→? · ? · triaged:c061c703d8673cb2b275b71229e920a6774a4981 · schema:1

Findings

[REV-001] · medium · resolved · valid · blocks:yes — A contradictory conclusion token does not fail closed

Path: scripts/run_cycle.py::_tests.

Resolution: a reported passed: true is downgraded when the recognized conclusion is failed or not_verified; the conclusion remains recorded separately. Regression coverage exercises both tokens with successful test evidence. Fix commit: c061c703d8673cb2b275b71229e920a6774a4981.

[REV-002] · low · resolved · valid · blocks:no — The cycle row can pair one stage's conclusion with another stage's test outcome

Paths: scripts/cycle.py::CycleRecorder.record_verdict; scripts/stats.py::aggregate.

Resolution: the cycle recorder now replaces test outcome and conclusion as one latest stage report, clearing an omitted counterpart. Stats applies the same per-cycle pairing rule. Regression tests verify that a later outcome does not inherit an earlier conclusion in either cycle reconstruction or stats. Fix commit: c061c703d8673cb2b275b71229e920a6774a4981.

[REV-003] · high · resolved · valid · blocks:yes — A non-string conclusion can crash the cycle parser

Path: scripts/run_cycle.py::_tests.

Resolution: the negative-conclusion check now requires a string before set membership, so malformed unhashable values are ignored instead of raising TypeError. Regression coverage exercises a list conclusion. Fix commit: b8f9063d2d65747f4e108df3be6bcc3d46e8a82a.

Post-change reviews

  • cc-code-review: the initial pass found the malformed-conclusion crash, recorded as REV-003 and fixed above. Its follow-up found no remaining actionable findings.
  • cc-security-review: no confirmed vulnerability or potential exploit path was found in the reviewed result-validation and telemetry surfaces. The repository has no configured security_review.always_when rule and the PR has no sensitive labels; the audit ran because the fixes touch agent-supplied input validation. Unreviewed: unrelated host adapters and security surfaces outside these paths. Residual risk: command evidence remains agent-reported; this change does not independently execute or prove commands described in agent payloads.

Verification

Check Result
rtk proxy python3 scripts/validate-package.py PASS — 14 skills and shared sections validated
rtk proxy python3 -m unittest discover -s tests -p test_cycle_outcomes.py -v PASS — 33 tests
rtk proxy python3 -m unittest discover -s tests -p test_stats.py -v PASS — 24 tests
rtk proxy python3 -m unittest discover -s tests -v PASS — 791 tests
rtk git diff --check PASS
PR checks on b8f9063d2d65747f4e108df3be6bcc3d46e8a82a PASS — 4/4 (Bash 2/2, PowerShell 2/2); 0 failed, 0 pending

The review history contained no inline review threads; this comment preserves the finding record and their final status. No findings remain open.

@datacas

datacas commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Rereview — PR #104

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

[CCT-20260928-001] · manual · ?/?→? · ? · triaged:fd9db15822956fab22c00588fd6cea01a104dfcd · schema:1

[CCT-20260928-002] · manual · ?/?→? · ? · triaged:c061c703d8673cb2b275b71229e920a6774a4981 · schema:1

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

Verdict: APPROVED. I reviewed head b8f9063d2d65747f4e108df3be6bcc3d46e8a82a; the previous review was of fd9db15822956fab22c00588fd6cea01a104dfcd. I read the full history in order: all four comments are from the trusted author datacas, there are no untrusted comments and no inline threads, and REV-001 to REV-003 are numbered without gaps or collisions.

Changes since the previous review

  • c061c70: _tests now vetoes a reported pass when the conclusion is failed or not_verified. CycleRecorder.record_verdict and stats.aggregate now treat a stage's test outcome and its conclusion as one latest report.
  • b8f9063: the negative-conclusion check now requires a string before set membership.

I re-read the complete merge-base diff against origin/main with these changes in place and found no new issues. When a BLOCKED result reports passed: true with conclusion failed and no evidence, only the conclusion is recorded. That matches the documented "never ran" handling, so I did not raise it as a finding.

Previous findings

[REV-001] · medium · resolved · valid · blocks:yes — A contradictory conclusion token does not fail closed

scripts/run_cycle.py (_tests). Corrected and verified by execution. With successful test evidence, passed: true now yields tests_passed: False for conclusion failed and for not_verified; verified still yields True. Regression test: tests/test_cycle_outcomes.py:379.

[REV-002] · low · resolved · valid · blocks:no — The cycle row can pair one stage's conclusion with another stage's test outcome

scripts/cycle.py, scripts/stats.py. Corrected and verified by execution. The regression tests test_later_test_outcome_does_not_inherit_an_earlier_conclusion (tests/test_cycle_outcomes.py:95) and test_latest_test_report_does_not_inherit_an_earlier_conclusion (tests/test_stats.py:119) pass in the full suite.

[REV-003] · high · resolved · valid · blocks:yes — A non-string conclusion can crash the cycle parser

scripts/run_cycle.py (_tests). Corrected and verified by execution. Conclusions [] and {'x': 1} are now ignored and no TypeError is raised. Regression test: tests/test_cycle_outcomes.py:389.

New findings

None.

Security triage

The deterministic rule used the built-in defaults, because security_review.always_when is absent. security_gate.evaluate returned required=False: no path, file, or label matched. My own reading found the change limited to validating agent-supplied telemetry tokens against fixed allow-lists, with no authentication, secrets, dependency, CI, or deployment surface. Not a sensitive change: the security audit was skipped after triage. The resolver also ran cc-security-review voluntarily and reported no vulnerability.

Verification

Command Result
Direct _tests(...) calls with conclusions failed, not_verified, verified, [], {'x': 1} Output as described above
python3 -m unittest discover -s tests Ran 791 tests — OK
python3 scripts/validate-package.py VALID: 14 skills (6 cycle, 8 supporting), shared sections in sync, cross-agent manifests aligned

Unverified: none.

CI on b8f9063

In both runs of the Validate package workflow, both checks succeeded:

  • Skills, manifests, and Bash installer: SUCCESS (×2)
  • PowerShell installer: SUCCESS (×2)

No checks are pending, skipped, or missing.

Residual risk

Test evidence is still reported by the agent. No component produces runtime_observed or externally_verified yet; #86 is the follow-up for that.

Verdict

APPROVED. No findings are open, and nothing blocks approval.

@datacas
datacas merged commit 33efddf into main Sep 28, 2026
4 checks passed
@datacas
datacas deleted the issue-85-verification-evidence-level 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.

Verification results carry their evidence level: claimed, agent-reported, runtime-observed, externally verified

1 participant