Skip to content

refactor(persona): fail hard on missing model selection - #1077

Merged
joelteply merged 1 commit into
canaryfrom
feature/rust-persona-model-boundary
May 11, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feature/rust-persona-model-boundary

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary\n- Makes Rust persona model selection fail hard when no trained adapter-backed model is available.\n- Removes the base-model fallback tier from .\n- Adds ts-rs exported and updates generated persona TS types.\n- now returns an explicit error instead of silently selecting a default model.\n\n## TDD\n- -> 13 passed.\n- Commit hook passed TypeScript build, clippy baseline, and browser ping.\n\n## VDD\n- Decision path remains sub-millisecond in the fail-hard empty-registry case.\n- Mac validation used the required GPU feature set (); CPU-only macOS build is still blocked by the llama guard.\n\n## Notes\n- PR #1076 fixed the stale ESLint baseline first; this branch is rebased on current canary.\n- Pre-push passed. It warned that native Docker image push could not run because Rust tests generated local ts-rs output noise; those files were restored locally and are not part of this PR.

@joelteply
joelteply merged commit 08bbc7a into canary May 11, 2026
3 checks passed
@joelteply
joelteply deleted the feature/rust-persona-model-boundary branch May 11, 2026 18:35
joelteply pushed a commit to RebelTechPro/continuum that referenced this pull request May 13, 2026
…F PR-2)

Per-pattern ratchet on src/system/user/server/, mirroring PR CambrianTech#1091's
LOC ratchet shape. Tracks three anti-patterns under the persona surface:

  - fallback_mention (case-insensitive, baseline 83): Joel 2026-04-22 —
    "fallbacks have ruined this project ... they are ILLEGAL." The WORD
    count proxies conceptual presence; comments saying "no fallback
    here" count too.
  - direct_adapter_instantiation (baseline 12): matches `new <Name>Adapter(`.
    TS surface should request providers via the ModelRequirement →
    ResolvedModel resolver shipped in CambrianTech#1066/CambrianTech#1074, not instantiate
    adapters directly.
  - direct_api_key_env_read (baseline 0): matches `process.env.*API_KEY`.
    Cloud key lookup belongs in the Rust provider registry per Codex's
    CambrianTech#1077 boundary. Locks 0 in.

Per-pattern monotonic-decrease (any pattern growing fails CI; shrinkage
allowed and surfaces a hint to --update-baseline post-merge). Same
3-mode shape as PR CambrianTech#1091: default check / --update-baseline / --verbose.

Validated locally: clean tree passes (3 patterns hold), intentional
+2 fallback growth fails with named pattern + delta + actionable Rust
target paths.

Lane F (PR CambrianTech#1084 alpha workstreams). Companion to CambrianTech#1091 — extends
docs/architecture/TS-PERSONA-COGNITION-RATCHET.md with the new gate.
Independent CI workflow (~5s, shell + python only).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request May 13, 2026
… fail loud on unknown tier

ROOT CAUSE for 2026-05-11 RTX 5090 silent-no-replies finding (continuum-8e97
VDD report): install seeded only voice-models, no Qwen GGUF, personas had
no local provider to invoke, fail-hard rule (#1077) didn't fire because the
silent skip happened pre-resolver in download-models.sh.

Two compounding bugs:

(1) Tier-name divergence — install.sh sets CONTINUUM_TIER='primary' for
32GB+ Macs but src/shared/models.json + src/scripts/download-models.sh
canon is 'full'. If 'primary' ever leaks to model-init's TIER env, the jq
lookup `auto_download.by_tier[primary]` returns [] (silent), leaving install
with always[] (voice/embedding/whisper/piper/kokoro/silero) only — no Qwen.

(2) Container /proc/meminfo blindspot — docker-compose has
`mem_limit: ${MODEL_INIT_MEM:-2g}` on model-init. download-models.sh:30 reads
RAM from /proc/meminfo INSIDE the container. With cgroups-aware /proc/meminfo,
that's the 2GB limit, NOT host RAM. Result: TIER auto-detects to `mba`
regardless of host (RTX 5090 / 32GB+ Mac / 8GB MBA all see 2GB). Even when
CONTINUUM_TIER isn't set externally, in-container detection silently
bottoms-out at the smallest tier.

Three changes — all single-purpose, additive (no semantic shifts elsewhere):

1. install.sh: rename CONTINUUM_TIER='primary' → 'full' (single source of
   truth = src/shared/models.json `tiers` keys). Updates inline comment +
   case-stmt fallback default. Three textual occurrences of the legacy
   name converted to the canonical name plus a note in the comment block
   explaining why.

2. docker-compose.yml: pass `TIER=${CONTINUUM_TIER:-full}` to model-init's
   env. Makes install.sh's hardware-tier choice flow through to the
   downloader instead of having the container guess from its own
   /proc/meminfo. The `:-full` default guarantees headed installs (no
   install.sh) still pull the full multimodal Qwen set rather than
   bottoming-out at mba.

3. src/scripts/download-models.sh: validate $TIER against {mba|mid|full}
   BEFORE the jq lookup. Unknown tier (e.g. residual 'primary' or any
   future divergence) errors loudly with the registry's actual valid
   set + the most likely cause. Per Joel's "no silent fallback to
   placeholder models" rule.

Validation:
- bash -n install.sh: syntax OK
- bash -n src/scripts/download-models.sh: syntax OK
- docker compose config --quiet: parses OK

Out of scope (separate followups):
- Lane B Docker volume/profile mechanics (continuum-8e97 owns)
- Verify #1077 fail-hard fires when NO local model present at runtime
- Linux install path doesn't set CONTINUUM_TIER; now defaults to `full`
  on non-Mac, which is right for Linux+RTX. MBA on Linux would need
  explicit env override — acceptable since the in-container
  /proc/meminfo bottom-out is now fail-loud rather than silent-mba

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant