Skip to content

ams: attempt-cli's blocked_own_open_pr outcome is missing from the exported AttemptCliResult type #9331

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

This is a type-hygiene-only fix — no runtime behavior changes.

attempt-cli.ts's exported AttemptCliResult type (~lines 98-121) is a union of specific
outcomes. Line 836 has an explicit acknowledging comment for one real gap:

// blocked_max_concurrent_claims is a real runtime outcome omitted from AttemptCliResult (.d.ts drift).
options.onResult?.(blockedResult as AttemptCliResult);

blocked_own_open_pr (built and cast the same way, ~line 512, added later by #8808's idempotency
guard) has no equivalent field in AttemptCliResult's union either, but — unlike
blocked_max_concurrent_claims — carries no acknowledging comment at its own cast site. Since
loop-cli.ts re-exposes AttemptCliResult["outcome"] in its own type, this is real .d.ts drift
consistent with the codebase's own established convention of flagging such drift inline wherever
it's cast past the type system (as blocked_max_concurrent_claims already does) — this one case
was just missed.

Requirements

  • Add a blocked_own_open_pr member to AttemptCliResult's union, matching the shape of the
    actual duplicateResult object built at ~line 511 (outcome: "blocked_own_open_pr", reason: string, repoFullName, issueNumber, plus whatever other fields CommonAttemptResultFields
    already covers — read the full duplicateResult object at its construction site to get the
    exact shape right, don't guess).
  • This issue does not require also fixing blocked_max_concurrent_claims's already-acknowledged
    drift — that one already has its own tracking comment and is explicitly out of scope here unless
    you choose to fix both in the same PR (optional, not required); if you do only
    blocked_own_open_pr, that fully satisfies this issue.
  • Do not change any runtime logic — this is purely a type definition addition. The as AttemptCliResult cast at the blocked_own_open_pr call site should become unnecessary once the
    type is correct (remove the cast if it becomes a type error or a no-op, but only if doing so
    doesn't require any other change).

Deliverables

  • AttemptCliResult's union gains a blocked_own_open_pr member with the exact field shape
    of the real duplicateResult object built in runAttempt.
  • The as AttemptCliResult cast at the blocked_own_open_pr result's options.onResult?.(...)
    call site is removed if the corrected type makes it unnecessary (verify via tsc/the
    repo's type-check command — don't leave a now-redundant cast in place if it no longer
    resolves to anything).
  • No other file changes — this is scoped to attempt-cli.ts's type definition only.

All deliverables are required in this single PR.

Test Coverage Requirements

This is a type-only change with no new runtime branch — no new test is required. State explicitly
in the PR description that no test changes are needed because no runtime behavior changed, and
confirm the repo's type-check command (e.g. tsc --noEmit or the project's equivalent) passes
with the cast removed.

Expected Outcome

AttemptCliResult's union accurately includes blocked_own_open_pr, matching the real runtime
outcome the function can produce — closing the same class of .d.ts drift already acknowledged
(but not yet fixed) for blocked_max_concurrent_claims.

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