Repository navigation
fix(platform): correct unreleased-copy overlap fallback, owner-name hint, and worker warm-up - #3317
Conversation
…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 reviewed
|
| """ | ||
| 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) |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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
uc3and 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· verifyopenai/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
…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>
⏭ Ditto stopped reviewing
|
…rlap check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
⏭ Ditto stopped reviewing
|
Summary
load_contextcomputed each agent's overlap withARRAY(SELECT unnest(item_keys) FROM agent_distinctive_items INTERSECT …). The compound select carries its ownFROM, 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.SIGNAL_VERSIONmoves touc3, 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🤖 Generated with Claude Code