@cortexkit/magic-context 0.49.63 → 0.49.65

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 (2) hide show
  1. package/dist/index.js +119 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34723,8 +34723,100 @@ var init_storage_reasoning_removal = __esm(async () => {
34723
34723
  });
34724
34724
 
34725
34725
  // ../plugin/src/features/magic-context/overflow-detection.ts
34726
- var PREFIX_BOUND_THINKING_MODELS, PREFIX_BOUND_THINKING_PATTERN;
34726
+ function overflowPattern(strings, ...fragments) {
34727
+ return new RegExp(String.raw(strings, ...fragments), "i");
34728
+ }
34729
+ var TOKEN_COUNT, ESTIMATED_REQUEST, OVERFLOW_PATTERNS, LIMIT_EXTRACTION_PATTERNS, PREFIX_BOUND_THINKING_MODELS, PREFIX_BOUND_THINKING_PATTERN, INPUT_EXTRACTION_PATTERNS;
34727
34730
  var init_overflow_detection = __esm(() => {
34731
+ TOKEN_COUNT = String.raw`(?<![\d+_-])(?:\d+(?:[,_ .\u202f]+\d+)*(?=\s*tokens?\b)|\d+(?:[,_ \u202f]+\d+)*)(?!\w|[,_\s.]+\d)`;
34732
+ ESTIMATED_REQUEST = String.raw`\bthis request has an estimated\b`;
34733
+ OVERFLOW_PATTERNS = [
34734
+ /prompt is too long/i,
34735
+ /input is too long for requested model/i,
34736
+ /exceeds the context window/i,
34737
+ /input token count.*exceeds the maximum/i,
34738
+ /maximum prompt length is \d+/i,
34739
+ /reduce the length of the messages/i,
34740
+ overflowPattern`maximum context length is ${TOKEN_COUNT} tokens?\b`,
34741
+ /maximum model length is \d+/i,
34742
+ /exceeds the limit of \d+/i,
34743
+ /exceeds the available context size/i,
34744
+ /greater than the context length/i,
34745
+ /context window exceeds limit/i,
34746
+ /exceeded model token limit/i,
34747
+ /context[_ ]length[_ ]exceeded/i,
34748
+ /request entity too large/i,
34749
+ overflowPattern`context length is only ${TOKEN_COUNT} tokens?\b`,
34750
+ /input length.*exceeds.*context length/i,
34751
+ /\bContextWindowExceededError\b/i,
34752
+ overflowPattern`\bthe input \(${TOKEN_COUNT} tokens?\) is longer than the model's context length \(${TOKEN_COUNT} tokens?\)`,
34753
+ /prompt too long; exceeded (?:max )?context length/i,
34754
+ overflowPattern`too large for model with ${TOKEN_COUNT} maximum context length`,
34755
+ /model_context_window_exceeded/i,
34756
+ /context size has been exceeded/i,
34757
+ /prepared prompt exceeds engine max_context/i,
34758
+ /prompt exceeds (?:the )?.{0,32}\bmax_context\b/i
34759
+ ];
34760
+ LIMIT_EXTRACTION_PATTERNS = [
34761
+ {
34762
+ pattern: overflowPattern`maximum prompt length is (${TOKEN_COUNT})`,
34763
+ provenance: "prompt_only"
34764
+ },
34765
+ {
34766
+ pattern: overflowPattern`maximum context length is (${TOKEN_COUNT}) tokens?\b`,
34767
+ provenance: "combined"
34768
+ },
34769
+ { pattern: overflowPattern`maximum model length is (${TOKEN_COUNT})`, provenance: "combined" },
34770
+ {
34771
+ pattern: overflowPattern`context length is only (${TOKEN_COUNT}) tokens?\b`,
34772
+ provenance: "combined"
34773
+ },
34774
+ { pattern: overflowPattern`exceeds the limit of (${TOKEN_COUNT})`, provenance: "unknown" },
34775
+ {
34776
+ pattern: overflowPattern`too large for model with (${TOKEN_COUNT}) maximum context length`,
34777
+ provenance: "combined"
34778
+ },
34779
+ {
34780
+ pattern: overflowPattern`context size[^0-9]{0,40}(${TOKEN_COUNT})\s*tokens?\b`,
34781
+ provenance: "combined"
34782
+ },
34783
+ {
34784
+ pattern: overflowPattern`exceeds? the context length of (${TOKEN_COUNT})`,
34785
+ provenance: "combined"
34786
+ },
34787
+ {
34788
+ pattern: overflowPattern`\bthe input \(${TOKEN_COUNT} tokens?\) is longer than the model's context length \((${TOKEN_COUNT}) tokens?\)`,
34789
+ provenance: "combined"
34790
+ },
34791
+ {
34792
+ pattern: overflowPattern`>\s*(${TOKEN_COUNT})\s*(?:tokens?\s*)?(?:maximum|max|limit)\b`,
34793
+ provenance: "prompt_only"
34794
+ },
34795
+ {
34796
+ pattern: overflowPattern`maximum number of tokens allowed\s*\(?\s*(${TOKEN_COUNT})`,
34797
+ provenance: "prompt_only"
34798
+ },
34799
+ {
34800
+ pattern: overflowPattern`prepared prompt exceeds engine max_context\s+(${TOKEN_COUNT})`,
34801
+ provenance: "unknown"
34802
+ },
34803
+ {
34804
+ pattern: overflowPattern`prompt exceeds (?:the )?.{0,32}\bmax_context\s+(${TOKEN_COUNT})`,
34805
+ provenance: "unknown"
34806
+ },
34807
+ {
34808
+ pattern: overflowPattern`\ballows a context of up to (${TOKEN_COUNT}) tokens?\b`,
34809
+ provenance: "combined"
34810
+ },
34811
+ {
34812
+ pattern: overflowPattern`(?<!${ESTIMATED_REQUEST}\s+)\bup to (${TOKEN_COUNT}) tokens?\b`,
34813
+ provenance: "unknown"
34814
+ },
34815
+ {
34816
+ pattern: overflowPattern`max(?:imum)?.*context(?:(?!${ESTIMATED_REQUEST})[^\d\r\n])*(${TOKEN_COUNT})`,
34817
+ provenance: "unknown"
34818
+ }
34819
+ ];
34728
34820
  PREFIX_BOUND_THINKING_MODELS = [
34729
34821
  ["fable", 5, 1],
34730
34822
  ["fable", 5, 2],
@@ -34735,6 +34827,16 @@ var init_overflow_detection = __esm(() => {
34735
34827
  ["haiku", 5, 5]
34736
34828
  ];
34737
34829
  PREFIX_BOUND_THINKING_PATTERN = new RegExp(`(?:^|[-_.:/])(?:${PREFIX_BOUND_THINKING_MODELS.map(([family, major, minor]) => `${family}[-_.]?${major}[-_.]${minor}`).join("|")})(?:$|[-_.:/@])`, "i");
34830
+ INPUT_EXTRACTION_PATTERNS = [
34831
+ overflowPattern`prompt is too long:\s*(${TOKEN_COUNT})`,
34832
+ overflowPattern`input token count\s*\(?\s*(${TOKEN_COUNT})`,
34833
+ overflowPattern`input length\s*(${TOKEN_COUNT})`,
34834
+ overflowPattern`prompt was\s*(${TOKEN_COUNT})`,
34835
+ overflowPattern`messages resulted in\s*(${TOKEN_COUNT})\s*tokens?\b`,
34836
+ overflowPattern`\bthe input \((${TOKEN_COUNT}) tokens?\) is longer than the model's context length \(${TOKEN_COUNT} tokens?\)`,
34837
+ overflowPattern`\(\s*(${TOKEN_COUNT})\s+in the messages,\s*${TOKEN_COUNT}\s+in the completion\s*\)`,
34838
+ overflowPattern`${ESTIMATED_REQUEST}\s+(${TOKEN_COUNT})`
34839
+ ];
34738
34840
  });
34739
34841
 
34740
34842
  // ../plugin/src/hooks/magic-context/sentinel.ts
@@ -34882,7 +34984,7 @@ function pickNearestPriorOwner(candidates, currentMessageId, times) {
34882
34984
  }
34883
34985
  return best?.id ?? null;
34884
34986
  }
34885
- var insertTagStatements, updateTagStatusStatements, updateTagDropModeStatements, updateTagMessageIdStatements, getTagNumbersByMessageIdStatements, deleteTagsByMessageIdStatements, getMaxTagNumberBySessionStatements, getTagNumberByMessageIdStatements, getAssignableTagNumberByMessageIdStatements, hasPiFallbackMessageTagStatements, updateTagByteSizeStatements, updateTagInputByteSizeStatements, recentTagOwnerStatements, RECLAIM_HINT_EXCLUDED_TOOLS, getActiveToolTagsForAgeReclaimStatements, scopedActiveTokenTotalStatements, updateTagTokenCountStatements, updateTagInputTokenCountStatements, tagOwnerSummaries, TAG_OWNER_COLUMNS = "id, type, message_id, tool_owner_message_id, tag_number, reasoning_token_count", TAG_OWNER_APPENDED_WITH_SHAPE_SQL, droppedTagStatements, inertWhitespaceStatements, inertWhitespaceByNumberStatements, foldStatements, getOwnerScopedToolTagNumbersStatements, getMinMessageTagNumberForRawIdStatements, getActiveTagsBySessionStatements, getNullOwnerToolTagsBySessionStatements, getDroppedTagsBySessionStatements, getMaxDroppedTagNumberStatements, newestToolTagNumberStatements, droppedNumberStatements, tagByIdStatements, getToolTagNumberByOwnerStatements, getNullOwnerToolTagStatements, adoptNullOwnerToolTagStatements, getToolOwnerByTagIdStatements, deleteToolTagsByOwnerStatements;
34987
+ var insertTagStatements, updateTagStatusStatements, updateTagDropModeStatements, updateTagMessageIdStatements, getTagNumbersByMessageIdStatements, deleteTagsByMessageIdStatements, getMaxTagNumberBySessionStatements, getTagNumberByMessageIdStatements, getAssignableTagNumberByMessageIdStatements, hasPiFallbackMessageTagStatements, updateTagByteSizeStatements, updateTagInputByteSizeStatements, recentTagOwnerStatements, RECLAIM_HINT_EXCLUDED_TOOLS, getActiveToolTagsForAgeReclaimStatements, scopedActiveTokenTotalStatements, updateTagTokenCountStatements, setTagTokenCountStatements, updateTagInputTokenCountStatements, tagOwnerSummaries, TAG_OWNER_COLUMNS = "id, type, message_id, tool_owner_message_id, tag_number, reasoning_token_count", TAG_OWNER_APPENDED_WITH_SHAPE_SQL, droppedTagStatements, inertWhitespaceStatements, inertWhitespaceByNumberStatements, foldStatements, getOwnerScopedToolTagNumbersStatements, getMinMessageTagNumberForRawIdStatements, getActiveTagsBySessionStatements, getNullOwnerToolTagsBySessionStatements, getDroppedTagsBySessionStatements, getMaxDroppedTagNumberStatements, newestToolTagNumberStatements, droppedNumberStatements, tagByIdStatements, getToolTagNumberByOwnerStatements, getNullOwnerToolTagStatements, adoptNullOwnerToolTagStatements, getToolOwnerByTagIdStatements, deleteToolTagsByOwnerStatements;
34886
34988
  var init_storage_tags = __esm(async () => {
34887
34989
  init_tag_owner_id();
34888
34990
  init_migration_v95_perf_indexes();
@@ -34918,6 +35020,7 @@ var init_storage_tags = __esm(async () => {
34918
35020
  getActiveToolTagsForAgeReclaimStatements = new WeakMap;
34919
35021
  scopedActiveTokenTotalStatements = new WeakMap;
34920
35022
  updateTagTokenCountStatements = new WeakMap;
35023
+ setTagTokenCountStatements = new WeakMap;
34921
35024
  updateTagInputTokenCountStatements = new WeakMap;
34922
35025
  tagOwnerSummaries = new WeakMap;
34923
35026
  TAG_OWNER_APPENDED_WITH_SHAPE_SQL = `SELECT ${TAG_OWNER_COLUMNS}, 0 AS shape, NULL AS tag_count, NULL AS max_id, NULL AS revision
@@ -48494,6 +48597,7 @@ var init_issue_log_templates_generated = __esm(() => {
48494
48597
  "transform: last input \x01 (model \x01) exceeds new model \x01 catalog limit \x01; arming overflow recovery proactively for the shrinking switch\x021m,2s",
48495
48598
  "transform: native host compaction heads the window (request \x01, summary \x01, completed \x01); a baseline older than it folds on this pass\x020i,1i",
48496
48599
  "[magic-context] sqlite writer site=compaction-marker-replace db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=committed",
48600
+ "compartment trigger: proactive fire at \x01% (floor=\x01% projected post-drop=none target=\x01%) admittedBy=\x01 trueRawTokens=\x01 formattedTokens=\x01",
48497
48601
  "[magic-context] embedding endpoint blocked: embedding endpoint host \x01 (IPv4-mapped \x01.\x01.\x01.\x01) is link-local / cloud metadata (blocked)",
48498
48602
  "clone-inheritance: failed source=unknown dest=unknown stage=resolve-destination error=\x01; run /ctx-wrapup to rebuild, or re-clone",
48499
48603
  "[magic-context] conflict-detector: resolved config carried no explicit compaction.auto (\x01); falling back to file-based detection",
@@ -48508,6 +48612,7 @@ var init_issue_log_templates_generated = __esm(() => {
48508
48612
  "[magic-context] skipping hidden agent '\x01' — prompt unavailable at config time (dir=\x01); will re-register on a later complete pass\x021p",
48509
48613
  "signed thinking hold: held=false reason=force_band heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading, local count)",
48510
48614
  "[dreamer] compress-cues: stopping before chunk \x01/\x01 — remaining budget \x01ms is below the \x01ms chunk floor; banking \x01 compressed cue(s)",
48615
+ "compartment trigger: force-firing at \x01% (projected post-drop none) admittedBy=overflow_recovery trueRawTokens=\x01 formattedTokens=\x01",
48511
48616
  'historian failure: source=chunk-coverage reason="chunk omits raw message \x01 while still claiming coverage through \x01" chunkRange=\x01-\x01',
48512
48617
  "historian pathological component split: range=\x01-\x01 resultBoundary=\x01 removedTokens=\x01 producerSourceTokens=\x01 producerInputLimitTokens=\x01",
48513
48618
  "transform: recovery chain stops: the historian's drain budget is spent; the request is still about \x01 tokens, over the 95% line \x01",
@@ -48515,6 +48620,7 @@ var init_issue_log_templates_generated = __esm(() => {
48515
48620
  "[magic-context] sqlite writer site=compaction-marker-replace db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=failed",
48516
48621
  '[magic-context] partial recomp failed session=\x01 code=\x01 reason="chunk omits raw message \x01 while still claiming coverage through \x01"\x020s',
48517
48622
  "auto-search: decision outcome=no-candidates reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48623
+ "compartment trigger: proactive fire at \x01% (floor=\x01% projected post-drop=\x01% target=\x01%) admittedBy=\x01 trueRawTokens=\x01 formattedTokens=\x01",
48518
48624
  "[magic-context] Pi process scan: PID \x01 command line is ambiguous (image-name or missing Pi/OMP arc); treating as inconclusive",
48519
48625
  "historian: dropped drifted ordinal checkpoints after exact-read disagreement (\x01); the next run rebuilds them from a full scan",
48520
48626
  "[magic-context] embedding endpoint blocked: embedding endpoint host \x01 (IPv4-mapped \x01) is link-local / cloud metadata (blocked)",
@@ -48527,6 +48633,7 @@ var init_issue_log_templates_generated = __esm(() => {
48527
48633
  "mc-module: render identity session=\x01 changed=\x01 observed=\x01 coordinator=\x01 transition=\x01 tool_present=\x01 profile=\x01 effective=\x01 persisted=\x01",
48528
48634
  "latest-turn thinking recovery: restore no longer possible (missing-thinking-original); removing the turn's thinking instead",
48529
48635
  "[mural] rendered for \x01: \x01 cues drawn, \x01 left out for space, \x01 left out because the mural font has no glyph for their characters",
48636
+ "compartment trigger: force-firing at \x01% (projected post-drop \x01%) admittedBy=overflow_recovery trueRawTokens=\x01 formattedTokens=\x01",
48530
48637
  "rust compaction-marker admission deferred: reason=capture_inputs fit=\x01 estimated=\x01 trusted=\x01 proxy_tokens=\x01 proxy_bytes=\x01 limit=\x01",
48531
48638
  "tag identity recurred after its one repair: serving without a second rebuild (one cache change) session=\x01 identity=\x01 numbers=\x01\x020s",
48532
48639
  "[magic-context] fail-closed blocking armed (\x01); primary sessions will error until storage recovers or the build is upgraded",
@@ -48540,6 +48647,7 @@ var init_issue_log_templates_generated = __esm(() => {
48540
48647
  "latest-turn thinking recovery: unbound because a newer message of the turn was accepted (now last=\x01) (stage=\x01 first=\x01 last=\x01)",
48541
48648
  "[auto-search] decision save hit a busy store for session \x01; serving without a hint and retrying the save on a later pass: \x01\x020s",
48542
48649
  "auto-search: decision outcome=\x01 reason=completed lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48650
+ "compartment trigger: force-firing at \x01% (projected post-drop none) admittedBy=emergency_95 trueRawTokens=\x01 formattedTokens=\x01",
48543
48651
  "compartment trigger: not firing at \x01% — below meaningfulness; offset=\x01 protectedStart=\x01 eligibleEnd=\x01 rawTokens=\x01 chunkTokens=\x01",
48544
48652
  "[magic-context] registered tools: ctx_search, ctx_memory, ctx_note, ctx_expand, todowrite, ctx_reduce; registered /todos",
48545
48653
  "RUST LOOP BREAKER: suppressing host directives after three consecutive synthetic turns until a real user message arrives",
@@ -48555,6 +48663,7 @@ var init_issue_log_templates_generated = __esm(() => {
48555
48663
  "pending ops WILL APPLY — reason=m0_hard_fold (drain folded into executed m[0] bust, scheduler=\x01), pendingOps=\x01, context=\x01%",
48556
48664
  "auto-search: decision outcome=below-threshold lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48557
48665
  "auto-search: decision outcome=timeout reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48666
+ "compartment trigger: force-firing at \x01% (projected post-drop none) admittedBy=force_band trueRawTokens=\x01 formattedTokens=\x01",
48558
48667
  "rust compaction-marker admission deferred: reason=output_fit fit=\x01 estimated=\x01 trusted=\x01 proxy_tokens=\x01 proxy_bytes=\x01 limit=\x01",
48559
48668
  "compaction-marker drain: candidate preparation deferred; pending marker kept for the next pass with rewrite permission",
48560
48669
  "transform: historian join timed out — reclaim and final fit checks continue; historian keeps running in the background",
@@ -48564,6 +48673,8 @@ var init_issue_log_templates_generated = __esm(() => {
48564
48673
  "[dreamer] map-memories: stopping before batch \x01/\x01 — remaining budget \x01ms is below the \x01ms batch floor; banking \x01 mapping(s)",
48565
48674
  "pending ops WILL APPLY — reason=m0_hard_fold (drain folded into executed m[0] bust, scheduler=\x01), pendingOps=\x01 context=\x01%",
48566
48675
  "auto-search: decision outcome=\x01 reason=exited lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48676
+ "compartment trigger: commit-cluster fire — \x01 clusters (min=\x01) admittedBy=commit_clusters trueRawTokens=\x01 formattedTokens=\x01",
48677
+ "compartment trigger: force-firing at \x01% (projected post-drop \x01%) admittedBy=emergency_95 trueRawTokens=\x01 formattedTokens=\x01",
48567
48678
  "event message.updated: provider=\x01 model=\x01 hasUsageTokens=\x01 tokens.input=\x01 cache.read=\x01 cache.write=\x01 message.id=\x01 session.id=\x01\x020m,1m,6i,7s",
48568
48679
  "injecting legacy compartments without visible-prefix trimming because latest stored compartment has no end_message_id \x01",
48569
48680
  "Pi identity fold guards unreadable: tag identity duplicates are served unmerged and the stored row is left untouched: \x01",
@@ -48585,6 +48696,7 @@ var init_issue_log_templates_generated = __esm(() => {
48585
48696
  "[dreamer] curate safety refusal: session_id=\x01 memory_id=\x01 verdict=\x01 reason=\x01 original_chars=\x01 replacement_chars=\x01 refused=\x01\x020s,6s",
48586
48697
  "[dreamer] retrospective: child rejected \x01-token estimated prompt for size; retrying watermark=\x01 with usable input \x01 -> \x01\x022m",
48587
48698
  "[dreamer] retrospective: child rejected \x01-token estimated prompt for size; retrying watermark=\x01 with usable input \x01 -> \x01",
48699
+ "compartment trigger: force-firing at \x01% (projected post-drop \x01%) admittedBy=force_band trueRawTokens=\x01 formattedTokens=\x01",
48588
48700
  "transform: proceeding after bounded historian join; trusted final-wire \x01 fits context limit \x01 after emergency reclaim=\x01\x021m",
48589
48701
  "transform: proceeding after bounded historian join; trusted final-wire \x01 fits context limit \x01 after emergency reclaim=\x01",
48590
48702
  "compaction-off transition could not verify complete marker cleanup; durable cleanup retry will run on the next pass",
@@ -48665,6 +48777,7 @@ var init_issue_log_templates_generated = __esm(() => {
48665
48777
  "overflow detected on subagent via message.updated: reportedLimit=\x01 provenance=\x01 pattern=\x01 — recorded limit only",
48666
48778
  "latest-turn thinking recovery: provider rejected the bound turn again (rejection \x01, first=\x01 last=\x01); \x01 -> remove",
48667
48779
  "compartment trigger: skipped — no new raw history (usage=\x01% nextStartOrdinal=\x01 diagnostic-collection-failed: \x01)",
48780
+ "compartment trigger: tail-size fire — budget threshold \x01 admittedBy=formatted trueRawTokens=\x01 formattedTokens=\x01",
48668
48781
  "tag identity unresolved: serving with a newly allocated tag number (one cache change per identity) session=\x01 \x01\x020s",
48669
48782
  "[magic-context] registered todowrite overlay: DISABLED (todowrite.enabled=false or todowrite.overlay=false)",
48670
48783
  "clone-inheritance: skipped source=unknown dest=unknown stage=destination-guard reason=destination-not-empty",
@@ -48678,6 +48791,7 @@ var init_issue_log_templates_generated = __esm(() => {
48678
48791
  "historian prompt fit: sized to \x01 (chunkTokens=\x01 sessionReferences=\x01 memories=\x01/\x01 seeds=\x01/\x01; requestedChunkTokens=\x01)\x020m",
48679
48792
  "system prompt hash changed: \x01 → \x01 (len=\x01), triggering flush (idle-expired request); presetChanged=\x01 elements=[\x01]",
48680
48793
  "[mc-module][\x01] historian prompt fit: chunkTokens=\x01 requestedChunkTokens=\x01 sessionReferences=\x01 memories=\x01/\x01 seeds=\x01",
48794
+ "compartment trigger: tail-size fire — budget threshold \x01 admittedBy=has_more trueRawTokens=\x01 formattedTokens=\x01",
48681
48795
  "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=replay permitted=unknown host=\x01",
48682
48796
  "[magic-context] instance disposed — stopped RPC server, dream timer, auto-update, Rust replay registration",
48683
48797
  "historian deferred: exact ordinals not ready (ordinal warm-up still running); a later pass starts it again",
@@ -48687,7 +48801,6 @@ var init_issue_log_templates_generated = __esm(() => {
48687
48801
  "compaction-marker drain: pass has no rewrite permission; ordinal \x01 waits for a pass with rewrite permission",
48688
48802
  "[magic-context] embedding endpoint blocked: embedding endpoint host \x01 is a cloud metadata service (blocked)",
48689
48803
  "[magic-context] sqlite writer site=\x01 db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=not_acquired",
48690
- "compartment trigger: tail-size fire — ~\x01 TC-chunked tokens (hasMore=\x01, true-raw ~\x01) exceeds \x01 budget threshold",
48691
48804
  "rust compaction-marker: pending target write skipped on lock contention; next cache-busting pass retries: \x01",
48692
48805
  "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=input permitted=unknown host=\x01",
48693
48806
  '⚠️ Magic Context: The "protected_tags" setting is deprecated and ignored. Use "protected_tokens" instead.',
@@ -48700,6 +48813,7 @@ var init_issue_log_templates_generated = __esm(() => {
48700
48813
  "rust transform still pending after healthy probe original_attempt=\x01 stall_ms=\x01; duplicate resend suppressed",
48701
48814
  "historian discard-last: dropped provisional compartment \x01-\x01 (lookaheadMargin=\x01 <= \x01); will re-derive next run",
48702
48815
  "final representation: clearedParts=\x01 mergedReasoningParts=\x01 removedReasoningParts=\x01 settledDroppedReasoning=\x01",
48816
+ "historian request sizes: systemBytes=\x01 userBytes=\x01 memoryBytes=\x01 seedBytes=\x01 referenceBytes=\x01 newMessageBytes=\x01",
48703
48817
  "mc-module: overflow recovery arm has no eligible history boundary; suppressing forced emergency pass for \x01",
48704
48818
  "note-nudge: suppressing — agent ran ctx_note(read) at \x01 and the read is still visible; no new notes since \x01",
48705
48819
  "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=pass permitted=unknown host=\x01",
@@ -48985,7 +49099,6 @@ var init_issue_log_templates_generated = __esm(() => {
48985
49099
  "[git-commits] sweep finished for \x01, but lease was no longer active; cooldown not advanced",
48986
49100
  "compartment injection: cached boundary \x01 not in messages (already trimmed), reusing cache\x020i",
48987
49101
  "[dreamer] maintain-docs altered a protected region in \x01 — restored from pre-task snapshot",
48988
- "compartment trigger: commit-cluster fire — \x01 clusters (min=\x01), ~\x01 tokens in eligible prefix",
48989
49102
  "DEGRADED PASS \x01: LKG unavailable (lkg_emergency_armed); refusing unreduced \x01-message input",
48990
49103
  'historian failure: source=validation reason="\x01" chunkRange=\x01-\x01 fallbackModel=\x01 twoPass=false\x023m',
48991
49104
  "TRANSIENT STORAGE FAILURE \x01: LKG replay unavailable (\x01); refusing unreduced \x01-message input",
@@ -49081,7 +49194,6 @@ var init_issue_log_templates_generated = __esm(() => {
49081
49194
  "stable-id scheme cutover: stored=\x01 < current=\x01 — forcing execute+materialize this pass",
49082
49195
  "Pi held identity rebuild: prior prefix unavailable (\x01); applying the declared rebuild",
49083
49196
  "thinking binding recovery: stripped bound reasoning from \x01 assistant(s) [\x01]; flag=kept",
49084
- "compartment trigger: proactive fire at \x01% (floor=\x01% projected post-drop=none target=\x01%)",
49085
49197
  "context limit resolved: \x01 for \x01 (catalog \x01, overflow-detected \x01, proven accepted input \x01)\x021m",
49086
49198
  "pending ops WILL NOT APPLY — reason=\x01 pendingOps=not loaded (deferred pass) context=\x01%",
49087
49199
  'recomp partial code=\x01 reason="history model response did not validate for messages \x01-\x01"',
@@ -49163,7 +49275,6 @@ var init_issue_log_templates_generated = __esm(() => {
49163
49275
  "[magic-context] slow write transaction: site=storage_meta_wrapup_release held=\x01ms ",
49164
49276
  "[magic-context] embedding model load attempt \x01/\x01 failed transiently, retrying in \x01ms",
49165
49277
  "[magic-context] slow write transaction: site=user_memory_candidate_insert held=\x01ms",
49166
- "compartment trigger: proactive fire at \x01% (floor=\x01% projected post-drop=\x01% target=\x01%)",
49167
49278
  "[magic-context] local embedding pooling for \x01: \x01 pooling, normalization disabled (\x01)\x020m",
49168
49279
  "Ignoring project protected_tokens=\x01; it cannot lower resolved user/default floor \x01.",
49169
49280
  'recomp partial code=\x01 reason="historian made no forward progress after messages \x01-\x01"',
@@ -49424,6 +49535,7 @@ var init_issue_log_templates_generated = __esm(() => {
49424
49535
  "[magic-context] v2 historian and dreamer could not start after recovery: \x01",
49425
49536
  "[mc][embedding] config load untrusted, preserving last-known-good for \x01 — \x01",
49426
49537
  "[migrations] async open main-thread migration-body count: \x01 (total=\x01) path=\x01\x022p",
49538
+ "historian recovery fire: admittedBy=\x01 trueRawTokens=\x01 formattedChunkTokens=\x01",
49427
49539
  "historian skip: internal drain budget spent (\x01/\x01 tokens); next eligible at \x01",
49428
49540
  "mc-module: pending_rewrite ambiguous after boundary-present recovery for \x01",
49429
49541
  "mc-pass-stage session=\x01 stage=historian_inline_wait event=begin budget_ms=\x01\x020s",
@@ -49682,7 +49794,6 @@ var init_issue_log_templates_generated = __esm(() => {
49682
49794
  "injected \x01 facts + \x01 memories into message[0] (no compartments yet)",
49683
49795
  "v2 fork inheritance: fork of \x01 already has state; not copied again\x020s",
49684
49796
  "Subagent temperature omitted for \x01: no host or models.dev metadata\x020m",
49685
- "compartment trigger: force-firing at \x01% (projected post-drop none)",
49686
49797
  "historian trigger eval: usage=\x01% (\x01 tokens) [\x01], checking trigger...",
49687
49798
  "[dreamer] domain lease busy (maintain-docs:\x01) — deferring \x01 task(s)",
49688
49799
  "[dreamer] domain lease busy (user-memories:\x01) — deferring \x01 task(s)",
@@ -49788,7 +49899,6 @@ var init_issue_log_templates_generated = __esm(() => {
49788
49899
  "Subagent temperature omitted for \x01: host model metadata says no\x020m",
49789
49900
  "Magic Context \x01 config already present at \x01; legacy copies match\x021p",
49790
49901
  "historian recovery triggered on session load after \x01 failure(s)",
49791
- "compartment trigger: force-firing at \x01% (projected post-drop \x01%)",
49792
49902
  "heuristic cleanup stage: stage=measureEmergencyTags elapsed=\x01ms",
49793
49903
  '[magic-context] partial recomp failed session=\x01 code=\x01 reason="\x01"\x020s',
49794
49904
  "injected m[0]/m[1] into Pi messages (\x01 + \x01 bytes, materialized=\x01)",
@@ -51334,7 +51444,7 @@ var init_issue_log_templates_generated = __esm(() => {
51334
51444
  }
51335
51445
  return { parts, slots };
51336
51446
  });
51337
- ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,ambiguous-rewrite,anchor-missing,anchors-disagree,anthropic-continue,appended,applied,archive,assistant,assistant-message,attachment,attempt_mismatch,audio,auth_failed,auto_search_hint,backoff,band-crossing,band-deescalation,baseline-reset,baseline-unavailable,baseline-unevaluable,batch,batch-timeout,behind,below-emergency-band,below-threshold,boot_recovery,boundary,boundary_repair,busy,bytes,cache_hit,cache_invalid,cached_m1_missing,cadence-growth,cadence-refire,call,candidate-preparation,candidate_conflict,candidate_loss,candidate_rows_changed,candidates,capture_failed,cas-exhausted,cas-exhaustion,catalog,category,ceiling-threshold-met,changes-request,channel-2-ceiling-nudge,checkpoint,chunk_empty_canonical_text,chunk_fts_mapping_incomplete,chunk_partial_vector_set,chunk_window_contract_mismatch,cleared_reasoning_through_tag,close,closed-book,commit_clusters,committed,compaction,compartment-removed,compartment_render_epoch,compiled-check,compressed,compressor,config-re-read,conflict,content,content-loss,context_boundary,cooldown_active,count,coverage_fold,ctx_search_hint,custom_tool_call,darwin,data,date-cwd,deadline,defer,deferred,deferred_materialization,deferred_publication,definitely-no-cut,degraded,destination-not-empty,diagnostics,dimensions_mismatch,directive-shaped-project-rule,directory,disabled,discarded_last,divergent,document,done,drained,dreamer,dreamer-task,drift,drop_seed,duplicate_submission_budget,embed,embedded,empty,empty-session,empty_output,end_block_index,endpoint_unsupported,entry,entry-removed,envelope_unreadable,epoch_change,error,error_content,error_text,evaluate-smart-notes,exact-ordinal-ids,exception,excluded,execute,exited,expired,explicit_flush,failed,fallback,fatal,fenced_path,file,file_contains,first_render,fit_retry,flush,fold,force,force_band,force_materialization,found,frozen_slot,fts-rowid-backfill,full,function_call,generation-invalidated,git_commit_after,git_identity_unavailable,git_tag_matching,has-state,heavy_reasoning,historian,historian-editor,historian_editor,hold,home_directory,host,host-checkpoint,host_compaction,host_cut_before_watermark,host_history_change,host_rerender,http_error,identity_paused,image,images,incremental,indexed,injector,input,input_text,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,latest_turn_thinking_removed,leaked-id,lease_active,legacy,length,limit,live-geometry,lkg_anthropic_reasoning_run_invalid,lkg_content_mismatch,lkg_invalidated_reshape,lkg_miss,lkg_model_mismatch,lkg_output_mapping_unavailable,lkg_recovery_input_rebuild,lkg_recovery_unproven,lkg_restart_head_changed,lkg_restart_rebuild,lkg_seam_invalid,lkg_system_state_mismatch,lkg_unsafe_seam,m1_delta,magic-context-host-stall,maintain-docs,malformed,management_surface,manual-full-recomp,manual-wrapup-empty,max_mutation_id,memory,memory_hash_guard_rejected,merged-reasoning-strip-exception,merged-reasoning-strip-persistence-failure,message,messages,migrated,migration_guard,migration_required,mismatch,missing,missing-active-same-category-successor,missing_tool_messages,model_change,model_failed,model_or_limit_changed,mtime_after,mutation_drift,native,network_error,newer_schema,no-anchor,no-file,no-output,no-result,no_assistant,no_head,no_originating_cache_bust,no_recent_heavy_reasoning,non-finite-input,non_zero_exit,none,not-a-fork,not-accepted,not-ready,not-text-user,not_a_repo,not_certified,not_found,not_owned,not_tracked,note,note_nudge_anchor,object,ok,omp,opaque,open-tool-arc,openai-codex-responses,openai-responses,opencode,opencode2,orphan_tool_message,other,output,output_text,overflow,oversized,ownership_lost,pair_commit_failed,parent-missing,parse,parse-invalid,parse_failed,partial,partial-message-boundary,partial-recomp,parts,pass,pass-cap,patch,path_exists,pending_agent_drop,pending_materialization,pi,placeholder,polarity-missing-mechanism,populated,post-reduce-band-escalation,post-reduce-baseline-pending,post-reduce-compliance-grace,post-reduce-regrowth-reached,prepared-row,pressure_refold,prewarm,primary,probe_required,proceed,process,processed_image,profile_transition,prohibition-missing-marker,project,project_change,project_memory_epoch,projected_headroom,provider-overflow-abort,provider_error,provider_returned_no_vectors,publication-failed,query,range,ratio-below-ceiling,ratio-below-gentle,raw,read-outstanding,read_error,ready,reason,reasoning,reasoning-removal-persistence-failure,reasoning-removal-read-failure,recent-reduce-refresh,reclaimable-below-floor,recomp,reconnect,recovery-request-over-limit,recovery_prefix_released,recovery_tail_normalized,redacted_reasoning,redacted_thinking,refresh,refusal-grade-final-wire-over-limit,registration_retired_during_embed,release,reminder-strip,renew,repaired,replace,replay,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,search-limit,seeded,server_tool_use,session-content,shifted,size-walk,skip,skipped,snapshot,source,source-revision,source_changed,source_removed,spawn-failed,spawn_failed,stacked,stale,stale-skip,stale_reduce,stale_snapshot,stalled,stalled_no_progress,start,start-failed,start_block_index,steer,step-finish,step-start,step_limit,sticky-turn-floor,stop,stopped,storage,storage-busy,storage_failure,store_not_found,store_schema_unknown,store_unreadable,string,strip,strip_seed,structural,subtask,summary,summary_message,superpowers-bootstrap,superseded,synthetic-boundary-merged,synthetic-kept-entry,system,system_hash,system_injected,tag,tag-delta,tag-identity-rebuild-failed,tag-identity-recurring,tag-identity-repair-once,tag-identity-repair-pending,tag-summary,tag_identity_repair,tag_prefix,tail-below-minimum,tail_size,target-superseded,test-legacy,text,thinking,thinking_binding,thinking_hold,timeout,timeout-circuit-breaker,token-budget,token_budget,too-short,tool,tool-pair,tool-result,tool_call,tool_definitions,tool_provider,tool_result,tool_search_tool_result,tool_use,transform,transient,truncated,trusted-final-wire-disarm,ttl_expiry,ttl_idle,turn,type,unanchored,unavailable,unbalanced-parens,uncaptured_replay,uncertain,unknown,unknown_write_rejection,unmatched_tool_call_id,unplaceable,unreadable-branch,unregistered,unresolved,update,upgrade,upgrade_state,url,usage,user,user-memories,user-profile-is-not-project-memory,user_flush,user_memory_review,v1,v2,v2-archive-read,v2-archive-ready,v2-archive-result,validated,validation-failed,variant_change,verbose,verified,verify,video,view_error,waiting,waiting-for-entry,weak_lookahead_final_compartment,web_search_tool_result,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
51447
+ ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,ambiguous-rewrite,anchor-missing,anchors-disagree,anthropic-continue,appended,applied,archive,assistant,assistant-message,attachment,attempt_mismatch,audio,auth_failed,auto_search_hint,backoff,band-crossing,band-deescalation,baseline-reset,baseline-unavailable,baseline-unevaluable,batch,batch-timeout,behind,below-emergency-band,below-threshold,boot_recovery,boundary,boundary_repair,busy,bytes,cache_hit,cache_invalid,cached_m1_missing,cadence-growth,cadence-refire,call,candidate-preparation,candidate_conflict,candidate_loss,candidate_rows_changed,candidates,capture_failed,cas-exhausted,cas-exhaustion,catalog,category,ceiling-threshold-met,changes-request,channel-2-ceiling-nudge,checkpoint,chunk_empty_canonical_text,chunk_fts_mapping_incomplete,chunk_partial_vector_set,chunk_window_contract_mismatch,cleared_reasoning_through_tag,close,closed-book,commit_clusters,committed,compaction,compartment-removed,compartment_render_epoch,compiled-check,compressed,compressor,config-re-read,conflict,content,content-loss,context_boundary,cooldown_active,count,coverage_fold,ctx_search_hint,custom_tool_call,darwin,data,date-cwd,deadline,defer,deferred,deferred_materialization,deferred_publication,definitely-no-cut,degraded,destination-not-empty,diagnostics,dimensions_mismatch,directive-shaped-project-rule,directory,disabled,discarded_last,divergent,document,done,drained,dreamer,dreamer-task,drift,drop_seed,duplicate_submission_budget,embed,embedded,emergency_95,empty,empty-session,empty_output,end_block_index,endpoint_unsupported,entry,entry-removed,envelope_unreadable,epoch_change,error,error_content,error_text,evaluate-smart-notes,exact-ordinal-ids,exception,excluded,execute,exited,expired,explicit_flush,failed,fallback,fatal,fenced_path,file,file_contains,first_render,fit_retry,flush,fold,force,force_band,force_materialization,found,frozen_slot,fts-rowid-backfill,full,function_call,generation-invalidated,git_commit_after,git_identity_unavailable,git_tag_matching,has-state,heavy_reasoning,historian,historian-editor,historian_editor,history_retirement,hold,home_directory,host,host-checkpoint,host_compaction,host_cut_before_watermark,host_history_change,host_rerender,http_error,identity_paused,image,images,incremental,indexed,injector,input,input_text,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,latest_turn_thinking_removed,leaked-id,lease_active,legacy,length,limit,live-geometry,lkg_anthropic_reasoning_run_invalid,lkg_content_mismatch,lkg_invalidated_reshape,lkg_miss,lkg_model_mismatch,lkg_output_mapping_unavailable,lkg_recovery_input_rebuild,lkg_recovery_unproven,lkg_restart_head_changed,lkg_restart_rebuild,lkg_seam_invalid,lkg_system_state_mismatch,lkg_unsafe_seam,m1_delta,magic-context-host-stall,maintain-docs,malformed,management_surface,manual-full-recomp,manual-wrapup-empty,max_mutation_id,memory,memory_hash_guard_rejected,merged-reasoning-strip-exception,merged-reasoning-strip-persistence-failure,message,messages,migrated,migration_guard,migration_required,mismatch,missing,missing-active-same-category-successor,missing_tool_messages,model_change,model_failed,model_or_limit_changed,mtime_after,mutation_drift,native,network_error,newer_schema,no-anchor,no-file,no-output,no-result,no_assistant,no_head,no_originating_cache_bust,no_recent_heavy_reasoning,non-finite-input,non_zero_exit,none,not-a-fork,not-accepted,not-ready,not-text-user,not_a_repo,not_certified,not_found,not_owned,not_tracked,note,note_nudge_anchor,object,ok,omp,opaque,open-tool-arc,openai-codex-responses,openai-responses,opencode,opencode2,orphan_tool_message,other,output,output_text,overflow,overflow_recovery,oversized,ownership_lost,pair_commit_failed,parent-missing,parse,parse-invalid,parse_failed,partial,partial-message-boundary,partial-recomp,parts,pass,pass-cap,patch,path_exists,pending_agent_drop,pending_materialization,pi,placeholder,polarity-missing-mechanism,populated,post-reduce-band-escalation,post-reduce-baseline-pending,post-reduce-compliance-grace,post-reduce-regrowth-reached,prepared-row,pressure_refold,prewarm,primary,probe_required,proceed,process,processed_image,profile_transition,prohibition-missing-marker,project,project_change,project_memory_epoch,projected_headroom,provider-overflow-abort,provider_error,provider_returned_no_vectors,publication-failed,query,range,ratio-below-ceiling,ratio-below-gentle,raw,read-outstanding,read_error,ready,reason,reasoning,reasoning-removal-persistence-failure,reasoning-removal-read-failure,recent-reduce-refresh,reclaimable-below-floor,recomp,reconnect,recovery-request-over-limit,recovery_chain,recovery_prefix_released,recovery_tail_normalized,redacted_reasoning,redacted_thinking,refresh,refusal-grade-final-wire-over-limit,registration_retired_during_embed,release,reminder-strip,renew,repaired,replace,replay,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,search-limit,seeded,server_tool_use,session-content,shifted,size-walk,skip,skipped,snapshot,source,source-revision,source_changed,source_removed,spawn-failed,spawn_failed,stacked,stale,stale-skip,stale_reduce,stale_snapshot,stalled,stalled_no_progress,start,start-failed,start_block_index,startup_recovery,steer,step-finish,step-start,step_limit,sticky-turn-floor,stop,stopped,storage,storage-busy,storage_failure,store_not_found,store_schema_unknown,store_unreadable,string,strip,strip_seed,structural,subtask,summary,summary_message,superpowers-bootstrap,superseded,synthetic-boundary-merged,synthetic-kept-entry,system,system_hash,system_injected,tag,tag-delta,tag-identity-rebuild-failed,tag-identity-recurring,tag-identity-repair-once,tag-identity-repair-pending,tag-summary,tag_identity_repair,tag_prefix,tail-below-minimum,tail_size,target-superseded,test-legacy,text,thinking,thinking_binding,thinking_hold,timeout,timeout-circuit-breaker,token-budget,token_budget,too-short,tool,tool-pair,tool-result,tool_call,tool_definitions,tool_provider,tool_result,tool_search_tool_result,tool_use,transform,transient,truncated,trusted-final-wire-disarm,ttl_expiry,ttl_idle,turn,type,unanchored,unavailable,unbalanced-parens,uncaptured_replay,uncertain,unknown,unknown_write_rejection,unmatched_tool_call_id,unplaceable,unreadable-branch,unregistered,unresolved,update,upgrade,upgrade_state,url,usage,user,user-memories,user-profile-is-not-project-memory,user_flush,user_memory_review,v1,v2,v2-archive-read,v2-archive-ready,v2-archive-result,validated,validation-failed,variant_change,verbose,verified,verify,video,view_error,waiting,waiting-for-entry,weak_lookahead_final_compartment,web_search_tool_result,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
51338
51448
  });
51339
51449
 
51340
51450
  // src/lib/log-lines.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/magic-context",
3
- "version": "0.49.63",
3
+ "version": "0.49.65",
4
4
  "description": "Unified CLI for Magic Context — setup, doctor, and migration across OpenCode, Pi, and OMP",
5
5
  "keywords": [
6
6
  "opencode",