Skip to content

fix(miner): surface verification payload in attempt-cli JSON for verification_failed - #9372

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jeffrey701:fix-9328-attempt-verification-json
Jul 27, 2026
Merged

fix(miner): surface verification payload in attempt-cli JSON for verification_failed#9372
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jeffrey701:fix-9328-attempt-verification-json

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

What

attempt-runner.ts's AttemptResult union includes a verification_failed outcome (added by #8807's
target-repo verification gate):

| { outcome: "verification_failed"; verification: unknown; loopResult: IterateLoopResult }

But attempt-cli.ts's runAttempt built its finalResult by conditionally spreading the sibling
optional fields — reason, decision, spec, execResult — via
...("field" in result ? { field: result.field } : {}), with no equivalent for verification.
So on a verification_failed outcome the CLI's --json output (and options.onResult payload) silently
dropped the verification detail.

Change

  • finalResult now spreads verification with the same conditional-spread pattern already used for its
    siblings: ...("verification" in result ? { verification: result.verification } : {}).
  • AttemptCliResult's attempt_${RunMinerAttemptResult["outcome"]} union member gains an optional
    verification?: unknown field, matching the shape of the other optional fields already there
    (execResult?: unknown).

attempt-runner.ts's AttemptResult/verification_failed outcome is untouched — this only changes
attempt-cli.ts's consumption of it. No other outcome's fields change.

Validation

  • New test in test/unit/miner-attempt-cli.test.ts: with runMinerAttempt mocked to return a
    verification_failed outcome carrying a verification payload, runAttempt's --json output has
    outcome: "attempt_verification_failed" and the exact verification object — dropped before this fix.
  • npx vitest run test/unit/miner-attempt-cli.test.ts -t "verification payload" passes. Both branches of
    the new conditional spread are covered (this test drives the present side; the existing
    submitted/abandon/handoff outcome tests drive the absent side). Every changed line is line+branch covered.

(Three unrelated tests in this file — #5185 broken appendAttemptLogEvent, unexpected allocator failure, #8808 null resolution — fail identically on clean main on this Windows dev box, i.e.
pre-existing platform-baseline failures, not touched by this change.)

Closes #9328

@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 27, 2026 14:45
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.50%. Comparing base (86c42c5) to head (4c6df57).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9372      +/-   ##
==========================================
+ Coverage   75.38%   75.50%   +0.12%     
==========================================
  Files         275      276       +1     
  Lines       58023    58314     +291     
  Branches     6181     6278      +97     
==========================================
+ Hits        43739    44030     +291     
  Misses      14014    14014              
  Partials      270      270              
Flag Coverage Δ
backend 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-miner/lib/attempt-cli.ts 100.00% <100.00%> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 14:55:02 UTC

2 files · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
Small, correct fix: mirrors the existing conditional-spread pattern for `reason`/`decision`/`spec`/`execResult` to also surface `verification` in `finalResult` (attempt-cli.ts) when the outcome is `verification_failed`, and adds the matching optional field to `AttemptCliResult`'s union. The new test in miner-attempt-cli.test.ts exercises the real path (mocked `runMinerAttempt` returning a `verification_failed` outcome) and asserts the payload survives to the CLI JSON output, which is exactly the previously-dropped behavior. This is a narrow, well-targeted bug fix with no unrelated changes.

Nits — 3 non-blocking
  • The PR description references issue ams: attempt-cli drops the target-repo verification failure detail from its result/JSON output #9328 but doesn't explicitly state it closes/fixes that issue with GitHub closing syntax — worth confirming the linkage is recognized.
  • attempt-cli.ts is already a very large file (~1000+ lines per the external size note); not this PR's fault, but an eventual split would help review load on future changes to this file.
  • Consider a brief inline comment or doc note in attempt-runner.ts's AttemptResult type pointing at attempt-cli.ts's consumption pattern, so a future new optional outcome field doesn't get silently dropped the same way `verification` did.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9328
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 83 registered-repo PR(s), 38 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 83 PR(s), 17 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff adds the exact conditional spread for verification in finalResult, adds the optional verification?: unknown field to AttemptCliResult's attempt_ union member, and includes a new test verifying the verification payload appears in the CLI JSON output for a verification_failed outcome, matching all three required deliverables.

Review context
  • Author: jeffrey701
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Rust, TypeScript, Clojure, JavaScript
  • Official Gittensor activity: 83 PR(s), 17 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit a58ce3d into JSONbored:main Jul 27, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 27, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ams: attempt-cli drops the target-repo verification failure detail from its result/JSON output

1 participant