instar 1.3.287 → 1.3.288

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.
@@ -1 +1 @@
1
- {"version":3,"file":"QuotaExhaustionDetector.d.ts","sourceRoot":"","sources":["../../src/monitoring/QuotaExhaustionDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAqB,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAiDlG;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,GAC7B,0BAA0B,CAkE5B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAYvI;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAc/E"}
1
+ {"version":3,"file":"QuotaExhaustionDetector.d.ts","sourceRoot":"","sources":["../../src/monitoring/QuotaExhaustionDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAqB,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAiElG;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,GAC7B,0BAA0B,CAkE5B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAkBvI;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAc/E"}
@@ -37,6 +37,20 @@ const CONTEXT_PATTERNS = [
37
37
  'error during compaction.*too long',
38
38
  'press esc twice to go up a few messages',
39
39
  ];
40
+ const NORMAL_COMPACTION_LIFECYCLE_PATTERNS = [
41
+ 'conversation compacted',
42
+ 'paused for context compaction',
43
+ 'context compaction.*resumed',
44
+ 'identity recovery.*post-compaction',
45
+ 'active projects.*post-compaction',
46
+ 'compaction recovery',
47
+ ];
48
+ const EXPLICIT_CONTEXT_EXHAUSTION_PATTERNS = [
49
+ 'conversation too long',
50
+ 'conversation is too long',
51
+ 'error during compaction',
52
+ 'press esc twice to go up a few messages',
53
+ ];
40
54
  const CRASH_PATTERNS = [
41
55
  'SIGABRT',
42
56
  'SIGSEGV',
@@ -128,6 +142,10 @@ export function detectContextExhaustion(tmuxOutput) {
128
142
  return { matched: false, pattern: null, confidence: 'medium' };
129
143
  }
130
144
  const output = tmuxOutput.toLowerCase();
145
+ if (matchPatterns(output, NORMAL_COMPACTION_LIFECYCLE_PATTERNS)
146
+ && !matchPatterns(output, EXPLICIT_CONTEXT_EXHAUSTION_PATTERNS)) {
147
+ return { matched: false, pattern: null, confidence: 'medium' };
148
+ }
131
149
  const match = matchPatterns(output, CONTEXT_PATTERNS);
132
150
  if (!match) {
133
151
  return { matched: false, pattern: null, confidence: 'medium' };
@@ -1 +1 @@
1
- {"version":3,"file":"QuotaExhaustionDetector.js","sourceRoot":"","sources":["../../src/monitoring/QuotaExhaustionDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,oCAAoC;AACpC,MAAM,cAAc,GAAG;IACrB,kBAAkB;IAClB,YAAY;IACZ,KAAK;IACL,iBAAiB;IACjB,cAAc;IACd,mBAAmB;IAC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,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1C,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,uDAAuD;YACvD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;gBAC3C,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"QuotaExhaustionDetector.js","sourceRoot":"","sources":["../../src/monitoring/QuotaExhaustionDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,oCAAoC;AACpC,MAAM,cAAc,GAAG;IACrB,kBAAkB;IAClB,YAAY;IACZ,KAAK;IACL,iBAAiB;IACjB,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,UAAU;IACV,SAAS;IACT,qBAAqB;CACtB,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACvB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,uBAAuB;IACvB,kBAAkB;IAClB,0BAA0B;IAC1B,uBAAuB;IACvB,mCAAmC;IACnC,yCAAyC;CAC1C,CAAC;AAEF,MAAM,oCAAoC,GAAG;IAC3C,wBAAwB;IACxB,+BAA+B;IAC/B,6BAA6B;IAC7B,oCAAoC;IACpC,kCAAkC;IAClC,qBAAqB;CACtB,CAAC;AAEF,MAAM,oCAAoC,GAAG;IAC3C,uBAAuB;IACvB,0BAA0B;IAC1B,yBAAyB;IACzB,yCAAyC;CAC1C,CAAC;AAEF,MAAM,cAAc,GAAG;IACrB,SAAS;IACT,SAAS;IACT,SAAS;IACT,aAAa;IACb,sBAAsB;IACtB,QAAQ;IACR,gBAAgB;IAChB,eAAe;IACf,WAAW;CACZ,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,eAAe;IACf,UAAU;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C,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;gBAC3C,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.287",
3
+ "version": "1.3.288",
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-06-05T10:43:22.902Z",
5
- "instarVersion": "1.3.287",
4
+ "generatedAt": "2026-06-05T10:47:44.969Z",
5
+ "instarVersion": "1.3.288",
6
6
  "entryCount": 198,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,26 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ `detectContextExhaustion` checks for known normal compaction lifecycle markers first. If such a marker is present and no explicit context-exhaustion failure phrase is present, the detector returns no match.
9
+
10
+ ## What to Tell Your User
11
+
12
+ Nothing user-facing. Instar should produce fewer false context-exhaustion recovery notices after ordinary compaction/resume lifecycle text.
13
+
14
+ ## Summary of New Capabilities
15
+
16
+ - The live context-exhaustion detector now excludes normal compaction lifecycle banners before applying broad context-limit matching.
17
+ - Real context-exhaustion failure text still detects, including the conversation-too-long and esc-twice variants.
18
+ - Regression tests cover normal resume banners, prompt banners, and the boundary where a normal banner also includes real failure text.
19
+
20
+ ## Evidence
21
+
22
+ Reproduction: normal compaction/resume text can include context and compaction wording even though the session has recovered normally.
23
+
24
+ Observed before: the detector had no normal-compaction exclusion, so broad context patterns could classify lifecycle text as context exhaustion.
25
+
26
+ Observed after: focused regression tests show normal compaction resume banners and `Conversation compacted` prompt banners return no match, while a compaction banner containing the real conversation-too-long failure still returns a high-confidence match.
@@ -0,0 +1,37 @@
1
+ # Side-Effects Review - context exhaustion compaction banner exclusion
2
+
3
+ **Version / slug:** `context-exhaustion-compaction-banner`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary
9
+
10
+ The live-session context-exhaustion detector now ignores normal compaction lifecycle banners unless the same output also contains explicit context-exhaustion failure text.
11
+
12
+ ## Signal Versus Authority
13
+
14
+ This is a detector-layer fix. It changes one signal from "context exhausted" to "not context exhausted" for normal compaction/resume banners. It does not add a new notification path, recovery authority, session action, or user-facing emitter. PresenceProxy and future emission-gate work remain the authorities that decide what to do with detector outputs.
15
+
16
+ ## Runtime Side Effects
17
+
18
+ - Normal compaction/resume banners no longer trigger context-exhaustion recovery as a false alarm.
19
+ - Real context-exhaustion errors still match when they contain explicit failure text such as conversation-too-long or the esc-twice instruction.
20
+ - The exclusion runs before broad context-limit matching, so lifecycle text with words like context and compaction does not trip the detector by accident.
21
+
22
+ ## Non-Effects
23
+
24
+ - No change to quota exhaustion detection.
25
+ - No change to session death classification.
26
+ - No change to compaction recovery, PromptGate, rate-limit recovery, or Telegram delivery.
27
+ - No config, persistence, route, schema, or migration changes.
28
+
29
+ ## Risk Review
30
+
31
+ Primary over-block risk: a real context-exhaustion error could be hidden if it appears next to a normal compaction banner. The implementation prevents that by checking explicit failure patterns before suppressing the match. The regression test covers a banner plus real failure text and expects high-confidence detection.
32
+
33
+ Primary under-block risk: a new normal compaction banner phrase not listed here may still false-positive. This patch covers the currently known lifecycle phrases without widening scope into a general notification gate.
34
+
35
+ ## Rollback
36
+
37
+ Remove the normal-compaction lifecycle pattern list and the early return in `detectContextExhaustion`, then remove the regression tests. No state repair is needed.