pi-tuck 1.1.3 → 1.2.0
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.
- package/CHANGELOG.md +46 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +16 -111
- package/dist/src/build-id.d.ts +1 -1
- package/dist/src/build-id.js +1 -1
- package/dist/src/compaction.d.ts +2 -103
- package/dist/src/compaction.js +20 -140
- package/dist/src/diagnostic-replay.js +2 -2
- package/dist/src/diagnostics.d.ts +3 -2
- package/dist/src/diagnostics.js +30 -9
- package/dist/src/history-tools.js +3 -3
- package/dist/src/kept-reads.d.ts +2 -2
- package/dist/src/kept-reads.js +144 -8
- package/dist/src/ledger.d.ts +1 -1
- package/dist/src/ledger.js +5 -3
- package/dist/src/legacy-cleanup.d.ts +3 -0
- package/dist/src/legacy-cleanup.js +190 -0
- package/dist/src/notify.d.ts +3 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/omissions.d.ts +1 -1
- package/dist/src/omissions.js +3 -3
- package/dist/src/path-key.d.ts +3 -0
- package/dist/src/path-key.js +8 -0
- package/dist/src/request-capacity.js +1 -1
- package/dist/src/run.d.ts +1 -3
- package/dist/src/run.js +3 -5
- package/dist/src/source-export.d.ts +1 -1
- package/dist/src/source-export.js +1 -1
- package/dist/src/status.d.ts +0 -6
- package/dist/src/status.js +1 -6
- package/dist/src/tuck/core/content.js +6 -9
- package/dist/src/tuck/core/keyword-query.d.ts +2 -2
- package/dist/src/tuck/core/keyword-query.js +1 -1
- package/dist/src/tuck/core/search-entries.js +5 -5
- package/dist/src/tuck/core/transcript.js +2 -1
- package/dist/src/tuck.js +390 -394
- package/dist/src/windows-private-storage.d.ts +9 -0
- package/dist/src/windows-private-storage.js +90 -0
- package/index.ts +18 -82
- package/package.json +5 -8
- package/src/build-id.ts +1 -1
- package/src/compaction.ts +19 -107
- package/src/diagnostic-replay.ts +2 -2
- package/src/diagnostics.ts +24 -9
- package/src/history-tools.ts +3 -3
- package/src/kept-reads.ts +78 -10
- package/src/ledger.ts +5 -3
- package/src/legacy-cleanup.ts +134 -0
- package/src/notify.ts +10 -0
- package/src/omissions.ts +3 -3
- package/src/path-key.ts +9 -0
- package/src/request-capacity.ts +1 -1
- package/src/run.ts +4 -6
- package/src/source-export.ts +1 -1
- package/src/status.ts +1 -10
- package/src/tuck/core/content.ts +5 -10
- package/src/tuck/core/keyword-query.ts +2 -2
- package/src/tuck/core/search-entries.ts +5 -5
- package/src/tuck/core/transcript.ts +2 -1
- package/src/tuck.ts +329 -335
- package/src/windows-private-storage.ts +94 -0
- package/dist/src/assets.d.ts +0 -58
- package/dist/src/assets.js +0 -80
- package/dist/src/eligibility-cache.d.ts +0 -19
- package/dist/src/eligibility-cache.js +0 -33
- package/dist/src/semantic-recall.d.ts +0 -422
- package/dist/src/semantic-recall.js +0 -1386
- package/dist/src/setup.d.ts +0 -3
- package/dist/src/setup.js +0 -191
- package/scripts/eg2-runtime.py +0 -307
- package/scripts/provision-eg2.py +0 -139
- package/scripts/semantic-worker.py +0 -234
- package/src/assets.ts +0 -92
- package/src/eligibility-cache.ts +0 -43
- package/src/semantic-recall.ts +0 -592
- package/src/setup.ts +0 -163
|
@@ -53,7 +53,7 @@ const countMatches = (hay: string, terms: readonly KeywordMatcher[]): number =>
|
|
|
53
53
|
const BM25_K = 1.2;
|
|
54
54
|
const BM25_B = 0.75;
|
|
55
55
|
|
|
56
|
-
/** Count non-overlapping literal occurrences with the prepared matcher's
|
|
56
|
+
/** Count non-overlapping literal occurrences with the prepared matcher's rules. */
|
|
57
57
|
const termFreq = (text: string, matcher: KeywordMatcher): number => {
|
|
58
58
|
let count = 0, offset = 0;
|
|
59
59
|
for (;;) {
|
|
@@ -126,12 +126,12 @@ const TOOL_ARGS_BUDGET = 2000;
|
|
|
126
126
|
/**
|
|
127
127
|
* Tool name of the recall tool itself (src/tools/recall.ts). A search
|
|
128
128
|
* operation must not match its own query or its own prior output: the
|
|
129
|
-
*
|
|
129
|
+
* lookup invocation is persisted as an ordinary assistant toolCall (its
|
|
130
130
|
* `{ query }` argument, excluded below in `toolCallArgsText`) followed by an
|
|
131
131
|
* ordinary toolResult message (its `N matches for "<query>"` text, excluded
|
|
132
132
|
* in `fullText`) — without both exclusions a repeated query keeps matching
|
|
133
133
|
* its own prior invocation/output and the hit count grows on every search.
|
|
134
|
-
* This is a targeted introspection invariant for
|
|
134
|
+
* This is a targeted introspection invariant for recognized history lookup tools, not a
|
|
135
135
|
* general allowlist/blocklist over tool names or tool results.
|
|
136
136
|
*/
|
|
137
137
|
|
|
@@ -186,7 +186,7 @@ const fullText = (msg: Message): string => {
|
|
|
186
186
|
* stopword filtering and case/duplicate normalization (see the
|
|
187
187
|
* `effectiveTermCount >= 2` gate below `searchEntriesDetailed` uses before
|
|
188
188
|
* calling `applyRelativeFloor`). Distinct, not raw count: "auth auth" or
|
|
189
|
-
* "Auth AUTH" is
|
|
189
|
+
* "Auth AUTH" is a single-term query after normalization and must bypass the floor
|
|
190
190
|
* like any other single term — repeating or casing a word doesn't turn it
|
|
191
191
|
* into the multi-term OR-tail noise this floor targets. The normalization is
|
|
192
192
|
* gate-only; it doesn't change `terms` or the BM25 scoring itself, which
|
|
@@ -292,7 +292,7 @@ export const searchEntriesDetailed = (
|
|
|
292
292
|
// apply the hard cap.
|
|
293
293
|
scored.sort((a, b) => b.score - a.score);
|
|
294
294
|
// Gate on DISTINCT normalized terms, not raw term count: "auth auth" or
|
|
295
|
-
// "Auth AUTH" is
|
|
295
|
+
// "Auth AUTH" is a single-term query after normalization and must bypass the
|
|
296
296
|
// floor like any other single term — repeating/casing a word doesn't turn
|
|
297
297
|
// it into the multi-term OR-tail noise this floor targets. This is a
|
|
298
298
|
// gate-only normalization; it does not change `terms` itself or the BM25
|
|
@@ -69,7 +69,8 @@ export const splitSummary = (summary: string): { body: string; closing: string;
|
|
|
69
69
|
if (at < 0) return undefined;
|
|
70
70
|
// A summary saved before the rename keeps its records byte for byte (their lengths are checked); only its closing is pointed at the
|
|
71
71
|
// tools the model has now.
|
|
72
|
-
const closing =
|
|
72
|
+
const closing = summary.slice(at).replaceAll("vcc_recall", "tuck_recall").replaceAll("vcc_search", "tuck_recall")
|
|
73
|
+
.replaceAll("tuck_search", "tuck_recall").replaceAll("tuck_recall or tuck_recall", "tuck_recall");
|
|
73
74
|
return { body: summary.slice(header.length + 1, at), closing, version: header === TRANSCRIPT_HEADER ? 2 : 1 };
|
|
74
75
|
};
|
|
75
76
|
const LEGACY_RECEIPT_RANGE_NOTICE = RECEIPT_RANGE_NOTICE.replace("tuck_recall", "vcc_recall");
|