Skip to content

fix(lane D intake): close entries the validator judged final (verdict sync) - #1066

Merged
tensorlink-dev merged 1 commit into
mainfrom
fix/laned-intake-close-judged
Dec 3, 2026
Merged

tensorlink-dev merged 1 commit into
mainfrom
fix/laned-intake-close-judged

Conversation

@tensorlink-dev

Copy link
Copy Markdown
Contributor

Bug

LaneDIntake.close() had no caller on main or the release. Judged entries stayed revealed (an OPEN_STATE) forever, so a hotkey's next submit got 409 hotkey_entry_open, making each lane D hotkey one-submission-for-life. Live: 14 intake entries all revealed, while the validator state shows 10 lost and 2 crowned.

Fix (owner defaults)

  • New intake flag --validator-lane-d-state PATH (default off, so other operators are unaffected). On every refresh tick ([lane_d_ops] queue_poll_seconds, 60 s live) and once at startup (app.tick()), the intake reads the validator's local lane_d_state.json read-only. It closes each open entry whose (hotkey, digest) has a final status, reusing close(), and sets closed_reason to the validator's reason (lost_duel, crowned, ...).
    • Final = crowned, lost, closed. These are the validator's ENTRY_STATUSES minus OPEN_STATUSES (pending, hold), and no validator path moves a final entry back. A test pins this equality.
    • The file can be 39 MB (frozen sets), so it is parsed outside the request lock, only when its (inode, size, mtime) changed, and only while some entry is open. Measured cost: about 0.4 s and 140 MB RSS per parse, roughly once per settlement.
    • If the file is missing, partial, mid-write, or a foreign schema, the intake logs a lane_d_intake_unavailable verdict source ... warning and closes nothing. It never raises.
  • Retired rows. A resubmit used to overwrite the hotkey's row. Now the replaced closed row is kept under a new top-level retired key in the queue file. Older readers ignore the key because they check only schema and entries. This does three things:
    • The judged digest stays owned: another hotkey gets digest_owned, and the same hotkey gets entry_closed. Without this, a resubmitted judged digest would never be judged again.
    • VaultGetGrants (eval host prefetch) and ops_jobs._licence (king publish) fall back to retired, so a crowned king's checkpoint stays fetchable after its hotkey submits again.
  • The queue endpoint already shows state: closed. closed_reason stays out of the public row, as before.

No consensus, signed-format, or chain changes. Satellites never read the intake.

Tests

tests/accept/w3/test_w3_verdict_sync.py has 9 tests:

  • lost, crowned, and closed entries close; pending and hold stay open
  • the final-status set equals the validator's non-open statuses
  • a digest or hotkey mismatch is ignored
  • an unreadable, partial, or foreign file closes nothing
  • the feature is off by default
  • after a close the same hotkey can submit again, while entry_closed, digest_owned (also across a restart), and duplicate_weights are still enforced
  • an unchanged file is not re-parsed
  • the CLI flag parses
  • the retired fallback works for grants and licence

Local runs:

  • W3 suite: 180 passed, 1 skipped (test_w3_published_sources was skipped because it uses torch)
  • w10 ready, w13, king-publish streaming, and box torch-free: 147 passed

🤖 Generated with Claude Code

… sync)

close() had no caller, so every judged entry stayed `revealed` and the
hotkey's next submit was refused 409 hotkey_entry_open: one lane D
submission per hotkey, for life.

- New `--validator-lane-d-state PATH` (default off): every refresh tick and
  once at startup the intake reads the validator's local lane_d_state.json
  (read-only, outside the request lock, only when the file changed) and
  closes an open entry whose (hotkey, digest) has a final status
  (crowned / lost / closed = the validator's non-open statuses;
  pending / hold stay open). closed_reason = the validator's reason.
  Missing / partial / foreign file: warning, nothing closed, never raises.
- A resubmit keeps the replaced closed row under the queue file's
  `retired` key: the judged digest stays owned (digest_owned for others,
  entry_closed for the same hotkey), and the VaultGetGrants prefetch and
  the king-publish licence lookup fall back to it, so a crowned king stays
  fetchable after its hotkey submits again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
@vercel

vercel Bot commented Dec 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cascade Ignored Ignored Dec 3, 2026 4:59am UTC

Request Review

@tensorlink-dev
tensorlink-dev added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 584ae78 Dec 3, 2026
12 checks passed
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.

1 participant