agentfootprint 6.23.0 → 6.25.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/README.md +31 -0
- package/bin/agentfootprint-lint-tools.mjs +14 -0
- package/dist/esm/lib/influence-core/cache.js +149 -0
- package/dist/esm/lib/influence-core/cache.js.map +1 -0
- package/dist/esm/lib/influence-core/index.js +32 -0
- package/dist/esm/lib/influence-core/index.js.map +1 -0
- package/dist/esm/lib/influence-core/margin.js +110 -0
- package/dist/esm/lib/influence-core/margin.js.map +1 -0
- package/dist/esm/lib/influence-core/signals.js +232 -0
- package/dist/esm/lib/influence-core/signals.js.map +1 -0
- package/dist/esm/lib/influence-core/similarity.js +79 -0
- package/dist/esm/lib/influence-core/similarity.js.map +1 -0
- package/dist/esm/lib/influence-core/types.js +35 -0
- package/dist/esm/lib/influence-core/types.js.map +1 -0
- package/dist/esm/lib/tool-lint/analyze.js +235 -0
- package/dist/esm/lib/tool-lint/analyze.js.map +1 -0
- package/dist/esm/lib/tool-lint/cli.js +198 -0
- package/dist/esm/lib/tool-lint/cli.js.map +1 -0
- package/dist/esm/lib/tool-lint/format.js +61 -0
- package/dist/esm/lib/tool-lint/format.js.map +1 -0
- package/dist/esm/lib/tool-lint/index.js +23 -0
- package/dist/esm/lib/tool-lint/index.js.map +1 -0
- package/dist/esm/lib/tool-lint/rules.js +249 -0
- package/dist/esm/lib/tool-lint/rules.js.map +1 -0
- package/dist/esm/lib/tool-lint/types.js +25 -0
- package/dist/esm/lib/tool-lint/types.js.map +1 -0
- package/dist/esm/lib/trace-toolpack/bounded.js +76 -0
- package/dist/esm/lib/trace-toolpack/bounded.js.map +1 -0
- package/dist/esm/lib/trace-toolpack/index.js +10 -0
- package/dist/esm/lib/trace-toolpack/index.js.map +1 -0
- package/dist/esm/lib/trace-toolpack/traceToolpack.js +699 -0
- package/dist/esm/lib/trace-toolpack/traceToolpack.js.map +1 -0
- package/dist/esm/lib/trace-toolpack/types.js +24 -0
- package/dist/esm/lib/trace-toolpack/types.js.map +1 -0
- package/dist/esm/observe.js +25 -0
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/recorders/observability/ToolChoiceRecorder.js +261 -0
- package/dist/esm/recorders/observability/ToolChoiceRecorder.js.map +1 -0
- package/dist/lib/influence-core/cache.js +155 -0
- package/dist/lib/influence-core/cache.js.map +1 -0
- package/dist/lib/influence-core/index.js +50 -0
- package/dist/lib/influence-core/index.js.map +1 -0
- package/dist/lib/influence-core/margin.js +114 -0
- package/dist/lib/influence-core/margin.js.map +1 -0
- package/dist/lib/influence-core/signals.js +242 -0
- package/dist/lib/influence-core/signals.js.map +1 -0
- package/dist/lib/influence-core/similarity.js +83 -0
- package/dist/lib/influence-core/similarity.js.map +1 -0
- package/dist/lib/influence-core/types.js +38 -0
- package/dist/lib/influence-core/types.js.map +1 -0
- package/dist/lib/tool-lint/analyze.js +242 -0
- package/dist/lib/tool-lint/analyze.js.map +1 -0
- package/dist/lib/tool-lint/cli.js +203 -0
- package/dist/lib/tool-lint/cli.js.map +1 -0
- package/dist/lib/tool-lint/format.js +65 -0
- package/dist/lib/tool-lint/format.js.map +1 -0
- package/dist/lib/tool-lint/index.js +43 -0
- package/dist/lib/tool-lint/index.js.map +1 -0
- package/dist/lib/tool-lint/rules.js +256 -0
- package/dist/lib/tool-lint/rules.js.map +1 -0
- package/dist/lib/tool-lint/types.js +26 -0
- package/dist/lib/tool-lint/types.js.map +1 -0
- package/dist/lib/trace-toolpack/bounded.js +86 -0
- package/dist/lib/trace-toolpack/bounded.js.map +1 -0
- package/dist/lib/trace-toolpack/index.js +16 -0
- package/dist/lib/trace-toolpack/index.js.map +1 -0
- package/dist/lib/trace-toolpack/traceToolpack.js +704 -0
- package/dist/lib/trace-toolpack/traceToolpack.js.map +1 -0
- package/dist/lib/trace-toolpack/types.js +28 -0
- package/dist/lib/trace-toolpack/types.js.map +1 -0
- package/dist/observe.js +64 -1
- package/dist/observe.js.map +1 -1
- package/dist/recorders/observability/ToolChoiceRecorder.js +266 -0
- package/dist/recorders/observability/ToolChoiceRecorder.js.map +1 -0
- package/dist/types/lib/influence-core/cache.d.ts +95 -0
- package/dist/types/lib/influence-core/cache.d.ts.map +1 -0
- package/dist/types/lib/influence-core/index.d.ts +33 -0
- package/dist/types/lib/influence-core/index.d.ts.map +1 -0
- package/dist/types/lib/influence-core/margin.d.ts +34 -0
- package/dist/types/lib/influence-core/margin.d.ts.map +1 -0
- package/dist/types/lib/influence-core/signals.d.ts +104 -0
- package/dist/types/lib/influence-core/signals.d.ts.map +1 -0
- package/dist/types/lib/influence-core/similarity.d.ts +26 -0
- package/dist/types/lib/influence-core/similarity.d.ts.map +1 -0
- package/dist/types/lib/influence-core/types.d.ts +158 -0
- package/dist/types/lib/influence-core/types.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/analyze.d.ts +84 -0
- package/dist/types/lib/tool-lint/analyze.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/cli.d.ts +44 -0
- package/dist/types/lib/tool-lint/cli.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/format.d.ts +19 -0
- package/dist/types/lib/tool-lint/format.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/index.d.ts +24 -0
- package/dist/types/lib/tool-lint/index.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/rules.d.ts +86 -0
- package/dist/types/lib/tool-lint/rules.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/types.d.ts +156 -0
- package/dist/types/lib/tool-lint/types.d.ts.map +1 -0
- package/dist/types/lib/trace-toolpack/bounded.d.ts +48 -0
- package/dist/types/lib/trace-toolpack/bounded.d.ts.map +1 -0
- package/dist/types/lib/trace-toolpack/index.d.ts +10 -0
- package/dist/types/lib/trace-toolpack/index.d.ts.map +1 -0
- package/dist/types/lib/trace-toolpack/traceToolpack.d.ts +70 -0
- package/dist/types/lib/trace-toolpack/traceToolpack.d.ts.map +1 -0
- package/dist/types/lib/trace-toolpack/types.d.ts +60 -0
- package/dist/types/lib/trace-toolpack/types.d.ts.map +1 -0
- package/dist/types/observe.d.ts +4 -0
- package/dist/types/observe.d.ts.map +1 -1
- package/dist/types/recorders/observability/ToolChoiceRecorder.d.ts +165 -0
- package/dist/types/recorders/observability/ToolChoiceRecorder.d.ts.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tool-lint — the tool-catalog confusability lint (RFC-002 tier 1,
|
|
3
|
+
* blocks C1–C3).
|
|
4
|
+
*
|
|
5
|
+
* Build-time, CI-gateable, framework-agnostic: a plain
|
|
6
|
+
* `{ name, description?, inputSchema? }[]` in (any OpenAI / Anthropic /
|
|
7
|
+
* LangChain / MCP tool list coerces to it), a report with a CI-gateable
|
|
8
|
+
* `ok` out. The embedding geometry comes from influence-core
|
|
9
|
+
* (`pairwiseSimilarity`); this module is the policy layer — thresholds,
|
|
10
|
+
* verdicts, hints, and the pluggable structural rule pack.
|
|
11
|
+
*
|
|
12
|
+
* Surfaces:
|
|
13
|
+
* - `analyzeToolCatalog(tools, opts)` — the API (C1)
|
|
14
|
+
* - `defaultStructuralRules` + rule factories — the rule pack (C2)
|
|
15
|
+
* - `runToolLintCli` / bin `agentfootprint-lint-tools` — the gate (C3)
|
|
16
|
+
*
|
|
17
|
+
* Front-door guide: docs/guides/tool-catalog-lint.md
|
|
18
|
+
*/
|
|
19
|
+
export { analyzeToolCatalog, catalogFromTools, confusabilityText, differentiationHint, DEFAULT_CONFUSABILITY_THRESHOLD, DEFAULT_WATCH_BAND, MOCK_EMBEDDER_CALIBRATION, } from './analyze.js';
|
|
20
|
+
export { defaultStructuralRules, descriptionRule, enumInProseRule, optionalParamRule, saysWhatNotWhenRule, DEFAULT_OMISSION_CUES, DEFAULT_WHEN_CUES, } from './rules.js';
|
|
21
|
+
export { formatToolCatalogReport } from './format.js';
|
|
22
|
+
export { coerceCatalog, runToolLintCli } from './cli.js';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/tool-lint/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAcH,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,+BAA+B,EAC/B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GAIlB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,uBAAuB,EAA4B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural lint rules (RFC-002 block C2) — the PLUGGABLE RULE PACK.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Strategy list — each rule is a plain `{ id, check }` object;
|
|
5
|
+
* `defaultStructuralRules` is OUR pack, and consumers add /
|
|
6
|
+
* remove / replace freely via `AnalyzeToolCatalogOptions.rules`.
|
|
7
|
+
* Parameterizable rules ship as FACTORIES (`descriptionRule`,
|
|
8
|
+
* `saysWhatNotWhenRule`, …) returning a configured `LintRule`.
|
|
9
|
+
* Role: `src/lib/tool-lint/` leaf. Pure functions over `CatalogTool`;
|
|
10
|
+
* no embedder, no I/O.
|
|
11
|
+
*
|
|
12
|
+
* Every rule encodes a FIELD FINDING from real catalogs (the Neo SAN
|
|
13
|
+
* triage agent's 29-tool catalog was the seed corpus):
|
|
14
|
+
*
|
|
15
|
+
* 1. description-missing-or-short — the model can only guess from a name.
|
|
16
|
+
* 2. says-what-not-when — describes WHAT the tool returns but gives the
|
|
17
|
+
* model no cue for WHEN to pick it over a sibling (the #1 cause of
|
|
18
|
+
* twin-tool confusion: 'get_fcns_database' vs 'influx_get_fcns_database').
|
|
19
|
+
* 3. enum-in-prose — string params whose legal values are listed in prose
|
|
20
|
+
* ("avg_iops | peak_iops | mbps") instead of a JSON-Schema `enum` the
|
|
21
|
+
* model (and validators, see #9 tool-args validation) can act on.
|
|
22
|
+
* 4. optional-param-undocumented — optional params whose omission has
|
|
23
|
+
* meaning (fabric-wide sweep vs one switch) but whose schema never
|
|
24
|
+
* says so; the model can't reason about leaving them out.
|
|
25
|
+
*
|
|
26
|
+
* Honest claim: these are token/regex HEURISTICS. They flag review
|
|
27
|
+
* prompts, not certainties — expect (rare) false positives and tune via
|
|
28
|
+
* the factory options instead of deleting the rule.
|
|
29
|
+
*/
|
|
30
|
+
/** Read `properties` / `required` out of a JSON-Schema-ish inputSchema,
|
|
31
|
+
* tolerating absent or malformed shapes (rules must never throw). */
|
|
32
|
+
function readObjectSchema(tool) {
|
|
33
|
+
const schema = tool.inputSchema;
|
|
34
|
+
const props = schema?.properties;
|
|
35
|
+
const properties = props !== null && typeof props === 'object'
|
|
36
|
+
? Object.entries(props).filter((entry) => entry[1] !== null && typeof entry[1] === 'object')
|
|
37
|
+
: [];
|
|
38
|
+
const required = new Set(Array.isArray(schema?.required) ? schema.required.filter((r) => typeof r === 'string') : []);
|
|
39
|
+
return { properties, required };
|
|
40
|
+
}
|
|
41
|
+
function hasWholeWord(text, word) {
|
|
42
|
+
return new RegExp(`(?:^|[^a-z0-9])${escapeRegExp(word.toLowerCase())}(?:[^a-z0-9]|$)`).test(text.toLowerCase());
|
|
43
|
+
}
|
|
44
|
+
function escapeRegExp(s) {
|
|
45
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Missing description → `error` (the model can only guess from the
|
|
49
|
+
* name). Present but shorter than `minChars` → `warn` (too short to
|
|
50
|
+
* differentiate from siblings).
|
|
51
|
+
*/
|
|
52
|
+
export function descriptionRule(options = {}) {
|
|
53
|
+
const minChars = options.minChars ?? 40;
|
|
54
|
+
return {
|
|
55
|
+
id: 'description-missing-or-short',
|
|
56
|
+
check(tool) {
|
|
57
|
+
const description = tool.description?.trim() ?? '';
|
|
58
|
+
if (description.length === 0) {
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
rule: 'description-missing-or-short',
|
|
62
|
+
tool: tool.name,
|
|
63
|
+
severity: 'error',
|
|
64
|
+
message: 'tool has no description — the model can only guess from the name',
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
if (description.length < minChars) {
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
rule: 'description-missing-or-short',
|
|
72
|
+
tool: tool.name,
|
|
73
|
+
severity: 'warn',
|
|
74
|
+
message: `description is ${description.length} chars (< ${minChars}) — too short to differentiate this tool from its siblings`,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
return [];
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
// ── Rule 2 — says WHAT, not WHEN ─────────────────────────────────────
|
|
83
|
+
/** RFC-002 C2 heuristic cue list — temporal/conditional words whose
|
|
84
|
+
* presence suggests the description says WHEN to use the tool. */
|
|
85
|
+
export const DEFAULT_WHEN_CUES = [
|
|
86
|
+
'for',
|
|
87
|
+
'when',
|
|
88
|
+
'after',
|
|
89
|
+
'first',
|
|
90
|
+
'fallback',
|
|
91
|
+
'only',
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* A description with NO temporal/conditional cue token usually describes
|
|
95
|
+
* WHAT the tool returns but never WHEN to pick it — the #1 cause of
|
|
96
|
+
* twin-tool confusion. Heuristic by design: tune `cueTokens` rather than
|
|
97
|
+
* dropping the rule. Skips tools with no description (rule 1's finding).
|
|
98
|
+
*/
|
|
99
|
+
export function saysWhatNotWhenRule(options = {}) {
|
|
100
|
+
const cues = options.cueTokens ?? DEFAULT_WHEN_CUES;
|
|
101
|
+
return {
|
|
102
|
+
id: 'says-what-not-when',
|
|
103
|
+
check(tool) {
|
|
104
|
+
const description = tool.description?.trim() ?? '';
|
|
105
|
+
if (description.length === 0)
|
|
106
|
+
return [];
|
|
107
|
+
if (cues.some((cue) => hasWholeWord(description, cue)))
|
|
108
|
+
return [];
|
|
109
|
+
return [
|
|
110
|
+
{
|
|
111
|
+
rule: 'says-what-not-when',
|
|
112
|
+
tool: tool.name,
|
|
113
|
+
severity: 'warn',
|
|
114
|
+
message: 'description says WHAT the tool returns but gives no cue for WHEN to use it ' +
|
|
115
|
+
`(no ${cues.map((c) => `'${c}'`).join('/')}) — add the choice condition, ` +
|
|
116
|
+
'e.g. "Use when …" / "Call FIRST" / "FALLBACK if …"',
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
// ── Rule 3 — enum described in prose ─────────────────────────────────
|
|
123
|
+
const IDENT = '[A-Za-z][A-Za-z0-9_.-]*';
|
|
124
|
+
/** `avg_iops | peak_iops | mbps` — two or more pipe-separated literals. */
|
|
125
|
+
const PIPE_LIST = new RegExp(`(${IDENT})(?:\\s*\\|\\s*(?:${IDENT}))+`);
|
|
126
|
+
/** `one of: red, green, blue` — comma lists only behind an explicit
|
|
127
|
+
* values marker, so free-form examples ("e.g. 1h, 24h") don't flag. */
|
|
128
|
+
const COMMA_LIST = new RegExp(`(?:one of|allowed values?|valid values?|options|values)\\s*:?\\s*(${IDENT}(?:\\s*,\\s*${IDENT})+)`, 'i');
|
|
129
|
+
/**
|
|
130
|
+
* A string param whose description enumerates its legal values in prose
|
|
131
|
+
* (pipe-separated literals, or comma lists behind "one of"/"allowed
|
|
132
|
+
* values") should declare a JSON-Schema `enum` instead — the model picks
|
|
133
|
+
* reliably from enums, and arg validators (#9) can enforce them. The
|
|
134
|
+
* field case: Neo's `influx_get_port_ranking.metric` =
|
|
135
|
+
* `"avg_iops | peak_iops | mbps"`.
|
|
136
|
+
*/
|
|
137
|
+
export function enumInProseRule() {
|
|
138
|
+
return {
|
|
139
|
+
id: 'enum-in-prose',
|
|
140
|
+
check(tool) {
|
|
141
|
+
const findings = [];
|
|
142
|
+
const { properties } = readObjectSchema(tool);
|
|
143
|
+
for (const [param, prop] of properties) {
|
|
144
|
+
if (prop.enum !== undefined)
|
|
145
|
+
continue;
|
|
146
|
+
if (prop.type !== undefined && prop.type !== 'string')
|
|
147
|
+
continue;
|
|
148
|
+
const description = typeof prop.description === 'string' ? prop.description : '';
|
|
149
|
+
if (description.length === 0)
|
|
150
|
+
continue;
|
|
151
|
+
const literals = extractProseLiterals(description);
|
|
152
|
+
if (literals === undefined)
|
|
153
|
+
continue;
|
|
154
|
+
findings.push({
|
|
155
|
+
rule: 'enum-in-prose',
|
|
156
|
+
tool: tool.name,
|
|
157
|
+
severity: 'warn',
|
|
158
|
+
param,
|
|
159
|
+
message: `param '${param}' lists its legal values in prose ("${description.slice(0, 80)}") — declare them as a JSON-Schema enum so the model picks reliably`,
|
|
160
|
+
suggestion: `"enum": ${JSON.stringify(literals)}`,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return findings;
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function extractProseLiterals(description) {
|
|
168
|
+
const pipe = PIPE_LIST.exec(description);
|
|
169
|
+
if (pipe) {
|
|
170
|
+
return pipe[0].split('|').map((v) => v.trim());
|
|
171
|
+
}
|
|
172
|
+
const comma = COMMA_LIST.exec(description);
|
|
173
|
+
if (comma) {
|
|
174
|
+
return comma[1].split(',').map((v) => v.trim());
|
|
175
|
+
}
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
// ── Rule 4 — optional param whose omission is undocumented ───────────
|
|
179
|
+
/** Words that signal the description DOES say what omission means. */
|
|
180
|
+
export const DEFAULT_OMISSION_CUES = [
|
|
181
|
+
'optional',
|
|
182
|
+
'default',
|
|
183
|
+
'defaults',
|
|
184
|
+
'omit',
|
|
185
|
+
'omitted',
|
|
186
|
+
'if not',
|
|
187
|
+
'when not',
|
|
188
|
+
'absent',
|
|
189
|
+
'all',
|
|
190
|
+
'entire',
|
|
191
|
+
'every',
|
|
192
|
+
'fallback',
|
|
193
|
+
];
|
|
194
|
+
/**
|
|
195
|
+
* An optional param's omission usually MEANS something (Neo:
|
|
196
|
+
* `influx_get_interface_counters` without `switch_name` = fabric-wide
|
|
197
|
+
* sweep) — but the model can only reason about leaving a param out if
|
|
198
|
+
* the description says so. No description at all, or one with no
|
|
199
|
+
* omission cue, gets a `warn`.
|
|
200
|
+
*/
|
|
201
|
+
export function optionalParamRule(options = {}) {
|
|
202
|
+
const cues = options.omissionCues ?? DEFAULT_OMISSION_CUES;
|
|
203
|
+
return {
|
|
204
|
+
id: 'optional-param-undocumented',
|
|
205
|
+
check(tool) {
|
|
206
|
+
const findings = [];
|
|
207
|
+
const { properties, required } = readObjectSchema(tool);
|
|
208
|
+
for (const [param, prop] of properties) {
|
|
209
|
+
if (required.has(param))
|
|
210
|
+
continue;
|
|
211
|
+
const description = typeof prop.description === 'string' ? prop.description.trim() : '';
|
|
212
|
+
if (description.length === 0) {
|
|
213
|
+
findings.push({
|
|
214
|
+
rule: 'optional-param-undocumented',
|
|
215
|
+
tool: tool.name,
|
|
216
|
+
severity: 'warn',
|
|
217
|
+
param,
|
|
218
|
+
message: `optional param '${param}' has no description — say what happens when it is omitted (a default? a broader scope?)`,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
else if (!cues.some((cue) => hasWholeWord(description, cue))) {
|
|
222
|
+
findings.push({
|
|
223
|
+
rule: 'optional-param-undocumented',
|
|
224
|
+
tool: tool.name,
|
|
225
|
+
severity: 'warn',
|
|
226
|
+
param,
|
|
227
|
+
message: `optional param '${param}' is described but never says what omission means — add e.g. "optional — defaults to …" / "omit for all …"`,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return findings;
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// ── The default pack ─────────────────────────────────────────────────
|
|
236
|
+
/**
|
|
237
|
+
* OUR rule pack, built with default options. Compose your own:
|
|
238
|
+
*
|
|
239
|
+
* rules: [...defaultStructuralRules, myRule] // add
|
|
240
|
+
* rules: defaultStructuralRules.filter(r => r.id !== '…') // remove
|
|
241
|
+
* rules: [descriptionRule({ minChars: 80 }), …] // re-tune
|
|
242
|
+
*/
|
|
243
|
+
export const defaultStructuralRules = [
|
|
244
|
+
descriptionRule(),
|
|
245
|
+
saysWhatNotWhenRule(),
|
|
246
|
+
enumInProseRule(),
|
|
247
|
+
optionalParamRule(),
|
|
248
|
+
];
|
|
249
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/lib/tool-lint/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAYH;sEACsE;AACtE,SAAS,gBAAgB,CAAC,IAAiB;IAIzC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,EAAE,UAAU,CAAC;IACjC,MAAM,UAAU,GACd,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QACzC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,CAAC,MAAM,CACrD,CAAC,KAAK,EAAqC,EAAE,CAC3C,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CACpD;QACH,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,QAAQ,GAAG,IAAI,GAAG,CACtB,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,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,EAAE,CAAC;gBACxF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC7B,QAAQ,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE,6BAA6B;wBACnC,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,QAAQ,EAAE,MAAM;wBAChB,KAAK;wBACL,OAAO,EAAE,mBAAmB,KAAK,0FAA0F;qBAC5H,CAAC,CAAC;gBACL,CAAC;qBAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;oBAC/D,QAAQ,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE,6BAA6B;wBACnC,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,QAAQ,EAAE,MAAM;wBAChB,KAAK;wBACL,OAAO,EAAE,mBAAmB,KAAK,4GAA4G;qBAC9I,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,wEAAwE;AAExE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IACzD,eAAe,EAAE;IACjB,mBAAmB,EAAE;IACrB,eAAe,EAAE;IACjB,iBAAiB,EAAE;CACpB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tool-lint types — the tool-catalog confusability lint contract
|
|
3
|
+
* (RFC-002 tier 1, blocks C1–C3).
|
|
4
|
+
*
|
|
5
|
+
* Pattern: Strategy seam (the plug-and-play meta-pattern) — the frame
|
|
6
|
+
* and rule engine are the library's; the embedder, thresholds,
|
|
7
|
+
* and structural rule pack are all consumer-injected, with our
|
|
8
|
+
* defaults. Exactly like NarrativeFormatter / reliability /
|
|
9
|
+
* permission / commentary strategies.
|
|
10
|
+
* Role: `src/lib/` leaf module. ZERO stack buy-in: input is a plain
|
|
11
|
+
* `{ name, description?, inputSchema? }[]` — any OpenAI /
|
|
12
|
+
* Anthropic / LangChain / MCP tool list normalizes to it
|
|
13
|
+
* (see `coerceCatalog`). The library's own `Tool[]` adapts via
|
|
14
|
+
* `catalogFromTools`.
|
|
15
|
+
*
|
|
16
|
+
* ## Honest claim (RFC-002 §2)
|
|
17
|
+
*
|
|
18
|
+
* Confusability here is embedding geometry over what the model READS
|
|
19
|
+
* (tool name + description) — a deterministic heuristic for "could the
|
|
20
|
+
* model mix these up", never a measurement of any model's actual
|
|
21
|
+
* selection function. Tier 3 (choice-entropy sampling) validates the
|
|
22
|
+
* proxy; until then treat verdicts as review prompts, not ground truth.
|
|
23
|
+
*/
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/tool-lint/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded serialization helpers for the trace toolpack.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: pure functions — no state, no events.
|
|
5
|
+
* Role: The token-economics layer. EVERY value the toolpack serves goes
|
|
6
|
+
* through these: previews are capped, truncation is EXPLICIT
|
|
7
|
+
* (never silent), and nested-path keys round-trip between the
|
|
8
|
+
* engine's DELIM encoding and LLM-friendly dot notation.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* footprintjs's canonical nested-path delimiter (ASCII unit separator,
|
|
12
|
+
* `src/lib/memory/utils.ts`). Internal to the engine — the toolpack
|
|
13
|
+
* translates it to/from dot notation so the LLM never sees a control char.
|
|
14
|
+
*/
|
|
15
|
+
export const FP_PATH_DELIM = '\u001F';
|
|
16
|
+
/** Engine path → LLM-friendly dotted display form. */
|
|
17
|
+
export function displayKey(path) {
|
|
18
|
+
return path.includes(FP_PATH_DELIM) ? path.split(FP_PATH_DELIM).join('.') : path;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* LLM-supplied key → engine path. Exact keys pass through; a dotted key
|
|
22
|
+
* that doesn't exist verbatim but matches a known DELIM-joined path is
|
|
23
|
+
* translated back. `knownPaths` is the set of every path seen in the
|
|
24
|
+
* commit log's trace entries.
|
|
25
|
+
*/
|
|
26
|
+
export function normalizeKey(key, knownPaths) {
|
|
27
|
+
if (knownPaths.has(key))
|
|
28
|
+
return key;
|
|
29
|
+
if (key.includes('.')) {
|
|
30
|
+
const delimForm = key.split('.').join(FP_PATH_DELIM);
|
|
31
|
+
if (knownPaths.has(delimForm))
|
|
32
|
+
return delimForm;
|
|
33
|
+
}
|
|
34
|
+
return key;
|
|
35
|
+
}
|
|
36
|
+
/** Replace every DELIM in an already-formatted text block with '.' for display. */
|
|
37
|
+
export function displayText(text) {
|
|
38
|
+
return text.split(FP_PATH_DELIM).join('.');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Serialize a value to compact JSON, total-function style: cycles, BigInt
|
|
42
|
+
* and other non-JSON values degrade to a tagged placeholder instead of
|
|
43
|
+
* throwing — a debugger tool must never crash on the evidence it serves.
|
|
44
|
+
*/
|
|
45
|
+
export function safeStringify(value) {
|
|
46
|
+
if (value === undefined)
|
|
47
|
+
return 'undefined';
|
|
48
|
+
try {
|
|
49
|
+
const json = JSON.stringify(value);
|
|
50
|
+
return json === undefined ? String(value) : json;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return '[unserializable value]';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Serialize + cap at `maxChars`. Truncation is reported, never silent. */
|
|
57
|
+
export function boundedPreview(value, maxChars) {
|
|
58
|
+
const full = safeStringify(value);
|
|
59
|
+
if (full.length <= maxChars) {
|
|
60
|
+
return { text: full, totalChars: full.length, truncated: false };
|
|
61
|
+
}
|
|
62
|
+
return { text: `${full.slice(0, maxChars)}…`, totalChars: full.length, truncated: true };
|
|
63
|
+
}
|
|
64
|
+
/** Render a preview with its honesty suffix when truncated. */
|
|
65
|
+
export function renderPreview(preview, fetchHint) {
|
|
66
|
+
if (!preview.truncated)
|
|
67
|
+
return preview.text;
|
|
68
|
+
const hint = fetchHint ? ` — ${fetchHint}` : '';
|
|
69
|
+
return `${preview.text} (${preview.totalChars} chars total${hint})`;
|
|
70
|
+
}
|
|
71
|
+
/** Clamp an LLM-supplied numeric param into [min, hardCap], with a default. */
|
|
72
|
+
export function clampParam(requested, fallback, min, hardCap) {
|
|
73
|
+
const value = typeof requested === 'number' && Number.isFinite(requested) ? requested : fallback;
|
|
74
|
+
return Math.max(min, Math.min(Math.floor(value), hardCap));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=bounded.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounded.js","sourceRoot":"","sources":["../../../../src/lib/trace-toolpack/bounded.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AAEtC,sDAAsD;AACtD,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,UAA+B;IACvE,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACpC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrD,IAAI,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IAC5C,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,UAAU,eAAe,IAAI,GAAG,CAAC;AACtE,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CACxB,SAA6B,EAC7B,QAAgB,EAChB,GAAW,EACX,OAAe;IAEf,MAAM,KAAK,GAAG,OAAO,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjG,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trace-toolpack — RFC-003 Part C: the introspection toolpack.
|
|
3
|
+
*
|
|
4
|
+
* footprintjs trace evidence exposed as TOOLS an LLM calls: a debugging
|
|
5
|
+
* model navigates a COMPLETED run's evidence by runtimeStageIds instead of
|
|
6
|
+
* reading dumps. Bounded, honest (⚠ markers), redaction-respecting.
|
|
7
|
+
*/
|
|
8
|
+
export { callTraceTool, traceToolpack } from './traceToolpack.js';
|
|
9
|
+
export { TOOLPACK_HARD_CAPS, } from './types.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/trace-toolpack/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,kBAAkB,GAGnB,MAAM,YAAY,CAAC"}
|