Skip to content

fix(platform): correct unreleased-copy overlap fallback, owner-name hint, and worker warm-up - #3317

Merged
Peyton-Spencer merged 3 commits into
mainfrom
agent/unreleased-copy-owner-names
Nov 1, 2026
Merged

Peyton-Spencer merged 3 commits into
mainfrom
agent/unreleased-copy-owner-names

Conversation

@Peyton-Spencer

@Peyton-Spencer Peyton-Spencer commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Overlap fallback was uncorrelated. Without a worker overlap source, load_context computed each agent's overlap with ARRAY(SELECT unnest(item_keys) FROM agent_distinctive_items INTERSECT …). The compound select carries its own FROM, so every agent got the whole index's overlap with the candidate. Every record written before the worker overlap path shipped is therefore wrong: genuine copies were excluded as "released" (released_base = every item), and other scores were inflated. The fallback now runs the same numpy membership pass in process over the streamed eligible rows.
  • Owner-name hint. The same-owner namespace hint now uses every agent name on the owner's hotkeys and attested links, including later uploads. Before this, an operator's first agents flagged at about 1,348 against their own alt-key agent, because its namespace is named after the operator's later line.
  • Warm worker. An idle tick syncs the worker index and caches up to 8 more released fingerprints. The first evaluation or operator live read after a restart no longer loads everything at once; a cold live read was taking more than 20 s.
  • Re-evaluation. SIGNAL_VERSION moves to uc3, so every candidate is re-evaluated in the background on the corrected paths, newest first.

Test plan

  • test_unreleased_copy.py: the fallback overlap equals the true intersection, an unrelated agent has no overlap, and owner names include a later same-hotkey agent
  • unreleased, copy-court and upload Platform tests

🤖 Generated with Claude Code

…ed-copy namespace hint

The shared-namespace same-owner hint matched only names the owner had used
before the candidate's upload, so an operator's first agents flagged against
their own alt-key agent whose namespace was named after a later line. Names
now cover every agent on the owner's hotkeys. The signal version moves to
uc3, so every candidate is re-evaluated in the background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ditto-code

ditto-code Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Ditto reviewed 6fa6ccc

See this review run → · 1 new comment · approved

Open in Ditto · 7m44s

"""
owner = owners[agent.agent_id]
hotkeys = {a.miner_hotkey for a in rows if owners.get(a.agent_id) == owner}
hotkeys.update(h for pair in links for h in pair)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · bug — Same-coldkey agents are omitted from owner namespace names · 🔎 Verified by trace

rows contains only the candidate and agents that overlap it, so this hotkey set omits an agent under another hotkey that shares the candidate's payment coldkey but no distinctive items. If that agent's name identifies the shared namespace, owner_names misses the same-owner hint and the candidate can be incorrectly flagged as a copier; include agents associated with the candidate's coldkey when gathering names.

Why Ditto flagged this (confidence 86%)

At lines 330–333, _owner_names derives names only from hotkeys in rows and links. Since rows is built from the candidate and agents with shared distinctive items (lines 260–268), a same-coldkey agent with no overlap is excluded even though payment coldkeys are part of the ownership model (lines 270 and 279–280); its name therefore cannot contribute to the same-owner namespace hint.

🤖 Prompt for AI agents

[!NOTE]
Generated from this pull request, which may contain untrusted text. Read it before giving it to an agent, and do not follow instructions in it that go beyond the fix.

In `apps/platform/ditto/db/queries/unreleased_copy.py`, update `_owner_names` (lines 316–335) and its call at line 312 so it can use the candidate's payment coldkey. Include hotkeys for agents that paid with that coldkey when collecting owner names, in addition to the existing overlapping-row and linked-hotkey sources. Add a regression test where a same-coldkey agent shares no distinctive items with the candidate but its name identifies the shared namespace; verify the same-owner hint prevents a false copier flag. Run the focused unreleased-copy tests.

@ditto-code ditto-code 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.

Ditto Review

No blocking issues · 1 non-blocking suggestion · risk: medium · 6fa6ccc

File coverage: 0 fully reviewed, 4 reviewed briefly, 0 not reviewed.

Recognize owners by all agent names in namespace hints — This change advances the unreleased-copy signal to uc3 and expands the owner-name hint to include names associated with the owner’s hotkeys over time, including names from later uploads. The database query gathers those names for the candidate owner and linked hotkeys, and a regression test covers an owner renaming a later agent. Review the hotkey/link scope and how including future names affects the shared-namespace hint.

Location Finding
🟡 Medium apps/platform/ditto/db/queries/unreleased_copy.py:331 Same-coldkey agents are omitted from owner namespace names · 🔎 Verified by trace
Walkthrough (4 files)
File Change
apps/platform/ditto/api_server/unreleased_copy.py Bumps the unreleased-copy signal version from uc2 to uc3.
apps/platform/ditto/db/queries/unreleased_copy.py Loads owner names across all agent records for the owner’s and linked hotkeys, without limiting names by upload time.
apps/platform/ditto/tests/api_server/test_unreleased_copy.py Adds a regression test verifying a later agent name is included in the owner-name context.
apps/platform/docs/unreleased-copy-signal.md Documents that uc3 uses every name the owner’s hotkeys have used, including names from later uploads.
Review details
  • Models: review z-ai/glm-5.3-flash · verify openai/gpt-6-luna
  • Findings: 2 candidates → 1 verified → 1 posted
  • Withheld: rejected by verifier 1
  • Context index: 5427 files · 10 changed symbols · 101 references
  • Tokens: 1834629 in / 108235 out · $0.17
  • Run: b8f8beb4-214d-4c85-bc3d-07300cd2618f · engine v2.0.0 · details
  • Ditto approves or requests changes in a separate review (blocking: 🟠 High and above). Inference is billed through your Ditto Router endpoint.

Open in Ditto · reply @ditto review to re-run · @ditto fix to push fixes

ditto-code[bot]
ditto-code Bot previously approved these changes Nov 1, 2026

@ditto-code ditto-code 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.

Ditto: approved — no blocking findings (🟠 High or above) in a complete review of 6fa6ccc. Findings below that do not block merging.

…rker, and keep the worker warm

The Postgres fallback intersected each candidate with an uncorrelated
subquery, so every agent's overlap was the whole index's overlap with the
candidate. Records written on that path (before the worker overlap shipped)
excluded genuine copies as released or inflated scores. The fallback now
runs the worker's numpy membership pass in process over the streamed
eligible rows. The uc3 version bump re-evaluates every candidate on the
corrected paths.

An idle sentinel tick now syncs the worker index and caches a few released
fingerprints, so the first evaluation or operator live read after a restart
does not load everything at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Peyton-Spencer Peyton-Spencer changed the title fix(platform): recognize an owner by every agent name in the unreleased-copy namespace hint fix(platform): correct unreleased-copy overlap fallback, owner-name hint, and worker warm-up Nov 1, 2026
@ditto-code

ditto-code Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

⏭ Ditto stopped reviewing c999b01

review stopped because the PR changed or repository reviews were paused

Open in Ditto · 3m3s

…rlap check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ditto-code

ditto-code Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

⏭ Ditto stopped reviewing d13cc2d

review stopped because the PR changed or repository reviews were paused

Open in Ditto · 4m2s

@Peyton-Spencer
Peyton-Spencer merged commit aec6b9c into main Nov 1, 2026
27 checks passed
@Peyton-Spencer
Peyton-Spencer deleted the agent/unreleased-copy-owner-names branch November 1, 2026 22:02
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