instar 1.3.1983 → 1.3.1985

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 (33) hide show
  1. package/dist/core/QuotaAwareScheduler.d.ts.map +1 -1
  2. package/dist/core/QuotaAwareScheduler.js +4 -26
  3. package/dist/core/QuotaAwareScheduler.js.map +1 -1
  4. package/dist/core/SessionManager.d.ts.map +1 -1
  5. package/dist/core/SessionManager.js +473 -443
  6. package/dist/core/SessionManager.js.map +1 -1
  7. package/dist/core/SubscriptionPool.d.ts +2 -1
  8. package/dist/core/SubscriptionPool.d.ts.map +1 -1
  9. package/dist/core/SubscriptionPool.js +10 -3
  10. package/dist/core/SubscriptionPool.js.map +1 -1
  11. package/dist/core/UsageWallRescue.d.ts +2 -1
  12. package/dist/core/UsageWallRescue.d.ts.map +1 -1
  13. package/dist/core/UsageWallRescue.js +4 -3
  14. package/dist/core/UsageWallRescue.js.map +1 -1
  15. package/dist/core/windowAwareChoice.d.ts +3 -0
  16. package/dist/core/windowAwareChoice.d.ts.map +1 -1
  17. package/dist/core/windowAwareChoice.js +18 -20
  18. package/dist/core/windowAwareChoice.js.map +1 -1
  19. package/dist/data/standards-guard-index.json +1 -1
  20. package/dist/data/standards-guard-index.meta.json +2 -2
  21. package/dist/data/standards-registry.meta.json +1 -1
  22. package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
  23. package/dist/native/instar-desktop-host +0 -0
  24. package/package.json +1 -1
  25. package/src/data/awareness/codex-weekly-reset-routing.md +12 -0
  26. package/src/data/builtin-manifest.json +3 -3
  27. package/src/data/standards-guard-index.json +1 -1
  28. package/src/data/standards-guard-index.meta.json +2 -2
  29. package/src/data/standards-registry.meta.json +1 -1
  30. package/upgrades/1.3.1984.md +22 -0
  31. package/upgrades/1.3.1985.md +20 -0
  32. package/upgrades/side-effects/codex-weekly-reset-routing.md +77 -0
  33. package/upgrades/side-effects/internal-codex-reset-first.md +48 -0
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.1983",
3
+ "version": "1.3.1985",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: Codex Account Selection Before Weekly Reset
3
+ ---
4
+ New cloud Codex conversations use the local account pool just like background Codex work. Among accounts with room, a fresh, valid weekly reset date takes priority: use the allowance that expires first and keep later-reset accounts in reserve. A short-window reset constrains capacity; it is not the weekly spending deadline.
5
+
6
+ When someone asks which account is being used, read `GET /sessions` for its recorded account and `GET /subscription-pool` for that account's usage and reset. Do not infer a session's account from the pool's least-used entry or the default login. An old untagged session is still unattributed; do not invent a tag.
7
+
8
+ Explicit account choices and local-model launches keep their meaning. This repair adds no automatic restart of active conversations: existing work and refresh gates still apply, and placement is reconsidered on the next normal launch. An automatically moved resume whose saved conversation cannot be opened reports failure while preserving its rollout and pending message; it does not silently start a fresh conversation.
9
+
10
+ Internal Codex checks use this same weekly-reset ordering among their existing eligible local accounts. Equal or unknown deadlines retain their available-room tie-break. This does not change model choice or grant permission to enable scheduled jobs.
11
+
12
+ Missing or stale weekly reset observations stay unknown; they do not establish an urgent spending deadline.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-11-23T09:59:35.301Z",
5
- "instarVersion": "1.3.1983",
4
+ "generatedAt": "2026-11-23T14:52:54.807Z",
5
+ "instarVersion": "1.3.1985",
6
6
  "entryCount": 210,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -1604,7 +1604,7 @@
1604
1604
  "type": "subsystem",
1605
1605
  "domain": "sessions",
1606
1606
  "sourcePath": "src/core/SessionManager.ts",
1607
- "contentHash": "f21213adc91fc9378f9c604a1db4bcd70ab76d1b374d3aba757b7b6a921cad22",
1607
+ "contentHash": "617fd5da2007501d968d3c33dc7d463a882c600b6ff345d629ac1a7320823079",
1608
1608
  "since": "2025-01-01"
1609
1609
  },
1610
1610
  "subsystem:auto-updater": {
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "generatedFrom": "source-tree",
4
4
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
5
- "packageVersion": "1.3.1983",
5
+ "packageVersion": "1.3.1985",
6
6
  "guards": [
7
7
  {
8
8
  "ref": "docs/audits/phase-b/f10-triage.md",
@@ -1,5 +1,5 @@
1
1
  {
2
- "sha256": "d89e6d694d0c54d7786e16d79be398a87a91f95c5f15f36c614048414818b49c",
2
+ "sha256": "3be9ae3abfcb4086877b0237f9e1f3640bdd5fec2151bd5f2c123fe835c09cca",
3
3
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
4
- "packageVersion": "1.3.1983"
4
+ "packageVersion": "1.3.1985"
5
5
  }
@@ -2,5 +2,5 @@
2
2
  "sha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
3
3
  "articleCount": 102,
4
4
  "generatedFrom": "docs/STANDARDS-REGISTRY.md",
5
- "packageVersion": "1.3.1983"
5
+ "packageVersion": "1.3.1985"
6
6
  }
@@ -0,0 +1,22 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Interactive cloud Codex conversations now use the existing Codex account resolver, pass its actual home to launch and resume placement, and record the matching subscription account. Codex placement and reactive selection prefer the earliest fresh valid weekly reset among eligible accounts, then use their existing tie-breaks. Five-hour resets cannot override a different weekly spending deadline. Explicit account homes and local models remain separate from automatic selection.
9
+
10
+ If an automatically moved saved conversation cannot be placed or fails during startup, the session is reported failed, admission is released, and its saved rollout and pending message are retained instead of silently starting fresh. Account-selection refusals before tmux creation also release admission.
11
+
12
+ ## What to Tell Your User
13
+
14
+ New Codex conversations now use the account whose available weekly allowance expires first. Previously, ongoing chats could skip the account picker and stay on the computer's default login. Existing busy conversations are not restarted just to change accounts.
15
+
16
+ ## Summary of New Capabilities
17
+
18
+ None — this repairs existing Codex account placement and conversation continuity.
19
+
20
+ ## Evidence
21
+
22
+ Unit checks cover the displayed five-account case, weekly versus short-window deadlines, unknown or expired dates, explicit pins, local models, refusal cleanup and failed-resume preservation. HTTP integration and lifecycle checks use real pool/resolver/manager dependencies and prove the selected account and launch home agree. Normal complete Local Verify remains required; no published or live-install result is claimed by these targeted checks.
@@ -0,0 +1,20 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Internal Codex model calls now reuse the shared weekly reset preference after their existing account eligibility checks. Equal or unknown deadlines retain room ordering; other frameworks retain their prior behavior.
9
+
10
+ ## What to Tell Your User
11
+
12
+ Internal Codex checks now use available allowance that expires sooner before drawing on accounts that reset later.
13
+
14
+ ## Summary of New Capabilities
15
+
16
+ None. This repairs existing account selection.
17
+
18
+ ## Evidence
19
+
20
+ A regression reproduced the former reserve-first choice. Focused unit, real-child integration and durable-pool restart lifecycle checks pass. Complete verification and live installation are tracked separately.
@@ -0,0 +1,77 @@
1
+ # Side-Effects Review — Codex account selection by weekly expiration
2
+
3
+ **Version / slug:** `codex-weekly-reset-routing`
4
+ **Date:** 2026-11-22
5
+ **Author:** echo
6
+ **Second-pass reviewers:** reset_spec_safety, reset_spec_integration, reset_spec_completeness
7
+
8
+ ## Summary of the change
9
+
10
+ Tier 1: a reversible repair of existing account placement, with no credential writer, new endpoint, model change or new restart authority. Interactive cloud Codex now uses its existing resolver, launches in the selected home and records the matching account. Legacy and window-aware Codex selectors share weekly-expiration priority inside their existing eligibility floors. Automatically selected resumes preserve their saved thread or report a failure; account refusal and dead-startup paths release admission correctly.
11
+
12
+ The code changes four existing runtime modules plus an awareness entry. Unit, HTTP integration and lifecycle tests accompany them. The final narrow code received one independent multi-perspective review and a cleanup correction with concurrence. Planning effort was disproportionate to the final Tier 1 repair: a broader lifecycle-controller design was rejected, and its draft review tags are not reused or claimed as approval for this change.
13
+
14
+ ## Decision-point inventory
15
+
16
+ - Existing placement authority: prefer the earliest fresh valid Codex weekly deadline among eligible accounts. Claude ranking and all eligibility/headroom floors remain intact.
17
+ - Interactive Codex launch: use the existing Codex resolver when no explicit account home and no local provider were supplied. An orphan account label refuses before launch.
18
+ - Automatically moved resume: missing/failed placement or dead startup reports failure instead of silently starting a new thread. Existing explicit-home fallback behavior is unchanged.
19
+ - Admission cleanup: release before-tmux refusal slots, retain slots for a live created session, and mark a dead resumed session failed before releasing its slot.
20
+
21
+ ## 1. Over-block
22
+
23
+ No new quota threshold is introduced. An automatically selected resume that cannot locate or launch its saved conversation now refuses rather than opening an empty one. The pending bootstrap and original rollout remain for recovery. A local model skips paid-account placement. An explicit account label without a corresponding home refuses because it cannot truthfully identify the launched login.
24
+
25
+ ## 2. Under-block
26
+
27
+ This is account routing, not a full spending controller. Existing quota cutoffs, freshness windows and rescue behavior remain. It does not guarantee exact exhaustion at reset. Existing untagged conversations remain unattributed until a normal lifecycle launch selects an account; this change never invents tags or forces active work to move.
28
+
29
+ ## 3. Level-of-abstraction fit
30
+
31
+ The shared deadline comparator reads the existing window-state classifier; it does not fabricate reset dates or create another controller. The existing resolver remains the source of account/home selection. The interactive path consumes the same decision as the headless path, and the existing rollout placement carries the conversation.
32
+
33
+ ## 4. Signal vs authority compliance
34
+
35
+ Required reference: [Signal vs Authority](../../docs/signal-vs-authority.md). The comparator is a pure ordering input to existing placement authorities. No message/content filter, credential permission, new autonomous kill authority or parallel spending gate is added.
36
+
37
+ ## 4b. Judgment-point check
38
+
39
+ The routing preference implements the operator's explicit weekly-expiration objective, relayed in Chief handoffs 71371169-a65e-4031-affe-c183520ea6b9 and d37b61da-b101-4402-8bbf-59d1a2004b7e. Existing credential availability and headroom constraints remain deterministic floors. Task/model priority is not newly inferred by a heuristic here. No timer is given authority to interrupt work.
40
+
41
+ ## 5. Interactions
42
+
43
+ A short-window reset can still make an account ineligible but cannot outrank another account's different weekly deadline. Equal deadlines retain existing tie-breaks. Mixed-provider candidate sets retain the previous scoring order, avoiding a partial deadline order across providers. Unknown, stale or rolled weekly dates do not become urgent deadlines. Explicit homes remain dominant. Resolver-selected homes are passed consistently to launch, rollout placement and account-sensitive MCP planning.
44
+
45
+ The strict startup failure path marks persisted state failed and releases admission before throwing. It does not emit the event whose consumer would clear the saved resume ID, and it leaves pending injection custody intact. The outer admission cleanup only releases a pre-tmux failure; a live session's injection error cannot surrender its running recovery slot.
46
+
47
+ ## 6. External surfaces
48
+
49
+ New interactive cloud sessions now have real subscription-account tags and corresponding CODEX_HOME values. Existing conversations are not restarted by a new loop. Refusal or failed resume is visible rather than a false fresh-conversation success. No account login, token, configuration default or provider/model preference is changed by the source patch.
50
+
51
+ ## 6b. Operator-surface quality
52
+
53
+ The release note and overview describe the behavior in complete sentences. The awareness entry tells agents to distinguish session attribution from pool capacity and never describe an old untagged conversation as assigned to a particular pool account without evidence.
54
+
55
+ ## 7. Multi-machine posture
56
+
57
+ The policy ships through the normal release/update path on every machine. Eligible account homes are machine-local because credentials physically reside there; no credentials or live process state are replicated by this change.
58
+ machine-local-justification: physical-credential-locality
59
+
60
+ Existing owner routing determines which machine launches the conversation. Existing pool views expose account/reset observations. No independent per-machine notification source or new durable store is introduced. The new awareness file reaches new and updated agents through the existing awareness registry.
61
+
62
+ ## 8. Rollback cost
63
+
64
+ Revert the source change. Correctly tagged sessions and their CODEX_HOME remain supported by the old account-swap launch path; no schema or credential rollback is required. Copied rollout files preserve their originals. No configuration or account default was changed as a stopgap.
65
+
66
+ ## Evidence pointers
67
+
68
+ - `.instar/recovery/token-reset-routing/codex-related-unit.log`: 151 checks across seven related unit files passed on the Studio, including the new account-selection and lifecycle-refusal boundaries.
69
+ - `.instar/recovery/token-reset-routing/codex-integration-final.log` and `codex-e2e-final.log`: final targeted HTTP/lifecycle runs on the Studio; their recorded exits/counts are the evidence, not this prose.
70
+ - `.instar/recovery/token-reset-routing/codex-live-selector-comparison.json`: one fresh, read-only pool snapshot fed to both installed and corrected selectors. Installed headless choice: codex-sagemindai (9%, Thursday); corrected choice: codex-justin-gmail (20%, Tuesday). The Studio's default interactive login was separately observed as dawn. This comparison is not an installed-code or live-user-channel claim.
71
+ - Final mixed-provider delta review found no material findings; 78 related ordering checks passed. Final HTTP integration passed 7 checks and lifecycle passed 3 checks.
72
+ - Type checking and normal commit/push gates run before publication. Full normal Local Verify and a verified installed-session reply remain required before a live-success claim.
73
+
74
+
75
+ ## Critical rollout main alignment (2026-11-23)
76
+
77
+ The previous exact dcc90cfbb4d761ca35ec84620480ba227014e85a complete-gate attempt stopped during merge preparation against the actual merged prerequisite, before any tests ran. The only conflict is the shared ledger side-effects document: current main adds retained failure-history and alignment evidence. This merge preserves that document byte-for-byte from current main 6b331e26e and introduces no manual routing, test assertion, native-lock or timing change. The original preflight error is retained separately and is not called a test pass or failure. Independent reviewer reset_spec_integration confirmed the resolved document equals main blob dd55c946536506b464d16b1d02b89d16a1031c48 and no source/test differences from the automatic merge. The resolution is staged and no unmerged entries remain. The corrected head still requires a new normal complete gate.
@@ -0,0 +1,48 @@
1
+ # Side-Effects Review — Internal Codex Reset-First Selection
2
+
3
+ ## Summary
4
+ A Tier 1 reversible repair of the existing internal account picker. The shared comparator comes from prerequisite PR 3664. Existing account eligibility, provider choice, ambient fallback and sibling retry order are unchanged.
5
+
6
+ ## 1. Over-block
7
+ No new eligibility condition or refusal is added. Unknown or stale weekly deadlines lose ordering priority but remain eligible under the existing headroom rules.
8
+
9
+ ## 2. Under-block
10
+ This does not promise complete quota exhaustion, enforce a token budget, or prove every running session uses a named account. Full accounts remain excluded. No credentials or identities are synthesized.
11
+
12
+ ## 3. Level of abstraction
13
+ The picker reuses compareCodexWeeklyReset rather than copying date or freshness logic. Stable sorting retains existing room order for equal deadlines. Its dependency imports SubscriptionPool types only, so it does not introduce a runtime import cycle.
14
+
15
+ ## 4. Signal versus authority
16
+ The operator-authorized ordering preference feeds an existing account-selection authority. It grants no new launch, restart, credential, or shutdown authority. See ../../docs/signal-vs-authority.md.
17
+
18
+ ## 5. Interactions
19
+ Only internal Codex initial selection changes. Non-Codex ordering, sibling rescue selection, explicit provider overrides and the default-off account-selection configuration remain as before. The follow-through job stays disabled.
20
+
21
+ ## 6. Rollback
22
+ Revert this picker repair and its tests/docs; the account store schema and credentials are untouched. Parent PR 3664 remains an independently reviewed dependency.
23
+
24
+ ## 7. Evidence and review
25
+ The new unit regression failed before the source fix (reserve selected instead of sooner-reset account). After the fix: 26 unit, 4 real-provider integration and 1 durable-pool restart lifecycle test passed. Native CLI behavior and live installation are not claimed; tests use a local stand-in executable and make no model calls. Independent reviewer reset_spec_safety concurred with the production change and identified a lifecycle coverage gap. The test was corrected to persist distinct reset deadlines before reopening the pool. Normal complete verification remains required.
26
+
27
+
28
+ ## Prerequisite alignment for the critical rollout (2026-11-23)
29
+
30
+ This candidate merges corrected prerequisite 3664 at 1e13322bdbf10c3c3576adde59e07cb1313d003e, including current main 6b331e26e. The merge completed automatically with no conflict. The prerequisite correction preserves the already-merged ledger evidence artifact; it changes no routing or test assertions manually. This dependent alignment preserves the internal picker repair and introduces no new authority, credentials or schema. The prior 3664 merge-preparation error ran zero tests and is not replaced by the focused evidence. A new complete gate is still required for the corrected dependent head after its actual prerequisite merge.
31
+
32
+ Independent reviewer reset_spec_integration concurred: the alignment leaves internal picker source and all three related test files unchanged, with no manual assertions or lock changes. Fresh focused checks passed 26 unit, 4 real-child integration and 1 restart lifecycle test.
33
+
34
+
35
+ ## Missing audit coverage correction (2026-11-23)
36
+
37
+ The corrected candidate aa8957992 failed decision-audit CI: src/core/SubscriptionPool.ts lacked generated decision scope. The original new picker change was combined with a prerequisite merge commit; the substantive local gate intentionally exempts MERGE_HEAD integrations, which is not evidence for newly authored code in that merge. A normal non-merge commit now clarifies the existing eligibility-before-ordering contract and runs the actual substantive pre-commit gate on SubscriptionPool.ts. No audit JSON is hand-authored, no check is weakened, and no runtime logic or assertion changes. The prior CI failure is retained separately. Existing independent review and 26 unit, 4 integration and 1 lifecycle passes still cover the unchanged picker; the newly pushed head requires normal CI and complete verification after its prerequisite merges.
38
+
39
+ Independent reviewer reset_spec_integration confirmed this correction is comment-only and an honest coverage remedy if the real substantive gate generates the record; inspect the generated scope and new CI result before claiming closure. It does not retroactively make the original merge pass that gate.
40
+
41
+
42
+ ## Current-base awareness audit correction (2026-11-23)
43
+
44
+ After prerequisite 3664 actually merged, checking child b0f66bb3d against current main aa1f50b67876c8f66621c85df1bdbf145c0d66af exposed missing generated coverage for src/data/awareness/codex-weekly-reset-routing.md. Its earlier CI success was against pre-parent main 6b331e26, where an added prerequisite decision record covered this path. Once that record became part of main, it no longer counted as added child evidence. The old-base CI success remains true for that comparison; it is not current-base proof.
45
+
46
+ A useful awareness clarification now states that missing/stale weekly reset observations remain unknown. The actual normal substantive gate evaluates this awareness path and generates its own decision record. No audit scope is hand-authored and no runtime logic, assertion, native lock or timing threshold changes. Before the next exact-head handoff, run the CI-equivalent check against freshly fetched main for every changed in-scope path, not just the previously reported file. The current worker is reconciled by throughput through supported controls; no duplicate suite is started by the author.
47
+
48
+ Independent reviewer reset_spec_integration concurred: awareness-only staged source change, no runtime/test/lock/timing changes; validate the complete changed-path audit scope against freshly fetched main before push or closure.