Skip to content

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

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

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 }

attempt-cli.ts's runAttempt builds its finalResult object (~lines 991-1024) by conditionally
spreading several sibling optional fields from resultreason, decision, spec,
execResult — via ...("field" in result ? { field: result.field } : {}). There is no equivalent
...("verification" in result ? { verification: result.verification } : {}).

The exported AttemptCliResult type (~lines 98-121) also has no verification field anywhere in
its union.

So on a real verification failure, finalResult.outcome is "attempt_verification_failed" but
finalResult carries zero diagnostic detail about which build/test/lint command failed or why —
both the CLI's JSON output (console.log(JSON.stringify(...))) and options.onResult's payload
lose the verification value entirely, even though it was computed and is sitting right there on
result.

Requirements

  • finalResult's construction must include verification via the same conditional-spread pattern
    already used for reason/decision/spec/execResult:
    ...("verification" in result ? { verification: result.verification } : {}).
  • AttemptCliResult's attempt_${...} union member (~lines 109-121) must add an optional
    verification?: unknown field, matching the type of the other optional fields already there.
  • Do not change attempt-runner.ts's AttemptResult union or verification_failed outcome
    itself — only attempt-cli.ts's consumption of it.
  • Do not change any other outcome's fields.

Deliverables

  • finalResult in runAttempt (attempt-cli.ts) includes the conditional verification
    spread alongside its existing conditional spreads.
  • AttemptCliResult's attempt_${RunMinerAttemptResult["outcome"]} member gains an optional
    verification?: unknown field.
  • A new test asserting that when the underlying attempt result has
    outcome: "verification_failed", runAttempt's CLI JSON output (or options.onResult
    payload, whichever the existing test suite already asserts against for this function)
    includes the verification value from the underlying result.

All three deliverables are required in this single PR.

Test Coverage Requirements

This repo enforces 99%+ Codecov patch coverage, branch-counted, on all changed lines/branches
(applies to packages/loopover-miner/lib/**). The new spread and its test above must be covered.

Expected Outcome

A verification_failed attempt outcome's CLI JSON output and onResult payload now include the
actual verification diagnostic detail (which build/test/lint command failed and why), instead of
silently dropping it.

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions