Skip to content

feat(registry): add repoOrigin (BYOR/APR) to RegistryRepoConfig#7645

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
glorydavid03023:feat/registry-repo-origin
Jul 21, 2026
Merged

feat(registry): add repoOrigin (BYOR/APR) to RegistryRepoConfig#7645
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
glorydavid03023:feat/registry-repo-origin

Conversation

@glorydavid03023

Copy link
Copy Markdown
Contributor

Closes #7636

Summary

Adds an optional repoOrigin field to RegistryRepoConfig, mirroring poolAssociation's exact null-safety convention from #6320. A repo that predates this field carries no origin and round-trips byte-identical to today — there is no behavior change for any existing repo.

RepoOrigin distinguishes BYOR (a customer's own pre-existing repo) from APR (a loopover-provisioned repo), the representation the BYOR+APR epic (#7589) needs so downstream consumers know which provisioning path a repo took.

What changed (2 files, mirroring #6320's footprint exactly)

  • src/types.tsRepoOrigin = { kind: "byor" } | { kind: "apr"; hostingOrg: string }, and repoOrigin?: RepoOrigin | null on RegistryRepoConfig, with the same doc-comment convention poolAssociation uses. Per the issue, absent means "pre-dates this field / not yet known"deliberately not assumed BYOR.
  • src/registry/normalize.tsparseRepoOrigin(config) reads the registry's flat repo_origin (+ hosting_org for APR) fields and is threaded into normalizeRepo right beside parsePoolAssociation; a getRepoOrigin accessor mirrors getRepoPoolAssociation.

An absent marker, an unrecognized origin string, or an apr marker missing its hosting org all parse to null — the same "a partial one is treated as none" collapse parsePoolAssociation already uses for a half-specified pool association, never a half-populated object.

Type-and-plumbing only. No repo-creation, GitHub API, or provisioning logic — that is #7590's scope, explicitly excluded here.

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.
  • I linked a currently open issue this PR resolves — see the closing reference at the top of this body.

Validation

  • git diff --check
  • npm run typecheck (zero new errors vs base)
  • npm run test:coverage locally; codecov/patch ≥99% of changed lines AND branches
  • npm run ui:openapi:check
  • npm run engine-parity:drift-check
  • npm run docs:drift-check
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

Patch coverage: 100% (7/7 executable changed lines, both branches of the new field — present and absent).

Tests in test/unit/registry.test.ts mirror #6320's poolAssociation test exactly: a byor marker → { kind: "byor" }; a full APR origin → { kind: "apr", hostingOrg }; an unmarked repo → null (byte-identical); a malformed apr-without-hosting-org → null; an unrecognized origin → null; plus the getRepoOrigin accessor over present / null / undefined / key-absent configs. All existing registry tests pass unchanged.

If any required check was skipped, explain why:

  • None skipped.

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.
  • API/OpenAPI/MCP behavior is updated and tested where needed (no API/OpenAPI surface changes — this is an internal registry type; ui:openapi:check confirms no drift).
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section. Not applicable — backend type + parser only.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable — this is a backend type addition plus its registry parser. No UI, frontend, docs, or extension surface is touched.

Notes

  • The field is optional and defaults to absent, so this is a pure additive change: git diff shows only additions to existing constructs, no modification to how any current repo normalizes.
  • getRepoOrigin is exported-but-unconsumed for now, exactly as getRepoPoolAssociation was when Extend the repo-registry data model to support subnet-funded pool association #6320 landed — it is the read seam later APR work will consume.

…bored#7636)

Mirrors JSONbored#6320's poolAssociation exactly: a new OPTIONAL field on RegistryRepoConfig that is absent for
every repo predating it, so an unmarked repo round-trips byte-identical to today. No behavior changes.

- types.ts: `RepoOrigin = { kind: "byor" } | { kind: "apr"; hostingOrg: string }` and
  `repoOrigin?: RepoOrigin | null` on RegistryRepoConfig, with the same null-safety doc convention
  poolAssociation uses. Absent means "pre-dates this field / not yet known" -- deliberately NOT assumed
  BYOR, per the issue.
- registry/normalize.ts: `parseRepoOrigin` reads the registry's flat `repo_origin` (+ `hosting_org` for
  APR) fields and is threaded into normalizeRepo alongside parsePoolAssociation; a `getRepoOrigin`
  accessor mirrors getRepoPoolAssociation. An absent marker, an unrecognized string, or an `apr` marker
  missing its hosting org all parse to null -- the same "a partial one is treated as none" collapse
  parsePoolAssociation already uses, never a half-populated object.

Type-and-plumbing only: no repo-creation, GitHub API, or provisioning logic (that is JSONbored#7590's scope).

Tests (registry.test.ts, mirroring JSONbored#6320's poolAssociation test): a BYOR marker, a full APR origin,
an unmarked repo (null, byte-identical), a malformed apr-without-hosting-org (null), and an
unrecognized origin (null); plus the getRepoOrigin accessor over present/null/undefined configs. Both
the present and absent branches of the new field are covered.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (22c2c4a) to head (6093903).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7645      +/-   ##
==========================================
- Coverage   88.51%   88.50%   -0.02%     
==========================================
  Files         724      724              
  Lines       76001    76008       +7     
  Branches    22619    22625       +6     
==========================================
- Hits        67272    67268       -4     
- Misses       7681     7688       +7     
- Partials     1048     1052       +4     
Flag Coverage Δ
shard-1 35.72% <28.57%> (-0.01%) ⬇️
shard-2 32.97% <28.57%> (-0.02%) ⬇️
shard-3 28.59% <28.57%> (-0.04%) ⬇️
shard-4 40.52% <100.00%> (-0.10%) ⬇️
shard-5 34.00% <28.57%> (+<0.01%) ⬆️
shard-6 35.92% <28.57%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/registry/normalize.ts 100.00% <100.00%> (ø)
src/types.ts 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-21 06:29:07 UTC

3 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a clean, type-and-plumbing-only addition of an optional `repoOrigin` field to `RegistryRepoConfig`, mirroring the existing `poolAssociation` null-safety convention exactly. The parser correctly collapses an absent marker, an unrecognized string, or an APR marker missing `hosting_org` all to `null`, preserving byte-identical round-tripping for pre-existing repos, and the added tests exercise every one of those branches (byor, apr, legacy/absent, apr-no-org, bogus) plus the accessor's null/undefined/missing-key cases. The PR closes #7636 as required, stays narrowly scoped to plumbing (explicitly excluding #7590's provisioning logic), and mirrors #6320's footprint as claimed.

Nits — 4 non-blocking

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7636
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 208 registered-repo PR(s), 121 merged, 15 issue(s).
Contributor context ✅ Confirmed Gittensor contributor glorydavid03023; Gittensor profile; 208 PR(s), 15 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds RepoOrigin and RegistryRepoConfig.repoOrigin exactly per the requested shape, threads it through normalizeRepo/parseRepoOrigin and a getRepoOrigin accessor mirroring poolAssociation's pattern, and includes tests covering byte-identical round-trip for absent origin plus BYOR/APR/malformed/unknown branches.

Review context
  • Author: glorydavid03023
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, TypeScript, Rust, C++, Kotlin, MDX, Ruby
  • Official Gittensor activity: 208 PR(s), 15 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 3629080 into JSONbored:main Jul 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add repoOrigin (BYOR/APR) field to RegistryRepoConfig, mirroring poolAssociation's pattern

1 participant