Skip to content

fix(review): allow multi-entry surface submissions and detect duplicates - #2442

Merged
JSONbored merged 1 commit into
mainfrom
claude/pr-a-multi-entry-dedup
Jul 2, 2026
Merged

fix(review): allow multi-entry surface submissions and detect duplicates#2442
JSONbored merged 1 commit into
mainfrom
claude/pr-a-multi-entry-dedup

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • The surface-lane orchestrator (src/review/content-lane/orchestrator.ts) hard-closed any registry PR appending more than one surfaces[] entry, contradicting metagraphed's documented 2026-06 contributor policy that explicitly allows appending several surfaces[] entries for one subnet in one PR (the anti-farming fix — the single-entry cap used to force splitting one subnet's surfaces into many near-identical PRs). Confirmed live on metagraphed PR fix(upstream): match the drift-issue signals label case-insensitively #2619 (2 clean surfaces entries, one new file) — Orb closed it with "A surface submission must append exactly one new surfaces[] entry"; this fix resolves that exact shape to merge instead.
  • RegistryLaneSpec gains an opt-in maxAppendedEntries cap (omitted ⇒ today's strict single-entry default, unchanged for every other/future spec) and an opt-in duplicateKeyFields for cross-entry duplicate detection. The latter closes a real side effect: removing the single-entry cap for metagraphed also removed its incidental protection against a same-PR duplicate surfaces[] submission — METAGRAPHED_LANE_SPEC opts back into duplicate detection explicitly, keyed on url.
  • diffAppendedSurfaceEntries (renamed from the singular form) now returns every added entry instead of enforcing exactly one; runSurfaceReview validates each entry independently and aggregates (close if any invalid, manual if any needs manual review, merge only if all clean).

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • This is small enough that the summary explains why an issue is not needed (a direct bug report → fix, no filed issue).

Validation

  • git diff --check
  • npm run actionlint (via npm run test:ci)
  • npm run typecheck
  • npm run test:coverage locally — 100% statements/branches/functions/lines on every changed file
  • npm run test:workers (via npm run test:ci)
  • npm run build:mcp (via npm run test:ci)
  • npm run test:mcp-pack (via npm run test:ci)
  • npm run ui:openapi:check (via npm run test:ci) — no API/schema changes
  • npm run ui:lint (via npm run test:ci)
  • npm run ui:typecheck (via npm run test:ci)
  • npm run ui:build (via npm run test:ci)
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — includes a regression test built from the real PR fix(upstream): match the drift-issue signals label case-insensitively #2619 diff content

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no such changes.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A, no API-surface change.
  • UI changes use live API data or real empty/error/loading states. — N/A, no UI change.
  • Visible UI changes include a UI Evidence section. — N/A, backend-only change, no UI Evidence needed.
  • Public docs/changelogs are updated where needed. — N/A, no changelog edit.

Notes

  • This is deterministic, AI-free review-engine logic (runSurfaceReview / classifyRegistryPrScope) — no AI model is involved in this change.
  • Follow-up work (removing metagraphed-specific hardcoding from this same subsystem so any self-hosted maintainer's registry can use it) is tracked separately and builds on top of this PR.

The surface-lane orchestrator hard-closed any registry PR appending more
than one surfaces[] entry, contradicting metagraphed's documented 2026-06
anti-farming policy that explicitly wants multi-entry PRs (confirmed live
on PR #2619, which the fix now resolves to merge instead of auto-close).

RegistryLaneSpec gains an opt-in maxAppendedEntries cap (default preserves
today's strict single-entry behavior for every other spec) and an opt-in
duplicateKeyFields for cross-entry duplicate detection, closing a side
effect where removing the entry cap also removed its incidental protection
against same-PR duplicate submissions.
@dosubot dosubot Bot added the size:L label Jul 2, 2026
@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-02 00:23:44 UTC

7 files · 1 AI reviewer · no blockers · readiness 86/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

Review summary
The change cleanly moves the surface orchestrator from a singular appended-entry model to a spec-capped multi-entry model, and the metagraphed spec opts into unlimited entries plus explicit duplicate detection by URL. The aggregation policy is coherent: any invalid entry closes, otherwise any manual entry routes to manual, otherwise all-clean entries merge. The new tests cover the default single-entry compatibility path, finite caps, duplicate checks, and live adapter wiring, so the visible diff is safe enough to proceed.

Nits — 5 non-blocking
  • nit: src/review/content-lane/registry-logic.ts: normalizeIdentityValue documents non-string values as a structural comparison, but JSON.stringify is order-sensitive for object keys, so two semantically identical objects with different key insertion order would not match.
  • nit: src/review/content-lane/orchestrator.ts: appendCountCloseSummary accepts any numeric maxAppendedEntries, so a misconfigured spec with 0, negative, or NaN would produce confusing close behavior instead of failing closed with a clear configuration error.
  • nit: test/unit/content-lane-registry-logic.test.ts: the comment mentioning a `part ?? ""` join path is stale now that duplicateIdentityKey uses JSON.stringify(parts), which makes the test harder to trust at a glance.
  • src/review/content-lane/registry-logic.ts: either tighten duplicateKeyFields to primitive identity fields in the comment/type contract, or canonicalize object values before JSON.stringify so the documented structural comparison is actually order-insensitive.
  • src/review/content-lane/orchestrator.ts: validate maxAppendedEntries as a positive finite number or Infinity before comparing counts, and return a deterministic close summary for invalid spec configuration.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (size label size:L; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 65 registered-repo PR(s), 55 merged, 572 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 65 PR(s), 572 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 65 PR(s), 572 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Triage stale or unlinked PRs.
  • No action.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.89%. Comparing base (c31de60) to head (4182f12).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2442   +/-   ##
=======================================
  Coverage   95.88%   95.89%           
=======================================
  Files         224      224           
  Lines       25169    25211   +42     
  Branches     9151     9166   +15     
=======================================
+ Hits        24134    24176   +42     
  Misses        422      422           
  Partials      613      613           
Files with missing lines Coverage Δ
src/review/content-lane-wire.ts 97.95% <ø> (ø)
src/review/content-lane/orchestrator.ts 100.00% <100.00%> (ø)
src/review/content-lane/registry-logic.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jul 2, 2026
@JSONbored
JSONbored merged commit bef2d67 into main Jul 2, 2026
12 checks passed
@JSONbored
JSONbored deleted the claude/pr-a-multi-entry-dedup branch July 2, 2026 00:41
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant