@dzhechkov/harness-core 0.8.33 → 0.8.35
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 +52 -52
- package/README.md +228 -5
- package/dist/agentdb-index.d.ts +39 -7
- package/dist/agentdb-index.d.ts.map +1 -1
- package/dist/agentdb-index.js +217 -23
- package/dist/agentdb-index.js.map +1 -1
- package/dist/apply-leg.d.ts +197 -6
- package/dist/apply-leg.d.ts.map +1 -1
- package/dist/apply-leg.js +858 -46
- package/dist/apply-leg.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/mutation-gate.d.ts +19 -0
- package/dist/mutation-gate.d.ts.map +1 -1
- package/dist/mutation-gate.js +37 -1
- package/dist/mutation-gate.js.map +1 -1
- package/dist/operations.d.ts +16 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +115 -13
- package/dist/operations.js.map +1 -1
- package/dist/publish-sibling-drift.d.ts +72 -0
- package/dist/publish-sibling-drift.d.ts.map +1 -1
- package/dist/publish-sibling-drift.js +150 -4
- package/dist/publish-sibling-drift.js.map +1 -1
- package/dist/release.d.ts +72 -0
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +236 -19
- package/dist/release.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +90 -14
- package/dist/setup.js.map +1 -1
- package/dist/skills.d.ts +87 -3
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +266 -15
- package/dist/skills.js.map +1 -1
- package/dist/vector-tier.d.ts +27 -2
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +117 -4
- package/dist/vector-tier.js.map +1 -1
- package/package.json +2 -2
- package/sbom.json +51 -51
- package/src/agentdb-index.ts +223 -24
- package/src/apply-leg.ts +875 -46
- package/src/index.ts +18 -2
- package/src/mutation-gate.ts +58 -2
- package/src/operations.ts +117 -14
- package/src/publish-sibling-drift.ts +209 -4
- package/src/release.ts +263 -17
- package/src/setup.ts +81 -16
- package/src/skills.ts +303 -14
- package/src/vector-tier.ts +157 -5
package/dist/apply-leg.d.ts
CHANGED
|
@@ -26,6 +26,31 @@
|
|
|
26
26
|
*
|
|
27
27
|
* @packageDocumentation
|
|
28
28
|
*/
|
|
29
|
+
import { type RemovePatternsResult } from './patterns.js';
|
|
30
|
+
/**
|
|
31
|
+
* FR-6 (feature `hook-recall-hybrid-parity`, ADR-001 C-4): send ONE `op: recall` probe to a LIVE
|
|
32
|
+
* embed daemon socket and report the `engine` it answers with (`'hybrid'` | `'cosine-fallback'`) —
|
|
33
|
+
* `dz doctor` prints this so an operator can SEE which engine is actually serving prompts, rather
|
|
34
|
+
* than trusting the daemon's mere presence. Honest-degrade contract, matching every other doctor
|
|
35
|
+
* probe: a non-socket path (e.g. a plain file, as every non-live doctor fixture in this repo uses),
|
|
36
|
+
* a connection error, an unparsable reply, or a timeout all resolve to `undefined` — NEVER a thrown
|
|
37
|
+
* error, and never distinguishable from "no daemon" in the caller's output (the existing "socket
|
|
38
|
+
* present/absent" line already carries that half of the truth).
|
|
39
|
+
*
|
|
40
|
+
* `timeoutMs` defaults to 1000 ms — comfortably above the documented `HOOK_RECALL_BUDGET_MS` default
|
|
41
|
+
* (500 ms): under that default, a cold `recallHybrid` semantic leg routinely exceeds the budget in
|
|
42
|
+
* this environment (MEASURED — see the manifest's NFR-1 discussion), so the daemon's OWN answer
|
|
43
|
+
* time is closer to ~500-550 ms than to the socket round-trip cost alone; a shorter probe timeout
|
|
44
|
+
* would silently miss a live, correctly-answering daemon and report no engine at all.
|
|
45
|
+
*
|
|
46
|
+
* AM-8 (fix round 1): lives HERE, not in `operations.ts` — this module already owns the daemon's
|
|
47
|
+
* wire protocol (`recallHookSource`/`embedDaemonSource`'s generated `op: recall` handshake) and its
|
|
48
|
+
* socket-path resolution; `operations.ts`'s `runDoctor` reaches it via a dynamic `import()`
|
|
49
|
+
* (matching its existing `embed-socket-path.js` import one line above the call site) rather than
|
|
50
|
+
* duplicating a second, independent `node:net` IO surface in a file whose job is orchestration, not
|
|
51
|
+
* protocol.
|
|
52
|
+
*/
|
|
53
|
+
export declare function probeRecallEngine(socketPath: string, timeoutMs?: number): Promise<string | undefined>;
|
|
29
54
|
/**
|
|
30
55
|
* Version stamped into BOTH generated helper files as `// dz-apply-leg-version: N` (line 2, right
|
|
31
56
|
* after the shebang). Bump on ANY change to {@link recallHookSource} or {@link embedDaemonSource}'s
|
|
@@ -43,8 +68,70 @@
|
|
|
43
68
|
* compiled module), the daemon writes a `.dz/embed.sock.path` pointer when it picks the tmpdir-short
|
|
44
69
|
* branch, and `ready` is now printed only after `existsSync(SOCKET)` confirms the bind actually
|
|
45
70
|
* landed (previously logged unconditionally, before `listen` even ran).
|
|
71
|
+
*
|
|
72
|
+
* Bumped 4→5 (feature `hook-recall-hybrid-parity`, ADR-001 D1/D2): the daemon's `op: recall`
|
|
73
|
+
* handler now tries core's `recallHybrid` FIRST — under a time budget (`HOOK_RECALL_BUDGET_MS`,
|
|
74
|
+
* default 500 ms) — via the SAME `CORE_DIST_DIR` + `loadCoreModule` mechanism the hook already
|
|
75
|
+
* used only for its policy modules; on budget overrun, engine error, or no resolvable core module
|
|
76
|
+
* it falls back to today's brute-force cosine, honestly labelled `engine: 'cosine-fallback'` with a
|
|
77
|
+
* `reason`. The hook now reads `engine`/`reason` off the daemon's reply (stderr-only, never
|
|
78
|
+
* context) and applies its relevance floor to the NEW `score` format when `engine === 'hybrid'`,
|
|
79
|
+
* preserving today's cosine-calibrated floor unchanged for the `cosine-fallback` path.
|
|
80
|
+
*
|
|
81
|
+
* Bumped 5→6 (`hook-recall-hybrid-parity`, fix round 1 — AM-1/AM-2/AM-3/AM-5): the daemon now
|
|
82
|
+
* (a) fires a fire-and-forget engine warm-up before `listen()` (AM-1) so the first REAL `op: recall`
|
|
83
|
+
* is less likely to pay a cold `resolveAgentdbEmbedder` init; (b) arms the budget timer BEFORE
|
|
84
|
+
* `loadCoreModule()`, not after (AM-2, wall clock from request receipt); (c) treats ANY failure
|
|
85
|
+
* past the budget race — a malformed hit, `patternRecordId()` throwing — as an honest cosine
|
|
86
|
+
* fallback rather than a bare protocol error (AM-3); (d) reports the RAW core RRF score, unchanged,
|
|
87
|
+
* instead of a locally re-normalized [0,1] value (AM-5) — the hook's own `HOOK_SCORE_FLOOR` default
|
|
88
|
+
* moved from `0.01` to `0.005` to match (see that constant's own comment for the measurement).
|
|
89
|
+
*
|
|
90
|
+
* Bumped 6→7 (feature `apply-leg-install-root`, ADR-001 D1): both generated files now resolve
|
|
91
|
+
* `PROJECT` install-root-first (`INSTALL_ROOT` = this file's own location, when it owns a `.dz/`)
|
|
92
|
+
* instead of trusting a foreign session's `CLAUDE_PROJECT_DIR`/cwd (issue #2) — the hook's own
|
|
93
|
+
* `[dz-recall]` diagnostic line also gains `root=<path> (install|env|cwd)`.
|
|
94
|
+
*
|
|
95
|
+
* Bumped 7→8 (`apply-leg-install-root`, fix round 1, AM-7 HIGH — real regression MEASURED via
|
|
96
|
+
* `retro-debt-hook.test.ts` going 4/5 red on the v7 hub helper): `PROJECT` install-root-first is
|
|
97
|
+
* correct for the STORE (pattern db, socket, daemon script) but WRONG for a per-session artifact —
|
|
98
|
+
* the narrated-error retro-debt sentinel (`retro-pending.json`) is written by the INVOKING
|
|
99
|
+
* SESSION's own Stop hook under `CLAUDE_PROJECT_DIR`, not under wherever the hook happens to be
|
|
100
|
+
* installed; a shared $HOME install made the hook look for a foreign session's sentinel under the
|
|
101
|
+
* install root and silently drop every session's own debt confrontation. Split: `PROJECT` (install-
|
|
102
|
+
* root-first) stays the STORE root; a new `SESSION_ROOT` (`CLAUDE_PROJECT_DIR || cwd()`, the
|
|
103
|
+
* pre-feature resolution, unchanged) is the root for `RETRO_PENDING` — the ONE per-session file this
|
|
104
|
+
* hook reads (every other `PROJECT`-derived path in this file names the store, the daemon, or the
|
|
105
|
+
* harness-core install, confirmed by grep against every `path.join(PROJECT, …)` site). The diag line
|
|
106
|
+
* gains `session=<path>` alongside the existing `root=<path> (…)`.
|
|
107
|
+
*
|
|
108
|
+
* Bumped 8→9 (feature `apply-leg-never-silent`, ADR-001 D2, FR-1): every early return in `main()`
|
|
109
|
+
* now prints `[dz-recall] skipped reason=<store-not-found|socket-absent|core-unavailable|
|
|
110
|
+
* empty-prompt|no-hits> root=<path> (…) session=<path>` on stderr before returning — the hook used
|
|
111
|
+
* to exit silently on every one of these paths, indistinguishable (from stderr alone) from a
|
|
112
|
+
* correctly-quiet "nothing relevant" outcome. `embedDaemonSource`'s own bytes are UNCHANGED by this
|
|
113
|
+
* bump; the shared version number still advances because both helpers are upgraded as one unit by
|
|
114
|
+
* `dz setup`/`applyLegStatus`.
|
|
115
|
+
*
|
|
116
|
+
* Bumped 9→10 (`apply-leg-never-silent`, fix round 1 — cross-model review AM-3/AM-6): (a) the hook
|
|
117
|
+
* now tags its `op: recall` request with `probe: <bool>` (true only when
|
|
118
|
+
* `DZ_HOOK_LIVENESS_PROBE=1`, the env {@link "./operations.js".probeHookLiveness} already stamps on
|
|
119
|
+
* every live-probe spawn) so the daemon can tell a genuine session prompt apart from
|
|
120
|
+
* `probeApplyLeg`'s own beacon query — AM-3: a beacon written for the ~8s of a doctor/parity probe
|
|
121
|
+
* used to be recallable by ANY concurrent real prompt in the SAME project, a probe-only fixture
|
|
122
|
+
* leaking into a real session's context; (b) `askDaemon`'s every failure path used to collapse into
|
|
123
|
+
* one `undefined`, forcing the hook's own `skip('socket-absent')` call regardless of what actually
|
|
124
|
+
* went wrong — AM-6: it now returns a tagged `{error: 'socket-absent'|'connect-refused'|
|
|
125
|
+
* 'daemon-timeout'|'bad-reply'}` so the stderr reason names the ACTUAL failure (no socket file vs a
|
|
126
|
+
* non-socket file at that path vs a listener that never replies vs a listener that replies with
|
|
127
|
+
* something unparseable/shapeless). `embedDaemonSource`'s bytes also change for AM-3: `loadPatterns`
|
|
128
|
+
* now reads each row's `domain` out of the SAME metadata JSON `dzIdOf`/`quarantinedOf` already
|
|
129
|
+
* parse (the vector mirror carries no separate domain column), and both `hybridRecall`'s hits and
|
|
130
|
+
* the cosine-fallback `scored` array are filtered to exclude `domain === 'apply-leg-probe'` unless
|
|
131
|
+
* the request carried `probe: true` — a probe's own beacon still needs to reach ITS query, only a
|
|
132
|
+
* REAL prompt must never see it.
|
|
46
133
|
*/
|
|
47
|
-
export declare const APPLY_LEG_VERSION =
|
|
134
|
+
export declare const APPLY_LEG_VERSION = 10;
|
|
48
135
|
/**
|
|
49
136
|
* Parse the `dz-apply-leg-version` stamp from a deployed helper file. Unlike
|
|
50
137
|
* `writerVersionOf` (which floors an absent stamp at `0`), this returns `-1` for "no stamp at
|
|
@@ -114,13 +201,22 @@ export interface ResolvedIdleMs {
|
|
|
114
201
|
export declare function resolveIdleMs(raw: number): ResolvedIdleMs;
|
|
115
202
|
/**
|
|
116
203
|
* Generate `.claude/helpers/dz-embed-daemon.mjs`. Behaviourally identical to the pre-existing
|
|
117
|
-
* hand-committed hub file except for: the version stamp (new, line 2)
|
|
118
|
-
*
|
|
204
|
+
* hand-committed hub file except for: the version stamp (new, line 2), `resolveDeps()`, which
|
|
205
|
+
* tries `@huggingface/transformers` before falling back to `@xenova/transformers` — AM-3,
|
|
119
206
|
* dz-harness-hub issue #10 defect 3: `agentdb >= 3.0.0-alpha` depends on the former, and an older
|
|
120
207
|
* agentdb install still carries the latter, so probing only one name silently starved the daemon
|
|
121
|
-
* on either side of that agentdb version boundary
|
|
208
|
+
* on either side of that agentdb version boundary — and (feature `hook-recall-hybrid-parity`,
|
|
209
|
+
* ADR-001 D1) the `op: recall` handler, which now tries core's `recallHybrid` under a time budget
|
|
210
|
+
* before falling back to the brute-force cosine below.
|
|
211
|
+
*
|
|
212
|
+
* `coreDistDir` (new parameter, ADR-001 D1) is baked in exactly like {@link recallHookSource}'s own
|
|
213
|
+
* parameter of the same name — the FIRST resolve candidate for `loadCoreModule`. `null` (the
|
|
214
|
+
* default, and what every existing zero-arg call site gets) is the same PORTABLE marker
|
|
215
|
+
* `recallHookSource(null)` uses: `loadCoreModule` falls through to the project-relative fallback
|
|
216
|
+
* candidates, resolved from `DZ_PROJECT_ROOT`/`cwd()` at daemon RUNTIME, which is correct in any
|
|
217
|
+
* clone and for any consumer whose `harness-core` install is reachable under its own project tree.
|
|
122
218
|
*/
|
|
123
|
-
export declare function embedDaemonSource(): string;
|
|
219
|
+
export declare function embedDaemonSource(coreDistDir?: string | null): string;
|
|
124
220
|
/** One Claude Code hook-registry entry in the matcher-group shape (no matcher — session/prompt events don't need one). */
|
|
125
221
|
export interface ApplyLegHookEntry {
|
|
126
222
|
readonly hooks: readonly {
|
|
@@ -134,8 +230,35 @@ export interface ApplyLegHookEntry {
|
|
|
134
230
|
* the recall hook is invoked with a swallowed non-zero exit (`|| true`) so a broken hook body never
|
|
135
231
|
* fails a prompt, and the embed daemon is spawned detached via `nohup` + a backgrounding `sh -c`
|
|
136
232
|
* so `SessionStart` never waits on model load.
|
|
233
|
+
*
|
|
234
|
+
* `installRoot` (ADR-001 D2, feature `apply-leg-install-root`): when the caller (`dz setup`) knows
|
|
235
|
+
* its own install root, the commands bake it in as an ABSOLUTE path — the deployed helper already
|
|
236
|
+
* bakes an absolute `CORE_DIST_DIR`, so a `${CLAUDE_PROJECT_DIR:-.}`-relative command in
|
|
237
|
+
* settings.json only masked that non-portability, and broke down to `Cannot find module` (swallowed
|
|
238
|
+
* by `2>/dev/null || true`) whenever `project === $HOME` and a session's own `CLAUDE_PROJECT_DIR`
|
|
239
|
+
* pointed elsewhere (issue #2). Omitting `installRoot` (every pre-existing zero-arg caller — status
|
|
240
|
+
* fixtures, `applyLegStatus` regression tests) keeps the original `CLAUDE_PROJECT_DIR`-relative
|
|
241
|
+
* form byte for byte; `hookCommandInvokes`/`applyLegStatus` (FR-3) recognize BOTH forms as wired,
|
|
242
|
+
* and `runSetup`'s `addIfMissing` (setup.ts) REPLACES a stale form with the current one in place —
|
|
243
|
+
* never a second entry — on re-setup.
|
|
244
|
+
*
|
|
245
|
+
* Fix round 1 corrections to the absolute (`installRoot`-given) branch — the legacy zero-arg branch
|
|
246
|
+
* is UNCHANGED byte for byte:
|
|
247
|
+
* - AM-1 (HIGH): a caller-controlled path was interpolated RAW into shell source. A `"`, `$`,
|
|
248
|
+
* backtick, or `'` in `installRoot` altered or injected commands, and the SessionStart form broke
|
|
249
|
+
* outright on a `'` (it cannot be escaped inside a `'...'` body by nesting `"`). Fixed:
|
|
250
|
+
* {@link shellQuote} wraps every path; SessionStart passes them as POSITIONAL ARGS (`$1`/`$2`) to
|
|
251
|
+
* an INNER `sh -c` whose script text is a FIXED literal with no caller-controlled bytes, so
|
|
252
|
+
* nested-quote fragility cannot arise at all.
|
|
253
|
+
* - AM-3 (HIGH): the daemon used to fall back to `DZ_PROJECT_ROOT ?? installLocal`, and nothing in
|
|
254
|
+
* the SessionStart command ever SET that variable — a stale inherited `DZ_PROJECT_ROOT` in the
|
|
255
|
+
* parent env could win over the install root the hook itself resolves to. Fixed: the SessionStart
|
|
256
|
+
* command now sets `DZ_PROJECT_ROOT="$1"` (`$1` = installRoot) explicitly, so the daemon and the
|
|
257
|
+
* hook agree by construction regardless of what the parent environment happens to carry.
|
|
258
|
+
* - AM-4 (LOW): a relative `installRoot` used to produce a relative command, breaking the "every
|
|
259
|
+
* baked path is absolute" invariant the module's own docs claim. Fixed: `resolve()`s its input.
|
|
137
260
|
*/
|
|
138
|
-
export declare function applyLegHookEntries(): {
|
|
261
|
+
export declare function applyLegHookEntries(installRoot?: string): {
|
|
139
262
|
readonly userPromptSubmit: ApplyLegHookEntry;
|
|
140
263
|
readonly sessionStart: ApplyLegHookEntry;
|
|
141
264
|
};
|
|
@@ -191,6 +314,14 @@ export interface ApplyLegStatus {
|
|
|
191
314
|
* Codex, third pass). A bare mention (`echo .claude/helpers/recall-hook.cjs`) is not an invocation:
|
|
192
315
|
* the helper path must follow a `node` word — directly, or inside the daemon's
|
|
193
316
|
* `sh -c 'nohup node "…"'` spawn. Forward slashes only: every command dz writes uses them.
|
|
317
|
+
*
|
|
318
|
+
* Fix round 1 (AM-1/AM-3, apply-leg-install-root): the SessionStart command now passes its daemon
|
|
319
|
+
* path as a POSITIONAL ARG (`sh -c '… node "$2" …' sh <root> <daemonPath>`) rather than interpolating
|
|
320
|
+
* it textually next to `node`, so the ORIGINAL adjacency regex alone no longer matches it. A SECOND
|
|
321
|
+
* recognizer accepts that shape: the command invokes `node` with a `$N`-style positional argument
|
|
322
|
+
* AND carries `markerPath` as one of its own (shellQuote()d) trailing arguments — both conditions
|
|
323
|
+
* together, so a foreign command that merely echoes the marker path near an unrelated `node "$1"`
|
|
324
|
+
* invocation still does not count.
|
|
194
325
|
*/
|
|
195
326
|
export declare function hookCommandInvokes(command: string, markerPath: string): boolean;
|
|
196
327
|
/**
|
|
@@ -211,4 +342,64 @@ export declare function applyLegStatus(root: string): ApplyLegStatus;
|
|
|
211
342
|
* (pre-existing, tested) phrasing for that case before this fix round, and unifying it was not asked.
|
|
212
343
|
*/
|
|
213
344
|
export declare function applyLegReasonMessage(status: ApplyLegStatus): string;
|
|
345
|
+
/**
|
|
346
|
+
* AM-4 (fix round 1, apply-leg-never-silent): the LEGACY zero-arg form ({@link applyLegHookEntries}'s
|
|
347
|
+
* no-installRoot branch) reads `${CLAUDE_PROJECT_DIR:-.}` — a shell expansion that only resolves to
|
|
348
|
+
* something useful from a REAL session's own cwd. Spawning it from `probeApplyLeg`'s temp "foreign"
|
|
349
|
+
* cwd can never find the deployed helper by construction (the file lives at `root`'s own
|
|
350
|
+
* `.claude/helpers/`, never under the temp dir), so a probe against this form would spawn a doomed
|
|
351
|
+
* command and report a confusing generic failure — not a fact about whether the leg injects, only a
|
|
352
|
+
* fact about the fixture being unprobeable. The absolute form ({@link shellQuote}'d installRoot)
|
|
353
|
+
* never contains this literal env-expansion syntax — it bakes a resolved path instead — so a plain
|
|
354
|
+
* substring check distinguishes the two without re-parsing shell grammar.
|
|
355
|
+
*/
|
|
356
|
+
export declare function isLegacyRelativeRecallCommand(command: string): boolean;
|
|
357
|
+
/** {@link probeApplyLeg}'s result — the ONE measurement `dz doctor`'s new row and `dz parity`'s
|
|
358
|
+
* Self-learning cell both read (ADR-001 Decision 3, extended by `apply-leg-never-silent` D1): green
|
|
359
|
+
* means OBSERVED injection, never inferred file presence. */
|
|
360
|
+
export interface ApplyLegProbeResult {
|
|
361
|
+
/** True ONLY when the probe's own beacon lesson came back inside `additionalContext`. */
|
|
362
|
+
readonly ok: boolean;
|
|
363
|
+
/** Present exactly when `ok` is `false` — taken from the hook's own `[dz-recall] skipped
|
|
364
|
+
* reason=…` stderr line when present, else a best-effort description of what went wrong. */
|
|
365
|
+
readonly reason?: string;
|
|
366
|
+
readonly elapsedMs: number;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Live, end-to-end proof that the apply leg actually injects — ADR-001 Decision 1. `applyLegStatus`
|
|
370
|
+
* only proves FILES exist and are STRUCTURALLY wired (issue #2's whole defect: four green checks,
|
|
371
|
+
* a leg that injected nothing in every session but one). This spawns the REAL configured hook
|
|
372
|
+
* command from a TEMPORARY cwd with `CLAUDE_PROJECT_DIR` pointing at that same temp dir — the exact
|
|
373
|
+
* shape of a real Claude Code session, which never runs a hook from the project root itself — and
|
|
374
|
+
* asks it to recall a throwaway "beacon" lesson written into the store for the duration of the call.
|
|
375
|
+
* `ok: true` only when the beacon's own SECRET token (fix round 1, AM-1 — never sent as input, only
|
|
376
|
+
* stored) comes back inside `additionalContext`; every other outcome is `ok: false` with a `reason`,
|
|
377
|
+
* never a silent guess.
|
|
378
|
+
*
|
|
379
|
+
* The beacon is written via {@link recordPattern} (the SAME lexical-store seam `dz teach` uses) and
|
|
380
|
+
* removed via {@link removePatternsByIds} in a `finally` — a probe that throws, times out, or never
|
|
381
|
+
* finds the leg alive still leaves the store exactly as it found it (proven by a count-before ==
|
|
382
|
+
* count-after test, not merely claimed).
|
|
383
|
+
*
|
|
384
|
+
* `timeoutMs` bounds `probeHookLiveness`'s spawn. Measured (this environment, 2026-09-14, T1): a
|
|
385
|
+
* `store-not-found`/`socket-absent` early exit returns in well under 200 ms; a live-daemon probe
|
|
386
|
+
* answers in ~100-200 ms, matching ADR-001's own estimate. 8000 ms leaves roughly a 40x margin for a
|
|
387
|
+
* loaded daemon without ever approaching `probeHookLiveness`'s own un-overridden 20 000 ms ceiling —
|
|
388
|
+
* a genuinely dead probe still returns to `dz doctor`/`dz parity` in bounded time.
|
|
389
|
+
*
|
|
390
|
+
* `env` is a TEST-ONLY escape hatch (never used by `dz doctor`/`dz parity`, both call this with
|
|
391
|
+
* default opts): it lets a test widen the HOOK's OWN internal socket-connect timeout
|
|
392
|
+
* (`DZ_RECALL_HOOK_TIMEOUT_MS`) against a genuinely cold daemon, matching the same widening
|
|
393
|
+
* `apply-leg-recall-parity.test.ts`/`apply-leg-install-root.test.ts` already apply to the daemon's
|
|
394
|
+
* `HOOK_RECALL_BUDGET_MS`. Merged BEFORE `CLAUDE_PROJECT_DIR`, so a caller can never override the
|
|
395
|
+
* one env var this probe's own honesty depends on.
|
|
396
|
+
*/
|
|
397
|
+
export declare function probeApplyLeg(root: string, opts?: {
|
|
398
|
+
timeoutMs?: number;
|
|
399
|
+
env?: Readonly<Record<string, string>>;
|
|
400
|
+
/** TEST-ONLY seam (AM-2, fix round 1): a stand-in for {@link removePatternsByIds} so a test can
|
|
401
|
+
* force cleanup to fail WITHOUT needing to corrupt the real store mid-call. Never set by
|
|
402
|
+
* `dz doctor`/`dz parity` — both call with default opts, and the real function is the default. */
|
|
403
|
+
removeBeacon?: (root: string, ids: ReadonlySet<string>) => RemovePatternsResult;
|
|
404
|
+
}): Promise<ApplyLegProbeResult>;
|
|
214
405
|
//# sourceMappingURL=apply-leg.d.ts.map
|
package/dist/apply-leg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-leg.d.ts","sourceRoot":"","sources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