Skip to content

Load master repo weights from on-chain registry - #1668

Open
LandynDev wants to merge 1 commit into
feat/2a-4-contract-backendfrom
feat/2a-5-registry-loader-swap
Open

Load master repo weights from on-chain registry#1668
LandynDev wants to merge 1 commit into
feat/2a-4-contract-backendfrom
feat/2a-5-registry-loader-swap

Conversation

@LandynDev

Copy link
Copy Markdown
Collaborator

Part of repo-registration phase 2a (task 2a-5). Stacked on #1667 — merge order #1665 -> #1666 -> #1667 -> this.

  • New repo_registry/loader.py: RegistryLoader reads the registry once per scoring round at the snapshot block hash (atomic across validators), decodes the FP6 hyperparam table (keys 1-26), memoizes per snapshot, and maintains a last-good disk cache
  • Identity shim at the load_weights.py boundary: contract github_id resolves to lowercase owner/name dict keys — downstream scoring sees zero changes; renames appear as a new key next snapshot (forward-only, no history migration)
  • Fallback ladder (spec semantics): contract @ snapshot -> last-good disk cache -> baked JSON. Paused/empty registry deliberately skips the cache and lands on baked so a set_paused rollback is not defeated by stale cache. Worst case = today's behavior.
  • Proof enforcement is structural: verified no code path filters or renormalizes on App-install status; share vectors derive only from contract state at the snapshot hash (vtrust byte-identity)
  • issue_discovery_share default fix: DEFAULT_ISSUE_DISCOVERY_SHARE 0.5 -> 0.0. Bug: novel repos entering via consensus inherited the 0.5 default, silently diverting half their slice to issue discovery (17/18 live repos use 0.0). All baked entries set the field explicitly, so baked behavior is unchanged. Regression tests included. (Checked das-gittensor: only aggregates issue_discovery_score DB columns, no mirrored default constant — no cross-repo change needed.)
  • Out-of-bounds contract params raise on parse and degrade down the ladder instead of crashing — defense in depth over the contract's own bounds

Tests: +26 (ladder legs, shim + rename, snapshot atomicity, discovery-share regression, novel-repo consensus entry); full suite 1123 passed; ruff clean.

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