refactor: agent-discoverable naming, docs, and file splits - #2989
refactor: agent-discoverable naming, docs, and file splits#2989unarbos wants to merge 104 commits into
Conversation
Add AGENTS.md, write-discoverable-code skill, docs-stripped metadata fingerprint oracle, freeze_struct doc rules, and the shard manifest for the refactor/discoverability swarm migration. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve rename-proposals.md by keeping both proxy and utility proposals. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…odules Split the monolithic tests/networks.rs into tests/networks/ by dissolve, register, prune, and registration-queue concepts for grep-first navigation. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the 3973-line tests/epoch.rs monolith with tests/epoch/ modules for graph runs, bonds, liquid alpha, Yuma3, sniped-UID masking, and input-state checks. Existing `mod epoch;` keeps working without touching tests/mod.rs. Co-authored-by: Cursor <cursoragent@cursor.com>
… concepts Replace the 3251-line tests/swap_hotkey_with_subnet.rs monolith with tests/swap_hotkey_with_subnet/ modules for ownership, membership/serve, stake transfer, parent/child maps, rate limits, revert paths, and root claims. Existing `mod swap_hotkey_with_subnet;` keeps working without touching tests/mod.rs. Co-authored-by: Cursor <cursoragent@cursor.com>
…odules Split the monolithic tests/coinbase.rs into tests/coinbase/ by issuance, drain, dividend, and inject/swap concepts for grep-first navigation. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Process rename-proposals.md: private/crate helpers and adapter types only; defer uid_lookup, fixed, and extensions module path (SDK fixtures). Co-authored-by: Cursor <cursoragent@cursor.com>
Record precompile INDEX/selectors without source paths so file splits do not break the oracle; refresh metadata-baseline.txt for the new format. Co-authored-by: Cursor <cursoragent@cursor.com>
Capture migration learnings (sn/rl/do_/if_ abbreviations; RPC naming) and mark wave-3 shards merged in the refactor manifest. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
eco-tests changed — indexer review requiredThis PR modifies files under Changed files
|
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE MEDIUM scrutiny: four-month-old account with substantial contribution history and repository write access; no known Gittensor association; refactor/discoverability → main. The large diff is predominantly documentation, internal symbol renaming, and file/test-module splits. Static review found no dependency changes, AI-review trust-boundary edits, new privilege paths, security-relevant runtime behavior changes, or malicious activation conditions. FindingsNo findings. ConclusionNo security vulnerability or evidence of malicious intent was found in the PR-specific changes. 🔍 AI Review — Auditor (domain review)VERDICT: 👎 Established write-access contributor; Gittensor association UNKNOWN. No overlapping PR is a functional duplicate. The PR description is substantive, and the oracle produces identical fingerprints for the immutable base and current head. However, the oracle omits several frozen structural dimensions that the PR says it protects. Auto-fix: Findings
ConclusionThe refactor should not merge until its central safety oracle covers the frozen field and signature structure it claims to validate, with negative tests demonstrating that incompatible changes fail the check. |
|
|
||
|
|
||
| def collect_pallet_enum(path: Path, kind: str) -> list[str]: | ||
| """Collect Event/Error variant names in declaration order.""" |
There was a problem hiding this comment.
[MEDIUM] Fingerprint omits frozen field and signature structure
This extractor records Event/Error variant names and order, but not their field names, order, or types. Similar gaps exist for storage hashers/key/value types, dispatch argument signatures, and runtime API argument/return types. Consequently, incompatible SCALE or API changes can pass while the PR describes this as a structural safety oracle.
Extend the fingerprint to include these structures (preferably from generated metadata or a real Rust parser), and add negative tests that mutate each frozen dimension and require the check to fail.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
Summary
Migrate the codebase toward Modem-style agent-discoverable conventions (distinctive names, definition-site docs, concept-named modules) without changing the on-chain or client-facing surface.
Landed on integration branch
refactor/discoverabilityvia a parallel shard swarm (Waves 1–3).What changed
AGENTS.md+.agents/skills/write-discoverable-code/SKILL.mdwith Tier A–D do-not-rename taxonomy and glossaryscripts/check_metadata_unchanged.sh— docs-stripped structural fingerprint of storage names, call indices/names, events/errors,construct_runtime!, RPC methods, runtime APIs, precompile indices/selectors. Baseline inrefactor/metadata-baseline.txtrefactor/rename-proposals.md; path-agnostic precompile fingerprint; glossary finalizedExplicitly untouched (frozen)
construct_runtime!names & indicescall_index, extrinsic names, Event/Error names & orderpallets/subtensor/src/weights.rs, applied migration name stringsHow to verify
./scripts/check_metadata_unchanged.sh # must print OK SKIP_WASM_BUILD=1 cargo check -p pallet-subtensor --lib SKIP_WASM_BUILD=1 cargo check -p node-subtensor-runtime --libRequest label
no-spec-version-bump: behavior and metadata (minus docs) are unchanged; this is documentation / internal structure / private helper naming only.Notes for reviewers
refactor/refactor-manifest.jsonrefactor/WAVE1_GATE.md,WAVE2_GATE.md,WAVE3_GATE.mdrefactor/rename-proposals.md(e.g.uid_lookup, barefixed, extensions module path)Test plan
./scripts/check_metadata_unchanged.shgreencheck-rust(fmt/clippy/nextest) greenruntime-checks(try-runtime / clone-upgrade) green or skipped with documented reasonMade with Cursor