@getrift/rift 0.1.0-beta.11 → 0.1.0-beta.13
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/dist/src/cli/commands/onboard.d.ts +38 -0
- package/dist/src/cli/commands/onboard.d.ts.map +1 -1
- package/dist/src/cli/commands/onboard.js +176 -101
- package/dist/src/cli/commands/onboard.js.map +1 -1
- package/dist/src/cli/commands/reconcile.d.ts.map +1 -1
- package/dist/src/cli/commands/reconcile.js +12 -0
- package/dist/src/cli/commands/reconcile.js.map +1 -1
- package/dist/src/cli/status/friend-header.d.ts +8 -1
- package/dist/src/cli/status/friend-header.d.ts.map +1 -1
- package/dist/src/cli/status/friend-header.js +93 -12
- package/dist/src/cli/status/friend-header.js.map +1 -1
- package/dist/src/cli/ui.d.ts +47 -0
- package/dist/src/cli/ui.d.ts.map +1 -0
- package/dist/src/cli/ui.js +166 -0
- package/dist/src/cli/ui.js.map +1 -0
- package/dist/src/jobs/handlers/compact.js +1 -0
- package/dist/src/jobs/handlers/compact.js.map +1 -1
- package/dist/src/jobs/handlers/dedupe-conversations.d.ts +134 -0
- package/dist/src/jobs/handlers/dedupe-conversations.d.ts.map +1 -0
- package/dist/src/jobs/handlers/dedupe-conversations.js +371 -0
- package/dist/src/jobs/handlers/dedupe-conversations.js.map +1 -0
- package/dist/src/jobs/handlers/ingest.d.ts.map +1 -1
- package/dist/src/jobs/handlers/ingest.js +44 -18
- package/dist/src/jobs/handlers/ingest.js.map +1 -1
- package/dist/src/jobs/handlers/reconcile.d.ts +11 -0
- package/dist/src/jobs/handlers/reconcile.d.ts.map +1 -1
- package/dist/src/jobs/handlers/reconcile.js +25 -0
- package/dist/src/jobs/handlers/reconcile.js.map +1 -1
- package/dist/src/jobs/handlers/save.d.ts.map +1 -1
- package/dist/src/jobs/handlers/save.js +6 -1
- package/dist/src/jobs/handlers/save.js.map +1 -1
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +43 -3
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/context-pack.js +163 -25
- package/dist/src/mcp/tools/context-pack.js.map +1 -1
- package/dist/src/observability/onboarding-metric.d.ts +115 -0
- package/dist/src/observability/onboarding-metric.d.ts.map +1 -0
- package/dist/src/observability/onboarding-metric.js +344 -0
- package/dist/src/observability/onboarding-metric.js.map +1 -0
- package/dist/src/observability/tool-usage-stats.d.ts +8 -0
- package/dist/src/observability/tool-usage-stats.d.ts.map +1 -1
- package/dist/src/observability/tool-usage-stats.js +11 -1
- package/dist/src/observability/tool-usage-stats.js.map +1 -1
- package/dist/src/retrieval/context-pack.d.ts +100 -0
- package/dist/src/retrieval/context-pack.d.ts.map +1 -1
- package/dist/src/retrieval/context-pack.js +274 -6
- package/dist/src/retrieval/context-pack.js.map +1 -1
- package/dist/src/retrieval/current-truth.d.ts +326 -0
- package/dist/src/retrieval/current-truth.d.ts.map +1 -0
- package/dist/src/retrieval/current-truth.js +747 -0
- package/dist/src/retrieval/current-truth.js.map +1 -0
- package/dist/src/retrieval/git-state.d.ts +53 -0
- package/dist/src/retrieval/git-state.d.ts.map +1 -0
- package/dist/src/retrieval/git-state.js +174 -0
- package/dist/src/retrieval/git-state.js.map +1 -0
- package/dist/src/server/routes/friend-status.d.ts +63 -0
- package/dist/src/server/routes/friend-status.d.ts.map +1 -1
- package/dist/src/server/routes/friend-status.js +97 -0
- package/dist/src/server/routes/friend-status.js.map +1 -1
- package/dist/src/server/routes/mcp-usage.d.ts +4 -3
- package/dist/src/server/routes/mcp-usage.d.ts.map +1 -1
- package/dist/src/server/routes/mcp-usage.js.map +1 -1
- package/dist/src/server/routes/reconcile.d.ts.map +1 -1
- package/dist/src/server/routes/reconcile.js +16 -0
- package/dist/src/server/routes/reconcile.js.map +1 -1
- package/dist/src/storage/rebuild.d.ts.map +1 -1
- package/dist/src/storage/rebuild.js +24 -2
- package/dist/src/storage/rebuild.js.map +1 -1
- package/dist/src/storage/tables.d.ts +9 -0
- package/dist/src/storage/tables.d.ts.map +1 -1
- package/dist/src/storage/tables.js +22 -1
- package/dist/src/storage/tables.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `time_to_first_useful_recall` v1 instrumentation.
|
|
3
|
+
*
|
|
4
|
+
* Persists exactly four fields under `<data_dir>/metrics/onboarding.json`:
|
|
5
|
+
* - install_id (random UUID, minted on first read)
|
|
6
|
+
* - useful_state_reached_at (ISO timestamp or null)
|
|
7
|
+
* - first_useful_recall_at (ISO timestamp or null)
|
|
8
|
+
* - first_useful_recall_tool (one of the three retrieval tools)
|
|
9
|
+
*
|
|
10
|
+
* Privacy contract: query text, response text, hit IDs, source paths and
|
|
11
|
+
* client identifiers MUST NEVER land in this file. Writes go through a
|
|
12
|
+
* fixed-key sanitizer so an upstream caller that hands in extra fields
|
|
13
|
+
* cannot leak them by accident. Tests assert the persisted shape.
|
|
14
|
+
*
|
|
15
|
+
* Write-once: once a field is set, it is never overwritten. End
|
|
16
|
+
* stamping (`first_useful_recall_*`) requires `useful_state_reached_at`
|
|
17
|
+
* to have already been observed by a real readiness check — the metric's
|
|
18
|
+
* definition is "first MCP retrieval *after start*", so a recorded end
|
|
19
|
+
* without a prior recorded start would lie about the latency. If start
|
|
20
|
+
* is null when end fires, the end is dropped. To avoid losing the first
|
|
21
|
+
* real recall, callers should evaluate readiness via
|
|
22
|
+
* `stampOnboardingStartIfReady` (the shared helper used by
|
|
23
|
+
* `/status/friend`) before invoking the end-event recorder.
|
|
24
|
+
*/
|
|
25
|
+
import fs from "node:fs";
|
|
26
|
+
import path from "node:path";
|
|
27
|
+
import { randomUUID } from "node:crypto";
|
|
28
|
+
/** MCP retrieval tools that can satisfy the end-event condition. */
|
|
29
|
+
export const RETRIEVAL_TOOLS = new Set([
|
|
30
|
+
"rift_search",
|
|
31
|
+
"rift_conversations_search",
|
|
32
|
+
"rift_context_pack",
|
|
33
|
+
]);
|
|
34
|
+
export function onboardingMetricPath(dataDir) {
|
|
35
|
+
return path.join(dataDir, "metrics", "onboarding.json");
|
|
36
|
+
}
|
|
37
|
+
function isRetrievalTool(v) {
|
|
38
|
+
return typeof v === "string" && RETRIEVAL_TOOLS.has(v);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Read-or-bootstrap. A missing/corrupt file is replaced with a fresh
|
|
42
|
+
* record whose `install_id` is a new UUID. Unknown fields in an existing
|
|
43
|
+
* file are dropped on the next write (sanitizer drops everything outside
|
|
44
|
+
* the fixed key set).
|
|
45
|
+
*/
|
|
46
|
+
export function readOnboardingMetric(dataDir) {
|
|
47
|
+
const file = onboardingMetricPath(dataDir);
|
|
48
|
+
let parsed;
|
|
49
|
+
try {
|
|
50
|
+
const raw = fs.readFileSync(file, "utf8");
|
|
51
|
+
const obj = JSON.parse(raw);
|
|
52
|
+
if (obj && typeof obj === "object") {
|
|
53
|
+
parsed = obj;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// missing or unreadable — fall through to bootstrap
|
|
58
|
+
}
|
|
59
|
+
if (!parsed ||
|
|
60
|
+
typeof parsed["install_id"] !== "string" ||
|
|
61
|
+
parsed["install_id"].length === 0) {
|
|
62
|
+
const fresh = {
|
|
63
|
+
install_id: randomUUID(),
|
|
64
|
+
useful_state_reached_at: null,
|
|
65
|
+
first_useful_recall_at: null,
|
|
66
|
+
first_useful_recall_tool: null,
|
|
67
|
+
};
|
|
68
|
+
writeOnboardingMetric(dataDir, fresh);
|
|
69
|
+
return fresh;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
install_id: parsed["install_id"],
|
|
73
|
+
useful_state_reached_at: typeof parsed["useful_state_reached_at"] === "string"
|
|
74
|
+
? parsed["useful_state_reached_at"]
|
|
75
|
+
: null,
|
|
76
|
+
first_useful_recall_at: typeof parsed["first_useful_recall_at"] === "string"
|
|
77
|
+
? parsed["first_useful_recall_at"]
|
|
78
|
+
: null,
|
|
79
|
+
first_useful_recall_tool: isRetrievalTool(parsed["first_useful_recall_tool"])
|
|
80
|
+
? parsed["first_useful_recall_tool"]
|
|
81
|
+
: null,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Persist the metric. The sanitizer copies exactly four named fields —
|
|
86
|
+
* anything else a caller might have spliced onto the object is discarded
|
|
87
|
+
* before it touches disk. This is the privacy guard that the schema
|
|
88
|
+
* test pins.
|
|
89
|
+
*/
|
|
90
|
+
function writeOnboardingMetric(dataDir, metric) {
|
|
91
|
+
const file = onboardingMetricPath(dataDir);
|
|
92
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
93
|
+
const sanitized = {
|
|
94
|
+
install_id: metric.install_id,
|
|
95
|
+
useful_state_reached_at: metric.useful_state_reached_at,
|
|
96
|
+
first_useful_recall_at: metric.first_useful_recall_at,
|
|
97
|
+
first_useful_recall_tool: metric.first_useful_recall_tool,
|
|
98
|
+
};
|
|
99
|
+
fs.writeFileSync(file, JSON.stringify(sanitized, null, 2));
|
|
100
|
+
}
|
|
101
|
+
export function isUsefulStateReached(signals) {
|
|
102
|
+
return (signals.daemonHealthy &&
|
|
103
|
+
signals.voyageKeyValid &&
|
|
104
|
+
signals.indexedCount >= 1);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Stamp `useful_state_reached_at` if (a) readiness is observed and
|
|
108
|
+
* (b) the field is still null. No-op otherwise. Returns the (possibly
|
|
109
|
+
* updated) record.
|
|
110
|
+
*/
|
|
111
|
+
export function stampUsefulStateIfReady(dataDir, opts) {
|
|
112
|
+
const current = readOnboardingMetric(dataDir);
|
|
113
|
+
if (current.useful_state_reached_at !== null)
|
|
114
|
+
return current;
|
|
115
|
+
if (!opts.ready)
|
|
116
|
+
return current;
|
|
117
|
+
const next = {
|
|
118
|
+
...current,
|
|
119
|
+
useful_state_reached_at: opts.now,
|
|
120
|
+
};
|
|
121
|
+
writeOnboardingMetric(dataDir, next);
|
|
122
|
+
return next;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Stamp `first_useful_recall_*` if eligible. Eligibility:
|
|
126
|
+
* 1. tool is one of `RETRIEVAL_TOOLS`
|
|
127
|
+
* 2. response was not degraded
|
|
128
|
+
* 3. response had at least one hit
|
|
129
|
+
* 4. `first_useful_recall_at` is still null (write-once)
|
|
130
|
+
* 5. `useful_state_reached_at` was already observed (non-null)
|
|
131
|
+
*
|
|
132
|
+
* The metric measures "first MCP retrieval *after* start." If start
|
|
133
|
+
* has not been observed yet, end stamping is skipped — recording an
|
|
134
|
+
* end alongside a synthesised start would report a near-zero duration
|
|
135
|
+
* that doesn't reflect a real "from readiness to first useful recall"
|
|
136
|
+
* measurement. Callers that want to avoid dropping the first real
|
|
137
|
+
* recall should evaluate readiness via the shared helper
|
|
138
|
+
* (`stampOnboardingStartIfReady` on the daemon, exposed through
|
|
139
|
+
* `/status/friend`) before invoking this function.
|
|
140
|
+
*/
|
|
141
|
+
export function stampFirstUsefulRecallIfEligible(dataDir, opts) {
|
|
142
|
+
const current = readOnboardingMetric(dataDir);
|
|
143
|
+
if (!RETRIEVAL_TOOLS.has(opts.tool))
|
|
144
|
+
return current;
|
|
145
|
+
if (opts.isDegraded)
|
|
146
|
+
return current;
|
|
147
|
+
if (opts.hitCount < 1)
|
|
148
|
+
return current;
|
|
149
|
+
if (current.first_useful_recall_at !== null)
|
|
150
|
+
return current;
|
|
151
|
+
if (current.useful_state_reached_at === null)
|
|
152
|
+
return current;
|
|
153
|
+
const next = {
|
|
154
|
+
...current,
|
|
155
|
+
first_useful_recall_at: opts.now,
|
|
156
|
+
first_useful_recall_tool: opts.tool,
|
|
157
|
+
};
|
|
158
|
+
writeOnboardingMetric(dataDir, next);
|
|
159
|
+
return next;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Project the persisted metric to the three rendering states the
|
|
163
|
+
* status surface needs. Hidden = no start yet (don't show the line at
|
|
164
|
+
* all). Pending = start, no end. Completed = both, with a derived
|
|
165
|
+
* `duration_seconds`.
|
|
166
|
+
*/
|
|
167
|
+
export function computeOnboardingState(metric) {
|
|
168
|
+
if (!metric.useful_state_reached_at)
|
|
169
|
+
return { state: "hidden" };
|
|
170
|
+
if (!metric.first_useful_recall_at ||
|
|
171
|
+
!metric.first_useful_recall_tool) {
|
|
172
|
+
return {
|
|
173
|
+
state: "pending",
|
|
174
|
+
useful_state_reached_at: metric.useful_state_reached_at,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
const startMs = Date.parse(metric.useful_state_reached_at);
|
|
178
|
+
const endMs = Date.parse(metric.first_useful_recall_at);
|
|
179
|
+
const duration_seconds = Number.isNaN(startMs) || Number.isNaN(endMs)
|
|
180
|
+
? 0
|
|
181
|
+
: Math.max(0, Math.round((endMs - startMs) / 1000));
|
|
182
|
+
return {
|
|
183
|
+
state: "completed",
|
|
184
|
+
useful_state_reached_at: metric.useful_state_reached_at,
|
|
185
|
+
first_useful_recall_at: metric.first_useful_recall_at,
|
|
186
|
+
first_useful_recall_tool: metric.first_useful_recall_tool,
|
|
187
|
+
duration_seconds,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* MCP-side bridge between a finished retrieval-tool call and the
|
|
192
|
+
* end-event stamper. Mirrors the extractor logic in
|
|
193
|
+
* `observability/tool-usage.ts` for `result_count` and `degraded`, but
|
|
194
|
+
* stays self-contained so this module has no dependency on the logger.
|
|
195
|
+
*
|
|
196
|
+
* Readiness handshake: end stamping requires `useful_state_reached_at`
|
|
197
|
+
* to already be set (the metric is "first MCP retrieval *after*
|
|
198
|
+
* start", per the v1 spec). When the recorder finds start still null
|
|
199
|
+
* but the response is otherwise eligible, it invokes the optional
|
|
200
|
+
* `pingReadiness` callback (the MCP wrapper passes one that GETs
|
|
201
|
+
* `/status/friend` on the daemon, which evaluates readiness signals
|
|
202
|
+
* and stamps start lazily). After the ping returns, the metric is
|
|
203
|
+
* re-read and end is stamped only if start has now landed. When no
|
|
204
|
+
* callback is provided, or readiness still cannot be observed, the
|
|
205
|
+
* end event is silently dropped — that matches the contract that
|
|
206
|
+
* end-without-start would otherwise misreport as a near-zero duration.
|
|
207
|
+
*
|
|
208
|
+
* Never throws: persistence errors and ping errors are swallowed so
|
|
209
|
+
* onboarding telemetry can never break a tool call. CLI callers do not
|
|
210
|
+
* invoke this helper (it lives behind the MCP server's tool
|
|
211
|
+
* registration), so the "MCP-only end" constraint is enforced by
|
|
212
|
+
* construction.
|
|
213
|
+
*/
|
|
214
|
+
export async function recordMcpRetrievalForOnboarding(dataDir, tool, mcpResult, opts = {}) {
|
|
215
|
+
if (!RETRIEVAL_TOOLS.has(tool))
|
|
216
|
+
return;
|
|
217
|
+
if (mcpResult.isError)
|
|
218
|
+
return;
|
|
219
|
+
const initialNow = opts.now ?? new Date().toISOString();
|
|
220
|
+
try {
|
|
221
|
+
const signal = extractRetrievalSignal(tool, mcpResult);
|
|
222
|
+
if (signal.count === undefined)
|
|
223
|
+
return;
|
|
224
|
+
if (signal.degraded === true)
|
|
225
|
+
return;
|
|
226
|
+
if (signal.count < 1)
|
|
227
|
+
return;
|
|
228
|
+
// Cheap pre-check: if end is already stamped, skip everything
|
|
229
|
+
// (write-once means stampFirstUsefulRecallIfEligible would no-op
|
|
230
|
+
// anyway, but bailing here avoids a needless readiness ping).
|
|
231
|
+
let current = readOnboardingMetric(dataDir);
|
|
232
|
+
if (current.first_useful_recall_at !== null)
|
|
233
|
+
return;
|
|
234
|
+
// Readiness handshake: only when start is missing AND a ping is
|
|
235
|
+
// available. The end-condition (non-degraded, ≥ 1 hit) strictly
|
|
236
|
+
// implies the start-conditions hold in the wider system, but we
|
|
237
|
+
// still want the daemon to do the formal readiness observation
|
|
238
|
+
// (env present + last_embed_at + capability counts) before
|
|
239
|
+
// recording an end timestamp — otherwise the metric would lie
|
|
240
|
+
// about its own definition.
|
|
241
|
+
if (current.useful_state_reached_at === null && opts.pingReadiness) {
|
|
242
|
+
try {
|
|
243
|
+
await opts.pingReadiness();
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
// Ping failures degrade to "skip end this time" rather than
|
|
247
|
+
// breaking the tool call. The next eligible retrieval will
|
|
248
|
+
// re-attempt the ping.
|
|
249
|
+
}
|
|
250
|
+
// Re-read so the ordering clamp below sees the freshly stamped
|
|
251
|
+
// start (if any) before we record end.
|
|
252
|
+
current = readOnboardingMetric(dataDir);
|
|
253
|
+
}
|
|
254
|
+
// Ordering clamp: the metric measures "first MCP retrieval *after*
|
|
255
|
+
// start", so `first_useful_recall_at` must never be earlier than
|
|
256
|
+
// `useful_state_reached_at`. When the readiness ping above lazily
|
|
257
|
+
// stamps start during this same call, the retrieval `now` captured
|
|
258
|
+
// before the ping can be older than the freshly written start —
|
|
259
|
+
// recording the older `now` as end would produce an inverted pair
|
|
260
|
+
// that the duration projection then silently clamps to 0s, hiding
|
|
261
|
+
// the bug. Take the max so the persisted end is always >= start.
|
|
262
|
+
let now = initialNow;
|
|
263
|
+
if (current.useful_state_reached_at !== null &&
|
|
264
|
+
now < current.useful_state_reached_at) {
|
|
265
|
+
now = current.useful_state_reached_at;
|
|
266
|
+
}
|
|
267
|
+
stampFirstUsefulRecallIfEligible(dataDir, {
|
|
268
|
+
tool,
|
|
269
|
+
isDegraded: false,
|
|
270
|
+
hitCount: signal.count,
|
|
271
|
+
now,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
// Telemetry must never break tool execution.
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Per-tool `(count, degraded)` extraction. Duplicated from
|
|
280
|
+
* `tool-usage.ts` rather than imported to avoid circular dependency
|
|
281
|
+
* risk and to keep this module's contract narrow.
|
|
282
|
+
*/
|
|
283
|
+
function extractRetrievalSignal(tool, mcpResult) {
|
|
284
|
+
const sc = mcpResult.structuredContent;
|
|
285
|
+
if (tool === "rift_context_pack") {
|
|
286
|
+
if (!sc)
|
|
287
|
+
return {};
|
|
288
|
+
const sum = (key) => {
|
|
289
|
+
const v = sc[key];
|
|
290
|
+
return Array.isArray(v) ? v.length : 0;
|
|
291
|
+
};
|
|
292
|
+
const count = sum("decisions") + sum("constraints") + sum("examples") + sum("rules");
|
|
293
|
+
const out = { count };
|
|
294
|
+
if (typeof sc["degraded"] === "boolean")
|
|
295
|
+
out.degraded = sc["degraded"];
|
|
296
|
+
return out;
|
|
297
|
+
}
|
|
298
|
+
// search-style tools: prefer structuredContent.results, fall back to JSON-in-text.
|
|
299
|
+
const fromStructured = sc?.["results"];
|
|
300
|
+
if (Array.isArray(fromStructured)) {
|
|
301
|
+
const out = {
|
|
302
|
+
count: fromStructured.length,
|
|
303
|
+
};
|
|
304
|
+
if (typeof sc?.["degraded"] === "boolean") {
|
|
305
|
+
out.degraded = sc["degraded"];
|
|
306
|
+
}
|
|
307
|
+
return out;
|
|
308
|
+
}
|
|
309
|
+
try {
|
|
310
|
+
const text = mcpResult.content?.[0]?.text;
|
|
311
|
+
if (!text)
|
|
312
|
+
return {};
|
|
313
|
+
const parsed = JSON.parse(text);
|
|
314
|
+
const out = {};
|
|
315
|
+
if (Array.isArray(parsed["results"])) {
|
|
316
|
+
out.count = parsed["results"].length;
|
|
317
|
+
}
|
|
318
|
+
if (typeof parsed["degraded"] === "boolean") {
|
|
319
|
+
out.degraded = parsed["degraded"];
|
|
320
|
+
}
|
|
321
|
+
return out;
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return {};
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Render a duration like `7m 42s` / `1h 03m 17s` / `12s`. Used by the
|
|
329
|
+
* friend-status header so the value reads in human time, not seconds.
|
|
330
|
+
*/
|
|
331
|
+
export function formatOnboardingDuration(totalSeconds) {
|
|
332
|
+
const s = Math.max(0, Math.floor(totalSeconds));
|
|
333
|
+
const hours = Math.floor(s / 3600);
|
|
334
|
+
const minutes = Math.floor((s % 3600) / 60);
|
|
335
|
+
const seconds = s % 60;
|
|
336
|
+
if (hours > 0) {
|
|
337
|
+
return `${hours}h ${String(minutes).padStart(2, "0")}m ${String(seconds).padStart(2, "0")}s`;
|
|
338
|
+
}
|
|
339
|
+
if (minutes > 0) {
|
|
340
|
+
return `${minutes}m ${String(seconds).padStart(2, "0")}s`;
|
|
341
|
+
}
|
|
342
|
+
return `${seconds}s`;
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=onboarding-metric.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-metric.js","sourceRoot":"","sources":["../../../src/observability/onboarding-metric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS;IAC7C,aAAa;IACb,2BAA2B;IAC3B,mBAAmB;CACpB,CAAC,CAAC;AAyBH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,eAAe,CAAC,CAAU;IACjC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,IAAI,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,MAA2C,CAAC;IAChD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,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AAoB;IAC3D,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,GAAG,KAAK,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;IAC/F,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,OAAO,GAAG,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;IAC5D,CAAC;IACD,OAAO,GAAG,OAAO,GAAG,CAAC;AACvB,CAAC"}
|
|
@@ -18,6 +18,14 @@ export interface UsageWindow {
|
|
|
18
18
|
* Non-retrieval calls (rift_save, rift_status) are excluded.
|
|
19
19
|
*/
|
|
20
20
|
context_hits: number;
|
|
21
|
+
/**
|
|
22
|
+
* Subset of `context_hits` whose rows included `response_text_bytes`, meaning
|
|
23
|
+
* they actually contributed to `context_tokens_delivered_estimate`. Legacy
|
|
24
|
+
* rows written before byte measurement still count as context hits, but not
|
|
25
|
+
* as measured hits. SwiftBar renders this as "3/115 hits measured" so equal
|
|
26
|
+
* token totals across wider windows are understandable instead of suspicious.
|
|
27
|
+
*/
|
|
28
|
+
context_tokens_measured_hits: number;
|
|
21
29
|
/**
|
|
22
30
|
* Cheap tokens estimate (`ceil(bytes / 4)`) over the MCP text channel of
|
|
23
31
|
* every call that counts toward `context_hits`. Measured from the response
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-usage-stats.d.ts","sourceRoot":"","sources":["../../../src/observability/tool-usage-stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAsBtD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,iCAAiC,EAAE,MAAM,CAAC;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;;;;OAKG;IACH,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,kBAAkB,CAAC;CACpC;
|
|
1
|
+
{"version":3,"file":"tool-usage-stats.d.ts","sourceRoot":"","sources":["../../../src/observability/tool-usage-stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAsBtD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,4BAA4B,EAAE,MAAM,CAAC;IACrC;;;;;;;OAOG;IACH,iCAAiC,EAAE,MAAM,CAAC;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;;;;OAKG;IACH,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,kBAAkB,CAAC;CACpC;AAoED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,cAAc,EAAE,EACzB,GAAG,GAAE,IAAiB,GACrB,YAAY,CAuFd"}
|
|
@@ -16,7 +16,12 @@ function canonicalToolName(tool) {
|
|
|
16
16
|
}
|
|
17
17
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
18
18
|
function emptyWindow() {
|
|
19
|
-
return {
|
|
19
|
+
return {
|
|
20
|
+
calls: 0,
|
|
21
|
+
context_hits: 0,
|
|
22
|
+
context_tokens_measured_hits: 0,
|
|
23
|
+
context_tokens_delivered_estimate: 0,
|
|
24
|
+
};
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Cheap tokens estimate from a UTF-8 byte count. `bytes / 4` is the standard
|
|
@@ -93,8 +98,10 @@ export function aggregateUsage(entries, now = new Date()) {
|
|
|
93
98
|
const delivered = hit && typeof entry.response_text_bytes === "number"
|
|
94
99
|
? tokensFromBytes(entry.response_text_bytes)
|
|
95
100
|
: 0;
|
|
101
|
+
const measuredHit = hit && typeof entry.response_text_bytes === "number" ? 1 : 0;
|
|
96
102
|
summary.all_time.calls += 1;
|
|
97
103
|
summary.all_time.context_tokens_delivered_estimate += delivered;
|
|
104
|
+
summary.all_time.context_tokens_measured_hits += measuredHit;
|
|
98
105
|
summary.all_time.context_hits += hit;
|
|
99
106
|
summary.by_tool[tool] = (summary.by_tool[tool] ?? 0) + 1;
|
|
100
107
|
if (tool === "rift_search" && entry.search_mode === "exact_id") {
|
|
@@ -122,16 +129,19 @@ export function aggregateUsage(entries, now = new Date()) {
|
|
|
122
129
|
if (ts >= monthStartMs) {
|
|
123
130
|
summary.month.calls += 1;
|
|
124
131
|
summary.month.context_tokens_delivered_estimate += delivered;
|
|
132
|
+
summary.month.context_tokens_measured_hits += measuredHit;
|
|
125
133
|
summary.month.context_hits += hit;
|
|
126
134
|
}
|
|
127
135
|
if (ts >= weekStartMs) {
|
|
128
136
|
summary.week.calls += 1;
|
|
129
137
|
summary.week.context_tokens_delivered_estimate += delivered;
|
|
138
|
+
summary.week.context_tokens_measured_hits += measuredHit;
|
|
130
139
|
summary.week.context_hits += hit;
|
|
131
140
|
}
|
|
132
141
|
if (ts >= todayStartMs && ts < todayEndMs) {
|
|
133
142
|
summary.today.calls += 1;
|
|
134
143
|
summary.today.context_tokens_delivered_estimate += delivered;
|
|
144
|
+
summary.today.context_tokens_measured_hits += measuredHit;
|
|
135
145
|
summary.today.context_hits += hit;
|
|
136
146
|
}
|
|
137
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-usage-stats.js","sourceRoot":"","sources":["../../../src/observability/tool-usage-stats.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,MAAM,mBAAmB,GAA2B;IAClD,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,yBAAyB,EAAE,2BAA2B;IACtD,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEF,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC3C,CAAC;AAED,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-usage-stats.js","sourceRoot":"","sources":["../../../src/observability/tool-usage-stats.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,MAAM,mBAAmB,GAA2B;IAClD,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,yBAAyB,EAAE,2BAA2B;IACtD,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEF,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC3C,CAAC;AAED,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAqFnC,SAAS,WAAW;IAClB,OAAO;QACL,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,CAAC;QACf,4BAA4B,EAAE,CAAC;QAC/B,iCAAiC,EAAE,CAAC;KACrC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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B,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,iCAAiC,IAAI,SAAS,CAAC;YAC7D,OAAO,CAAC,KAAK,CAAC,4BAA4B,IAAI,WAAW,CAAC;YAC1D,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,GAAG,CAAC;QACpC,CAAC;QACD,IAAI,EAAE,IAAI,WAAW,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,iCAAiC,IAAI,SAAS,CAAC;YAC5D,OAAO,CAAC,IAAI,CAAC,4BAA4B,IAAI,WAAW,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,GAAG,CAAC;QACnC,CAAC;QACD,IAAI,EAAE,IAAI,YAAY,IAAI,EAAE,GAAG,UAAU,EAAE,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,iCAAiC,IAAI,SAAS,CAAC;YAC7D,OAAO,CAAC,KAAK,CAAC,4BAA4B,IAAI,WAAW,CAAC;YAC1D,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,GAAG,CAAC;QACpC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import type { EmbeddingProvider } from "../providers/types.js";
|
|
23
23
|
import type { SourceDir } from "../config/schema.js";
|
|
24
24
|
import { type RankedResult } from "./reranker.js";
|
|
25
|
+
import { type ConflictCard, type DiscountedCard, type EvidenceCard, type EvidenceIntent, type RecommendedLiveFile } from "./current-truth.js";
|
|
25
26
|
export declare const ITEM_TEXT_MAX = 200;
|
|
26
27
|
export declare const SNIPPET_MAX = 200;
|
|
27
28
|
export declare const DEFAULT_MAX_PER_BUCKET = 3;
|
|
@@ -48,6 +49,15 @@ export declare const TASK_MAX = 1024;
|
|
|
48
49
|
*/
|
|
49
50
|
export declare const DECISIONS_RELEVANCE_FLOOR = 0.3;
|
|
50
51
|
export declare const EXAMPLES_RELEVANCE_FLOOR = 0.3;
|
|
52
|
+
/**
|
|
53
|
+
* Equal-relevance band for {@link sortByRelevanceFirst}. Two candidates
|
|
54
|
+
* whose relevance signals (`max(S_sim, bm25_normalized)`) sit within
|
|
55
|
+
* this absolute delta are treated as effectively tied and fall through
|
|
56
|
+
* to the composite-score tie-breaker. Small enough to keep genuinely
|
|
57
|
+
* better relevance on top, wide enough that floating-point noise and
|
|
58
|
+
* trivial ranking jitter don't cause ping-pong between near-equal rows.
|
|
59
|
+
*/
|
|
60
|
+
export declare const RELEVANCE_TIE_EPSILON = 0.02;
|
|
51
61
|
export interface DecisionCard {
|
|
52
62
|
text: string;
|
|
53
63
|
source_id: string;
|
|
@@ -90,10 +100,46 @@ export interface RuleCard {
|
|
|
90
100
|
}
|
|
91
101
|
export interface ContextPack {
|
|
92
102
|
task: string;
|
|
103
|
+
/**
|
|
104
|
+
* Current Truth Mode v0 — intent the packager resolved from `task`.
|
|
105
|
+
* Drives which evidence sections are populated below.
|
|
106
|
+
*/
|
|
107
|
+
intent: EvidenceIntent;
|
|
93
108
|
decisions: DecisionCard[];
|
|
94
109
|
constraints: ConstraintCard[];
|
|
95
110
|
examples: ExampleCard[];
|
|
96
111
|
rules: RuleCard[];
|
|
112
|
+
/**
|
|
113
|
+
* Evidence partitioned by current-truth-vs-reasoning. Sections are
|
|
114
|
+
* optional and only emitted when populated — the renderer must not
|
|
115
|
+
* print "(none)" placeholders.
|
|
116
|
+
*
|
|
117
|
+
* - `current_truth` — tracker / source / recent evidence.
|
|
118
|
+
* - `past_reasoning` — conversation-derived evidence (taste, rationale,
|
|
119
|
+
* historical framing). Not demoted in `reasoning_archive` mode.
|
|
120
|
+
* - `older_memory` — older / non-canonical evidence kept for reference.
|
|
121
|
+
* - `discounted` — evidence the packager believes is stale or
|
|
122
|
+
* snapshot-shaped, with a short reason.
|
|
123
|
+
* - `recommended_live_files` — concrete paths the asker should read
|
|
124
|
+
* live before trusting the answer; populated when `current_truth` is
|
|
125
|
+
* empty or thin and the intent is current-truth/blended.
|
|
126
|
+
*/
|
|
127
|
+
current_truth?: EvidenceCard[];
|
|
128
|
+
past_reasoning?: EvidenceCard[];
|
|
129
|
+
older_memory?: EvidenceCard[];
|
|
130
|
+
discounted?: DiscountedCard[];
|
|
131
|
+
recommended_live_files?: RecommendedLiveFile[];
|
|
132
|
+
/**
|
|
133
|
+
* v2 surfaced conflicts (hard rule 4) — a discounted current-state
|
|
134
|
+
* source competing with higher-tier evidence. Optional; only emitted
|
|
135
|
+
* when populated.
|
|
136
|
+
*/
|
|
137
|
+
conflicts?: ConflictCard[];
|
|
138
|
+
/**
|
|
139
|
+
* v2 caveat (hard rule 3) — "tracker-backed, not live-verified" when
|
|
140
|
+
* `current_truth` has no `live_state`-tier evidence. Optional.
|
|
141
|
+
*/
|
|
142
|
+
current_truth_caveat?: string;
|
|
97
143
|
total_bytes: number;
|
|
98
144
|
truncated: boolean;
|
|
99
145
|
degraded: boolean;
|
|
@@ -119,6 +165,31 @@ export declare function buildContextPack(opts: BuildContextPackOptions): Promise
|
|
|
119
165
|
* synthetic `RankedResult`s.
|
|
120
166
|
*/
|
|
121
167
|
export declare function filterByRelevance(ranked: RankedResult[], floor: number): RankedResult[];
|
|
168
|
+
/**
|
|
169
|
+
* Re-sort ranked candidates so that query relevance dominates ordering,
|
|
170
|
+
* with the composite rerank score acting only as a tie-breaker.
|
|
171
|
+
*
|
|
172
|
+
* Primary key: `max(S_sim, bm25_normalized)`, descending — the same
|
|
173
|
+
* dual-channel signal `filterByRelevance` already uses, so semantic
|
|
174
|
+
* and keyword evidence are treated symmetrically. Two candidates whose
|
|
175
|
+
* primary keys are within `epsilon` ({@link RELEVANCE_TIE_EPSILON})
|
|
176
|
+
* fall through to the composite `score`, descending — preserving the
|
|
177
|
+
* freshness / quality / tier ordering that the PRD-6.2 reranker
|
|
178
|
+
* encodes when relevance is effectively equal. ID is a final
|
|
179
|
+
* tie-breaker for determinism.
|
|
180
|
+
*
|
|
181
|
+
* Slice motivation: the global reranker weights `S_sim` at only 55%
|
|
182
|
+
* of the composite score, so a confidently-captured but tangential row
|
|
183
|
+
* could outrank a clearly more relevant lower-confidence row in the
|
|
184
|
+
* `decisions` and `examples` buckets. This helper is applied only to
|
|
185
|
+
* the conversation pipeline that feeds those two buckets; `rift_search`
|
|
186
|
+
* and the global reranker are intentionally untouched. See
|
|
187
|
+
* docs/feedback/2026-05-14-fact-checking-rex.md (P1 #5) for the REX
|
|
188
|
+
* trace that motivated the change.
|
|
189
|
+
*
|
|
190
|
+
* Pure / non-mutating: returns a new array.
|
|
191
|
+
*/
|
|
192
|
+
export declare function sortByRelevanceFirst(ranked: RankedResult[], epsilon?: number): RankedResult[];
|
|
122
193
|
export declare function extractConstraintLines(content: string): string[];
|
|
123
194
|
/**
|
|
124
195
|
* True when `source_path` points into a `data/raw/conversations/**` directory.
|
|
@@ -128,4 +199,33 @@ export declare function extractConstraintLines(content: string): string[];
|
|
|
128
199
|
*/
|
|
129
200
|
export declare function isRawConversationPath(p: unknown): boolean;
|
|
130
201
|
export declare function shouldExcludeDocFromRules(p: unknown): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* True when `source_path`'s basename ends with `-prompt.md` — the naming
|
|
204
|
+
* convention this project uses for one-shot agent prompts (e.g.
|
|
205
|
+
* `reports/insights/2026-05-03-opus-rift-intelligence-snapshot-prompt.md`,
|
|
206
|
+
* `docs/05-claude-code-challenge-prompt.md`). These files routinely
|
|
207
|
+
* include `Hard Constraints` sections such as "Do not modify, create,
|
|
208
|
+
* delete, move, or rewrite any repository file." which match the
|
|
209
|
+
* imperative-marker gate in {@link extractConstraintLines} but are
|
|
210
|
+
* one-shot scaffolding, not durable project law — surfacing them in the
|
|
211
|
+
* `constraints` bucket erodes trust in the bucket as a whole
|
|
212
|
+
* (`docs/feedback/2026-05-14-fact-checking-rex.md`, P1 #6).
|
|
213
|
+
*
|
|
214
|
+
* Intentionally narrow: only files whose basename ends in literal
|
|
215
|
+
* `-prompt.md` match. A spec doc like `docs/02-agent-access-without-prompting.md`
|
|
216
|
+
* (ends in `-prompting.md`), a playbook like `prompts-overview.md`, or a
|
|
217
|
+
* mid-name occurrence like `prompt-engineering-notes.md` are untouched.
|
|
218
|
+
* Over-filtering a real project rule is worse than letting some prompt
|
|
219
|
+
* noise through.
|
|
220
|
+
*/
|
|
221
|
+
export declare function isPromptArtifactPath(p: unknown): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Per-bucket exclusion for the `constraints` surface. Combines the
|
|
224
|
+
* baseline engine/build filter with the one-shot prompt-artifact filter
|
|
225
|
+
* so an agent prompt can still appear in `rules` (as legitimate doc
|
|
226
|
+
* evidence — "this is what we instructed Opus") without contributing
|
|
227
|
+
* its imperative-marker lines to `constraints` (as if they were project
|
|
228
|
+
* law).
|
|
229
|
+
*/
|
|
230
|
+
export declare function shouldExcludeDocFromConstraints(p: unknown): boolean;
|
|
131
231
|
//# sourceMappingURL=context-pack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-pack.d.ts","sourceRoot":"","sources":["../../../src/retrieval/context-pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"context-pack.d.ts","sourceRoot":"","sources":["../../../src/retrieval/context-pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,E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