Skip to content

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

Closed

Description

@datacas

Problem

Stage results report verification as a bare claim, and the runtime records that claim as a test outcome.

  • cc-implement-issue and cc-resolve-comments return "tests": { "passed": true }. There is no command, exit status, count, or scope.
  • run_cycle._tests turns that boolean into the tests_passed telemetry flag.
  • cc-resolve-comments tells the agent to report passed: 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-verify reports 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:

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 format
  • skills/cc-implement-issue, skills/cc-resolve-comments: tests object and prose
  • scripts/run_cycle.py: _tests
  • scripts/telemetry.py: FIELD_SPECS, OUTCOME_FIELDS
  • scripts/stats.py: the test verification section
  • docs/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-stats reports test outcomes per level, and says "verified" only for runtime_observed and externally_verified;
  • agent_reported is shown as "reported", and claimed as "claimed".

This takes one token, not four new fields.

Where each level comes from today:

  • claimed and agent_reported both come from the stage result. Whether the evidence list is present, and consistent, decides which of the two it is.
  • runtime_observed is 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_verified arrives when the runtime reads the check state of the head SHA from the code host. Checks that an agent reports copying from gh pr checks are agent_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:

  1. cc-verify ends 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.
  2. The tests object 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 }
      ]
    }
    passed stays for compatibility.
  3. A no-code resolution reports "ran": false, "reason": "no_code_change", never passed: true.
  4. Runtime (_tests):
    • passed with a consistent evidence list (at least one test entry exited 0 and none exited non-zero) → tests_passed with tests_basis = agent_reported;
    • passed without evidence → tests_passed with tests_basis = claimed;
    • evidence that contradicts passed (for example passed: true with a non-zero entry) → tests_passed = false, agent_reported.
      Fail closed: a contradiction resolves to the failing reading.
  5. 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 verified or tests_passed = true, and a weaker level is never reported as a stronger one.
  • Unknown is not zero: no tests object → nothing recorded.
  • Telemetry holds closed tokens and counts only (telemetry.FIELD_SPECS).

Acceptance criteria

  • passed: true with a failing evidence entry → tests_passed = false, tests_basis = agent_reported.
  • passed: true with no evidence → tests_basis = claimed, and cc-stats shows it as a claim, never as verified.
  • passed: true with consistent evidence → tests_basis = agent_reported, shown as "reported", not "verified".
  • No row has tests_passed without tests_basis (enforced by the telemetry gate).
  • docs/verification.md defines the four levels, and cc-stats says "verified" only for runtime_observed and externally_verified.
  • ran: false, reason: no_code_change → nothing recorded as passed.
  • cc-resolve-comments no longer instructs passed: true for no-code resolutions.
  • cc-verify documents 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 whenever tests_passed is written.
  • New verdict field verification (token): the agent's conclusion, verified | verified_with_reservations | not_verified | failed.
  • tests_passed keeps its name. Older rows have no tests_basis and are read as claimed, 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

  1. changed the title [-]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[/+] on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions