instar 1.3.2021 → 1.3.2023

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.
@@ -650,6 +650,7 @@ class ChatsPage {
650
650
  this.view = null;
651
651
  if (!v) return;
652
652
  v.live = false;
653
+ if (v.historyWaitTimer) { clearTimeout(v.historyWaitTimer); this.timers.delete(v.historyWaitTimer); }
653
654
  if (v.abort) { try { v.abort.abort(); } catch { /* done */ } }
654
655
  this.revokeBlobs();
655
656
  if (this.observer) { try { this.observer.disconnect(); } catch { /* gone */ } this.observer = null; }
@@ -672,6 +673,11 @@ class ChatsPage {
672
673
  menu.append(rename, del);
673
674
  }
674
675
  v.msgs = el('div', { class: 'chat-messages', role: 'log', 'aria-live': 'polite' });
676
+ v.historyWords = el('p', { class: 'card-line chat-muted' });
677
+ v.historyRetry = el('button', { class: 'btn-quiet chat-history-retry', type: 'button', text: 'Try again', hidden: true });
678
+ v.historyRetry.addEventListener('click', () => this.loadFirst(v));
679
+ v.historyNotice = el('div', { class: 'chat-history-state', role: 'status' }, v.historyWords, v.historyRetry);
680
+ v.msgs.append(v.historyNotice);
675
681
  v.earlier = el('button', { class: 'btn-quiet chat-earlier', type: 'button', text: 'Earlier messages', hidden: true });
676
682
  v.earlier.addEventListener('click', () => { this.pauseSource(v); this.loadEarlier(v); });
677
683
  v.paused = el('p', { class: 'card-line chat-muted chat-paused', hidden: true, text: 'Live updates paused here — this conversation refreshes when you click into this window.' });
@@ -688,7 +694,7 @@ class ChatsPage {
688
694
  v.appStrip, v.pinBar, v.paused, v.sourceNotice, v.earlier, v.msgs, this.composer(v), v.statusLine));
689
695
  this.pageEl.classList.add('has-open');
690
696
  this.paintList();
691
- this.loadFirst(v);
697
+ this.loadFirst(v, { recoverUnfinished: true });
692
698
  this.loadAppStrip(v);
693
699
  this.announce();
694
700
  }
@@ -744,21 +750,71 @@ class ChatsPage {
744
750
  return (row) => Boolean(row && ((rec && row.originDeviceId && row.originDeviceId === rec.deviceId) || (row.messageId && this.ownIds.has(String(row.messageId)))));
745
751
  }
746
752
 
747
- async loadFirst(v) {
753
+ async loadFirst(v, { recoverUnfinished = false } = {}) {
754
+ if (!this.live || !v.live || this.view !== v || v.historyPending) return;
755
+ v.historyPending = true;
756
+ v.historyError = null;
757
+ v.historyWaiting = false;
758
+ this.paintHistoryState(v);
759
+ v.historyWaitTimer = this.later(() => {
760
+ if (!v.live || this.view !== v || !v.historyPending) return;
761
+ v.historyWaiting = true;
762
+ this.paintHistoryState(v);
763
+ }, 10_000);
748
764
  this.spent();
749
- const r = await this.call('GET', this.historyPath(v, { pool: true }));
750
- if (!v.live || r.gone) return;
751
- if (r.status === 404) { v.sourceNotice.hidden = true; v.statusLine.textContent = 'This conversation is not here any more.'; return; }
752
- if (!r.ok) { v.sourceNotice.hidden = true; v.statusLine.textContent = r.status === 503 ? OFF_TEXT : 'Couldn\'t load this conversation right now.'; return; }
753
- this.applyHistory(v, r.data, { replace: true });
754
- this.resumeUnfinished(v);
755
- this.scrollToEnd(v, true);
756
- v.historyReady = true;
757
- this.findSource(v);
765
+ try {
766
+ const r = await this.readHistory(v, this.historyPath(v, { pool: true }));
767
+ if (!this.live || !v.live || this.view !== v || r.gone) return;
768
+ if (!r.ok) {
769
+ v.sourceNotice.hidden = true;
770
+ v.historyError = r.status === 404 ? 'This conversation is not here any more.' : 'Couldn\'t load this conversation right now.';
771
+ return;
772
+ }
773
+ v.historyReady = true;
774
+ this.applyHistory(v, r.data, { replace: true });
775
+ // Preserve the existing open-time recovery; a history retry never resumes a send.
776
+ if (recoverUnfinished) this.resumeUnfinished(v);
777
+ this.scrollToEnd(v, true);
778
+ this.findSource(v);
779
+ } catch {
780
+ // A failed history read changes only its explanation, never messages or a draft.
781
+ if (this.live && v.live && this.view === v) v.historyError = 'Couldn\'t load this conversation right now.';
782
+ } finally {
783
+ v.historyPending = false;
784
+ clearTimeout(v.historyWaitTimer); this.timers.delete(v.historyWaitTimer);
785
+ v.historyWaitTimer = null;
786
+ if (this.live && v.live && this.view === v) this.paintHistoryState(v);
787
+ }
788
+ }
789
+
790
+ /** Initial, retry, focus and scheduled reads of one view/path share one signed request. */
791
+ readHistory(v, path) {
792
+ if (!v.historyReads) v.historyReads = new Map();
793
+ const current = v.historyReads.get(path);
794
+ if (current) return current;
795
+ const pending = this.call('GET', path).finally(() => {
796
+ if (v.historyReads.get(path) === pending) v.historyReads.delete(path);
797
+ });
798
+ v.historyReads.set(path, pending);
799
+ return pending;
800
+ }
801
+
802
+ paintHistoryState(v) {
803
+ if (!v.historyNotice) return;
804
+ const hasMessages = v.list.length > 0;
805
+ v.historyNotice.hidden = hasMessages && !v.historyError;
806
+ v.historyRetry.hidden = v.historyPending || (!v.historyError && hasMessages);
807
+ v.historyRetry.disabled = Boolean(v.historyPending);
808
+ if (v.historyError) v.historyWords.textContent = hasMessages
809
+ ? 'Couldn\'t refresh this conversation. Messages already loaded are still shown.' : v.historyError;
810
+ else if (v.historyPending) v.historyWords.textContent = v.historyWaiting
811
+ ? 'Waiting for the agent to return this conversation\'s messages. Your draft is unchanged.' : 'Loading messages…';
812
+ else v.historyWords.textContent = 'No messages were returned for this conversation. Try again to check its history.';
758
813
  }
759
814
 
760
815
  applyHistory(v, data, { replace = false, earlier = false } = {}) {
761
816
  if (!data) return;
817
+ v.historyError = null;
762
818
  if (v.ref.kind === 'slack' && typeof data.conversationKey === 'string') v.slackKey = data.conversationKey;
763
819
  const pins = pinsFrom(data);
764
820
  if (pins) this.setPins(v, pins);
@@ -831,6 +887,7 @@ class ChatsPage {
831
887
  }
832
888
  prev = n;
833
889
  }
890
+ this.paintHistoryState(v);
834
891
  if (atEnd) this.scrollToEnd(v);
835
892
  }
836
893
  scrollToEnd(v, force) {
@@ -1451,7 +1508,11 @@ class ChatsPage {
1451
1508
  // Snapshot the exact baseline sent: another tab's result may arrive while this read waits.
1452
1509
  const previous = task.mode === 'newest' ? this.quickPages.get(task.ref) || null : null;
1453
1510
  let r;
1454
- try { r = await this.call('GET', this.taskPath(task)); } catch { r = { ok: false, status: 0 }; }
1511
+ try {
1512
+ const path = this.taskPath(task);
1513
+ const v = this.view;
1514
+ r = v?.live && task.ref === refString(v.ref) ? await this.readHistory(v, path) : await this.call('GET', path);
1515
+ } catch { r = { ok: false, status: 0 }; }
1455
1516
  if (!this.live) return;
1456
1517
  this.scheduler.finish(task, now(), { status: r.status, retryAfterMs: r.retryAfterMs });
1457
1518
  if (r.gone) return;
@@ -1510,11 +1571,11 @@ class ChatsPage {
1510
1571
 
1511
1572
  /** The focused tab's conversation: read now (an operator-caused read, counted in the budget). */
1512
1573
  async pollNow(v) {
1513
- if (!v || !v.live) return;
1574
+ if (!v || !v.live || v.historyPending) return;
1514
1575
  const ref = refString(v.ref);
1515
1576
  if (this.leader && this.scheduler.tasks().some((t) => t.ref === ref && t.mode !== 'pool')) { this.scheduler.bump(ref, now()); this.loop(); return; }
1516
1577
  this.spent();
1517
- const r = await this.call('GET', this.historyPath(v, { pool: v.ref.kind !== 'slack' }));
1578
+ const r = await this.readHistory(v, this.historyPath(v, { pool: v.ref.kind !== 'slack' }));
1518
1579
  if (r.ok && v.live) this.applyHistory(v, r.data);
1519
1580
  }
1520
1581
  }
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "generatedFrom": "source-tree",
4
4
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
5
- "packageVersion": "1.3.2021",
5
+ "packageVersion": "1.3.2023",
6
6
  "guards": [
7
7
  {
8
8
  "ref": "docs/audits/phase-b/f10-triage.md",
@@ -1,5 +1,5 @@
1
1
  {
2
- "sha256": "6b904769f39bb2970b83c7790099f94495ff1b307637df9f7f2b5e4b22d3ecf1",
2
+ "sha256": "a67f69ad052cff80e97adde84d8632d98a7cbb5cd489cc99cd341ecb767b4da6",
3
3
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
4
- "packageVersion": "1.3.2021"
4
+ "packageVersion": "1.3.2023"
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.2021"
5
+ "packageVersion": "1.3.2023"
6
6
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.2021",
3
+ "version": "1.3.2023",
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",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-11-25T02:13:06.738Z",
5
- "instarVersion": "1.3.2021",
4
+ "generatedAt": "2026-11-25T02:45:30.714Z",
5
+ "instarVersion": "1.3.2023",
6
6
  "entryCount": 210,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "generatedFrom": "source-tree",
4
4
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
5
- "packageVersion": "1.3.2021",
5
+ "packageVersion": "1.3.2023",
6
6
  "guards": [
7
7
  {
8
8
  "ref": "docs/audits/phase-b/f10-triage.md",
@@ -1,5 +1,5 @@
1
1
  {
2
- "sha256": "6b904769f39bb2970b83c7790099f94495ff1b307637df9f7f2b5e4b22d3ecf1",
2
+ "sha256": "a67f69ad052cff80e97adde84d8632d98a7cbb5cd489cc99cd341ecb767b4da6",
3
3
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
4
- "packageVersion": "1.3.2021"
4
+ "packageVersion": "1.3.2023"
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.2021"
5
+ "packageVersion": "1.3.2023"
6
6
  }
@@ -0,0 +1,20 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Interactive dashboard chats explain loading, an empty history response and failed history reads. A pending read explains what it is waiting for after ten seconds. History retry preserves the draft and received messages, shares an identical pending read, and cannot resume an unfinished send. A successful background history read clears a stale failure notice. Existing initial-open send recovery remains separate.
9
+
10
+ ## What to Tell Your User
11
+
12
+ Opening a dashboard chat now explains whether messages are loading, none were returned, or the read failed. You can try the read again without losing your draft.
13
+
14
+ ## Summary of New Capabilities
15
+
16
+ No new capability or setting. This repairs the existing chat's loading, empty and failure states.
17
+
18
+ ## Evidence
19
+
20
+ Seven focused interactive-page regressions include actual delayed reads, empty and failed history, an eligible unfinished send, received messages during loading, background recovery, follower-first overlap and late results after navigation. The page/model files pass 98 tests. TypeScript and syntax checks pass; independent bounded source review concurs. A disposable browser exercise passed the five visible states and preserved the draft at desktop and phone sizes with invented data; no messages were sent. Complete verification and actual release remain separate.
@@ -0,0 +1,20 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The release publisher attempts dependency installation up to three times, waiting fifteen and thirty seconds between failed attempts. Exhaustion preserves the last command's failure status and stops the release. Package publication is not retried.
9
+
10
+ ## What to Tell Your User
11
+
12
+ None — internal change (no user-facing surface).
13
+
14
+ ## Summary of New Capabilities
15
+
16
+ None — internal change (no user-facing surface).
17
+
18
+ ## Evidence
19
+
20
+ Five focused tests execute the workflow's Bash block under GitHub's fail-fast options, covering success on every attempt, exhaustion, exit status and placement before the build. Independent review concurred. Complete Local Verify remains required before merge.
@@ -0,0 +1,41 @@
1
+ # Dashboard Chat History States: Side Effects
2
+
3
+ ## Summary
4
+
5
+ Tier 1 reversible repair of the existing interactive Chats page. Loading, empty response and failed read become visible; retry reads history. It introduces no send, enrollment, approval or merge authority. Accounts and held features are untouched. Source work is isolated from current cached main ec9401e5bdf28ed5ab1ff13f88e0032cc7895fc6.
6
+
7
+ ## Over-block
8
+
9
+ An existing pending history request prevents a second history retry or focus-triggered duplicate. It does not disable the composer or replace typed text. Navigation retains its normal behavior.
10
+
11
+ ## Under-block
12
+
13
+ These states do not repair missing server history or certify that an empty result is complete. Wording states what was returned. Real rendering and release proof remain separate.
14
+
15
+ ## Level of abstraction and signal versus authority
16
+
17
+ This is presentation of read outcomes, with request/view lifecycle invariants. No detector gains blocking authority. Existing browser signing, request limits, recovery and messaging authorities remain in place. Reference: docs/signal-vs-authority.md.
18
+
19
+ ## Interactions
20
+
21
+ Initial page recovery can resume existing unfinished work through its existing path. The new history-retry action must never invoke that path. Focus and background history share or defer to an existing read. Background successful history must clear a stale failure notice. Per-view timers and late responses cannot mutate another chat. Messages received before the initial result remain visible. Unrelated send/status text and the draft remain separate.
22
+
23
+ ## External surfaces
24
+
25
+ Visible chat-state wording and a retry button. The button uses the existing signed history GET. No new endpoint, browser approval, credentials, message write or server configuration. Static dashboard assets ship through the existing update path; no migration or new agent capability is introduced.
26
+
27
+ ## Multi-machine posture
28
+
29
+ The page continues reading the existing pooled history routes and cross-tab broadcast results. It does not create a new state store or infer completeness from a local empty response. View-only pending state is ephemeral browser UI, not durable agent state. No cross-machine ownership authority changes.
30
+
31
+ ## Rollback
32
+
33
+ Revert this page repair and its documentation/tests; no state migration is required. Session-storage unfinished messages are not deleted or rewritten by a history retry.
34
+
35
+ ## Verification and independent review
36
+
37
+ Initial three missing-state tests failed against the unchanged source; the old-view test already passed. The first candidate passed four focused cases. Independent Sol source review then found retry invoking send recovery, focus duplicating a read, and stale failure after background recovery. Actual seeded-send and background-recovery regressions failed on the first candidate, then passed after correction. A final review found the reverse overlap ordering; the corrected per-view/path promise map and focus-first regression address it. Final targeted page/model run: 98 passed, zero failures. TypeScript no-emit, JavaScript syntax and diff checks pass. The independent reviewer concurred with the bounded final source and artifact after three source passes; no extra review round is planned. A fresh headless Chromium1255 exercise on a disposable local server passed loading, ten-second waiting, empty, failed and retry/recovered states at1280x728 and390x844, preserving the draft. It verified14 signed history/event GETs, accounted for2 intentional503 history failures, accepted2 ephemeral read reports, made0 message/other writes and had0 JavaScript errors. The owned browser exited and its PID was absent. Root inspected the private captures. Initial fixture startup failures and a strict error-accounting failure are retained; the final fixture corrected its missing static import and read-report handling. This is narrow synthetic UI evidence, not live account history or whole-screen layout approval. Full suite is delegated to throughput, never claimed here.
38
+
39
+ ## Class-Closure Declaration
40
+
41
+ Defect class unbounded-self-action, closure n/a: no autonomous controller or new external action. The ten-second timer only changes explanation and is cancelled at view/read completion.
@@ -0,0 +1,45 @@
1
+ # Release Installation Retry Side Effects
2
+
3
+ ## Summary
4
+ Tier 1: narrow, reversible workflow repair. The Linux publisher's npm ci step gets three total attempts with 15 and 30 second waits. Five source and documentation files; one independent review round, no spec convergence required for Tier 1. Built from fresh origin/main, version 1.3.1989, remote https://github.com/JKHeadley/instar.git. One commit attempt planned.
5
+
6
+ ## Decision-point inventory
7
+ Modify dependency-install success handling in .github/workflows/publish.yml. The existing npm result remains authoritative; only two recovery attempts are added. No publishing or account-authority decision changes.
8
+
9
+ ## 1. Over-block
10
+ No newly rejected inputs. A consistently failing install still stops the release; permanent failures take two extra attempts and 45 seconds of backoff.
11
+
12
+ ## 2. Under-block
13
+ Persistent network failures still stop the release. Installation lifecycle scripts may execute three times; npm ci restores the dependency tree each time. This does not retry build, npm publish or the smoke test.
14
+
15
+ ## 3. Level-of-abstraction fit
16
+ The workflow owns its dependency preparation. An inline loop avoids a new downloaded action and preserves the existing command and lockfile.
17
+
18
+ ## 4. Signal vs authority compliance
19
+ Reference: docs/signal-vs-authority.md. No new heuristic authority: the command's concrete success or failure controls continuation, with the final failure status preserved. Warnings name the attempt and delay.
20
+
21
+ ## 4b. Judgment-point check
22
+ No new static heuristic at a competing-signals decision point. Three is an execution bound, not a classification of source or user intent.
23
+
24
+ ## 5. Interactions
25
+ The existing workflow concurrency group remains in force. The loop precedes the build and all publishing steps. No shared state, parallel retry or feedback loop is added. npm's own request retries remain possible within each npm ci execution.
26
+
27
+ ## 6. External surfaces
28
+ The registry may receive up to three installations per failed release preparation. Workflow logs expose failures and waits. Provenance and publishing permissions are unchanged.
29
+
30
+ ## 7. Multi-machine posture
31
+ GitHub-hosted release job only, by design. No agent-local or replicated state is introduced; all machines consume the same published package.
32
+
33
+ ## 8. Rollback cost
34
+ Revert the workflow change. No data migration, credential changes or local machine repair.
35
+
36
+ ## Verification and independent review
37
+ Five focused tests passed. Tests parse the actual workflow and execute its Bash block under -e -o pipefail, covering success on attempts one, two and three, exhausted failure and final status preservation, plus wiring before build and unchanged publication. Independent reviewer retry_review concurred and separately exercised all four behavior cases. Complete Local Verify is required before merging.
38
+
39
+ ## Second-pass review
40
+
41
+ **Reviewer:** /root/publisher_review
42
+
43
+ **Independent read of the artifact: concur**
44
+
45
+ The independent reviewer read the retry workflow and its bound side-effects artifact at 4af7df73541abd5506441fc182dfbe79b74ab45a. The review confirmed that the Linux dependency install makes at most three attempts, waits 15 and 30 seconds between failures, and returns the final status if installation still fails. Persistent failure stops the job before build or publication. The reviewer checked the five tests against the workflow shell and inspected the artifact hash. The publication command, permissions, credentials and concurrency configuration are unchanged. The reviewer did not rerun the tests.