wyrm-mcp 6.17.0 → 6.18.1

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/README.md CHANGED
@@ -319,7 +319,7 @@ Wyrm exposes 38 tools via the Model Context Protocol:
319
319
  | Tool | Description |
320
320
  |------|-------------|
321
321
  | `wyrm_remember` | Store a distilled memory artifact — pattern, lesson, anti-pattern, heuristic, or reasoning trace |
322
- | `wyrm_recall` | Retrieve relevant memory artifacts for a task using 2-stage FTS + tag retrieval with confidence scoring |
322
+ | `wyrm_recall` | Retrieve relevant memory artifacts for a task hybrid FTS5 + local-vector retrieval (convex score blend) when embeddings are available, lexical+tag fallback offline |
323
323
  | `wyrm_feedback` | Record whether a recalled artifact was helpful (updates confidence via Bayesian adjustment) |
324
324
  | `wyrm_context_build` | Assemble a task-specific context brief: ground truths + best scaffold + relevant memory artifacts |
325
325
 
@@ -332,7 +332,7 @@ Wyrm exposes 38 tools via the Model Context Protocol:
332
332
  | `wyrm_scaffold_save` | Save a reasoning scaffold — structured step-by-step checklist for a problem type |
333
333
  | `wyrm_scaffold_get` | Find the best matching reasoning scaffold for a task description |
334
334
  | `wyrm_distill` | Queue candidate memory artifacts from a session for human review |
335
- | `wyrm_review` | Approve (activate) or reject (delete) a queued distillation artifact |
335
+ | `wyrm_review` | Approve (activate) or reject (permanently delete) any queued review candidate — from auto-capture, harvest, capture conflict-routing, imports, or distillation |
336
336
 
337
337
  ---
338
338
 
@@ -0,0 +1,70 @@
1
+ /**
2
+ * v7 deprecation notices — Wyrm 6.18 bridge release (BROOD Phase F1, T007).
3
+ *
4
+ * 100% ADDITIVE on the 6.x surface: nothing here changes tool behavior,
5
+ * names, schemas, or profiles. This module is the single registry for the
6
+ * 22 CLI-exile candidates (spec FR-4: 18 operator tools + the device-egress
7
+ * quartet) and emits three kinds of forward-compat warnings:
8
+ *
9
+ * 1. A description SUFFIX merged into tools/list at build time
10
+ * (`applyDeprecationNotices`, wired in the ListToolsRequestSchema
11
+ * handler next to `annotateTools`).
12
+ * 2. A ONE-TIME-per-tool stderr note when a deprecated tool is invoked via
13
+ * MCP (`noteDeprecatedToolInvocation`, wired at the top of the CallTool
14
+ * handler). Failure-isolated: it can never block or break a call.
15
+ * 3. A ONE-TIME stderr notice when `WYRM_PROFILE=full` is in use
16
+ * (`noteFullProfileDeprecation`): in 7.0 `full` becomes a permanent
17
+ * synonym for `legacy` (the alias-spine surface). Behavior is unchanged
18
+ * today.
19
+ *
20
+ * The wyrm-http startup deprecation warning lives in src/http-server.ts
21
+ * (that whole server is slated for deletion in 7.0 — `wyrm serve` replaces
22
+ * it).
23
+ *
24
+ * CLI commands follow the spec FR-4 / T023 disposition: `wyrm
25
+ * setup|embed|sync|cloud` already exist; `wyrm
26
+ * license|activate|index|update|prompt|hours|invoice|agent` ship with T023.
27
+ * In 7.0 the MCP aliases for these names return a structured redirect to the
28
+ * exact command below — EXCEPT `wyrm_cloud_backup` and `wyrm_sync_export`,
29
+ * which stay FUNCTIONAL through 7.0.x with a published sunset so scheduled
30
+ * backups never silently stop.
31
+ *
32
+ * All output goes to STDERR only (stdout is the MCP wire on stdio).
33
+ */
34
+ export interface CliExileEntry {
35
+ /** The exact `wyrm` CLI replacement command. */
36
+ cli: string;
37
+ /**
38
+ * Set for the egress pair whose MCP aliases remain functional through
39
+ * 7.0.x (published sunset) — cloud_backup / sync_export.
40
+ */
41
+ functionalThrough?: string;
42
+ }
43
+ /** The 22 CLI-exile candidates (spec FR-4): 18 operator + 4 device-egress. */
44
+ export declare const CLI_EXILE_TOOLS: Readonly<Record<string, CliExileEntry>>;
45
+ /**
46
+ * The description suffix advertised on a deprecated tool, or '' for
47
+ * non-deprecated tools. Exact format pinned by tests.
48
+ */
49
+ export declare function deprecationSuffix(name: string): string;
50
+ /**
51
+ * Append the deprecation suffix to each CLI-exile tool's description.
52
+ * Non-mutating; unknown tools pass through untouched. Never throws.
53
+ */
54
+ export declare function applyDeprecationNotices<T extends {
55
+ name: string;
56
+ description?: string;
57
+ }>(tools: T[]): T[];
58
+ /** Test hook: reset the one-time warning state. */
59
+ export declare function _resetDeprecationWarningsForTests(): void;
60
+ /**
61
+ * One-time stderr note when a CLI-exile tool is invoked via MCP.
62
+ * Failure-isolated: never throws, never blocks the call.
63
+ */
64
+ export declare function noteDeprecatedToolInvocation(name: string): void;
65
+ /**
66
+ * One-time stderr notice that WYRM_PROFILE=full becomes a permanent synonym
67
+ * for 'legacy' in 7.0 (behavior unchanged today). Failure-isolated.
68
+ */
69
+ export declare function noteFullProfileDeprecation(): void;
70
+ //# sourceMappingURL=deprecations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecations.d.ts","sourceRoot":"","sources":["../src/deprecations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CA0BnE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOtD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EACtF,KAAK,EAAE,CAAC,EAAE,GACT,CAAC,EAAE,CAML;AAMD,mDAAmD;AACnD,wBAAgB,iCAAiC,IAAI,IAAI,CAGxD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAe/D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAYjD"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * v7 deprecation notices — Wyrm 6.18 bridge release (BROOD Phase F1, T007).
3
+ *
4
+ * 100% ADDITIVE on the 6.x surface: nothing here changes tool behavior,
5
+ * names, schemas, or profiles. This module is the single registry for the
6
+ * 22 CLI-exile candidates (spec FR-4: 18 operator tools + the device-egress
7
+ * quartet) and emits three kinds of forward-compat warnings:
8
+ *
9
+ * 1. A description SUFFIX merged into tools/list at build time
10
+ * (`applyDeprecationNotices`, wired in the ListToolsRequestSchema
11
+ * handler next to `annotateTools`).
12
+ * 2. A ONE-TIME-per-tool stderr note when a deprecated tool is invoked via
13
+ * MCP (`noteDeprecatedToolInvocation`, wired at the top of the CallTool
14
+ * handler). Failure-isolated: it can never block or break a call.
15
+ * 3. A ONE-TIME stderr notice when `WYRM_PROFILE=full` is in use
16
+ * (`noteFullProfileDeprecation`): in 7.0 `full` becomes a permanent
17
+ * synonym for `legacy` (the alias-spine surface). Behavior is unchanged
18
+ * today.
19
+ *
20
+ * The wyrm-http startup deprecation warning lives in src/http-server.ts
21
+ * (that whole server is slated for deletion in 7.0 — `wyrm serve` replaces
22
+ * it).
23
+ *
24
+ * CLI commands follow the spec FR-4 / T023 disposition: `wyrm
25
+ * setup|embed|sync|cloud` already exist; `wyrm
26
+ * license|activate|index|update|prompt|hours|invoice|agent` ship with T023.
27
+ * In 7.0 the MCP aliases for these names return a structured redirect to the
28
+ * exact command below — EXCEPT `wyrm_cloud_backup` and `wyrm_sync_export`,
29
+ * which stay FUNCTIONAL through 7.0.x with a published sunset so scheduled
30
+ * backups never silently stop.
31
+ *
32
+ * All output goes to STDERR only (stdout is the MCP wire on stdio).
33
+ */
34
+ /** The 22 CLI-exile candidates (spec FR-4): 18 operator + 4 device-egress. */
35
+ export const CLI_EXILE_TOOLS = {
36
+ // ── 18 operator tools ──────────────────────────────────────────────────
37
+ wyrm_setup: { cli: "wyrm setup" },
38
+ wyrm_embed: { cli: "wyrm embed" },
39
+ wyrm_inject_prompt: { cli: "wyrm prompt inject" },
40
+ wyrm_migrate_prompt: { cli: "wyrm prompt migrate" },
41
+ wyrm_check_update: { cli: "wyrm update --check" },
42
+ wyrm_self_update: { cli: "wyrm update" },
43
+ wyrm_vector_setup: { cli: "wyrm index setup" },
44
+ // reindex's long-running form also survives inside wyrm_maintenance (FR-3).
45
+ wyrm_reindex: { cli: "wyrm index rebuild" },
46
+ wyrm_encrypt_setup: { cli: "wyrm setup --encrypt" },
47
+ wyrm_license: { cli: "wyrm license" },
48
+ wyrm_activate: { cli: "wyrm activate <key>" },
49
+ wyrm_hours_report: { cli: "wyrm hours report" },
50
+ wyrm_invoice_generate: { cli: "wyrm invoice generate" },
51
+ wyrm_agent_init: { cli: "wyrm agent init" },
52
+ wyrm_agent_status: { cli: "wyrm agent status" },
53
+ wyrm_agent_stop: { cli: "wyrm agent stop" },
54
+ wyrm_agent_restart: { cli: "wyrm agent restart" },
55
+ wyrm_intro: { cli: "wyrm intro" },
56
+ // ── device-egress quartet ──────────────────────────────────────────────
57
+ wyrm_sync_export: { cli: "wyrm sync export --out <path>", functionalThrough: "7.0.x" },
58
+ wyrm_sync_import: { cli: "wyrm sync import --from <path>" },
59
+ wyrm_cloud_backup: { cli: "wyrm cloud backup", functionalThrough: "7.0.x" },
60
+ wyrm_cloud_sync: { cli: "wyrm cloud sync" },
61
+ };
62
+ /**
63
+ * The description suffix advertised on a deprecated tool, or '' for
64
+ * non-deprecated tools. Exact format pinned by tests.
65
+ */
66
+ export function deprecationSuffix(name) {
67
+ const entry = CLI_EXILE_TOOLS[name];
68
+ if (!entry)
69
+ return "";
70
+ const grace = entry.functionalThrough
71
+ ? ` — remains functional through ${entry.functionalThrough}`
72
+ : "";
73
+ return ` [Deprecated in v7 → use the wyrm CLI: ${entry.cli}${grace}]`;
74
+ }
75
+ /**
76
+ * Append the deprecation suffix to each CLI-exile tool's description.
77
+ * Non-mutating; unknown tools pass through untouched. Never throws.
78
+ */
79
+ export function applyDeprecationNotices(tools) {
80
+ return tools.map((tool) => {
81
+ const suffix = deprecationSuffix(tool.name);
82
+ if (!suffix)
83
+ return tool;
84
+ return { ...tool, description: `${tool.description ?? ""}${suffix}` };
85
+ });
86
+ }
87
+ // One-time-per-process warning state (per tool name + the profile notice).
88
+ const warnedTools = new Set();
89
+ let warnedFullProfile = false;
90
+ /** Test hook: reset the one-time warning state. */
91
+ export function _resetDeprecationWarningsForTests() {
92
+ warnedTools.clear();
93
+ warnedFullProfile = false;
94
+ }
95
+ /**
96
+ * One-time stderr note when a CLI-exile tool is invoked via MCP.
97
+ * Failure-isolated: never throws, never blocks the call.
98
+ */
99
+ export function noteDeprecatedToolInvocation(name) {
100
+ try {
101
+ const entry = CLI_EXILE_TOOLS[name];
102
+ if (!entry || warnedTools.has(name))
103
+ return;
104
+ warnedTools.add(name);
105
+ const grace = entry.functionalThrough
106
+ ? ` This name stays functional through ${entry.functionalThrough} (published sunset) so scheduled jobs never silently stop.`
107
+ : "";
108
+ process.stderr.write(`[wyrm] DEPRECATION: '${name}' moves off MCP to the wyrm CLI in 7.0 — use: ${entry.cli}.` +
109
+ ` Behavior is unchanged in 6.18.${grace}\n`);
110
+ }
111
+ catch {
112
+ /* warnings must never break a tool call */
113
+ }
114
+ }
115
+ /**
116
+ * One-time stderr notice that WYRM_PROFILE=full becomes a permanent synonym
117
+ * for 'legacy' in 7.0 (behavior unchanged today). Failure-isolated.
118
+ */
119
+ export function noteFullProfileDeprecation() {
120
+ try {
121
+ if (warnedFullProfile)
122
+ return;
123
+ if ((process.env.WYRM_PROFILE ?? "").toLowerCase() !== "full")
124
+ return;
125
+ warnedFullProfile = true;
126
+ process.stderr.write("[wyrm] NOTICE: WYRM_PROFILE=full becomes an alias of 'legacy' in Wyrm 7.0 " +
127
+ "(every 6.x name stays callable via the alias spine). Behavior is unchanged today.\n");
128
+ }
129
+ catch {
130
+ /* warnings must never break the server */
131
+ }
132
+ }
133
+ //# sourceMappingURL=deprecations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecations.js","s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,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAC5C,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,MAAM,KAAK,GAAG,KAAK,CAAC,iBAAiB;YACnC,CAAC,CAAC,uCAAuC,KAAK,CAAC,iBAAiB,4DAA4D;YAC5H,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,wBAAwB,IAAI,iDAAiD,KAAK,CAAC,GAAG,GAAG;YACvF,kCAAkC,KAAK,IAAI,CAC9C,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,2CAA2C;IAC7C,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACxC,IAAI,CAAC;QACH,IAAI,iBAAiB;YAAE,OAAO;QAC9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM;YAAE,OAAO;QACtE,iBAAiB,GAAG,IAAI,CAAC;QACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,4EAA4E;YAC1E,qFAAqF,CACxF,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,0CAA0C;IAC5C,CAAC;AACH,CAAC"}
@@ -48,7 +48,9 @@ export declare class FailurePatterns {
48
48
  record(input: RecordInput): FailurePattern;
49
49
  get(id: number): FailurePattern | null;
50
50
  /** Check whether a proposed action matches any unresolved failure.
51
- * Returns the matching patterns, ranked by recency × occurrences. */
51
+ * Stage 1: exact signature match (scope+target+description); stage 2 fallback:
52
+ * FTS fuzzy match within the same scope. Both ordered by occurrences DESC,
53
+ * last_seen DESC, LIMIT 5 — no multiplicative recency-times-occurrences score. */
52
54
  check(scope: FailureScope, target: string, description: string, projectId?: number | null): FailurePattern[];
53
55
  /** List unresolved failures in a project, most-recent-first. */
54
56
  list(projectId?: number | null, limit?: number): FailurePattern[];
@@ -1 +1 @@
1
- {"version":3,"file":"failure-patterns.d.ts","sourceRoot":"","sources":["../src/failure-patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAI3C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ,CAAC,QAAQ;IAEzC;mEAC+D;IAC/D,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,M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 export class FailurePatterns {
63
63
  return row ?? null;
64
64
  }
65
65
  /** Check whether a proposed action matches any unresolved failure.
66
- * Returns the matching patterns, ranked by recency × occurrences. */
66
+ * Stage 1: exact signature match (scope+target+description); stage 2 fallback:
67
+ * FTS fuzzy match within the same scope. Both ordered by occurrences DESC,
68
+ * last_seen DESC, LIMIT 5 — no multiplicative recency-times-occurrences score. */
67
69
  check(scope, target, description, projectId) {
68
70
  const signature = FailurePatterns.signature(scope, target, description);
69
71
  const exact = this.db.prepare(`
@@ -1 +1 @@
1
- {"version":3,"file":"failure-patterns.js","sourceRoot":"","sources":["../src/failure-patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA8BxC,MAAM,OAAO,eAAe;IACN;IAApB,YAAoB,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;IAAG,CAAC;IAE7C;mEAC+D;IAC/D,MAAM,CAAC,SAAS,CAAC,KAAa,EAAE,MAAc,EAAE,WAAmB;QACjE,oDAAoD;QACpD,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CACzB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC5D,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IACtE,CAAC;IAED,yEAAyE;IACzE,MAAM,CAAC,KAAkB;QACvB,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CACzC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAC7C,CAAC;QACF,MAAM,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CAAC;YACH,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;;;;;;;;OAStB,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,IAAI,IAAI,EAAE,SAAS,IAAI,IAAI,EAAE,KAAK,CAAqB,CAAC;QAC7E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,gEAAgE;IAChE,IAAI,CAAC,SAAyB,EAAE,KAAK,GAAG,EAAE;QACxC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CACpB;yCACiC,CAClC,CAAC,GAAG,CAAC,KAAK,CAAqB,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CACpB;;uCAEiC,CAClC,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAqB,CAAC;IAC9C,CAAC;IAED,mEAAmE;IACnE,OAAO,CAAC,EAAU,EAAE,IAAa;QAC/B,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;;;KAIf,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IAED,6EAA6E;IAC7E,MAAM,CAAC,EAAU;QACf,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAC1B,2CAA2C,CAC5C,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACV,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Golden-transcript capture — Wyrm 7.0 BROOD, Phase F1 (T003b).
3
+ *
4
+ * Opt-in (`WYRM_GOLDEN_CAPTURE=1`, default OFF — Article VII) full-fidelity
5
+ * request/response JSONL capture at the single CallTool dispatch choke point
6
+ * (src/index.ts), covering BOTH dispatch families (handlerRegistry + the
7
+ * switch) plus the cache-hit early return and both catch returns. This is the
8
+ * fidelity `tool_call_log` deliberately lacks (its args_summary is truncated +
9
+ * value-stripped by design — frequency/coverage ranking only, NOT replayable).
10
+ * The corpus feeds the T021 alias-spine replay gate.
11
+ *
12
+ * Design spec: specs/wyrm-v7-brood/research/golden-capture-spec.md
13
+ *
14
+ * Contract (the `emitEvent` contract — src/events.ts):
15
+ * - NEVER throws and never blocks the tool path; entire body try/catch,
16
+ * warn to stderr only (stdout is the MCP transport).
17
+ * - Circuit breaker: 5 consecutive write failures disable capture for the
18
+ * process lifetime with a single warning (no warn-per-call storm on a
19
+ * full disk).
20
+ * - Lazy init: dir creation attempted on first capture, not at startup.
21
+ * - Article III: pure local fs append — no LLM, no network, no new deps.
22
+ * - Secrets redacted BY KEY (recursive, request AND response, on a deep
23
+ * clone — the live result object is still on its way to the client and is
24
+ * never mutated), plus a value-pattern safety net for secrets smuggled
25
+ * through benign fields. Redacted paths are recorded in `redactions[]` so
26
+ * replay can wildcard them.
27
+ */
28
+ export type GoldenOutcome = "ok" | "soft_error" | "validation_error" | "error" | "unknown_tool";
29
+ export interface GoldenCaptureInput {
30
+ /** Tool name as dispatched. */
31
+ tool: string;
32
+ /** Raw request arguments (pre-redaction; never mutated). */
33
+ args: unknown;
34
+ /** Optional request _meta passthrough. */
35
+ meta?: unknown;
36
+ /** The exact response object returned to the client (never mutated). */
37
+ response: unknown;
38
+ /**
39
+ * Outcome when the call site knows it (catch paths). When omitted it is
40
+ * derived from the response: isError + "Unknown tool:" → unknown_tool,
41
+ * isError → soft_error, else ok.
42
+ */
43
+ outcome?: GoldenOutcome;
44
+ /** True only on the read-only-cache early return. */
45
+ cached?: boolean;
46
+ /** Wall time of the call in ms. */
47
+ ms: number;
48
+ /** Which dispatch family owns the tool (handlerRegistry.has(name)). */
49
+ dispatch: "registry" | "switch";
50
+ }
51
+ /**
52
+ * Redact a value tree for a given tool, recording redacted paths into
53
+ * `redactions`. Exported for direct unit testing.
54
+ */
55
+ export declare function redactForGolden(tool: string, value: unknown, rootPath: string, redactions: string[]): unknown;
56
+ /** Flag check — lazy per call (cheap string compare), default OFF. */
57
+ export declare function isGoldenCaptureEnabled(): boolean;
58
+ /**
59
+ * Capture one CallTool round-trip as a JSONL golden record. NEVER throws,
60
+ * never blocks; no-op unless WYRM_GOLDEN_CAPTURE=1 (Article VII: default OFF).
61
+ */
62
+ export declare function goldenCapture(input: GoldenCaptureInput): void;
63
+ /** Reset breaker/sequence state between tests. */
64
+ export declare function __resetGoldenForTests(): void;
65
+ /** Read-only view of the capture state for tests. */
66
+ export declare function __goldenStateForTests(): {
67
+ seq: number;
68
+ writeFailures: number;
69
+ disabled: boolean;
70
+ warned: boolean;
71
+ };
72
+ //# sourceMappingURL=golden.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golden.d.ts","sourceRoot":"","sources":["../src/golden.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA0BH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,YAAY,GAAG,kBAAkB,GAAG,OAAO,GAAG,cAAc,CAAC;AAEhG,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,IAAI,EAAE,OAAO,CAAC;IACd,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wEAAwE;IACxE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC;CACjC;AAuKD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAA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