Skip to content

feat(outcome): record_outcome accepts the predicate verdict (E0-01) - #1141

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/e0-01-verdict-argument
Nov 14, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
fix/e0-01-verdict-argument

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Work order E0-01. mix hypatia.record_outcome accepts --verdict with the 5 fleet verdicts, stores it as "verdict" in each row it writes, and rejects every pair outside the work order's table. A verdict can lower trust. It never raises trust by itself.

Why

gitbot-fleet issue 647 (only verified is positive evidence, no_op is neutral, unverified is no evidence) and issue 984, acceptance A3 (#984).

Evidence

  • Head commit: 73bfbeaac669d2f58d76f73f9506caa3fbc46989
  • New tests: test/mix_tasks/record_outcome_test.exs (15 tests). Before the change (tests first, same file, unchanged code):
    1) test verdicts that are not positive evidence a no_op row leaves the qualified counts at zero (Mix.Tasks.Hypatia.RecordOutcomeTest)
    2) test verdicts that are not positive evidence an unverified row leaves the qualified counts at zero (Mix.Tasks.Hypatia.RecordOutcomeTest)
    3) test verdicts that lower trust a failed row counts as one failure (Mix.Tasks.Hypatia.RecordOutcomeTest)
    4) test verdicts that lower trust an incomplete row counts as one failure (Mix.Tasks.Hypatia.RecordOutcomeTest)
    5) test rejected calls write no row an invalid verdict exits 1 (Mix.Tasks.Hypatia.RecordOutcomeTest)
    6) test rejected calls write no row a pair that the table does not list exits 1 (Mix.Tasks.Hypatia.RecordOutcomeTest)
    7) test rejected calls write no row false_positive with any verdict exits 1 (Mix.Tasks.Hypatia.RecordOutcomeTest)
    8) test rejected calls write no row an option that the task does not know exits 1 (Mix.Tasks.Hypatia.RecordOutcomeTest)
    9) test --verdict verified keeps the rescan the verdict is in the row whatever the rescan returns (Mix.Tasks.Hypatia.RecordOutcomeTest)
   10) test --verdict verified keeps the rescan --no-verify with --verdict verified gives no credit (Mix.Tasks.Hypatia.RecordOutcomeTest)
   11) test output and documentation --format json names the verdict (Mix.Tasks.Hypatia.RecordOutcomeTest)
   12) test output and documentation the task documentation names --verdict and the pairs (Mix.Tasks.Hypatia.RecordOutcomeTest)
   13) test OutcomeTracker.record_and_verify/5 :metadata keys that the function sets itself win over the map (Mix.Tasks.Hypatia.RecordOutcomeTest)
  15 tests, 13 failures

The 2 that pass before are the "no --verdict" tests, which pin the unchanged behaviour.

  • After the change: mix test test/mix_tasks/record_outcome_test.exs gave 15 tests, 0 failures.
  • The tests show: no_op and unverified rows leave qualified_outcome_counts/1 at 0 successes and 0 failures; failed and incomplete rows count as 1 failure each; an invalid verdict, each unlisted pair, false_positive with each verdict, and unknown options (--bogus, --verdct) exit 1 with no row; --verdict verified writes "verdict" in every row whether the rescan returns clean (1 row), still_present (2 rows, exit 2) or fails (1 row, scan_failed); a call with no --verdict writes no "verdict" key.
  • Ran: mix test (LANG=C.UTF-8) gave 3600 tests, 0 failures, 246 excluded.
  • mix help hypatia.record_outcome prints --verdict and the pair table.
  • mix format --check-formatted: exit 0 for lib/mix/tasks/hypatia.record_outcome.ex (formatted at origin/main) and the new test file. lib/outcome_tracker.ex was already unformatted at origin/main; its format diff is the same 8 lines before and after, so my lines add none.
  • mix escript.build && ./hypatia scan . --format json: 17 findings in total, 0 on the changed files.
  • Diff: docs/operations/dispatch-runner-contract.adoc, lib/mix/tasks/hypatia.record_outcome.ex, lib/outcome_tracker.ex (the :metadata option), test/mix_tasks/record_outcome_test.exs. Nothing else.
  • No sibling gitbot-fleet checkout was present (ls ../gitbot-fleet: no such directory).
  • Read, not run: the fleet side (E0-02) is not touched and was not run.
  • CI: not run yet.

Not done

  • Decisions the work order left open, which I made and you may want to rule on: (1) --no-verify with --verdict verified records "verification" => "unverified" plus "verdict" => "verified", so it gets no credit; (2) the unknown-option check uses OptionParser strict mode, so a typo such as --verdct now exits 1, as the work order asks.
  • estate-gates checklist read in part only; no .hypatia-ignore, baseline or SPDX change was made.
  • The tests put a fake panic-attack script on PATH inside a temp dir because the container has no scanner. Seen, not changed: OutcomeTracker.verify_fix/3 does not catch the error when panic-attack is absent from PATH; System.cmd raises.
  • Seen, not changed: mix deps.get needed HEX_CACERTS_PATH=/etc/ssl/certs/ca-certificates.crt in this container.

Cost

  • Work order E0-01, cap $6. Cost unknown: the launch script was not run for real, so there is no ledger line and the agent cannot see its own spend. Check the Console.

Add --verdict (verified, no_op, incomplete, unverified, failed) to
mix hypatia.record_outcome with a fixed table of accepted pairs. Reject
invalid verdicts, unlisted pairs, false_positive with a verdict, and unknown
options with exit 1 and no row. Store "verdict" in each row. Add a
:metadata option to record_and_verify/5 that cannot override the keys the
function sets itself. A verdict can lower trust; it never raises it.

Co-Authored-By: Claude <[email protected]>
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 14, 2026 22:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T22:51:09.675768Z 32a872e Draft marked ready
🔒 Security Review ✅ Completed 2026-11-14T22:50:40.899907Z 32a872e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Repository owner deleted a comment from coderabbitai Bot Nov 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

Repository owner deleted a comment from coderabbitai Bot Nov 14, 2026
@hyperpolymath
hyperpolymath merged commit 3e3b946 into main Nov 14, 2026
88 checks passed
@hyperpolymath
hyperpolymath deleted the fix/e0-01-verdict-argument branch November 14, 2026 22:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32a872e75d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

repo,
file,
outcome_atom,
%{"verification" => verdict, "verdict" => verdict}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the verdict in the fleet outcome row

For every no_op or unverified call, this records the local metadata but record_outcome/5 also invokes write_fleet_outcome/1, whose reconstructed fleet_record omits both verdict and verification. Consequently shared-context/learning/fix-outcomes.jsonl receives a bare success row and cannot distinguish these neutral results, despite the new contract saying each written row carries the verdict; propagate the verdict into that exported row as well.

Useful? React with 👍 / 👎.

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.

3 participants