instar 1.3.809 → 1.3.811

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 (37) hide show
  1. package/dashboard/glance.js +533 -0
  2. package/dashboard/index.html +111 -97
  3. package/dist/commands/server.d.ts.map +1 -1
  4. package/dist/commands/server.js +9 -4
  5. package/dist/commands/server.js.map +1 -1
  6. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  7. package/dist/core/PostUpdateMigrator.js +6 -0
  8. package/dist/core/PostUpdateMigrator.js.map +1 -1
  9. package/dist/core/ProactiveSwapMonitor.d.ts.map +1 -1
  10. package/dist/core/ProactiveSwapMonitor.js +5 -1
  11. package/dist/core/ProactiveSwapMonitor.js.map +1 -1
  12. package/dist/core/QuotaAwareScheduler.d.ts +6 -2
  13. package/dist/core/QuotaAwareScheduler.d.ts.map +1 -1
  14. package/dist/core/QuotaAwareScheduler.js +16 -3
  15. package/dist/core/QuotaAwareScheduler.js.map +1 -1
  16. package/dist/core/QuotaPoller.d.ts +9 -1
  17. package/dist/core/QuotaPoller.d.ts.map +1 -1
  18. package/dist/core/QuotaPoller.js +42 -4
  19. package/dist/core/QuotaPoller.js.map +1 -1
  20. package/dist/core/SubscriptionAccountMetaReplicatedStore.js +1 -1
  21. package/dist/core/SubscriptionAccountMetaReplicatedStore.js.map +1 -1
  22. package/dist/core/SubscriptionPool.d.ts +1 -1
  23. package/dist/core/SubscriptionPool.d.ts.map +1 -1
  24. package/dist/core/SwapAntiThrash.d.ts.map +1 -1
  25. package/dist/core/SwapAntiThrash.js +4 -1
  26. package/dist/core/SwapAntiThrash.js.map +1 -1
  27. package/dist/scaffold/templates.d.ts.map +1 -1
  28. package/dist/scaffold/templates.js +1 -0
  29. package/dist/scaffold/templates.js.map +1 -1
  30. package/package.json +1 -1
  31. package/src/data/builtin-manifest.json +19 -19
  32. package/src/scaffold/templates.ts +1 -0
  33. package/upgrades/1.3.810.md +22 -0
  34. package/upgrades/1.3.811.md +53 -0
  35. package/upgrades/eli16/codex-quota-framework-safe.md +20 -0
  36. package/upgrades/side-effects/codex-quota-framework-safe.md +81 -0
  37. package/upgrades/side-effects/glance-floors-f10-f11.md +225 -0
@@ -0,0 +1,81 @@
1
+ # Side-Effects Review — Codex quota and framework-safe pool selection
2
+
3
+ **Version / slug:** `codex-quota-framework-safe`
4
+ **Date:** 2026-07-10
5
+ **Author:** Instar-codey
6
+ **Second-pass reviewer:** framework_guard_review
7
+
8
+ ## Summary of the change
9
+
10
+ `QuotaPoller` now reuses the existing Codex rollout reader for OpenAI/Codex accounts and persists five-hour/weekly `AccountQuotaSnapshot` values. `QuotaAwareScheduler`, `poolHeadroom`, `ProactiveSwapMonitor`, and `SwapAntiThrashEngine` constrain candidates to the source session/account framework. Server wiring supplies the active framework where available. Snapshot replication, awareness/migration, and three test tiers are updated.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - Codex quota poll eligibility — modify — Codex/OpenAI joins the existing supported-account set.
15
+ - Account placement/headroom selection — modify — optional session-framework constraint filters candidates.
16
+ - Reactive/proactive swap target selection — modify — source framework is carried or derived and cross-framework targets are refused.
17
+
18
+ ## 1. Over-block
19
+
20
+ A pool with spare quota only in a different framework is now correctly treated as having no usable alternate for the current session. That is intentional: those credentials cannot execute the session. An unknown source framework fails closed before selection.
21
+
22
+ ## 2. Under-block
23
+
24
+ A Codex account has no new snapshot until at least one rollout contains a rate-limit event. It remains degraded/unknown rather than fabricated. A malformed or unreadable rollout produces no snapshot and retries on the next cadence. When an idle account's latest event predates a known window reset, that expired window becomes 0% so an old 99% reading cannot strand it forever. The snapshot retains the rollout's original capture time, so another non-expired window never masquerades as freshly measured; proactive optimization remains conservative while reactive rescue can use the deterministic reset boundary.
25
+
26
+ ## 3. Level-of-abstraction fit
27
+
28
+ The poller owns normalized quota snapshots and calls the existing provider reader rather than parsing rollouts itself. The pure scheduler and anti-thrash selection layers own framework compatibility, ensuring every caller inherits the same guard.
29
+
30
+ ## 4. Signal vs authority compliance
31
+
32
+ Required reference: [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
33
+
34
+ - [x] No — this is a hard credential-compatibility invariant, not conversational judgment.
35
+
36
+ Provider/framework types are enumerated structural facts. Cross-framework execution is invalid, so deterministic filtering is the correct authority.
37
+
38
+ ## 5. Interactions
39
+
40
+ - **Shadowing:** framework filtering composes before quota scoring; an incompatible account never influences rank.
41
+ - **Double-fire:** Codex and Claude poll branches are mutually exclusive by provider/framework pair.
42
+ - **Races:** the existing pool update persistence and poll cadence are unchanged.
43
+ - **Feedback loops:** proactive selection and execute-time revalidation both enforce framework compatibility, so a stale intent cannot bypass the guard.
44
+
45
+ ## 6. External surfaces
46
+
47
+ Users see accurate Codex quota in existing pool/quota surfaces. Automated swaps may now correctly report no matching alternate instead of attempting a foreign credential home. No new endpoint, external network call, URL, or approval surface is introduced; Codex reads local rollout data only.
48
+
49
+ ## 6b. Operator-surface quality
50
+
51
+ No operator renderer/form change — not applicable.
52
+
53
+ ## 7. Multi-machine posture
54
+
55
+ **Replicated.** Codex quota uses the existing subscription-account metadata projection and coherence-journal path; the validator now accepts `codex-rollout` provenance. Selection remains machine-local execution truth because credential homes are local, while redacted quota metadata follows the pool. No user notices, topic-transfer state, or generated URLs are added.
56
+
57
+ ## 8. Rollback cost
58
+
59
+ Normal code rollback. Existing Codex snapshots are optional backward-compatible fields; older readers that reject the new provenance drop that optional projection rather than credentials. No credential writes or irreversible migrations occur.
60
+
61
+ ## Conclusion
62
+
63
+ The two required halves ship together: Codex becomes quota-visible only after every selection and swap chokepoint is framework-safe. The independent review also forced unknown-framework fail-closed behavior and post-reset rollover normalization. Existing Claude-only behavior is explicitly regression-tested. Clear to ship after full gates and CI.
64
+
65
+ ## Second-pass review
66
+
67
+ **Reviewer:** framework_guard_review
68
+
69
+ **Independent read: concur.** Concerns raised across two passes (unknown-framework fail-open, post-reset stale exhaustion, and mixed-window false freshness) were incorporated. The reviewer reran the focused unit/integration boundaries and confirmed the structural credential invariant now fails closed without falsifying snapshot freshness.
70
+
71
+ ## Evidence pointers
72
+
73
+ - `tests/unit/quota-poller.test.ts`
74
+ - `tests/unit/quota-aware-scheduler.test.ts`
75
+ - `tests/unit/swap-antithrash-engine.test.ts`
76
+ - `tests/integration/quota-framework-safety.integration.test.ts`
77
+ - `tests/e2e/subscription-quota-lifecycle.test.ts`
78
+
79
+ ## Class-Closure Declaration
80
+
81
+ No agent-authored-artifact defect and no new self-triggered controller — not applicable.
@@ -0,0 +1,225 @@
1
+ # Side-Effects Review — Dashboard glance floors F10/F11 (Phase 1)
2
+
3
+ **Version / slug:** `glance-floors-f10-f11`
4
+ **Date:** `2026-07-10`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required` (no block/allow, session-lifecycle, or gate/sentinel/guard surface — this is a display-only front-end component; see §5)
7
+
8
+ ## Summary of the change
9
+
10
+ Adds the two "glance floors" (F10 glance + F11 universal drill-down) to the Dashboard
11
+ UX Standard and ships their enforcement: one shared front-end component
12
+ `dashboard/glance.js` (a plain-English headline + ≤5 labeled tiles + a drill-down
13
+ container that opens a filtered list then a full record), a pure `validateGlanceSpec`
14
+ that refuses an over-budget or jargon-carrying glance, and three test tiers
15
+ (unit F10 + F11, integration against the real `/commitments` route, e2e feature-alive).
16
+ One view — the Commitments tab — is wired onto the component as the reference
17
+ implementation (glance layer → existing list as Layer 2 → full record as Layer 3).
18
+ Files: `docs/specs/dashboard-ux-standard.md` (+ `.eli16.md` + convergence report),
19
+ `docs/STANDARDS-REGISTRY.md`, `dashboard/glance.js` (new), `dashboard/index.html`
20
+ (Commitments panel markup + CSS + `loadCommitments` rewrite), and four test files.
21
+ **No `src/*.ts` change, no new server route, no config, no hooks.**
22
+
23
+ ## Decision-point inventory
24
+
25
+ **No decision-point surface.** Nothing here gates information flow, blocks actions,
26
+ filters messages, or constrains agent behavior. `validateGlanceSpec` is a build-time
27
+ quality assertion over component-authored UI copy — it decides how a dashboard tab
28
+ *renders*, never what the agent may do. The one "refusal" (the component refusing to
29
+ render an over-budget/jargon glance) affects presentation only and falls back to an
30
+ honest degraded glance, never a raw dump — it holds no authority over any pipeline.
31
+
32
+ - `validateGlanceSpec` (dashboard/glance.js) — add — a pure UI-copy budget/jargon
33
+ check; presentation-only, no runtime authority.
34
+
35
+ ---
36
+
37
+ ## 1. Over-block
38
+
39
+ **No block/allow surface — over-block not applicable.** The nearest analog is the
40
+ jargon check possibly rejecting legitimate glance copy. It is scoped to
41
+ *component-authored* Layer-1 strings only (headline + tile labels + values); agent/
42
+ user free text lives at Layer 2/3 and is displayed (sanitized), never vocab-gated — so
43
+ a user phrasing a promise with jargon can never blank the operator's glance. If the
44
+ check does reject a builder's copy, the component renders an honest degraded glance
45
+ (truncated headline + a drill), never a raw dump — no operator-visible data is lost.
46
+
47
+ ---
48
+
49
+ ## 2. Under-block
50
+
51
+ **No block/allow surface — under-block not applicable.** As a readability floor the
52
+ jargon detector is deliberately heuristic (it is NOT a secret-redaction boundary —
53
+ secret handling stays at the API/data layer, untouched here). It can miss novel
54
+ concept-jargon expressed in ordinary words; that residual is a tracked later-phase
55
+ tightening, and the curated insider-TERM denylist + form heuristics cover the known
56
+ classes (internal IDs, machine ids, config keys, cadences, state-machine names) with
57
+ bypass-variant tests.
58
+
59
+ ---
60
+
61
+ ## 3. Level-of-abstraction fit
62
+
63
+ Right layer. F10/F11 are enforced at the **component boundary** (a shared renderer +
64
+ a pure validator), not by scraping bespoke per-tab markup — because the glance content
65
+ is JS-rendered from live data, a static grep of `index.html` cannot see it, so the
66
+ component is the correct place to make the floor structural. The component REUSES the
67
+ existing lower-level primitives instead of re-implementing them: `sanitizeForDisplay`,
68
+ `hasOpenInteraction`, and `updateCountdowns` are imported from `dashboard/subscriptions.js`
69
+ (the shipped F9 safety + interaction-hold bar), so both surfaces share one contract.
70
+
71
+ ---
72
+
73
+ ## 4. Signal vs authority compliance
74
+
75
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
76
+
77
+ - [x] No — this change has no block/allow surface.
78
+
79
+ `validateGlanceSpec` is a build-time/presentation quality check with no blocking
80
+ authority over any runtime pipeline. It informs how a tab renders (and, in the tests,
81
+ fails CI on a NEW below-floor tab) — it never gates a message, action, session, or
82
+ information flow. There is no brittle detector holding runtime authority here.
83
+
84
+ ---
85
+
86
+ ## 5. Interactions
87
+
88
+ - **Shadowing:** none. The glance component is additive; it renders into a new
89
+ `#commitmentsGlance` container. It does not run before/after any check.
90
+ - **Double-fire:** none. `loadCommitments` replaces (never appends) the glance root
91
+ and the drill container, so repeated renders/polls cannot accumulate DOM or listeners.
92
+ - **Races:** F9-composed. While a drill interaction is open (the drill container carries
93
+ `data-interaction-open`, or a field is focused/dirty), a re-render MERGES live counts
94
+ via `patchGlanceCounts` instead of rebuilding over the interaction — reusing the shipped
95
+ `hasOpenInteraction`. The Commitments tab has no background poll today, so this is
96
+ latent-but-correct (and unit-tested), and will already be right if a poll is added.
97
+ - **Feedback loops:** none — a pure renderer over data the tab already fetched.
98
+
99
+ ---
100
+
101
+ ## 6. External surfaces
102
+
103
+ - **Other agents / users / external systems:** none. `dashboard/glance.js` is a
104
+ client-side ESM module served statically; it holds no secrets, opens no endpoint, and
105
+ makes no network call of its own (the Commitments reference reuses the EXISTING authed
106
+ `/commitments` GET and the EXISTING `/commitments/:id/deliver` POST).
107
+ - **Persistent state:** none touched.
108
+ - **Operator surface (Mobile-Complete):** the operator actions on this surface (view
109
+ promises, drill in, mark delivered) are all completable from the dashboard, which is
110
+ phone-reachable via the tunnel + PIN — no new laptop-bound step. The "Mark delivered"
111
+ action lives on the Layer-3 record and calls the existing authed route.
112
+
113
+ ---
114
+
115
+ ## 6b. Operator-surface quality (Operator-Surface Quality standard)
116
+
117
+ This change touches an operator surface (`dashboard/glance.js`, `dashboard/index.html`).
118
+ The glance floors ARE the whole-view structural application of this standard.
119
+
120
+ 1. **Leads with the primary action?** Yes. On arrival the Commitments tab shows the
121
+ headline answer ("I'm carrying N open promises; K need attention soon, none overdue.")
122
+ and the big labeled tiles — the state and the way in, visible immediately, no toggle,
123
+ no below-the-fold, no explanatory prose in front.
124
+ 2. **Zero raw internals as primary content?** Yes — enforced by F10 itself. No internal
125
+ IDs, state-machine names, config keys, or seconds-cadences may appear at the glance
126
+ layer (a machine-checked rule). The raw detail (`CMT-953`, `cadence 1800s`, timestamps)
127
+ lives at Layer 3, one click down, where it belongs — verified in a real browser (tile →
128
+ list → record).
129
+ 3. **Destructive actions de-emphasized?** N/a-leaning: the only action is the constructive
130
+ "Mark delivered", placed on the Layer-3 record (not above the glance). There is no
131
+ destructive control on this surface; nothing louder than the primary path.
132
+ 4. **Plain language + phone width?** Yes. Copy reads the way a person would say it
133
+ ("Waiting on you", "Due soon", "Quiet"). Tiles use an auto-fit grid that reflows at
134
+ phone width; the drill list/records stack; nothing scrolls the page sideways (records
135
+ use `word-break`/`overflow-wrap`). Verified visually at 900px and via the responsive
136
+ grid.
137
+
138
+ ---
139
+
140
+ ## 7. Multi-machine posture (Cross-Machine Coherence)
141
+
142
+ **machine-local BY DESIGN → effectively `unified` by construction.** `dashboard/glance.js`
143
+ is a **stateless client-side renderer**: it persists nothing, reads no config, holds no
144
+ server state, and introduces no machine-divergent state. It renders whatever data the
145
+ adopting tab already fetched and inherits that endpoint's existing posture — the
146
+ Commitments reference drills into `GET /commitments`, whose pool-scope posture
147
+ (`?scope=mesh`) is unchanged by this PR. So there is no new machine-local surface to
148
+ justify and no `machine-local-justification` marker is required.
149
+
150
+ - **User-facing notices:** none emitted (a passive render surface — one-voice gating n/a).
151
+ - **Durable state:** none held (nothing strands on topic transfer).
152
+ - **Generated URLs:** none (no links minted that must survive a machine boundary).
153
+
154
+ **Migration Parity:** met by construction. The dashboard ships wholesale via
155
+ `express.static(dashboardDir)` from the installed package directory (`package.json`
156
+ `files` includes `dashboard/`; `AgentServer.resolveDashboardDir` resolves to the package
157
+ root, not the agent home). A package update replaces `dashboard/glance.js` + updated
158
+ `index.html` on the normal update path — exactly as `dashboard/subscriptions.js` shipped —
159
+ so already-deployed agents receive the glance with **no `PostUpdateMigrator` entry** and
160
+ no `init`-only templating. `loadCommitments` loads `glance.js` through the same `try/catch`
161
+ dynamic-import guard the other tabs use, so a missing/failed module degrades the tab
162
+ gracefully. **Agent Awareness:** n/a — this is an internal dashboard UX/dev standard (how
163
+ a view renders), not a new operator-invocable capability/route/config/hook; the awareness
164
+ surface is `STANDARDS-REGISTRY.md` (nine → eleven floors), already updated.
165
+
166
+ ---
167
+
168
+ ## 8. Rollback cost
169
+
170
+ **Pure front-end change — revert and ship a patch.** No persistent state, no data
171
+ migration, no agent-state repair. `dashboard/glance.js` and the `index.html` edits are
172
+ replaced wholesale on the next package update; reverting the commit restores the prior
173
+ Commitments renderer. No user-visible regression during the rollback window (the tab
174
+ simply reverts to its previous look). The new tests would revert with the code.
175
+
176
+ ---
177
+
178
+ ## Conclusion
179
+
180
+ This review produced no blocking concerns. The change is display-only with no
181
+ decision-point, block/allow, session-lifecycle, or gate/sentinel surface, so no
182
+ second-pass review is required. The design was materially hardened by /spec-converge
183
+ (a six-angle internal panel + the code-backed Standards-Conformance Gate + an external
184
+ Gemini pass across three rounds): the Layer-1-is-100%-component-authored invariant that
185
+ makes the jargon check both safe and complete; the XSS/display-safety contract reusing
186
+ the shipped `sanitizeForDisplay`; bypass-resistant vocab detection; the honest-degraded
187
+ (never raw-dump) failure mode; a strengthened F11 (non-vacuous, distinct, tile→list→record,
188
+ XSS + dead-end negatives); the structural grandfather ratchet (completeness + monotonic
189
+ ceiling); the one-population honest tile→server-field derivation with a count-truthfulness
190
+ test; and all three test tiers. Verified live in a real browser (Playwright): the
191
+ Commitments glance renders headline + tiles, and drilling opens the filtered list then the
192
+ full record with the raw IDs/cadence correctly one click down. Clear to ship.
193
+
194
+ ---
195
+
196
+ ## Second-pass review (if required)
197
+
198
+ **Reviewer:** not required — no block/allow, messaging-dispatch, session-lifecycle,
199
+ compaction, coherence/idempotency/trust, or sentinel/guard/gate/watchdog surface (Phase-5
200
+ triggers). Display-only front-end component.
201
+
202
+ ---
203
+
204
+ ## Evidence pointers
205
+
206
+ - Unit: `tests/unit/dashboard-glance-word-budget.test.ts` (31 tests — F10 budget/jargon +
207
+ bypass variants + adversarial-fixture conformance + count-truthfulness + the ratchet),
208
+ `tests/unit/dashboard-glance-drilldown.test.ts` (8 tests — F11 walk, Layer-2→3, negatives,
209
+ F9 hold, XSS).
210
+ - Integration: `tests/integration/glance-commitments-tab.test.ts` (glance built + walked
211
+ against a real `GET /commitments` HTTP response with a live `CommitmentTracker`).
212
+ - E2E: `tests/e2e/glance-commitments-tab-lifecycle.test.ts` (feature-alive: 200 not 503,
213
+ feature ON/OFF, full render, no `<script>` survives).
214
+ - Live: Playwright render of the reference glance — headline "I'm carrying 5 open
215
+ promises; 2 need attention soon, none overdue.", 4 tiles, tile→list (2 rows)→record
216
+ (`id: CMT-953`, `cadence: 1800s` at Layer 3 only).
217
+ - Spec convergence report: `docs/specs/reports/dashboard-ux-standard-convergence.md`.
218
+
219
+ ---
220
+
221
+ ## Class-Closure Declaration (display-only mirror)
222
+
223
+ No agent-authored-artifact defect and no self-triggered controller (no loop / monitor /
224
+ sentinel / reaper / scheduler / recovery path that fires a restart / swap / respawn /
225
+ spawn / notify / retry / re-drive / kill) — **not applicable**.