KeiSeiKit-1.0/_primitives/_rust
Parfii-bot 50c9e76b79 feat(model-tier+branch-dna): activate cost router + give branches DNA
Phase 4 of substrate-unified-registry: turn on the existing
kei-model-router by changing manifest defaults from `model = "opus"`
to `model = "sonnet"` for routine agents, and give every git branch
a deterministic DNA in the kei-status dashboard.

The model-tier system was BUILT (`_primitives/_rust/kei-model-router/`
crate with Beta posterior, complexity τ-estimator, escalate ladder,
calibrate subcommand) and the advisor hook
(`~/.claude/hooks/model-router-advisor.sh`) was REGISTERED. But every
ledger row from this session ran on Opus because:
  1. All 38 manifests hard-coded `model = "opus"` → no chance for the
     router to recommend cheaper.
  2. The orchestrator (me) ignored the stderr advisory.

This commit closes (1). (2) is a behavioural change tracked separately.

Manifest reclassification (4 Opus + 34 Sonnet):
  Opus (hard reasoning):
    - architect            (system-design synthesis)
    - ml-implementer       (Math-First paradigm)
    - ml-researcher        (literature analysis)
    - security-auditor     (deep risk synthesis)
  Sonnet (everything else):
    - 8 code-implementer-* + code-implementer
    - 5 critic-* + critic
    - 6 infra-implementer-* + infra-implementer
    - 4 researcher-* + researcher
    - 6 validator-* + validator
    - 3 security-auditor-{differential,supply-chain,variant}
    - cost-guardian, fal-ai-runner, frontend-validator, modal-runner

Regenerated all 38 `_generated/*.md` so the YAML frontmatter `model:`
field matches the manifest.

Branch DNA (kei-registry status):
  - New `compute_branch_dna(name, commit_sha)` in `status.rs`. Format
    `branch::git::<sha8(name)>::<sha8(commit)>`, mirrors kei-shared
    DNA wire layout `<role>::<caps>::<scope_sha8>::<body_sha8>`.
  - Deterministic — same `(name, commit)` → same DNA. Changes when
    either changes. No DB persistence: the underlying truth lives in
    `.git/refs/heads/<name>`.
  - 3 new unit tests cover format, determinism, name-change, commit-
    change. `cargo test status::tests` → 10 passed.

`kei-registry status` output now shows DNA prefix per branch alongside
ahead/behind, last commit. Combined with existing per-block DNA in the
[Blocks] and [Path Atoms] sections + `dna` column on `agents` table in
kei-ledger, every artefact in the dashboard has an identifier:

  Atoms (incl path-atoms)  → atom::<caps>::<scope>::<body>     (registry)
  Skills/Rules/Hooks/Prim  → <role>::<caps>::<scope>::<body>   (registry)
  Agent forks              → row.dna in agents table           (ledger)
  Local branches           → branch::git::<sha8>::<sha8>       (computed)

What this does NOT do:
- No outcome backfill — the 205 NULL outcomes in ledger still prevent
  the Beta posterior from learning. Router falls back to top-tier
  until ≥1 datapoint per (task_class, model) accumulates. Tracked as
  follow-up.
- No post-checkout hook to auto-register branches in kei-ledger. Live
  shell-out to `git for-each-ref` is fast enough for the dashboard;
  persistence buys nothing the .git tree doesn't already give.

=== STATUS-TRUTH MARKER ===
shipped: functional
stubs: 0
cargo-check: PASS
behaviour-verified: yes
follow-up-required:
  - Outcome backfill hook (writes outcome to ledger after agent done)
  - User /model claude-sonnet-4-6 for current session (5x cheaper)
  - Push the orchestrator (me) to read advisor stderr in real-time

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 23:05:07 +08:00
..
firewall-diff KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
frustration-matrix KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-agent-runtime KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-artifact KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-atom-discovery KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-auth KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-auth-apple KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-auth-google KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-auth-magiclink KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-auth-webauthn KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-backend-daytona KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-brain-view KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-cache KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-capability KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-changelog KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-chat-store KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-compute-baremetal KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-compute-digitalocean KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-compute-linode KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-compute-vultr KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-conflict-scan KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-content-store KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-cortex KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-cron-scheduler KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-crossdomain KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-curator KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-db-contract feat(frontend-loop): kei-db-contract primitive + frontend-validator agent + auto-dev-guard hook 2026-05-01 15:34:39 +08:00
kei-decision KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-decompose KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-diff KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-discover KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-dna-index KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-entity-store KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-export-trajectories KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-forge KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-fork KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-frustration-loop KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-gateway KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-gdrive-import KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-git-bitbucket KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-git-forgejo KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-git-gitea KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-git-gitlab KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-graph-check KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-hibernate KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-import-project KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-leak-matrix KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-ledger KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-ledger-sign KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-llm-bridge-mlx KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-llm-llamacpp KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-llm-mlx KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-llm-ollama KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-llm-router KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-machine-probe KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-mcp KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-memory chore(kit): wire kei-db-contract into installer + drop final #[path] hack 2026-05-01 17:55:52 +08:00
kei-memory-postgres KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-memory-redis KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-memory-sled KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-memory-sqlite KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-migrate KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-model KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-model-router KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-net-ipsec KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-net-openvpn KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-net-wireguard KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-notify-discord KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-notify-slack KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-notify-sms KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-notify-telegram KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-pet KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-ping KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-pipe KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-projects-index KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-projects-watcher KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-provision KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-prune KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-refactor-engine KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-registry feat(model-tier+branch-dna): activate cost router + give branches DNA 2026-05-01 23:05:07 +08:00
kei-replay KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-router KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-runtime KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-runtime-core KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-sage KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-scheduler KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-search-core KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-shared KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-skill-importer KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-skills KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-social-store KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-spawn KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-store KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-svc-systemd KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-task KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-tlog KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-token-tracker KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-tty KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
kei-watch KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
keisei KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
mock-render KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
ssh-check KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
tokens-sync KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
visual-diff KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
.gitignore KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
Cargo.lock feat(frontend-loop): kei-db-contract primitive + frontend-validator agent + auto-dev-guard hook 2026-05-01 15:34:39 +08:00
Cargo.toml feat(frontend-loop): kei-db-contract primitive + frontend-validator agent + auto-dev-guard hook 2026-05-01 15:34:39 +08:00