instar 1.2.10 → 1.2.12

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.
@@ -0,0 +1,65 @@
1
+ # Upgrade Guide — v1.2.10 (Codex wizard model pin)
2
+
3
+ <!-- bump: patch -->
4
+ <!-- patch = bug fixes, refactors, test additions, doc updates -->
5
+
6
+ ## What Changed
7
+
8
+ **Fix: Codex setup wizard now passes a working model name.**
9
+
10
+ `instar setup --framework codex-cli` and the v1.2.1 bareword runtime
11
+ prompt both spawn Codex without passing `-m`/`--model`. Codex CLI
12
+ falls back to its bundled default, `gpt-5.2-codex`, which OpenAI
13
+ retired from ChatGPT-subscription accounts on 2026-04-14. The first
14
+ real end-to-end install attempt by a ChatGPT-subscription user
15
+ returned a 400 from OpenAI before the wizard could render:
16
+
17
+ ```
18
+ The 'gpt-5.2-codex' model is not supported when using Codex with a
19
+ ChatGPT account.
20
+ ```
21
+
22
+ The fix:
23
+
24
+ - New module constant `WIZARD_CODEX_MODEL = 'gpt-5.3-codex'` in
25
+ `src/commands/setup.ts`. The "balanced" tier from the existing
26
+ empirically-probed availability table at
27
+ `src/providers/adapters/openai-codex/models.ts`.
28
+ - Both `codex exec` spawns in setup.ts (the setup-wizard launch and
29
+ the secret-setup micro-session) now include `-m
30
+ WIZARD_CODEX_MODEL` in the argv.
31
+ - New unit-tier canary at
32
+ `tests/unit/setup-codex-model-canary.test.ts` AST-greps every
33
+ `framework === 'codex-cli'` exec block in setup.ts and refuses
34
+ any block that omits the flag. If a future PR adds a third codex
35
+ spawn without the flag, or removes the flag from either existing
36
+ one, CI fails.
37
+
38
+ Spec: `specs/dev-infrastructure/codex-wizard-model.md`.
39
+ ELI16: `specs/dev-infrastructure/codex-wizard-model.eli16.md`.
40
+ Side-effects review: `upgrades/side-effects/fix-codex-wizard-model.md`.
41
+
42
+ ## What to Tell Your User
43
+
44
+ The first-time-install path on Codex CLI now actually reaches the
45
+ wizard. Before this release, typing the bareword instar command and
46
+ picking Codex bounced off OpenAI with a model-not-supported error
47
+ before anything visible happened. After this release, the same flow
48
+ proceeds into the wizard prompt for identity, secrets, etc.
49
+
50
+ If you already have an OPENAI API-key style auth and want to use a
51
+ different Codex model, set the CODEX_MODEL env var — Codex CLI
52
+ honors it and overrides the wizard default.
53
+
54
+ ## Summary of New Capabilities
55
+
56
+ No new capabilities. Behavior fix on top of v1.2.9.
57
+
58
+ ## Evidence
59
+
60
+ Reproduction prior: ran `npx instar@1.2.9` inside a cloned project,
61
+ picked Codex CLI at the runtime prompt, observed the exact 400
62
+ error above and the wizard never rendering.
63
+
64
+ After: the canary unit test passes. End-to-end re-test on
65
+ ChatGPT-subscription Codex auth pending on publish.
@@ -0,0 +1,82 @@
1
+ # Upgrade Guide — v1.2.12 (hybrid wizard for Codex runtime)
2
+
3
+ <!-- bump: patch -->
4
+ <!-- patch = bug fixes, refactors, test additions, doc updates -->
5
+
6
+ ## What Changed
7
+
8
+ **New: hybrid setup wizard for Codex-runtime installs.**
9
+
10
+ `npx instar` → pick Codex CLI at the runtime prompt → now reaches
11
+ an actual conversational walkthrough. Before this release, Codex
12
+ ignored the wizard skill's behavioral contract and executed the
13
+ entire setup non-interactively, leaving the user with a generic
14
+ agent identity they never got to shape.
15
+
16
+ The fix is a two-layer architecture under
17
+ `src/commands/setup-wizard/`:
18
+
19
+ 1. **State machine** owns the conversation flow. Each state has a
20
+ structural prompt printed verbatim by instar, a deterministic
21
+ transition function, and (for action states) a side effect call
22
+ to existing CLI commands. Order is fixed in TypeScript code; no
23
+ LLM can drift it.
24
+
25
+ 2. **Codex driver** drives the state machine turn-by-turn. For each
26
+ conversational state, the driver runs `codex exec -s read-only
27
+ -m gpt-5.3-codex --ephemeral` with a tightly-constrained prompt
28
+ asking Codex to generate ONE warm 2-3 sentence intro paragraph.
29
+ The structural prompt is printed by instar; readline reads the
30
+ answer. Codex cannot use tools, cannot reword the question,
31
+ cannot decide to execute the setup itself.
32
+
33
+ 3. **Telegram setup phase** hands off to Codex as a full agentic
34
+ session (sandbox bypass + Playwright access) — driving the
35
+ browser is execution, which is Codex's strength.
36
+
37
+ Claude-runtime users see no change. The Claude path keeps the
38
+ existing `/setup-wizard` slash-command spawn.
39
+
40
+ Settings the user picks during the wizard (agent name, focus,
41
+ autonomy level, messaging channel) can all be changed later just
42
+ by chatting the agent. The farewell text and the autonomy step's
43
+ narrative both surface this affordance.
44
+
45
+ Spec: `specs/dev-infrastructure/hybrid-wizard.md`.
46
+ ELI16: `specs/dev-infrastructure/hybrid-wizard.eli16.md`.
47
+ Side-effects review: `upgrades/side-effects/feat-hybrid-wizard.md`.
48
+
49
+ ## What to Tell Your User
50
+
51
+ The setup wizard now walks you through identity, autonomy, and
52
+ messaging conversationally, regardless of which runtime you picked.
53
+ On Codex, the wizard runs as a state machine in instar itself with
54
+ Codex generating the warm narrative for each step; on Claude it
55
+ runs the same way it always has. Anything you set up can be
56
+ changed later just by chatting your agent — no need to re-run setup.
57
+
58
+ ## Summary of New Capabilities
59
+
60
+ - New module: `src/commands/setup-wizard/` (state machine + Codex
61
+ driver + model constants).
62
+ - New CLI behavior: `npx instar` → pick Codex CLI → conversational
63
+ wizard with per-step narrative from Codex.
64
+ - Existing CLI surface unchanged.
65
+
66
+ ## Evidence
67
+
68
+ Reproduction prior to fix: ran v1.2.11 install via bareword `npx
69
+ instar` → picked Codex. Codex received the wizard skill prompt and
70
+ executed the entire setup non-interactively. Full log captured at
71
+ `setup-logs.md` in the test project — 2940 lines, zero
72
+ conversational walkthrough.
73
+
74
+ After fix:
75
+ - 12 new state-machine unit tests cover the choice resolver, graph
76
+ integrity, identity-answer threading, messaging branching, and
77
+ the post-server completion chain.
78
+ - 5 updated canary tests cover the dispatch contract: setup.ts
79
+ imports `runCodexWizard` for codex-cli, no codex exec argv with
80
+ the wizard skill prompt remains in setup.ts, the driver's codex
81
+ exec spawns still pin `-m WIZARD_CODEX_MODEL`.
82
+ - End-to-end re-test on the Codex install path pending on publish.
@@ -0,0 +1,122 @@
1
+ # Side-effects review — Hybrid wizard
2
+
3
+ Per L6. Seven dimensions.
4
+
5
+ ## 1. Over-block / under-block
6
+
7
+ Before: UNDER for Codex-runtime users. The bareword runtime prompt
8
+ let users pick Codex, which then spawned Codex with the wizard skill.
9
+ Codex ignored the skill's conversational contract and executed setup
10
+ non-interactively. Generic agent identity, no walkthrough.
11
+
12
+ After: precisely targeted. instar's state machine owns the
13
+ conversation flow; Codex is restricted per-turn to narrative-only
14
+ generation. Claude users see zero change (they keep the existing
15
+ SKILL.md-driven spawn). API-key Codex users keep the same auth
16
+ posture they had before. The agentic Telegram phase still uses
17
+ Codex with full sandbox bypass — that's the right tool for browser
18
+ automation.
19
+
20
+ ## 2. Level-of-abstraction fit
21
+
22
+ A new directory `src/commands/setup-wizard/` holds three files:
23
+ - `state-machine.ts` — pure data + transition functions, no I/O.
24
+ - `codex-driver.ts` — I/O (codex spawn, readline, CLI subcommands).
25
+ - `model-constants.ts` — single constant import target.
26
+
27
+ setup.ts adds one dispatch branch (~12 LOC). It dynamically imports
28
+ the codex driver only when the user picks Codex, keeping the
29
+ setup.ts module load lightweight.
30
+
31
+ The state machine is intentionally a flat record of states; no
32
+ class hierarchy, no event emitters. Drivers consume it via simple
33
+ lookups. Adding a state is one edit.
34
+
35
+ ## 3. Signal vs Authority compliance
36
+
37
+ - The user's runtime choice from the bareword prompt remains an
38
+ operator-intent SIGNAL flowing into `enabledFrameworks` and the
39
+ wizard dispatch.
40
+ - The state graph's transition functions are deterministic AUTHORITIES
41
+ for "what state comes next" given a user answer. Codex never sees
42
+ the transition function and cannot influence routing.
43
+ - `WIZARD_CODEX_MODEL` is the AUTHORITY for which Codex model the
44
+ narrative spawns use, drawn from the existing empirically-probed
45
+ availability table at `src/providers/adapters/openai-codex/models.ts`.
46
+ - The agentic Telegram phase respects the existing AUTHORITY for
47
+ Telegram bot creation (BotFather / OpenAI Codex's tool access /
48
+ Playwright MCP).
49
+
50
+ ## 4. Interactions with adjacent systems
51
+
52
+ - **v1.2.1 runtime prompt** (`promptForFramework`): unchanged. Still
53
+ reads `1`/`2`/`codex` and returns the chosen runtime.
54
+ - **`checkFrameworkPrerequisite`**: unchanged. Still validates the
55
+ chosen runtime's binary is detected.
56
+ - **`ensureSecretBackend`** (Phase 2.5): unchanged in v1.2.12. Still
57
+ spawns the chosen framework with `/secret-setup` for the secret
58
+ backend choice. A future PR can route secret-setup through the
59
+ state machine too, but for v1.2.12 we keep that scope bounded.
60
+ - **Existing wizard SKILL.md**: unchanged. Still owned by the Claude
61
+ path; the Codex path uses it ONLY as a reference target for the
62
+ Telegram-agentic phase prompt.
63
+ - **CLI subcommands the wizard calls** (`init`, `user add`, `server
64
+ start`, `autostart install`): unchanged. The driver calls them via
65
+ `execFileSync('npx', ['instar', ...])` the same way the existing
66
+ SKILL.md tells Claude to call them.
67
+ - **PR #299's canary**: updated. Previously asserted every `codex exec`
68
+ in setup.ts carries `-m WIZARD_CODEX_MODEL`. v1.2.12 asserts setup.ts
69
+ no longer has codex exec spawns (they moved into codex-driver.ts),
70
+ setup.ts dispatches via `runCodexWizard`, and the driver's codex
71
+ exec spawns still carry `-m WIZARD_CODEX_MODEL`.
72
+
73
+ ## 5. Rollback cost
74
+
75
+ Low. Three new files in a new directory plus one ~12-LOC dispatch
76
+ branch in setup.ts. The old `codex exec` argv shape in setup.ts is
77
+ removed; reverting reintroduces it. Claude path untouched.
78
+
79
+ `git revert` restores the v1.2.11 broken-on-Codex behavior. No state
80
+ migration; no agent-installed-files changes; no `PostUpdateMigrator`
81
+ work needed.
82
+
83
+ ## 6. Backwards compatibility / drift surface
84
+
85
+ Fully backwards-compatible.
86
+
87
+ - Claude-runtime users: zero change.
88
+ - Codex-runtime users: now get a working conversational wizard
89
+ driven by instar with Codex-generated narrative. Previously got
90
+ broken non-interactive setup.
91
+ - API-key Codex users: auth posture unchanged. `CODEX_MODEL` env
92
+ still overrides the wizard's `-m` flag if they prefer a different
93
+ model.
94
+ - No config schema change. No agent file template change. No hook
95
+ change.
96
+
97
+ Drift surface: the state graph and per-turn narrative prompts. Both
98
+ are flat data structures, so drift is visible in PR diffs. The
99
+ canary covers the dispatch shape; manual review covers narrative
100
+ prompt quality.
101
+
102
+ ## 7. Authorization / Trust posture
103
+
104
+ No new authority. The per-turn narrative codex spawns use `-s
105
+ read-only` (a strictly lower-privilege sandbox than the
106
+ `--dangerously-bypass-approvals-and-sandbox` the existing wizard
107
+ spawn uses). The Telegram-agentic phase keeps the existing sandbox-
108
+ bypass posture so it can drive Playwright. The action states call
109
+ `execFileSync('npx', ...)` for `init`, `user add`, `server start`,
110
+ `autostart install` — the same CLI surface the existing wizard
111
+ calls.
112
+
113
+ No new auth, no new gate, no new privilege.
114
+
115
+ ## Outcome
116
+
117
+ Ship. Closes the broken-on-Codex install experience that the v1.2.11
118
+ instar-codey log surfaced. Per-framework specialization preserves
119
+ each runtime's strengths (Claude's reliable skill-following, Codex's
120
+ strong execution mode for agentic phases). Structure-as-guarantee
121
+ prevents the regression class. Canary in CI guards the dispatch
122
+ contract.
@@ -0,0 +1,102 @@
1
+ # Side-effects review — Wizard codex spawn model pin
2
+
3
+ Per L6. Seven dimensions.
4
+
5
+ ## 1. Over-block / under-block
6
+
7
+ Before: UNDER. The wizard launch and the secret-setup spawn both ran
8
+ `codex exec` without `-m`, inheriting Codex CLI's bundled default
9
+ (`gpt-5.2-codex`) which OpenAI retired from ChatGPT-subscription
10
+ accounts on 2026-04-14. Every ChatGPT-subscription user hit a 400
11
+ from OpenAI before the wizard could render. The previously-shipped
12
+ runtime prompt (v1.2.1) made this reachable from the most natural
13
+ install command, so the bug surfaced on Justin's first end-to-end
14
+ test.
15
+
16
+ After: precisely scoped. Two argv positions add `-m
17
+ WIZARD_CODEX_MODEL`. No other code path touched. No over-block: API-
18
+ key users who explicitly want a different model can still override
19
+ via `CODEX_MODEL` env (Codex CLI honors it) or by editing their
20
+ shell init — the constant only sets the wizard default.
21
+
22
+ ## 2. Level-of-abstraction fit
23
+
24
+ One module-scope constant (`WIZARD_CODEX_MODEL`) in `setup.ts`
25
+ captures the wizard's policy choice. Two existing argv builders
26
+ consume it. No new abstraction layer.
27
+
28
+ Importing from `src/providers/adapters/openai-codex/models.ts`'s
29
+ TIER_TO_MODEL was considered and rejected — setup.ts has no other
30
+ dependency on the openai-codex adapter, and the constant doesn't
31
+ need to track every adapter-side update. If the available model
32
+ set drifts, the canary will surface the regression via deployed
33
+ errors faster than wiring a cross-module import would help.
34
+
35
+ ## 3. Signal vs Authority compliance
36
+
37
+ The wizard's chosen model is a SIGNAL to Codex. Codex / OpenAI is
38
+ the AUTHORITY for "is this model accessible to this auth posture."
39
+ The change moves the SIGNAL into instar's explicit control instead
40
+ of letting Codex's API-tier default decide for ChatGPT-subscription
41
+ users.
42
+
43
+ Memory `feedback_openai_path_constraints` (2026-05-16) is honored:
44
+ no raw OPENAI_API_KEY routing, no API-tier model leakage to the
45
+ subscription path.
46
+
47
+ ## 4. Interactions with adjacent systems
48
+
49
+ - **`src/providers/adapters/openai-codex/models.ts`** — unchanged.
50
+ The adapter's TIER_TO_MODEL map remains the authoritative
51
+ empirically-probed availability table. The wizard's constant
52
+ mirrors one of its entries (`balanced` tier = `gpt-5.3-codex`).
53
+ - **`src/core/SessionManager.ts`** — unchanged. Non-wizard codex
54
+ spawns elsewhere in the codebase already pass model selection
55
+ via existing options paths.
56
+ - **Existing `instar setup --framework codex-cli`** path —
57
+ unchanged. The bareword prompt path (v1.2.1) and the explicit
58
+ subcommand path both flow through the same `runSetup` function,
59
+ so both pick up the fix in one place.
60
+ - **Bareword runtime prompt** (v1.2.1) — unchanged. The prompt
61
+ routes intent (Claude vs Codex); the model flag is downstream of
62
+ the routing decision.
63
+ - **`CODEX_MODEL` env var** — Codex CLI honors this env var to
64
+ override `-m`. API-key users who want the frontier model can
65
+ still set it (`CODEX_MODEL=gpt-5.2-codex npx instar`); the
66
+ default for subscription users is now safe.
67
+
68
+ ## 5. Rollback cost
69
+
70
+ Trivial. One constant, two `-m WIZARD_CODEX_MODEL` insertions, one
71
+ canary test. `git revert` restores the pre-fix broken-on-
72
+ subscription behavior; nothing else depends on the constant.
73
+
74
+ ## 6. Backwards compatibility / drift surface
75
+
76
+ Fully backwards-compatible.
77
+
78
+ - Existing CLI surface unchanged.
79
+ - ChatGPT-subscription users: were broken, now work. No regression.
80
+ - API-key users: same model selection behavior as before (Codex
81
+ CLI's `CODEX_MODEL` env overrides `-m`).
82
+ - No agent-installed-files change → no `PostUpdateMigrator` work.
83
+
84
+ Drift surface: if OpenAI retires `gpt-5.3-codex` from
85
+ ChatGPT-subscription accounts in the future, the wizard will fail
86
+ the same class of error. The canary test catches "the model flag
87
+ is missing"; an additional follow-up canary should probe the
88
+ configured model against the user's auth before launching the
89
+ wizard, but that is out of scope here.
90
+
91
+ ## 7. Authorization / Trust posture
92
+
93
+ No new authority. The fix selects a model already accessible to
94
+ the existing auth posture; it does not add OPENAI_API_KEY support,
95
+ does not bypass any gate, does not change sandbox or approval
96
+ flags on the spawn.
97
+
98
+ ## Outcome
99
+
100
+ Ship. Closes the broken-from-the-jump Codex install path on
101
+ ChatGPT-subscription accounts. Canary test in CI prevents
102
+ regression. Single-constant locality keeps the fix small.