instar 1.3.706 → 1.3.708

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +12 -1
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/commands/setup-wizard/model-constants.d.ts +16 -2
  5. package/dist/commands/setup-wizard/model-constants.d.ts.map +1 -1
  6. package/dist/commands/setup-wizard/model-constants.js +22 -2
  7. package/dist/commands/setup-wizard/model-constants.js.map +1 -1
  8. package/dist/commands/setup.d.ts +7 -10
  9. package/dist/commands/setup.d.ts.map +1 -1
  10. package/dist/commands/setup.js +7 -9
  11. package/dist/commands/setup.js.map +1 -1
  12. package/dist/core/DispatchExecutor.d.ts +10 -1
  13. package/dist/core/DispatchExecutor.d.ts.map +1 -1
  14. package/dist/core/DispatchExecutor.js +10 -2
  15. package/dist/core/DispatchExecutor.js.map +1 -1
  16. package/dist/core/componentCategories.d.ts.map +1 -1
  17. package/dist/core/componentCategories.js +22 -0
  18. package/dist/core/componentCategories.js.map +1 -1
  19. package/dist/core/types.d.ts +28 -0
  20. package/dist/core/types.d.ts.map +1 -1
  21. package/dist/core/types.js.map +1 -1
  22. package/dist/providers/adapters/anthropic-headless/config.d.ts +8 -0
  23. package/dist/providers/adapters/anthropic-headless/config.d.ts.map +1 -1
  24. package/dist/providers/adapters/anthropic-headless/config.js.map +1 -1
  25. package/dist/providers/adapters/anthropic-headless/control/authCredentialInjection.d.ts.map +1 -1
  26. package/dist/providers/adapters/anthropic-headless/control/authCredentialInjection.js +18 -1
  27. package/dist/providers/adapters/anthropic-headless/control/authCredentialInjection.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/data/builtin-manifest.json +2 -2
  30. package/upgrades/1.3.707.md +65 -0
  31. package/upgrades/1.3.708.md +54 -0
  32. package/upgrades/config-driven-pinned-models.eli16.md +18 -0
  33. package/upgrades/side-effects/config-driven-pinned-models.md +63 -0
  34. package/upgrades/side-effects/llm-routing-register-uncategorized-components.md +100 -0
@@ -0,0 +1,54 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The last hardcoded-model callsites from the LLM Routing Registry audit ("Risk
9
+ items" #3/#5/#6/#7) are now overridable configuration with behavior-preserving
10
+ inline defaults — with nothing set, every callsite behaves byte-for-byte as
11
+ before, and nothing is written to any config file (absence IS the default; no
12
+ migration needed).
13
+
14
+ - `DispatchExecutor.runAgentic`'s spawned dispatch session model:
15
+ `intelligence.pinnedModels.dispatchAgentic` (default 'haiku', unchanged).
16
+ - The anthropic-headless credential-probe validation ping:
17
+ `intelligence.pinnedModels.anthropicCredentialProbe` (default now sourced
18
+ from `ANTHROPIC_MODELS.haiku` in the central tier map instead of a
19
+ free-floating `'claude-haiku-4-5'` literal, so a future model bump cannot
20
+ silently miss it).
21
+ - The setup wizard's narrative models (codex + gemini drivers): env-var
22
+ overrides `INSTAR_WIZARD_CODEX_MODEL` / `INSTAR_WIZARD_GEMINI_MODEL` — env
23
+ not config, because the wizard runs before `.instar/config.json` exists.
24
+ `setup.ts`'s duplicate `WIZARD_CODEX_MODEL` const collapsed into a single
25
+ source of truth in `setup-wizard/model-constants.ts` (re-exported, canary
26
+ contract preserved).
27
+ - Honest audit correction: risk item #4 (mentor loop → 'opus') needed no code
28
+ change — it was already config-driven via `mentor.autonomousFix.model`; a
29
+ canary test now pins that fact.
30
+
31
+ 15 new unit tests cover both sides of every boundary (absent ⇒ shipped
32
+ default, present ⇒ override wins, whitespace ⇒ absent) plus wiring canaries
33
+ asserting `server.ts` threads both config keys. This is step one of the
34
+ INSTAR-Bench v2 program (operator-approved 2026-07-02): before benchmark
35
+ results can drive model routing, every model choice must be reachable by
36
+ configuration rather than buried in code.
37
+
38
+ ## What to Tell Your User
39
+
40
+ Nothing proactively — this changes no behavior on its own. If your operator
41
+ asks: a handful of my internal helpers (the background dispatch runner, my
42
+ setup wizard's text generator, and the tiny "does this credential work?"
43
+ check) had their AI model choice typed directly into my code; those choices
44
+ are now ordinary settings, with the old models still used unless someone
45
+ deliberately changes them.
46
+
47
+ ## Summary of New Capabilities
48
+
49
+ - New config block `intelligence.pinnedModels` (`dispatchAgentic`,
50
+ `anthropicCredentialProbe`) — inline-defaulted, absent means today's
51
+ behavior exactly.
52
+ - New env overrides `INSTAR_WIZARD_CODEX_MODEL` / `INSTAR_WIZARD_GEMINI_MODEL`
53
+ for the pre-config setup wizard.
54
+ - New adapter config field `credentialProbeModel` on anthropic-headless.
@@ -0,0 +1,18 @@
1
+ # The last few "model choices burned into the code" are now settings
2
+
3
+ Instar makes hundreds of small AI calls a day — checking messages, validating credentials, running its setup wizard, executing background dispatch steps. For almost all of them, WHICH model gets used is a setting an operator can change. But an audit this week found a handful of stragglers where the model name was typed directly into the code: the background dispatch runner always spawned "haiku", the setup wizard always asked "gpt-5.3-codex" (or "gemini-2.5-flash") to write its intro text, and the credential checker always pinged Anthropic with a hard-typed "claude-haiku-4-5". If benchmarking ever showed a better/cheaper model for one of these jobs, changing it meant editing source code and shipping a release — for what should be a one-line setting.
4
+
5
+ This change makes those last callsites configurable, with one iron rule: **if you change nothing, nothing changes.** Every one of them keeps exactly its old model as the built-in default. The new settings don't even get written into config files — absence IS the default, so no existing agent's config is touched on update, and there is nothing to migrate.
6
+
7
+ The specifics, in plain terms:
8
+
9
+ - The background dispatch runner's model can now be set in config (`intelligence.pinnedModels.dispatchAgentic`). Unset, it's "haiku" like always.
10
+ - The credential checker's tiny "does this key work?" ping model is configurable too (`intelligence.pinnedModels.anthropicCredentialProbe`) — and its default now comes from the central model list instead of a lone typed-out string, so a future Claude model bump can't silently miss it.
11
+ - The setup wizard is special: it runs BEFORE the config file exists (creating that file is its whole job), so a config setting could never reach it. Its override is an environment variable instead (`INSTAR_WIZARD_CODEX_MODEL` / `INSTAR_WIZARD_GEMINI_MODEL`), which is the only kind of setting that CAN reach it.
12
+ - One honest discovery: the mentor loop — listed in the audit as hardcoded to "opus" — turned out to already be configurable (`mentor.autonomousFix.model`); the audit row was wrong. A test now pins that so the record stays honest.
13
+
14
+ Also cleaned up: the wizard's codex model name was typed in TWO places that could drift apart; now there's one source of truth that the other re-exports.
15
+
16
+ Safety story: this adds no new decision-making, no gating, no blocking — it only lets an operator choose the model for five existing, unchanged jobs. Fifteen new tests prove both directions on every surface: leave it unset and you get byte-for-byte the old behavior; set it and your value wins; set it to whitespace and it's treated as unset. The existing wizard canary tests (which pin the "-m model" discipline on every codex spawn) pass unmodified. Rollback is deleting a config line.
17
+
18
+ Why now: this is step one of the INSTAR-Bench v2 program (operator-approved 2026-07-02) — before benchmark results can drive model routing, every model choice has to be reachable by configuration rather than buried in code.
@@ -0,0 +1,63 @@
1
+ # Side-Effects Review — Config-driven pinned-model callsites (routing-registry risk items #3/#5/#6/#7)
2
+
3
+ **Version / slug:** `config-driven-pinned-models`
4
+ **Date:** `2026-07-02`
5
+ **Author:** `Instar Agent (echo)`
6
+ **Second-pass reviewer:** `not required` (no gate/sentinel/lifecycle surface — pure config plumbing with behavior-preserving defaults)
7
+
8
+ ## Summary of the change
9
+
10
+ Migrates the hardcoded-model callsites catalogued as "Risk items" #3, #5, #6, #7 in the LLM Routing Registry audit (2026-07-01, operator-directed) to overridable configuration with **behavior-preserving inline defaults** — with no config/env set, every callsite behaves byte-for-byte as before. Files touched: `src/core/types.ts` (new `intelligence.pinnedModels` block, inline-defaulted per the documented codexExecJson/swapAttemptTimeoutMs precedent), `src/core/DispatchExecutor.ts` (optional `agenticModel` ctor option, default 'haiku'), `src/commands/server.ts` (threads `pinnedModels.dispatchAgentic` + `pinnedModels.anthropicCredentialProbe` into the two construction sites), `src/commands/setup-wizard/model-constants.ts` (env-overridable resolvers `INSTAR_WIZARD_CODEX_MODEL` / `INSTAR_WIZARD_GEMINI_MODEL` — env not config because the wizard runs before `.instar/config.json` exists), `src/commands/setup.ts` (duplicate const replaced with import/re-export from model-constants — single source of truth), `src/providers/adapters/anthropic-headless/config.ts` + `control/authCredentialInjection.ts` (new `credentialProbeModel` field; default now sourced from `ANTHROPIC_MODELS.haiku` in `src/core/models.ts` instead of a free-floating string literal), and `tests/unit/pinned-model-callsites.test.ts` (15 new tests).
11
+
12
+ **Honest scope note:** risk item #4 (mentor loop → opus) required NO code change — it was already config-driven via `mentor.autonomousFix.model` (default 'opus'); the registry row was imprecise. A canary test now pins that fact.
13
+
14
+ ## Decision-point inventory
15
+
16
+ No decision point is added, modified, or removed. Model *selection inputs* to five existing callsites become configurable; the callsites' logic, gating, and control flow are untouched. All five are pass-through surfaces:
17
+
18
+ - `DispatchExecutor.runAgentic` — pass-through — spawned-session model tier now `options.agenticModel ?? 'haiku'`.
19
+ - `setup-wizard codex narrative spawn` — pass-through — model const now env-resolvable, default unchanged.
20
+ - `setup-wizard gemini narrative spawn` — pass-through — same.
21
+ - `anthropic-headless credential probe` — pass-through — ping model now `config.credentialProbeModel ?? ANTHROPIC_MODELS.haiku`.
22
+ - `server.ts boot wiring` — pass-through — threads the two config keys when present; spreads nothing when absent.
23
+
24
+ ---
25
+
26
+ ## 1. Over-block
27
+
28
+ No block/allow surface — over-block not applicable. (No input is ever rejected by this change; a nonsense model value in config flows to the underlying spawn/API call, which fails with that layer's existing error surface — same as a nonsense value in any other model config key like `subscriptionPath.model`.)
29
+
30
+ ## 2. Under-block
31
+
32
+ No block/allow surface — under-block not applicable. One adjacent honest note: this change does NOT validate configured model ids against a known-models list. That is deliberate and consistent with every existing model config key (`sessions.frameworkDefaultModels`, `subscriptionPath.model`, `mentor.autonomousFix.model` — none validate); inventing validation only here would be a new inconsistent behavior surface.
33
+
34
+ ## 3. Level-of-abstraction fit
35
+
36
+ Right layer. The change follows the established three-layer pattern already used by every other model-selection surface: config type (`types.ts`) → boot threading (`server.ts`) → inline default at the consumption site. The wizard deviation (env var instead of config key) is a deliberate fit-to-layer choice: the wizard runs pre-config by definition, so a config key would be unreadable at its runtime — an env var is the only honest override surface there, and the config docblock documents the split. The credential-probe default moving to `ANTHROPIC_MODELS.haiku` removes a string literal that could silently drift from the tier map (registry risk item #8's concern).
37
+
38
+ ## 4. Signal vs authority compliance
39
+
40
+ Compliant — trivially. No signal is produced, no authority is held, no brittle check is added anywhere. (Reference: docs/signal-vs-authority.md.)
41
+
42
+ ## 5. Interactions
43
+
44
+ - **Tier maps / escalation:** `dispatchAgentic` feeds `SessionManager.spawnSession({model})` exactly as the literal did; tier escalation and topic-profile resolution operate on spawned *conversation* sessions, not this job-slugged dispatch session — no new interaction.
45
+ - **componentFrameworks routing:** untouched — these callsites were router-bypasses before and remain framework-pinned; only the *model value* became configurable. (Making them router-routed was considered and rejected for this change: dispatch/wizard/probe are structurally tied to their frameworks. The v2 bench routing pass may revisit.)
46
+ - **Canary tests:** `setup-codex-model-canary.test.ts` still passes unmodified — the const-shape contract (`-m WIZARD_CODEX_MODEL` on every codex spawn; pinned to a subscription-supported model) is preserved by computing the const through the resolver at module load.
47
+ - **No double-fire / shadow / race surface:** nothing fires.
48
+
49
+ ## 6. External surfaces
50
+
51
+ None. No user-visible output changes, no API shape changes, no cross-agent surface. The probe ping still sends 4 max_tokens to the same endpoint with the same default model id.
52
+
53
+ ## 7. Multi-machine posture (Cross-Machine Coherence)
54
+
55
+ **Machine-local BY DESIGN.** `intelligence.pinnedModels` lives in `.instar/config.json`, which deliberately does not sync across machines (same posture as every other `intelligence.*` key — each machine's operator tunes its own routing). The wizard env vars are process-local by nature. No durable state, no user-facing notices, no generated URLs.
56
+
57
+ ## 8. Rollback cost
58
+
59
+ Trivial. Remove the config key / env var → shipped defaults apply immediately (next boot for config, next wizard run for env). Reverting the commit restores literals with zero data migration — no persisted state depends on the new keys (inline-defaulted precisely so absence is the default state; nothing was added to ConfigDefaults/migrateConfig, so no migration parity work is owed).
60
+
61
+ ## Test evidence
62
+
63
+ `tests/unit/pinned-model-callsites.test.ts` — 15 tests: both sides of every boundary (absent ⇒ shipped default, present ⇒ override wins, whitespace ⇒ absent) for all three migrated surfaces, wiring canaries asserting server.ts actually threads both config keys, and the mentor already-config-driven canary. Plus `setup-codex-model-canary.test.ts` (5 tests) unmodified and green. `npx tsc --noEmit` clean.
@@ -0,0 +1,100 @@
1
+ # Side-Effects Review — Register 13 uncategorized LLM components
2
+
3
+ **Version / slug:** `llm-routing-register-uncategorized-components`
4
+ **Date:** `2026-07-01`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ Adds 13 previously-unregistered LLM call-site component names to `COMPONENT_CATEGORY`
11
+ in `src/core/componentCategories.ts`, each tagged `sentinel` / `gate` / `reflector`
12
+ by function, so the framework router resolves them to a real category instead of
13
+ `other` (which falls back to the agent default framework, Claude). Correspondingly
14
+ removes those 13 names from the `WIRING_EXCLUSIONS` pinned backlog in
15
+ `tests/unit/llm-attribution-ratchet.test.ts`, leaving only the 5 components that
16
+ route via an explicit `attribution.category` (so they correctly stay map-unregistered).
17
+ Files touched: `src/core/componentCategories.ts`, `tests/unit/llm-attribution-ratchet.test.ts`.
18
+ The change interacts with one decision point — the router's category resolution
19
+ (`categoryForComponent`) — but only feeds it more data; it adds no branching logic.
20
+
21
+ ## Decision-point inventory
22
+
23
+ - `categoryForComponent` (src/core/componentCategories.ts) — **pass-through** — unchanged
24
+ function; this change only adds rows to the map it reads. No control-flow edit.
25
+ - `IntelligenceRouter.resolveFramework` (per-component framework routing) — **pass-through** —
26
+ consumes the category; unchanged. The 13 components now resolve to their category's
27
+ configured framework instead of the default, which is the intended effect.
28
+
29
+ ---
30
+
31
+ ## 1. Over-block
32
+
33
+ **What legitimate inputs does this change reject that it shouldn't?**
34
+
35
+ No block/allow surface — over-block not applicable. This is a routing-map data change,
36
+ not a gate. It changes WHICH provider runs a call, never WHETHER the call is allowed.
37
+
38
+ ---
39
+
40
+ ## 2. Under-block
41
+
42
+ **What failure modes does this still miss?**
43
+
44
+ No block/allow surface — under-block not applicable. The change cannot make any gate
45
+ more permissive; gate *authority* is untouched. (The one `gate`-category addition,
46
+ ResumeValidator, keeps its existing behavior; only its provider changes.)
47
+
48
+ ---
49
+
50
+ ## 3. Wrong-provider / routing correctness
51
+
52
+ **Could a component now route to a provider that can't serve it correctly?**
53
+
54
+ Low risk. All 13 join categories (`sentinel`/`gate`/`reflector`) that the
55
+ Provider-Fallback Default Policy already routes off-Claude for dozens of live
56
+ components — the target providers (codex-cli → pi-cli → gemini-cli, Claude last)
57
+ are production-exercised. A rate-limited or missing framework degrades via the
58
+ existing per-framework circuit breaker + fallback chain (unchanged). No component
59
+ routes to a provider class not already in use for its category.
60
+
61
+ The one behavioral nuance: components that make *nuanced/critical* judgments
62
+ (e.g. LLMConflictResolver resolving divergent multi-machine state) now run on a
63
+ non-Claude reasoning-capable model (gpt-5.5 via codex) rather than Claude. This is
64
+ aligned with the operator directive to prefer subsidized non-Claude subscriptions,
65
+ and gpt-5.5 is reasoning-capable. A later nature-based routing pass (operator-reviewed)
66
+ will refine per-task model tiers; this change does not lock that in.
67
+
68
+ ---
69
+
70
+ ## 4. Reversibility / rollback
71
+
72
+ Fully reversible: remove the 13 rows from `COMPONENT_CATEGORY` (and restore them to
73
+ `WIRING_EXCLUSIONS`) and routing returns to the prior state. No migration, no state
74
+ schema change, no persisted data. An operator can also override any single component
75
+ per-agent via `sessions.componentFrameworks.overrides` without touching this map.
76
+
77
+ ---
78
+
79
+ ## 5. Blast radius
80
+
81
+ Fleet-wide once shipped (it's a core map), but strictly additive and category-consistent.
82
+ No new code paths execute; the router simply finds a category where it previously found
83
+ none. Existing tests cover it: the wiring ratchet (`llm-attribution-ratchet.test.ts`)
84
+ proves every live `.evaluate()` component now resolves, `intelligence-router.test.ts` and
85
+ the integration/e2e routing suites remain green. Signal-vs-authority: N/A — no detector
86
+ and no authority is added or modified; this is a data-map completion.
87
+
88
+ ---
89
+
90
+ ## 6. Test coverage
91
+
92
+ - `tests/unit/llm-attribution-ratchet.test.ts` — the drift guard; asserts every literal
93
+ `attribution.component` in `src/` resolves to a registered category or a pinned
94
+ (explicit-category) exception, AND that every pinned exception still resolves to `other`.
95
+ Both sides green after the change.
96
+ - `tests/unit/intelligence-router.test.ts`, `tests/unit/standards-coverage-component-category.test.ts`,
97
+ `tests/integration/intelligence-routing-routes.test.ts`,
98
+ `tests/integration/provider-fallback-default-routing.test.ts` — all green.
99
+ - No NEW test added: the existing ratchet already IS the structural guard for this
100
+ invariant (adding a duplicate would be noise).