instar 1.3.208 → 1.3.209

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 (42) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +48 -0
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +13 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  8. package/dist/core/PostUpdateMigrator.js +19 -0
  9. package/dist/core/PostUpdateMigrator.js.map +1 -1
  10. package/dist/core/SessionManager.d.ts.map +1 -1
  11. package/dist/core/SessionManager.js +7 -3
  12. package/dist/core/SessionManager.js.map +1 -1
  13. package/dist/core/frameworkSessionLaunch.d.ts.map +1 -1
  14. package/dist/core/frameworkSessionLaunch.js +15 -0
  15. package/dist/core/frameworkSessionLaunch.js.map +1 -1
  16. package/dist/scaffold/templates.d.ts.map +1 -1
  17. package/dist/scaffold/templates.js +6 -0
  18. package/dist/scaffold/templates.js.map +1 -1
  19. package/dist/server/routes.d.ts.map +1 -1
  20. package/dist/server/routes.js +76 -0
  21. package/dist/server/routes.js.map +1 -1
  22. package/dist/threadline/A2ACheckInPolicy.d.ts +50 -0
  23. package/dist/threadline/A2ACheckInPolicy.d.ts.map +1 -0
  24. package/dist/threadline/A2ACheckInPolicy.js +51 -0
  25. package/dist/threadline/A2ACheckInPolicy.js.map +1 -0
  26. package/dist/threadline/A2ACheckInProxy.d.ts +56 -0
  27. package/dist/threadline/A2ACheckInProxy.d.ts.map +1 -0
  28. package/dist/threadline/A2ACheckInProxy.js +53 -0
  29. package/dist/threadline/A2ACheckInProxy.js.map +1 -0
  30. package/dist/threadline/A2ACheckInScheduler.d.ts +77 -0
  31. package/dist/threadline/A2ACheckInScheduler.d.ts.map +1 -0
  32. package/dist/threadline/A2ACheckInScheduler.js +90 -0
  33. package/dist/threadline/A2ACheckInScheduler.js.map +1 -0
  34. package/dist/threadline/A2ACheckInSummarizer.d.ts +48 -0
  35. package/dist/threadline/A2ACheckInSummarizer.d.ts.map +1 -0
  36. package/dist/threadline/A2ACheckInSummarizer.js +64 -0
  37. package/dist/threadline/A2ACheckInSummarizer.js.map +1 -0
  38. package/package.json +1 -1
  39. package/src/data/builtin-manifest.json +64 -64
  40. package/src/scaffold/templates.ts +6 -0
  41. package/upgrades/1.3.209.md +66 -0
  42. package/upgrades/side-effects/iris-audit-session-lifecycle.md +146 -0
@@ -0,0 +1,146 @@
1
+ # Side-Effects Review — Iris-audit session lifecycle (PR A: items 2/3/4)
2
+
3
+ **Version / slug:** `iris-audit-session-lifecycle`
4
+ **Date:** `2026-06-02`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `3 independent spec reviewers (convergence round) — concur`
7
+
8
+ ## Summary of the change
9
+
10
+ PR A of the Iris-audit spec (`docs/specs/iris-audit-session-observability.md`),
11
+ covering items 2/3/4. Three changes: (a) `claudeCodeBuilder` now pushes `--model
12
+ <resolved>` when `frameworkDefaultModels['claude-code']` is set (it was silently
13
+ dropped before — only Codex/Gemini builders passed it), and the interactive `Session`
14
+ record stores the model actually launched with; (b) a new `POST /sessions/restart-all`
15
+ route that bulk-refreshes every running Telegram-bound session through the existing
16
+ `SessionRefresh` path (staggered, conversation-preserving); (c) a CLAUDE.md template
17
+ section + idempotent `migrateClaudeMd` backfill teaching that hooks/config load at
18
+ session start so applying a change requires a restart. Files: `src/core/
19
+ frameworkSessionLaunch.ts`, `src/core/SessionManager.ts`, `src/server/routes.ts`,
20
+ `src/scaffold/templates.ts`, `src/core/PostUpdateMigrator.ts`, plus tests and an
21
+ upgrade fragment. Decision points touched: the interactive launch-arg builder
22
+ (launch-shape, no block surface), the new restart-all action endpoint (real blast
23
+ radius — reuses the existing rate-guarded `SessionRefresh` authority), and an
24
+ additive idempotent doc migration.
25
+
26
+ ## Decision-point inventory
27
+
28
+ - `claudeCodeBuilder` argv (frameworkSessionLaunch.ts) — **modify** — adds `--model`
29
+ when a default is set; pass-through otherwise. No block/allow surface.
30
+ - `POST /sessions/restart-all` (routes.ts) — **add** — new action endpoint; delegates
31
+ to the existing `SessionRefresh` (does not add a new blocking authority).
32
+ - interactive `Session.model` recording (SessionManager.ts) — **modify** — stores the
33
+ effective launched model; observational, no decision logic.
34
+ - `migrateClaudeMd` awareness section (PostUpdateMigrator.ts) — **add** — additive,
35
+ idempotent, content-sniffed text backfill; no decision logic.
36
+
37
+ ## 1. Over-block
38
+
39
+ No block/allow surface — over-block not applicable. The only gating is the existing
40
+ `SessionRefresh` rate-guard (5/10min per session), reused unchanged; restart-all does
41
+ not add or alter any allow/deny logic. The Telegram-bound filter is an inclusion
42
+ filter (which sessions are eligible), not a rejection of legitimate input.
43
+
44
+ ## 2. Under-block
45
+
46
+ No block/allow surface — under-block not applicable. restart-all intentionally skips
47
+ non-Telegram-bound sessions (Slack/iMessage/headless) — reported transparently in the
48
+ `skipped` count, not silently dropped.
49
+
50
+ ## 3. Level-of-abstraction fit
51
+
52
+ restart-all sits at the right layer: it is a thin HTTP route that orchestrates the
53
+ existing, fully-tested `SessionRefresh` orchestrator (which owns kill+respawn,
54
+ rate-guarding, in-flight protection, and topic resolution). It does NOT re-implement
55
+ any of that — it loops the existing primitive with a stagger. The model-launch change
56
+ is at the builder layer where every other framework already applies `--model`. The
57
+ awareness change is documentation, delivered via the established `migrateClaudeMd`
58
+ mechanism. Nothing is at the wrong layer; no parallel re-implementation of an existing
59
+ primitive.
60
+
61
+ ## 4. Signal vs authority compliance
62
+
63
+ **Required reference:** docs/signal-vs-authority.md
64
+
65
+ - [x] No — this change has no block/allow surface (restart-all reuses the existing
66
+ `SessionRefresh` authority; the model record and the awareness section are signals/
67
+ documentation).
68
+
69
+ The model field on `GET /sessions` is a pure signal (observability). restart-all
70
+ carries the authority to kill+respawn, but that authority already exists in
71
+ `SessionRefresh` (used by `/sessions/refresh`); this change does not create a new
72
+ brittle authority — it reuses the smart, rate-guarded one. No brittle detector owns
73
+ blocking authority here.
74
+
75
+ ## 5. Interactions
76
+
77
+ - **Shadowing:** restart-all runs N independent single-refreshes; it neither shadows
78
+ nor is shadowed by other `/sessions/*` routes (it only reads the session list and
79
+ calls `SessionRefresh`).
80
+ - **Double-fire:** the in-flight guard inside `SessionRefresh` prevents a second
81
+ refresh of the same session firing before the first completes, so restart-all can't
82
+ double-restart a session even if called twice.
83
+ - **Races:** the target set is snapshot-time; a session spawned after the snapshot is
84
+ untouched (documented). The reaper interaction is NOT new — restart-all reuses the
85
+ exact shipped `/sessions/refresh` path; a freshly respawned session has current
86
+ activity (not idle-reapable) and the old session is marked `killed`.
87
+ - **Feedback loops:** none. restart-all is a one-shot operation; it does not feed a
88
+ system that re-triggers it.
89
+
90
+ ## 6. External surfaces
91
+
92
+ - **Other agents on the machine:** none — restart-all only acts on THIS agent's own
93
+ sessions (its own `state`/`SessionRefresh`).
94
+ - **Install base:** items 2 and 4 reach the fleet via update. Item 2 makes a
95
+ previously-inert config (`frameworkDefaultModels['claude-code']`) active — effect
96
+ appears only on a fresh session, only when the field is set, and is auditable via
97
+ `GET /sessions` (documented "activation safety"). Item 4 appends an idempotent
98
+ CLAUDE.md section.
99
+ - **External systems:** Telegram only insofar as restarted sessions resume their
100
+ Telegram-bound conversations via `claude --resume` — same as the existing single
101
+ refresh.
102
+ - **Persistent state:** the `Session` record now carries `model` for interactive
103
+ sessions (additive field); no schema migration needed (optional field already on the
104
+ `Session` type). The CLAUDE.md migration appends text idempotently.
105
+ - **Timing:** the restart-all stagger (500 + i·750 ms) spreads respawns; no fleet-wide
106
+ concurrency ceiling in v1 (per-session rate-guard is the aggregate backstop; named
107
+ as a known bound in the spec).
108
+
109
+ ## 7. Rollback cost
110
+
111
+ - **Hot-fix release:** pure code revert shipped as the next patch.
112
+ - **Data migration:** none — `Session.model` is an optional field already in the type;
113
+ reverting just stops populating it for interactive sessions.
114
+ - **Agent state repair:** none. The CLAUDE.md migration is idempotent and additive;
115
+ reverting the migrator leaves already-patched CLAUDE.md files harmlessly carrying the
116
+ section (no removal needed).
117
+ - **User visibility:** no user-visible regression during the rollback window. Item 2's
118
+ effect only manifests on a fresh session; reverting simply returns Claude sessions to
119
+ the CLI account default.
120
+
121
+ ## Conclusion
122
+
123
+ The review produced no design changes to PR A's code — the changes are additive and
124
+ reuse existing authorities. The convergence round refined the SPEC's documentation
125
+ (snapshot semantics, fleet bound, reaper-reuse, activation safety, idempotency
126
+ pattern). Clear to ship. Item 1 (token accounting) ships as the sibling PR B against
127
+ the same spec.
128
+
129
+ ## Second-pass review (if required)
130
+
131
+ **Reviewer:** 3 independent spec reviewers (design-correctness, safety/blast-radius,
132
+ completeness/standards-fit)
133
+ **Independent read of the artifact: concur**
134
+
135
+ All three reviewers' material findings were resolved in-spec; the two "item 1 not
136
+ implemented" criticals were a misunderstanding of the intended PR A / PR B phasing
137
+ (item 1 is PR B, tracked via `deferrals-tracked`). No structural redesign. See
138
+ `docs/specs/reports/iris-audit-session-observability-convergence.md`.
139
+
140
+ ## Evidence pointers
141
+
142
+ - `tests/unit/frameworkSessionLaunch.test.ts` — `--model` set/unset/tier/raw/with-resume.
143
+ - `tests/unit/sessions-restart-all-route.test.ts` — real Express route behavior.
144
+ - `tests/unit/PostUpdateMigrator-applyConfigToRunningSessions.test.ts` — migration idempotency.
145
+ - `tests/unit/feature-delivery-completeness.test.ts` — template↔migrator parity (green).
146
+ - `tsc --noEmit` clean; `pnpm build` clean.