@dzhechkov/harness-core 0.7.2 → 0.7.4
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/.dz-manifest.json +121 -41
- package/README.md +1 -1
- package/dist/cli-flag-notice.d.ts +50 -0
- package/dist/cli-flag-notice.d.ts.map +1 -0
- package/dist/cli-flag-notice.js +106 -0
- package/dist/cli-flag-notice.js.map +1 -0
- package/dist/event-chain.d.ts +50 -0
- package/dist/event-chain.d.ts.map +1 -1
- package/dist/event-chain.js +31 -0
- package/dist/event-chain.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/name-check.d.ts +98 -0
- package/dist/name-check.d.ts.map +1 -0
- package/dist/name-check.js +333 -0
- package/dist/name-check.js.map +1 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +33 -5
- package/dist/operations.js.map +1 -1
- package/dist/provenance.d.ts +100 -92
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js +122 -122
- package/dist/provenance.js.map +1 -1
- package/dist/recall-domain-boost.d.ts +10 -3
- package/dist/recall-domain-boost.d.ts.map +1 -1
- package/dist/recall-domain-boost.js +7 -0
- package/dist/recall-domain-boost.js.map +1 -1
- package/dist/recall-hook-policy.d.ts +15 -0
- package/dist/recall-hook-policy.d.ts.map +1 -1
- package/dist/recall-hook-policy.js +59 -0
- package/dist/recall-hook-policy.js.map +1 -1
- package/dist/recap.d.ts +146 -0
- package/dist/recap.d.ts.map +1 -0
- package/dist/recap.js +346 -0
- package/dist/recap.js.map +1 -0
- package/dist/retro.d.ts +131 -0
- package/dist/retro.d.ts.map +1 -0
- package/dist/retro.js +207 -0
- package/dist/retro.js.map +1 -0
- package/dist/score.d.ts +21 -0
- package/dist/score.d.ts.map +1 -1
- package/dist/score.js +44 -3
- package/dist/score.js.map +1 -1
- package/dist/vector-tier.d.ts +54 -0
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +69 -8
- package/dist/vector-tier.js.map +1 -1
- package/package.json +8 -8
- package/sbom.json +240 -40
- package/src/cli-flag-notice.ts +114 -0
- package/src/event-chain.ts +64 -0
- package/src/index.ts +13 -0
- package/src/name-check.ts +331 -0
- package/src/operations.ts +34 -6
- package/src/provenance.ts +217 -0
- package/src/recall-domain-boost.ts +10 -3
- package/src/recall-hook-policy.ts +60 -0
- package/src/recap.ts +462 -0
- package/src/score.ts +53 -3
- package/src/vector-tier.ts +109 -10
package/dist/provenance.js
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
// Ed25519 witness signing + verification for skill packs (rUv-scout #4).
|
|
2
|
-
//
|
|
3
|
-
// Ported near-verbatim from the shipped TypeScript `agentic-flow/src/harness/provenance.ts` (RuvNet, ADR-075),
|
|
4
|
-
// adapted to a per-pack witness. Ed25519 (Edwards-curve Digital Signature Algorithm) + SHA-256 come from Node's
|
|
5
|
-
// built-in `crypto` — ZERO new dependencies. This module is PURE: build/sign/verify operate over INJECTED file
|
|
6
|
-
// contents (not the filesystem), so they are deterministic and unit-testable without a keypair on disk. The
|
|
7
|
-
// CLI (`dz sign` / `dz verify`) does the filesystem + key I/O. Same pure-engine shape as discrimination-gate.ts.
|
|
8
|
-
//
|
|
9
|
-
// A witness is `{ version, pack, packVersion, createdAt?, entries:[{path, sha256}], publicKey, signature }`. The
|
|
10
|
-
// SIGNED payload is the manifest (everything except publicKey + signature); the publicKey is the attached
|
|
11
|
-
// verification anchor. Because a tamperer could swap the publicKey AND re-sign with their own key, verification
|
|
12
|
-
// ALSO cross-checks the witness's publicKey against a trusted anchor (the committed `keys/dz.pub`) — without
|
|
13
|
-
// that anchor a re-signed tampered pack would verify clean. That cross-check is the load-bearing guard.
|
|
14
|
-
import { generateKeyPairSync, sign as cryptoSign, verify as cryptoVerify, createHash } from 'node:crypto';
|
|
15
|
-
/** Generate an Ed25519 keypair as PEM strings (spki public / pkcs8 private). */
|
|
16
|
-
export function generateKeyPairPem() {
|
|
17
|
-
const { publicKey, privateKey } = generateKeyPairSync('ed25519');
|
|
18
|
-
return {
|
|
19
|
-
publicKey: publicKey.export({ type: 'spki', format: 'pem' }).toString(),
|
|
20
|
-
privateKey: privateKey.export({ type: 'pkcs8', format: 'pem' }).toString(),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/** SHA-256 (lowercase hex) of a buffer or string. */
|
|
24
|
-
export function sha256Hex(data) {
|
|
25
|
-
return createHash('sha256').update(data).digest('hex');
|
|
26
|
-
}
|
|
27
1
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
2
|
+
* The provenance gate — nothing leaves this machine citing a source that may not.
|
|
3
|
+
*
|
|
4
|
+
* It checks PROVENANCE, not words. A denylist of forbidden phrases is an enumeration, and it loses
|
|
5
|
+
* to the first confidential note it has never heard of; the `.gitignore` in this repository carries
|
|
6
|
+
* a comment warning about exactly that mistake. An allowlist of SOURCES wins by construction: an
|
|
7
|
+
* unknown source is refused because it is unknown.
|
|
8
|
+
*
|
|
9
|
+
* Two things this module deliberately does NOT do, both named in ADR-001 rather than implied:
|
|
10
|
+
* - it does not read CONTENT, so confidential text pasted by hand into an allowed file inherits
|
|
11
|
+
* that file's permission;
|
|
12
|
+
* - it cannot see a paraphrase with no citation. It proves what was CITED, never what was known.
|
|
13
|
+
* The last line against both is a person reading the draft, and that is the design, not a gap.
|
|
14
|
+
*
|
|
15
|
+
* PURE: no filesystem, no git, no clock. The oracle runs in the CLI and arrives as a fact — a
|
|
16
|
+
* verdict that needs a real repository to reproduce is a verdict no test can pin.
|
|
17
|
+
*
|
|
18
|
+
* See features/provenance-gate/03_adr/ for the decisions and the measurements behind them.
|
|
30
19
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!f || typeof f.path !== 'string' || f.path.length === 0)
|
|
35
|
-
continue;
|
|
36
|
-
byPath.set(f.path, sha256Hex(f.content ?? ''));
|
|
37
|
-
}
|
|
38
|
-
const entries = [...byPath.entries()]
|
|
39
|
-
.map(([path, sha256]) => ({ path, sha256 }))
|
|
40
|
-
.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
41
|
-
return {
|
|
42
|
-
version: 1,
|
|
43
|
-
pack: input.pack,
|
|
44
|
-
packVersion: input.packVersion,
|
|
45
|
-
...(input.createdAt ? { createdAt: input.createdAt } : {}),
|
|
46
|
-
entries,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/** Canonical bytes that get signed/verified — stable JSON with a fixed key order; entries already sorted. */
|
|
50
|
-
function canonicalPayload(m) {
|
|
51
|
-
return JSON.stringify({
|
|
52
|
-
version: m.version,
|
|
53
|
-
pack: m.pack,
|
|
54
|
-
packVersion: m.packVersion,
|
|
55
|
-
createdAt: m.createdAt ?? null,
|
|
56
|
-
entries: m.entries.map((e) => ({ path: e.path, sha256: e.sha256 })),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/** Sign a manifest with an Ed25519 private-key PEM. Returns a base64 signature. Ed25519 uses a null algorithm. */
|
|
60
|
-
export function signManifest(m, privateKeyPem) {
|
|
61
|
-
return cryptoSign(null, Buffer.from(canonicalPayload(m), 'utf8'), privateKeyPem).toString('base64');
|
|
62
|
-
}
|
|
63
|
-
/** Verify a base64 Ed25519 signature over a manifest. Fail-safe: malformed sig/key ⇒ false, never throws. */
|
|
64
|
-
export function verifyManifest(m, signatureBase64, publicKeyPem) {
|
|
20
|
+
/** Parse a manifest. Unparseable is `null` — which the caller must NOT read as "empty". */
|
|
21
|
+
export function parseSourceManifest(text) {
|
|
22
|
+
let raw;
|
|
65
23
|
try {
|
|
66
|
-
|
|
24
|
+
raw = JSON.parse(text);
|
|
67
25
|
}
|
|
68
26
|
catch {
|
|
69
|
-
return
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (raw === null || typeof raw !== 'object')
|
|
30
|
+
return null;
|
|
31
|
+
const o = raw;
|
|
32
|
+
if (!Array.isArray(o['claims']))
|
|
33
|
+
return null;
|
|
34
|
+
const claims = [];
|
|
35
|
+
for (const c of o['claims']) {
|
|
36
|
+
if (c === null || typeof c !== 'object')
|
|
37
|
+
return null;
|
|
38
|
+
const cc = c;
|
|
39
|
+
claims.push({
|
|
40
|
+
id: typeof cc['id'] === 'string' ? cc['id'] : '',
|
|
41
|
+
...(typeof cc['kind'] === 'string' ? { kind: cc['kind'] } : {}),
|
|
42
|
+
...(typeof cc['source'] === 'string' ? { source: cc['source'] } : {}),
|
|
43
|
+
});
|
|
70
44
|
}
|
|
71
|
-
}
|
|
72
|
-
/** Build + sign into an on-disk witness. */
|
|
73
|
-
export function signWitness(input, keys) {
|
|
74
|
-
const manifest = buildManifest(input);
|
|
75
|
-
return { ...manifest, publicKey: keys.publicKey, signature: signManifest(manifest, keys.privateKey) };
|
|
76
|
-
}
|
|
77
|
-
/** Strip the witness wrapper back to the signed manifest (for re-verification). */
|
|
78
|
-
function manifestOf(w) {
|
|
79
45
|
return {
|
|
80
|
-
version:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
...(w.createdAt ? { createdAt: w.createdAt } : {}),
|
|
84
|
-
entries: w.entries,
|
|
46
|
+
version: typeof o['version'] === 'number' ? o['version'] : 1,
|
|
47
|
+
draft: typeof o['draft'] === 'string' ? o['draft'] : '',
|
|
48
|
+
claims,
|
|
85
49
|
};
|
|
86
50
|
}
|
|
87
|
-
/** Normalise two PEM keys for comparison (ignore surrounding whitespace / line-ending differences). */
|
|
88
|
-
function samePem(a, b) {
|
|
89
|
-
if (typeof a !== 'string' || typeof b !== 'string')
|
|
90
|
-
return false;
|
|
91
|
-
const norm = (s) => s.replace(/\s+/g, '');
|
|
92
|
-
return norm(a).length > 0 && norm(a) === norm(b);
|
|
93
|
-
}
|
|
94
51
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
52
|
+
* Classify ONE claim's source.
|
|
53
|
+
*
|
|
54
|
+
* Order matters and is load-bearing. The KIND is read from the manifest and never guessed from the
|
|
55
|
+
* string: `.dz/` holds 119 git-TRACKED files (measured), so `.dz/guard-audit.jsonl` is not ignored
|
|
56
|
+
* and a shape-based guess would let it through as an ordinary repo path, skipping the public-list
|
|
57
|
+
* requirement entirely.
|
|
97
58
|
*/
|
|
98
|
-
export function
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
59
|
+
export function classifySource(claim, facts) {
|
|
60
|
+
const id = claim.id === '' ? '(unnamed claim)' : claim.id;
|
|
61
|
+
const source = typeof claim.source === 'string' && claim.source.trim() !== '' ? claim.source.trim() : null;
|
|
62
|
+
const at = (verdict, detail) => ({ id, source, verdict, detail });
|
|
63
|
+
if (source === null)
|
|
64
|
+
return at('no-source', 'the claim names no source — a claim with no source is exactly what must not go out');
|
|
65
|
+
if (claim.kind === 'record') {
|
|
66
|
+
return facts.publicRecords.has(source)
|
|
67
|
+
? at('allowed', 'named in the tracked public-records list')
|
|
68
|
+
: at('not-marked-public', 'this record is not in the tracked public list — marking one public must be a reviewable commit, not a field inside an ignored store');
|
|
104
69
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
70
|
+
if (claim.kind === 'path') {
|
|
71
|
+
const real = facts.resolved.get(source);
|
|
72
|
+
if (real === undefined || real === null) {
|
|
73
|
+
return at('unresolvable', 'the path does not resolve inside the repository — a source that cannot be resolved cannot be shown to be safe');
|
|
74
|
+
}
|
|
75
|
+
if (facts.ignoredPaths === null) {
|
|
76
|
+
// Defensive: `decideSourceProvenance` refuses before reaching here. Kept so a direct caller of
|
|
77
|
+
// classifySource cannot obtain an `allowed` from an oracle that never ran.
|
|
78
|
+
return at('unresolvable', 'the ignore oracle did not run, so no path can be cleared');
|
|
79
|
+
}
|
|
80
|
+
if (facts.ignoredPaths.has(real))
|
|
81
|
+
return at('ignored-path', 'git says this path is ignored — the owner\'s own boundary refuses it');
|
|
82
|
+
// Three separate questions, and the first version asked only one. A brand-new file the drafting
|
|
83
|
+
// process wrote is not ignored either, and clearing it would let the generator author its own
|
|
84
|
+
// evidence.
|
|
85
|
+
if (!facts.trackedPaths.has(real))
|
|
86
|
+
return at('untracked', 'git does not track this path, so nobody has reviewed it — not being ignored says nothing about a file that has never been committed');
|
|
87
|
+
if (facts.dirtyPaths.has(real))
|
|
88
|
+
return at('uncommitted', 'this path has uncommitted changes, so its current contents went through no review');
|
|
89
|
+
return at('allowed', 'committed, reviewed, and not refused by the owner\'s boundary');
|
|
111
90
|
}
|
|
112
|
-
|
|
113
|
-
return { signatureValid, filesIntact: drift.length === 0, drift, anchorMatches };
|
|
91
|
+
return at('unknown-kind', `the manifest declares kind ${JSON.stringify(claim.kind ?? null)} — a kind this gate cannot check is refused, never inferred from the path's shape`);
|
|
114
92
|
}
|
|
115
93
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* - files drifted → BLOCK (on-disk files differ from what was signed)
|
|
121
|
-
* - signature valid + intact + (no anchor OR anchor matches) → PASS
|
|
122
|
-
* NEVER throws; a hostile/partial input degrades to BLOCK (safe default) rather than a false PASS.
|
|
94
|
+
* The whole-manifest verdict.
|
|
95
|
+
*
|
|
96
|
+
* Three outcomes, and neither non-pass returns zero. The dangerous one is the third: an empty
|
|
97
|
+
* manifest does not mean "nothing confidential is cited", it means "we checked nothing".
|
|
123
98
|
*/
|
|
124
|
-
export function
|
|
125
|
-
if (
|
|
126
|
-
return {
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
99
|
+
export function decideSourceProvenance(manifest, facts) {
|
|
100
|
+
if (manifest === null) {
|
|
101
|
+
return { outcome: 'not-established', exit: 3, claims: [], reason: 'the manifest could not be read — nothing was checked, which is not the same as nothing being wrong' };
|
|
102
|
+
}
|
|
103
|
+
if (facts.ignoredPaths === null) {
|
|
104
|
+
// BEFORE classification, and for the WHOLE batch. Measured 2026-08-22: one out-of-repo path in
|
|
105
|
+
// a `git check-ignore --stdin` batch prints the matches found so far, then dies with exit 128 —
|
|
106
|
+
// so crediting what was printed would clear every path queued behind it (ADR-003).
|
|
107
|
+
return { outcome: 'not-established', exit: 3, claims: [], reason: 'the ignore oracle did not run, so not one path was checked — this is not a pass' };
|
|
108
|
+
}
|
|
109
|
+
if (manifest.claims.length === 0) {
|
|
110
|
+
return { outcome: 'not-established', exit: 3, claims: [], reason: 'the manifest lists no claims — a draft with nothing to check has not been shown to be safe, only left unchecked' };
|
|
111
|
+
}
|
|
112
|
+
const claims = manifest.claims.map((c) => classifySource(c, facts));
|
|
113
|
+
const blocked = claims.filter((c) => c.verdict !== 'allowed');
|
|
114
|
+
if (blocked.length > 0) {
|
|
115
|
+
return {
|
|
116
|
+
outcome: 'blocked',
|
|
117
|
+
exit: 1,
|
|
118
|
+
claims,
|
|
119
|
+
reason: `${blocked.length} of ${claims.length} claim(s) cite a source that may not leave this machine`,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return { outcome: 'allowed', exit: 0, claims, reason: `all ${claims.length} claim(s) cite a source cleared to go out` };
|
|
123
|
+
}
|
|
124
|
+
/** What the operator sees. Every blocked claim names its id, its source and its reason. */
|
|
125
|
+
export function renderSourceProvenance(decision) {
|
|
126
|
+
const out = [];
|
|
127
|
+
const label = decision.outcome === 'allowed' ? 'ALLOWED' : decision.outcome === 'blocked' ? 'BLOCKED' : 'NOT ESTABLISHED';
|
|
128
|
+
for (const c of decision.claims) {
|
|
129
|
+
if (c.verdict === 'allowed')
|
|
130
|
+
continue;
|
|
131
|
+
out.push(` [${c.verdict}] ${c.id} — ${c.source ?? '(no source)'}: ${c.detail}`);
|
|
132
|
+
}
|
|
133
|
+
out.push(`dz provenance-check: ${label} — ${decision.reason}`);
|
|
134
|
+
if (decision.outcome === 'allowed') {
|
|
135
|
+
// Said on the PASSING path too, because that is the path where it gets forgotten: a green tick
|
|
136
|
+
// here proves where the citations came from, not that the prose is safe.
|
|
137
|
+
out.push(' note: this proves what was CITED. It cannot see a paraphrase with no citation, nor confidential text pasted by hand into an allowed file. Read the draft.');
|
|
138
138
|
}
|
|
139
|
-
return
|
|
139
|
+
return out;
|
|
140
140
|
}
|
|
141
141
|
//# sourceMappingURL=provenance.js.map
|
package/dist/provenance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAgFH,2FAA2F;AAC3F,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzD,MAAM,CAAC,GAAG,GAA8B,CAAC;IACzC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7C,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAc,EAAE,CAAC;QACzC,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACrD,MAAM,EAAE,GAAG,CAA4B,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC;YAC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EAAE,SAAS;YAClB,IAAI,EAAE,CAAC;YACP,MAAM;YACN,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM,yDAAyD;SACvG,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,2CAA2C,EAAE,CAAC;AAC1H,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,sBAAsB,CAAC,QAAkC;IACvE,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC1H,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChC,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS;YAAE,SAAS;QACtC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,IAAI,aAAa,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACnF,CAAC;IACD,GAAG,CAAC,IAAI,CAAC,wBAAwB,KAAK,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/D,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACnC,+FAA+F;QAC/F,yEAAyE;QACzE,GAAG,CAAC,IAAI,CAAC,6JAA6J,CAAC,CAAC;IAC1K,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -39,8 +39,8 @@ export declare function normalizeDomain(domain: string | null | undefined): stri
|
|
|
39
39
|
* hierarchy shapes (`health` ↔ `health-research`) without a taxonomy: a taxonomy
|
|
40
40
|
* nobody maintains drifts, and a wrong taxonomy is worse than none. */
|
|
41
41
|
export declare function domainMatch(hitDomain: string | null | undefined, wanted: string | null | undefined): DomainMatch;
|
|
42
|
-
export interface DomainBoostResult {
|
|
43
|
-
readonly hits: readonly
|
|
42
|
+
export interface DomainBoostResult<T extends RecallHit = RecallHit> {
|
|
43
|
+
readonly hits: readonly T[];
|
|
44
44
|
/** How many hits MATCHED the domain (exactly / relatedly). */
|
|
45
45
|
readonly exact: number;
|
|
46
46
|
readonly related: number;
|
|
@@ -62,7 +62,14 @@ export interface DomainBoostResult {
|
|
|
62
62
|
* is deterministic — the same input always yields the same output, which is what
|
|
63
63
|
* makes it testable at all.
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Generic over the hit type so EXTRA FIELDS SURVIVE the boost. Narrowing to `RecallHit` silently
|
|
67
|
+
* dropped `similarity` from a `HybridHit`, and the closeness a reader is meant to act on vanished
|
|
68
|
+
* the moment `--domain` was passed. Note the deliberate asymmetry with `relevance`, which the CLI
|
|
69
|
+
* nulls under a boost because the boost invalidates the RRF ordering: closeness is
|
|
70
|
+
* ORDER-INDEPENDENT, so it stays populated.
|
|
71
|
+
*/
|
|
72
|
+
export declare function applyDomainBoost<T extends RecallHit>(hits: readonly T[], wanted: string | null | undefined): DomainBoostResult<T>;
|
|
66
73
|
/**
|
|
67
74
|
* How many hits the CUT hid that an unboosted recall would have shown.
|
|
68
75
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-domain-boost.d.ts","sourceRoot":"","sources":["../src/recall-domain-boost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;sEAMsE;AACtE,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,IAAI,CAA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AM,CAAC;IACvB;qFACiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAwBjI;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,KAAK,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;uBACuB;AACvB,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI5E;AAED;;;;;;;;gEAQgE;AAChE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAcvF"}
|
|
@@ -67,6 +67,13 @@ export function domainMatch(hitDomain, wanted) {
|
|
|
67
67
|
* is deterministic — the same input always yields the same output, which is what
|
|
68
68
|
* makes it testable at all.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Generic over the hit type so EXTRA FIELDS SURVIVE the boost. Narrowing to `RecallHit` silently
|
|
72
|
+
* dropped `similarity` from a `HybridHit`, and the closeness a reader is meant to act on vanished
|
|
73
|
+
* the moment `--domain` was passed. Note the deliberate asymmetry with `relevance`, which the CLI
|
|
74
|
+
* nulls under a boost because the boost invalidates the RRF ordering: closeness is
|
|
75
|
+
* ORDER-INDEPENDENT, so it stays populated.
|
|
76
|
+
*/
|
|
70
77
|
export function applyDomainBoost(hits, wanted) {
|
|
71
78
|
const target = normalizeDomain(wanted);
|
|
72
79
|
if (target === '' || hits.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-domain-boost.js","sourceRoot":"","sources":["../src/recall-domain-boost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;sEAMsE;AACtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAIrC;gFACgF;AAChF,MAAM,UAAU,eAAe,CAAC,MAAiC;IAC/D,OAAO,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;SACxB,WAAW,EAAE;SACb,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;QACxB,kFAAkF;QAClF,8EAA8E;QAC9E,qFAAqF;QACrF,kFAAkF;QAClF,gCAAgC;SAC/B,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;uEAEuE;AACvE,MAAM,UAAU,WAAW,CAAC,SAAoC,EAAE,MAAiC;IACjG,MAAM,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IAC5B,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACrE,OAAO,MAAM,CAAC;AAChB,CAAC;AAiBD;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,
|
|
1
|
+
{"version":3,"file":"recall-domain-boost.js","sourceRoot":"","sources":["../src/recall-domain-boost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqB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B,EAAE,MAAc;IAC7E,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,OAAO,aAAa,MAAM,8EAA8E,CAAC;IAC3G,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,KAAK,CAAC;QAC/B,CAAC,CAAC,+CAA+C;QACjD,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,mBAAmB,CAAC;IACvC,mFAAmF;IACnF,qFAAqF;IACrF,iFAAiF;IACjF,mDAAmD;IACnD,OAAO,aAAa,MAAM,YAAY,MAAM,CAAC,IAAI,CAAC,MAAM,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,MAAM,uDAAuD,CAAC;AAC1K,CAAC"}
|
|
@@ -103,4 +103,19 @@ export declare function selectHookHits(prompt: unknown, candidates: readonly Hoo
|
|
|
103
103
|
* NOTHING (not an empty JSON envelope) and exits 0, so an off-topic turn costs the reader zero tokens.
|
|
104
104
|
*/
|
|
105
105
|
export declare function renderHookContext(selection: HookSelection): string;
|
|
106
|
+
/**
|
|
107
|
+
* The closeness token for one recall row: `sim=0.67▲` above the floor, `sim=0.29▽` below it,
|
|
108
|
+
* `sim=—` when closeness was not measured for this row.
|
|
109
|
+
*
|
|
110
|
+
* The marker is the floor comparison DONE FOR THE READER, against the same per-language floors the
|
|
111
|
+
* hook already trusts — calibrated 2026-07-09 on a 32-probe labeled set, not chosen by feel. A bare
|
|
112
|
+
* cosine means nothing without that table, and the point of this token is a number the reader can
|
|
113
|
+
* act on: `▲` is on-topic, `▽` is "ranked because something had to rank first", `—` is "unmeasured".
|
|
114
|
+
*
|
|
115
|
+
* A lexical-only hit and an engine whose score is not a cosine both get the dash. Substituting a
|
|
116
|
+
* differently-scaled number there is the precise lie this exists to remove.
|
|
117
|
+
*/
|
|
118
|
+
export declare function closenessLine(similarity: number | undefined, query: unknown, floors?: Partial<RecallFloors>): string;
|
|
119
|
+
/** Did anything clear the floor? Used to say so ONCE, in words, instead of per row. */
|
|
120
|
+
export declare function anyAboveFloor(similarities: readonly (number | undefined)[], query: unknown, floors?: Partial<RecallFloors>): boolean;
|
|
106
121
|
//# sourceMappingURL=recall-hook-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-hook-policy.d.ts","sourceRoot":"","sources":["../src/recall-hook-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpC,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAqC,CAAC;AAE1E,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,qHAAqH;AACrH,eAAO,MAAM,gCAAgC,OAAO,CAAC;AAIrD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAGxD;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,MAAM,CAKlG;AAED,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAA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EACf,UAAU,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,GAAG,SAAS,EACvD,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAClF,aAAa,CAwCf;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAIlE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,MAAM,CAIpH;AAmCD,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAMpI"}
|
|
@@ -133,4 +133,63 @@ export function renderHookContext(selection) {
|
|
|
133
133
|
const lines = selection.hits.map((h) => ` - [${h.score.toFixed(2)}${h.domain ? ` / ${h.domain}` : ''}] ${h.pattern}`);
|
|
134
134
|
return `Learned lessons that match this prompt (dz recall, relevance ≥ ${selection.floor.toFixed(2)}):\n${lines.join('\n')}`;
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* The closeness token for one recall row: `sim=0.67▲` above the floor, `sim=0.29▽` below it,
|
|
138
|
+
* `sim=—` when closeness was not measured for this row.
|
|
139
|
+
*
|
|
140
|
+
* The marker is the floor comparison DONE FOR THE READER, against the same per-language floors the
|
|
141
|
+
* hook already trusts — calibrated 2026-07-09 on a 32-probe labeled set, not chosen by feel. A bare
|
|
142
|
+
* cosine means nothing without that table, and the point of this token is a number the reader can
|
|
143
|
+
* act on: `▲` is on-topic, `▽` is "ranked because something had to rank first", `—` is "unmeasured".
|
|
144
|
+
*
|
|
145
|
+
* A lexical-only hit and an engine whose score is not a cosine both get the dash. Substituting a
|
|
146
|
+
* differently-scaled number there is the precise lie this exists to remove.
|
|
147
|
+
*/
|
|
148
|
+
export function closenessLine(similarity, query, floors) {
|
|
149
|
+
if (typeof similarity !== 'number' || !isFinite(similarity))
|
|
150
|
+
return 'sim=—';
|
|
151
|
+
const floor = relevanceFloorFor(query, floors);
|
|
152
|
+
return `sim=${showCloseness(similarity, floor)}${similarity >= floor ? '▲' : '▽'}`;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The cosine, printed with enough digits that it cannot LOOK equal to the floor when it is not.
|
|
156
|
+
*
|
|
157
|
+
* Two rounds of cross-family review (codex `gpt-5.6-sol`, 2026-08-24) landed on opposite sides of one
|
|
158
|
+
* trade-off, and both were right. Comparing before rounding shows `sim=0.50▽` for 0.499 against a
|
|
159
|
+
* 0.50 floor — a figure equal to the floor, marked below it. Comparing after rounding shows
|
|
160
|
+
* `sim=0.50▲` for the same input — a marker that says on-topic for a value the calibrated floor
|
|
161
|
+
* excludes. Choosing a side cannot fix this, because the contradiction lives in the DISPLAY, not in
|
|
162
|
+
* the comparison: two decimals cannot always distinguish a value from its floor.
|
|
163
|
+
*
|
|
164
|
+
* So the comparison stays on the true value — the floors are calibrated on true cosines — and the
|
|
165
|
+
* display widens until the number visibly differs from the floor. 0.499 against 0.50 prints as
|
|
166
|
+
* `sim=0.499▽`: below the floor, and visibly so.
|
|
167
|
+
*/
|
|
168
|
+
function showCloseness(similarity, floor) {
|
|
169
|
+
// Widen until the number and the FLOOR differ AS DISPLAYED at the same precision. Comparing the
|
|
170
|
+
// shown value against the raw floor was not enough: 0.5009 against a floor of 0.501 stopped at two
|
|
171
|
+
// digits and printed `0.50`, which reads as the floor once the floor is itself rounded for a human
|
|
172
|
+
// (cross-family review round 3, 2026-08-24).
|
|
173
|
+
for (let digits = 2; digits <= 6; digits++) {
|
|
174
|
+
const shown = similarity.toFixed(digits);
|
|
175
|
+
if (similarity === floor || shown !== floor.toFixed(digits))
|
|
176
|
+
return shown;
|
|
177
|
+
}
|
|
178
|
+
// Even at full precision the two render alike — 0.4999999 and 0.5 both print `0.500000`, and the
|
|
179
|
+
// contradiction the widening exists to remove survives the cap (cross-family review round 4,
|
|
180
|
+
// 2026-08-24). At that distance the digits are not the answer: state the RELATION instead. The
|
|
181
|
+
// reader learns "just below the floor", which is exactly what is true and what the marker says.
|
|
182
|
+
// The floor is stated AS IT IS, never rounded: with a floor of 0.4999999 a value of 0.49999995 is
|
|
183
|
+
// above the floor and below 0.50, so `>0.50` was literally false (cross-family review round 5,
|
|
184
|
+
// 2026-08-24). `String(floor)` prints exactly what the comparison used.
|
|
185
|
+
return `${similarity < floor ? '<' : '>'}${String(floor)}`;
|
|
186
|
+
}
|
|
187
|
+
/** Did anything clear the floor? Used to say so ONCE, in words, instead of per row. */
|
|
188
|
+
export function anyAboveFloor(similarities, query, floors) {
|
|
189
|
+
const floor = relevanceFloorFor(query, floors);
|
|
190
|
+
// The TRUE value, matching what each row's marker uses — the footer must never contradict the
|
|
191
|
+
// markers above it, and "nothing clears the floor" printed under a visible ▲ would be worse than
|
|
192
|
+
// either alone.
|
|
193
|
+
return similarities.some((s) => typeof s === 'number' && isFinite(s) && s >= floor);
|
|
194
|
+
}
|
|
136
195
|
//# sourceMappingURL=recall-hook-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-hook-policy.js","sourceRoot":"","sources":["../src/recall-hook-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAWH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAE1E,2FAA2F;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,qHAAqH;AAC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