@miller-tech/uap 1.175.13 → 1.178.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.
Files changed (95) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/benchmarks/harness-card.d.ts +86 -0
  3. package/dist/benchmarks/harness-card.d.ts.map +1 -0
  4. package/dist/benchmarks/harness-card.js +153 -0
  5. package/dist/benchmarks/harness-card.js.map +1 -0
  6. package/dist/benchmarks/paired/report.d.ts +15 -0
  7. package/dist/benchmarks/paired/report.d.ts.map +1 -1
  8. package/dist/benchmarks/paired/report.js +12 -0
  9. package/dist/benchmarks/paired/report.js.map +1 -1
  10. package/dist/benchmarks/paired/types.d.ts +1 -1
  11. package/dist/bin/cli.js +27 -0
  12. package/dist/bin/cli.js.map +1 -1
  13. package/dist/cli/bench.d.ts.map +1 -1
  14. package/dist/cli/bench.js +64 -3
  15. package/dist/cli/bench.js.map +1 -1
  16. package/dist/cli/harness.d.ts +3 -2
  17. package/dist/cli/harness.d.ts.map +1 -1
  18. package/dist/cli/harness.js +81 -0
  19. package/dist/cli/harness.js.map +1 -1
  20. package/dist/cli/memory.d.ts +7 -1
  21. package/dist/cli/memory.d.ts.map +1 -1
  22. package/dist/cli/memory.js +165 -0
  23. package/dist/cli/memory.js.map +1 -1
  24. package/dist/delivery/agentic-executor.d.ts +76 -2
  25. package/dist/delivery/agentic-executor.d.ts.map +1 -1
  26. package/dist/delivery/agentic-executor.js +231 -29
  27. package/dist/delivery/agentic-executor.js.map +1 -1
  28. package/dist/delivery/edit-match.d.ts +134 -0
  29. package/dist/delivery/edit-match.d.ts.map +1 -0
  30. package/dist/delivery/edit-match.js +331 -0
  31. package/dist/delivery/edit-match.js.map +1 -0
  32. package/dist/memory/dynamic-retrieval.d.ts.map +1 -1
  33. package/dist/memory/dynamic-retrieval.js +57 -0
  34. package/dist/memory/dynamic-retrieval.js.map +1 -1
  35. package/dist/memory/reconstruct-ingest.d.ts +88 -0
  36. package/dist/memory/reconstruct-ingest.d.ts.map +1 -0
  37. package/dist/memory/reconstruct-ingest.js +165 -0
  38. package/dist/memory/reconstruct-ingest.js.map +1 -0
  39. package/dist/memory/reconstruct-store.d.ts +143 -0
  40. package/dist/memory/reconstruct-store.d.ts.map +1 -0
  41. package/dist/memory/reconstruct-store.js +312 -0
  42. package/dist/memory/reconstruct-store.js.map +1 -0
  43. package/dist/memory/reconstruct.d.ts +272 -0
  44. package/dist/memory/reconstruct.d.ts.map +1 -0
  45. package/dist/memory/reconstruct.js +552 -0
  46. package/dist/memory/reconstruct.js.map +1 -0
  47. package/dist/policies/schemas/policy.d.ts +2 -2
  48. package/dist/self-harness/evidence-proposer.d.ts +58 -0
  49. package/dist/self-harness/evidence-proposer.d.ts.map +1 -0
  50. package/dist/self-harness/evidence-proposer.js +132 -0
  51. package/dist/self-harness/evidence-proposer.js.map +1 -0
  52. package/dist/self-harness/manifest.d.ts +130 -0
  53. package/dist/self-harness/manifest.d.ts.map +1 -0
  54. package/dist/self-harness/manifest.js +247 -0
  55. package/dist/self-harness/manifest.js.map +1 -0
  56. package/dist/self-harness/mods.d.ts +57 -3
  57. package/dist/self-harness/mods.d.ts.map +1 -1
  58. package/dist/self-harness/mods.js +72 -0
  59. package/dist/self-harness/mods.js.map +1 -1
  60. package/dist/self-harness/orchestrator.d.ts +27 -0
  61. package/dist/self-harness/orchestrator.d.ts.map +1 -1
  62. package/dist/self-harness/orchestrator.js +47 -4
  63. package/dist/self-harness/orchestrator.js.map +1 -1
  64. package/dist/self-harness/pending.d.ts +17 -3
  65. package/dist/self-harness/pending.d.ts.map +1 -1
  66. package/dist/self-harness/pending.js +26 -4
  67. package/dist/self-harness/pending.js.map +1 -1
  68. package/dist/self-harness/profile.d.ts +17 -1
  69. package/dist/self-harness/profile.d.ts.map +1 -1
  70. package/dist/self-harness/profile.js +11 -4
  71. package/dist/self-harness/profile.js.map +1 -1
  72. package/dist/self-harness/run.d.ts +19 -0
  73. package/dist/self-harness/run.d.ts.map +1 -1
  74. package/dist/self-harness/run.js +43 -4
  75. package/dist/self-harness/run.js.map +1 -1
  76. package/dist/self-harness/transfer.d.ts.map +1 -1
  77. package/dist/self-harness/transfer.js +2 -0
  78. package/dist/self-harness/transfer.js.map +1 -1
  79. package/dist/self-harness/validate.d.ts +17 -6
  80. package/dist/self-harness/validate.d.ts.map +1 -1
  81. package/dist/self-harness/validate.js +73 -8
  82. package/dist/self-harness/validate.js.map +1 -1
  83. package/dist/telemetry/tool-calls.d.ts +82 -0
  84. package/dist/telemetry/tool-calls.d.ts.map +1 -0
  85. package/dist/telemetry/tool-calls.js +280 -0
  86. package/dist/telemetry/tool-calls.js.map +1 -0
  87. package/dist/telemetry/tool-failure.d.ts +71 -0
  88. package/dist/telemetry/tool-failure.d.ts.map +1 -0
  89. package/dist/telemetry/tool-failure.js +123 -0
  90. package/dist/telemetry/tool-failure.js.map +1 -0
  91. package/docs/plans/harness-engineering-uplift-2026-07-31.md +280 -0
  92. package/package.json +1 -1
  93. package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
  94. package/templates/hooks/__pycache__/deliver_autoroute.cpython-312.pyc +0 -0
  95. package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
@@ -0,0 +1,280 @@
1
+ /**
2
+ * Per-tool-call evidence corpus (harness plan areas D1/D3, 2026-07-31).
3
+ *
4
+ * Before this module, UAP's telemetry recorded sessions, routing decisions and
5
+ * time series — but NOT what happened inside the agent loop. The self-harness
6
+ * propose stage therefore had no evidence to reason from, which is why it could
7
+ * only search inference-server knobs: those are the only thing it could measure.
8
+ *
9
+ * Agentic Harness Engineering (arXiv 2604.25850) calls this layer "experience
10
+ * observability": distil trajectories into a layered corpus with per-task failure
11
+ * analysis and a benchmark-level overview, so mutation proposal is grounded
12
+ * rather than blind. This is that corpus, at the resolution that matters — one
13
+ * row per tool call, attributed to a harness component and a stable failure
14
+ * class.
15
+ *
16
+ * Every write is best-effort and fails open. Telemetry must never break the
17
+ * agent loop it is observing.
18
+ */
19
+ import Database from 'better-sqlite3';
20
+ import { existsSync, mkdirSync } from 'node:fs';
21
+ import { homedir } from 'node:os';
22
+ import { dirname, join } from 'node:path';
23
+ import { classifyToolResult, componentForTool, isFailureClass, } from './tool-failure.js';
24
+ /** Rolling cap: the corpus is a diagnosis aid, not an audit log. */
25
+ const MAX_TOOL_CALL_ROWS = 20_000;
26
+ const dbCache = new Map();
27
+ /**
28
+ * Handle cap. A paired bench runs each cell in its own temp dir, so an unbounded
29
+ * per-cwd cache leaks a better-sqlite3 handle (x3 files with WAL/SHM) per cell
30
+ * and hits the fd limit on a 200-cell run.
31
+ */
32
+ const MAX_CACHED_DBS = 8;
33
+ let insertCount = 0;
34
+ /**
35
+ * Where the corpus lives.
36
+ *
37
+ * NOT under the target project. Two reasons, both found in review:
38
+ *
39
+ * - A paired bench runs every cell in a throwaway temp dir, so a project-rooted
40
+ * corpus is written into directories that are deleted moments later. The
41
+ * evidence from the exact workload the loop is meant to learn from vanished,
42
+ * and `uap harness evidence` read a different path again (`process.cwd()`).
43
+ * - On a customer repo it created `agents/data/memory/telemetry.db` inside
44
+ * their tree — untracked noise at best, committed by an `add -A` at worst.
45
+ *
46
+ * A single per-user store keeps the corpus continuous across runs, which is what
47
+ * cross-run failure ranking needs. `UAP_TOOL_CORPUS_DIR` overrides it (tests).
48
+ */
49
+ export function toolCorpusRoot() {
50
+ return process.env.UAP_TOOL_CORPUS_DIR || join(homedir(), '.uap', 'telemetry');
51
+ }
52
+ function dbPathFor(root) {
53
+ return join(root, 'tool-calls.db');
54
+ }
55
+ function openStore(cwd) {
56
+ const cached = dbCache.get(cwd);
57
+ if (cached)
58
+ return cached;
59
+ try {
60
+ const dbPath = dbPathFor(cwd);
61
+ mkdirSync(dirname(dbPath), { recursive: true });
62
+ const db = new Database(dbPath);
63
+ // Same pragmas as the other producers of this file: WAL so the dashboard
64
+ // reader never blocks the agent loop, and a SHORT busy timeout because a
65
+ // dropped telemetry row beats stalling a tool call.
66
+ db.pragma('journal_mode = WAL');
67
+ db.pragma('synchronous = NORMAL');
68
+ db.pragma('busy_timeout = 2000');
69
+ db.exec(`
70
+ CREATE TABLE IF NOT EXISTS tool_calls (
71
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
72
+ ts TEXT NOT NULL DEFAULT (datetime('now')),
73
+ run_id TEXT,
74
+ task_id TEXT,
75
+ component TEXT NOT NULL,
76
+ tool TEXT NOT NULL,
77
+ outcome TEXT NOT NULL,
78
+ failed INTEGER NOT NULL DEFAULT 0,
79
+ turn INTEGER,
80
+ path TEXT,
81
+ latency_ms INTEGER,
82
+ bytes INTEGER,
83
+ detail TEXT
84
+ );
85
+ CREATE INDEX IF NOT EXISTS idx_tool_calls_run ON tool_calls(run_id);
86
+ CREATE INDEX IF NOT EXISTS idx_tool_calls_outcome ON tool_calls(outcome);
87
+ CREATE INDEX IF NOT EXISTS idx_tool_calls_component ON tool_calls(component);
88
+ `);
89
+ // Prune on OPEN, not on an insert counter: a deliver process records ~12
90
+ // rows and exits, so a `% 100` counter reset per process meant the row cap
91
+ // was never enforced and the table grew without bound across runs.
92
+ try {
93
+ db.prepare('DELETE FROM tool_calls WHERE id <= (SELECT MAX(id) - ? FROM tool_calls)').run(MAX_TOOL_CALL_ROWS);
94
+ }
95
+ catch {
96
+ /* best-effort */
97
+ }
98
+ if (dbCache.size >= MAX_CACHED_DBS) {
99
+ const oldest = dbCache.keys().next().value;
100
+ if (oldest !== undefined) {
101
+ try {
102
+ dbCache.get(oldest)?.close();
103
+ }
104
+ catch {
105
+ /* ignore */
106
+ }
107
+ dbCache.delete(oldest);
108
+ }
109
+ }
110
+ dbCache.set(cwd, db);
111
+ return db;
112
+ }
113
+ catch {
114
+ return null;
115
+ }
116
+ }
117
+ /**
118
+ * Record one tool call. Returns the class it was filed under so callers can
119
+ * assert on it in tests without reading the DB back.
120
+ */
121
+ export function recordToolCall(rec, root = toolCorpusRoot()) {
122
+ const outcome = classifyToolResult(rec.tool, rec.result);
123
+ const db = openStore(root);
124
+ if (!db)
125
+ return outcome;
126
+ try {
127
+ const component = rec.component ?? componentForTool(rec.tool);
128
+ // Only failures keep a detail excerpt, and only the FIRST LINE of one.
129
+ // The full text of an edit-miss now embeds `nearestMatchReport` — numbered
130
+ // lines of the user's current source — which this table would otherwise
131
+ // persist indefinitely, and into the target repo's tree at that. The first
132
+ // line carries the reason; the source body carries risk and no signal.
133
+ const detail = isFailureClass(outcome)
134
+ ? String(rec.result ?? '').split('\n')[0].slice(0, 300)
135
+ : null;
136
+ db.prepare(`INSERT INTO tool_calls
137
+ (run_id, task_id, component, tool, outcome, failed, turn, path, latency_ms, bytes, detail)
138
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(rec.runId ?? null, rec.taskId ?? null, component, rec.tool, outcome, isFailureClass(outcome) ? 1 : 0, rec.turn ?? null, rec.path ?? null, rec.latencyMs ?? null, rec.bytes ?? null, detail);
139
+ if (++insertCount % 100 === 0) {
140
+ db.prepare(`DELETE FROM tool_calls WHERE id <= (SELECT MAX(id) - ? FROM tool_calls)`).run(MAX_TOOL_CALL_ROWS);
141
+ }
142
+ }
143
+ catch {
144
+ /* best-effort */
145
+ }
146
+ return outcome;
147
+ }
148
+ const EMPTY_SUMMARY = {
149
+ totalCalls: 0,
150
+ failedCalls: 0,
151
+ failureRate: 0,
152
+ byComponent: [],
153
+ topFailures: [],
154
+ editHealth: { attempts: 0, exact: 0, tolerant: 0, misses: 0, ambiguous: 0, successRate: 0 },
155
+ };
156
+ /**
157
+ * Distil the corpus into the layered view the propose stage consumes: an
158
+ * overall health number, per-component attribution, a ranked failure queue, and
159
+ * the edit-tool detail.
160
+ *
161
+ * `runId` scopes the summary to a single run; omit it for the whole corpus.
162
+ */
163
+ export function summarizeToolCalls(runId, root = toolCorpusRoot()) {
164
+ if (!existsSync(dbPathFor(root)))
165
+ return EMPTY_SUMMARY;
166
+ const db = openStore(root);
167
+ if (!db)
168
+ return EMPTY_SUMMARY;
169
+ const where = runId ? 'WHERE run_id = ?' : '';
170
+ const params = runId ? [runId] : [];
171
+ try {
172
+ const totals = db
173
+ .prepare(`SELECT COUNT(*) AS calls, COALESCE(SUM(failed),0) AS failures FROM tool_calls ${where}`)
174
+ .get(...params);
175
+ if (!totals || totals.calls === 0)
176
+ return EMPTY_SUMMARY;
177
+ const byComponent = db
178
+ .prepare(`SELECT component, COUNT(*) AS calls, COALESCE(SUM(failed),0) AS failures
179
+ FROM tool_calls ${where}
180
+ GROUP BY component ORDER BY failures DESC, calls DESC`)
181
+ .all(...params);
182
+ const topFailures = db
183
+ .prepare(`SELECT component, tool, outcome, COUNT(*) AS count
184
+ FROM tool_calls ${where ? `${where} AND failed = 1` : 'WHERE failed = 1'}
185
+ GROUP BY component, tool, outcome ORDER BY count DESC LIMIT 20`)
186
+ .all(...params);
187
+ const editRows = db
188
+ .prepare(`SELECT outcome, COUNT(*) AS count FROM tool_calls
189
+ ${where ? `${where} AND` : 'WHERE'} tool IN ('edit_file','edit_range')
190
+ GROUP BY outcome`)
191
+ .all(...params);
192
+ const editCount = (o) => editRows.find((r) => r.outcome === o)?.count ?? 0;
193
+ const exact = editCount('ok');
194
+ const tolerant = editCount('ok-tolerant');
195
+ const misses = editCount('edit-miss');
196
+ const ambiguous = editCount('edit-ambiguous');
197
+ const attempts = editRows.reduce((n, r) => n + r.count, 0);
198
+ return {
199
+ totalCalls: totals.calls,
200
+ failedCalls: totals.failures,
201
+ failureRate: totals.calls > 0 ? totals.failures / totals.calls : 0,
202
+ byComponent: byComponent.map((r) => ({
203
+ component: r.component,
204
+ failures: r.failures,
205
+ calls: r.calls,
206
+ })),
207
+ topFailures,
208
+ editHealth: {
209
+ attempts,
210
+ exact,
211
+ tolerant,
212
+ misses,
213
+ ambiguous,
214
+ successRate: attempts > 0 ? (exact + tolerant) / attempts : 0,
215
+ },
216
+ };
217
+ }
218
+ catch {
219
+ return EMPTY_SUMMARY;
220
+ }
221
+ }
222
+ /**
223
+ * Render the summary as the prose block the propose stage puts in front of a
224
+ * model. Kept here (not in the prompt) so evidence and its formatting version
225
+ * together, and so a human can read the same text with `uap harness evidence`.
226
+ */
227
+ export function renderEvidence(summary) {
228
+ if (summary.totalCalls === 0)
229
+ return 'No tool-call evidence recorded yet.';
230
+ const lines = [];
231
+ lines.push(`Tool calls: ${summary.totalCalls} | failed: ${summary.failedCalls} ` +
232
+ `(${(summary.failureRate * 100).toFixed(1)}%)`);
233
+ if (summary.byComponent.length > 0) {
234
+ lines.push('');
235
+ lines.push('By harness component (failures/calls):');
236
+ for (const c of summary.byComponent) {
237
+ lines.push(` ${c.component.padEnd(10)} ${c.failures}/${c.calls}`);
238
+ }
239
+ }
240
+ const e = summary.editHealth;
241
+ if (e.attempts > 0) {
242
+ lines.push('');
243
+ lines.push(`Edit tool: ${e.attempts} attempts | exact ${e.exact} | tolerant ${e.tolerant} | ` +
244
+ `miss ${e.misses} | ambiguous ${e.ambiguous} | success ${(e.successRate * 100).toFixed(1)}%`);
245
+ }
246
+ if (summary.topFailures.length > 0) {
247
+ lines.push('');
248
+ lines.push('Top failure classes:');
249
+ for (const f of summary.topFailures.slice(0, 10)) {
250
+ lines.push(` ${String(f.count).padStart(4)}x ${f.tool}/${f.outcome} [${f.component}]`);
251
+ }
252
+ }
253
+ return lines.join('\n');
254
+ }
255
+ /** Test-only: close cached handles so temp-dir fixtures do not leak. */
256
+ export function closeToolCallStores(root) {
257
+ if (root) {
258
+ const db = dbCache.get(root);
259
+ if (db) {
260
+ try {
261
+ db.close();
262
+ }
263
+ catch {
264
+ /* ignore */
265
+ }
266
+ dbCache.delete(root);
267
+ }
268
+ return;
269
+ }
270
+ for (const db of dbCache.values()) {
271
+ try {
272
+ db.close();
273
+ }
274
+ catch {
275
+ /* ignore */
276
+ }
277
+ }
278
+ dbCache.clear();
279
+ }
280
+ //# sourceMappingURL=tool-calls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-calls.js","sourceRoot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B,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Tool-call outcome taxonomy (harness plan area D2, 2026-07-31).
3
+ *
4
+ * The Agentic-Harness-Engineering result (arXiv 2604.25850) turns on a single
5
+ * capability we did not have: every tool call is attributed to a harness
6
+ * COMPONENT and a stable FAILURE CLASS, so the evolve stage can rank "which part
7
+ * of the harness is bleeding turns" instead of guessing. Their measured gains
8
+ * concentrate in tools (+3.3pp), middleware (+2.2pp) and memory (+5.6pp) — and
9
+ * system-prompt-only edits scored NEGATIVE (-2.3pp), which is exactly the search
10
+ * direction a system without attribution drifts into.
11
+ *
12
+ * The executor's tool results are strings by design (they go straight back to the
13
+ * model), so classification is textual. That is deliberate: the classifier reads
14
+ * the same bytes the model reads, so a class can never claim a failure mode the
15
+ * model was not actually shown.
16
+ */
17
+ /**
18
+ * Stable outcome classes. Stable is the point — these strings are GROUP BY keys
19
+ * in the evidence corpus, so renaming one silently splits its history.
20
+ */
21
+ export type ToolOutcomeClass =
22
+ /** Call succeeded with no caveat. */
23
+ 'ok'
24
+ /** Succeeded, but only via the whitespace-tolerant edit rung (anchor drift). */
25
+ | 'ok-tolerant'
26
+ /** `old_string` matched nothing. The dominant edit-tool failure. */
27
+ | 'edit-miss'
28
+ /** Matched several places, or an out-of-range occurrence selector. */
29
+ | 'edit-ambiguous'
30
+ /** A line range that does not exist in the file. */
31
+ | 'range-invalid'
32
+ /** Target file/dir does not exist. */
33
+ | 'path-not-found'
34
+ /** Path escaped the project root. */
35
+ | 'path-escape'
36
+ /** Refused: protected test/contract/gate-config/agent-internal path. */
37
+ | 'protected-path'
38
+ /** Refused by the stub-substance guard (would hollow the file out). */
39
+ | 'stub-refusal'
40
+ /** Write rejected as truncated mid-file. */
41
+ | 'truncated-write'
42
+ /** `run_bash` returned a non-zero exit code. */
43
+ | 'command-failed'
44
+ /** Call exceeded its time budget. */
45
+ | 'timeout'
46
+ /** Model asked for a tool that does not exist. */
47
+ | 'unknown-tool'
48
+ /** The tool refused to run at all (e.g. run_bash disabled outside a sandbox). */
49
+ | 'refused'
50
+ /** A command mutated protected files and the harness restored them. */
51
+ | 'tamper-restored'
52
+ /** An error we have not given a name to yet. */
53
+ | 'other-error';
54
+ /** The harness component a tool call exercises. Mirrors the AHE ablation axes. */
55
+ export type HarnessComponent = 'tools' | 'middleware' | 'memory' | 'prompt' | 'execution';
56
+ export declare function isFailureClass(c: ToolOutcomeClass): boolean;
57
+ /**
58
+ * Classify one tool result string.
59
+ *
60
+ * Ordering matters: the specific edit classes are tested before the generic
61
+ * "not found", because an `old_string not found` message also contains the word
62
+ * "not found" and would otherwise be miscounted as a missing FILE — which would
63
+ * point the evolve stage at path handling instead of at the edit tool.
64
+ */
65
+ export declare function classifyToolResult(tool: string, result: string): ToolOutcomeClass;
66
+ /**
67
+ * Map a tool name to the harness component it exercises, so failures roll up to
68
+ * the same axes the AHE ablation measured.
69
+ */
70
+ export declare function componentForTool(tool: string): HarnessComponent;
71
+ //# sourceMappingURL=tool-failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-failure.d.ts","sourceRoot":"","sources":["../../src/telemetry/tool-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,MAAM,MAAM,gBAAgB;AAC1B,qCAAqC;AACnC,IAAI;AACN,gFAAgF;GAC9E,aAAa;AACf,oEAAoE;GAClE,WAAW;AACb,sEAAsE;GACpE,gBAAgB;AAClB,oDAAoD;GAClD,eAAe;AACjB,sCAAsC;GACpC,gBAAgB;AAClB,qCAAqC;GACnC,aAAa;AACf,wEAAwE;GACtE,gBAAgB;AAClB,uEAAuE;GACrE,cAAc;AAChB,4CAA4C;GAC1C,iBAAiB;AACnB,gDAAgD;GAC9C,gBAAgB;AAClB,qCAAqC;GACnC,SAAS;AACX,kDAAkD;GAChD,cAAc;AAChB,iFAAiF;GAC/E,SAAS;AACX,uEAAuE;GACrE,iBAAiB;AACnB,gDAAgD;GAC9C,aAAa,CAAC;AAElB,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAoB1F,wBAAgB,cAAc,CAAC,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAE3D;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAiDjF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAc/D"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Tool-call outcome taxonomy (harness plan area D2, 2026-07-31).
3
+ *
4
+ * The Agentic-Harness-Engineering result (arXiv 2604.25850) turns on a single
5
+ * capability we did not have: every tool call is attributed to a harness
6
+ * COMPONENT and a stable FAILURE CLASS, so the evolve stage can rank "which part
7
+ * of the harness is bleeding turns" instead of guessing. Their measured gains
8
+ * concentrate in tools (+3.3pp), middleware (+2.2pp) and memory (+5.6pp) — and
9
+ * system-prompt-only edits scored NEGATIVE (-2.3pp), which is exactly the search
10
+ * direction a system without attribution drifts into.
11
+ *
12
+ * The executor's tool results are strings by design (they go straight back to the
13
+ * model), so classification is textual. That is deliberate: the classifier reads
14
+ * the same bytes the model reads, so a class can never claim a failure mode the
15
+ * model was not actually shown.
16
+ */
17
+ /** Outcome classes that represent a wasted or degraded turn. */
18
+ const FAILURE_CLASSES = new Set([
19
+ 'refused',
20
+ 'tamper-restored',
21
+ 'edit-miss',
22
+ 'edit-ambiguous',
23
+ 'range-invalid',
24
+ 'path-not-found',
25
+ 'path-escape',
26
+ 'protected-path',
27
+ 'stub-refusal',
28
+ 'truncated-write',
29
+ 'command-failed',
30
+ 'timeout',
31
+ 'unknown-tool',
32
+ 'other-error',
33
+ ]);
34
+ export function isFailureClass(c) {
35
+ return FAILURE_CLASSES.has(c);
36
+ }
37
+ /**
38
+ * Classify one tool result string.
39
+ *
40
+ * Ordering matters: the specific edit classes are tested before the generic
41
+ * "not found", because an `old_string not found` message also contains the word
42
+ * "not found" and would otherwise be miscounted as a missing FILE — which would
43
+ * point the evolve stage at path handling instead of at the edit tool.
44
+ */
45
+ export function classifyToolResult(tool, result) {
46
+ const text = String(result ?? '');
47
+ const lower = text.toLowerCase();
48
+ if (lower.includes('unknown tool'))
49
+ return 'unknown-tool';
50
+ // run_bash NEVER starts with 'error:' — it returns `exit=<code> ...`, or a
51
+ // refusal when the shell is disabled. Classifying it by prefix filed every
52
+ // failed command as a success, left 'command-failed' unreachable, and made the
53
+ // execution component look permanently healthy to the evolve stage.
54
+ if (tool === 'run_bash') {
55
+ if (lower.startsWith('run_bash is disabled') || lower.includes('is disabled'))
56
+ return 'refused';
57
+ // A command that mutated protected files and was rolled back is a tamper
58
+ // event, and matters more than its exit code.
59
+ if (lower.includes('restored') && lower.includes('protected'))
60
+ return 'tamper-restored';
61
+ if (lower.includes('timed out'))
62
+ return 'timeout';
63
+ const exit = /(?:^|\s)exit=(-?\d+)/.exec(text);
64
+ if (exit)
65
+ return exit[1] === '0' ? 'ok' : 'command-failed';
66
+ return lower.startsWith('error:') ? 'other-error' : 'ok';
67
+ }
68
+ if (!lower.startsWith('error:')) {
69
+ // Success paths. The tolerant-match note is a success WITH a signal: the
70
+ // model's anchors are drifting, which predicts future misses.
71
+ if (lower.includes('did not match byte-for-byte'))
72
+ return 'ok-tolerant';
73
+ return 'ok';
74
+ }
75
+ // The agent-internal refusal is a protection, not a generic error.
76
+ if (lower.includes('agent') && lower.includes('internal'))
77
+ return 'protected-path';
78
+ if (lower.includes('deliverable and tells you nothing'))
79
+ return 'protected-path';
80
+ if (lower.includes('old_string not found'))
81
+ return 'edit-miss';
82
+ if (lower.includes('old_string matches') || lower.includes('occurrence'))
83
+ return 'edit-ambiguous';
84
+ if (lower.includes('start_line') || lower.includes('end_line'))
85
+ return 'range-invalid';
86
+ if (lower.includes('escapes project root'))
87
+ return 'path-escape';
88
+ if (lower.includes('protected test') ||
89
+ lower.includes('locked contract') ||
90
+ lower.includes('refusing to modify') ||
91
+ lower.includes('change the implementation, not the gate')) {
92
+ return 'protected-path';
93
+ }
94
+ if (lower.includes('stub') || lower.includes('skeleton'))
95
+ return 'stub-refusal';
96
+ if (lower.includes('truncated'))
97
+ return 'truncated-write';
98
+ if (lower.includes('timed out') || lower.includes('timeout'))
99
+ return 'timeout';
100
+ if (lower.includes('not found') || lower.includes('does not exist'))
101
+ return 'path-not-found';
102
+ return 'other-error';
103
+ }
104
+ /**
105
+ * Map a tool name to the harness component it exercises, so failures roll up to
106
+ * the same axes the AHE ablation measured.
107
+ */
108
+ export function componentForTool(tool) {
109
+ switch (tool) {
110
+ case 'edit_file':
111
+ case 'edit_range':
112
+ case 'write_file':
113
+ case 'read_file':
114
+ case 'list_dir':
115
+ case 'finish':
116
+ return 'tools';
117
+ case 'run_bash':
118
+ return 'execution';
119
+ default:
120
+ return tool.startsWith('memory') ? 'memory' : 'tools';
121
+ }
122
+ }
123
+ //# sourceMappingURL=tool-failure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-failure.js","sourceRoot":"","sources":["../../src/telemetry/tool-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2CH,gEAAgE;AAChE,MAAM,eAAe,GAAkC,IAAI,GAAG,CAAmB;IAC/E,SAAS;IACT,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,SAAS;IACT,cAAc;IACd,aAAa;CACd,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,CAAmB;IAChD,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAc;IAC7D,MAAM,IAA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