@dzhechkov/harness-core 0.3.147 → 0.3.148
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 +32 -8
- package/README.md +1 -0
- package/dist/feature-adr-checkpoints.d.ts +113 -0
- package/dist/feature-adr-checkpoints.d.ts.map +1 -0
- package/dist/feature-adr-checkpoints.js +184 -0
- package/dist/feature-adr-checkpoints.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/sbom.json +67 -7
- package/src/feature-adr-checkpoints.ts +221 -0
- package/src/index.ts +17 -0
package/.dz-manifest.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "README.md",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "4710903a3f0f81d2163062977f6471f29073d2c516209f875c09cc54e75ea099"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "coverage/coverage-final.json",
|
|
@@ -403,6 +403,22 @@
|
|
|
403
403
|
"path": "dist/event-chain.js.map",
|
|
404
404
|
"sha256": "a874ba52b35ed445f2310a04bb0fbdb0ba34db18601d0086e7e666b7bafc8a16"
|
|
405
405
|
},
|
|
406
|
+
{
|
|
407
|
+
"path": "dist/feature-adr-checkpoints.d.ts",
|
|
408
|
+
"sha256": "e93790da411c0385feb2153a6cd424b2305773a9709582eafe7f2adc8ab45c36"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"path": "dist/feature-adr-checkpoints.d.ts.map",
|
|
412
|
+
"sha256": "28f030188a9061ebab709bd2ce90d06ebff69f8baef39551df7dd25520b801a2"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"path": "dist/feature-adr-checkpoints.js",
|
|
416
|
+
"sha256": "88120bc4dc1a3fbab9b051434103936ea769978e66d7aada30589cf96602d46c"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"path": "dist/feature-adr-checkpoints.js.map",
|
|
420
|
+
"sha256": "361699e01e18cf80f46602673dc1ee8e13ec63bee1d37fe120e4275b052b265d"
|
|
421
|
+
},
|
|
406
422
|
{
|
|
407
423
|
"path": "dist/feature-adr-claim-gate.d.ts",
|
|
408
424
|
"sha256": "abce2849ac6aa7b31292fb4d5e80b500b3a33a77533d3a3a8b3da6fe3ebaa7af"
|
|
@@ -501,19 +517,19 @@
|
|
|
501
517
|
},
|
|
502
518
|
{
|
|
503
519
|
"path": "dist/index.d.ts",
|
|
504
|
-
"sha256": "
|
|
520
|
+
"sha256": "ecf62c0372ef24516aa12797719b0cedfbfea1cf0f92d573baea8e9d9dea45b8"
|
|
505
521
|
},
|
|
506
522
|
{
|
|
507
523
|
"path": "dist/index.d.ts.map",
|
|
508
|
-
"sha256": "
|
|
524
|
+
"sha256": "ef7b4183ebdd16a162e00960b8070207901d6d3b4415c2ff78da0a762e713a78"
|
|
509
525
|
},
|
|
510
526
|
{
|
|
511
527
|
"path": "dist/index.js",
|
|
512
|
-
"sha256": "
|
|
528
|
+
"sha256": "25595cd5c6d53c4376571a9bf52444778a749fc22f50c64d15c38b248c12ed1f"
|
|
513
529
|
},
|
|
514
530
|
{
|
|
515
531
|
"path": "dist/index.js.map",
|
|
516
|
-
"sha256": "
|
|
532
|
+
"sha256": "c07373c4a1ad8ec473dcd01852cbffc6b5641e78bbf629dd8b5060dda94eea5e"
|
|
517
533
|
},
|
|
518
534
|
{
|
|
519
535
|
"path": "dist/learning-backend.d.ts",
|
|
@@ -1093,7 +1109,7 @@
|
|
|
1093
1109
|
},
|
|
1094
1110
|
{
|
|
1095
1111
|
"path": "package.json",
|
|
1096
|
-
"sha256": "
|
|
1112
|
+
"sha256": "1a64e1ded35c482214c3426808b24bcf7048041d716e375f101e228931c28248"
|
|
1097
1113
|
},
|
|
1098
1114
|
{
|
|
1099
1115
|
"path": "src/__tests__/golden-baseline.test.ts",
|
|
@@ -1191,6 +1207,10 @@
|
|
|
1191
1207
|
"path": "src/event-chain.ts",
|
|
1192
1208
|
"sha256": "f8306131a5021167169b525733da711ff378382f0a7368376f35834c350a9e23"
|
|
1193
1209
|
},
|
|
1210
|
+
{
|
|
1211
|
+
"path": "src/feature-adr-checkpoints.ts",
|
|
1212
|
+
"sha256": "17278275695f9bbec9f48628853659c9d8b5dfcdc6bb2b03e0c88648f95a446d"
|
|
1213
|
+
},
|
|
1194
1214
|
{
|
|
1195
1215
|
"path": "src/feature-adr-claim-gate.ts",
|
|
1196
1216
|
"sha256": "0fd1c44e7f6aea1abfac1e6d3fac3e4bbe4dfd501d068803f310c1ec36716eb6"
|
|
@@ -1217,7 +1237,7 @@
|
|
|
1217
1237
|
},
|
|
1218
1238
|
{
|
|
1219
1239
|
"path": "src/index.ts",
|
|
1220
|
-
"sha256": "
|
|
1240
|
+
"sha256": "537dc4dc55cb43f11f2f0cee45ea53ec6fe362df470948408c49bb11fe972d9f"
|
|
1221
1241
|
},
|
|
1222
1242
|
{
|
|
1223
1243
|
"path": "src/learning-backend.ts",
|
|
@@ -1487,6 +1507,10 @@
|
|
|
1487
1507
|
"path": "test/feature-adr-brain.test.ts",
|
|
1488
1508
|
"sha256": "f131290294c1da977c621842e65c0dc560643720c6b5d49fd6aead2d9270bf74"
|
|
1489
1509
|
},
|
|
1510
|
+
{
|
|
1511
|
+
"path": "test/feature-adr-checkpoints.test.ts",
|
|
1512
|
+
"sha256": "8564e1953e6da1f5a2b0990b1e5d8c78b24cc268a2c4eea15609d90b8fbda6f6"
|
|
1513
|
+
},
|
|
1490
1514
|
{
|
|
1491
1515
|
"path": "test/feature-adr-claim-gate.test.ts",
|
|
1492
1516
|
"sha256": "0b72b9bc26722022dee860dff0811426c7038a15631bcd084a2fb8295211b741"
|
|
@@ -1705,5 +1729,5 @@
|
|
|
1705
1729
|
}
|
|
1706
1730
|
]
|
|
1707
1731
|
},
|
|
1708
|
-
"signature": "
|
|
1732
|
+
"signature": "hxJqU0VjfVbOQps7TTMTwogoeBt7+hX81mj6AF3qiYzso74iAmy0yyf2CQzfZO++8Lk3uw1Cxw50kz92gZyACQ=="
|
|
1709
1733
|
}
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ and any other consumer.
|
|
|
18
18
|
| `cost-ledger` | `deriveCostLedger`, `buildCostLedger`, `verifyCostLedgerReport`, `stageCostAggregates`, `renderCostLedger`, `writeCostLedgerJsonl`, `COST_LEDGER_SCOPE` | Per-stage cost ledger behind `dz usage --by-stage`. A feature-adr run reports ONE number; this joins the workflow's own `stageLabel()` strings to the per-agent transcripts the harness already writes, so a run becomes an itemized receipt. POST-HOC DERIVER, not a writer — no workflow edit, and a KILLED run is still derivable. The invariant: `accounted + unaccounted === runTotal` and `accounted + doubleAttributed === Σ stages`, RAW integer equality (rounding happens exactly once, per sample, at extraction), re-derived from the emitted report by `verifyCostLedgerReport` — the writer clamps, the verifier enforces. A mismatch is a NAMED defect (`Unaccounted`, `DoubleAttributed`, `ForeignSample`, `MissingStageTranscript`, `MalformedRecord`), never a rounding remainder, so `epsilon` defaults to 0. The run total comes from the run's transcript DIRECTORY LISTING, NOT the record's own `totalTokens` — that field is exactly `Σ workflowProgress[].tokens` in 29 of 29 recorded runs (MEASURED), so an invariant against it can never fail. Both sides share ONE estimator with `dz usage` (`weightedTokensOf`). `stageCostAggregates` is a pure feed-forward reader for auto-cost routing that EXCLUDES non-reconciling runs; wiring it into routing is deliberately out of scope. HONEST SCOPE, printed by every surface: local transcript ESTIMATES, not billed amounts — it catches ATTRIBUTION errors, NOT pricing errors; `hasKnownPricing` marks rows priced by the sonnet-class fallback. `INSUFFICIENT_DATA` is a distinct verdict, never collapsed into `BALANCED` |
|
|
19
19
|
| `compounding` | `mulberry32`, `bootstrapDelta`, `decidePromotion`, `assembleCompoundingReport` | Pure learning-loop payoff engine behind `dz compounding`: seeded deterministic bootstrap (conservative nearest-rank lower-95), promotion that refuses non-finite/malformed input and anything under 5 samples per arm, and dz-native measurements (pool write-only ratio, guard trajectory by RATE, replay readiness over unique untruncated prompt events). A gate without data says INSUFFICIENT_DATA — never a verdict. Compaction keeps the newest query-bearing rows verbatim and aggregates ONLY the rest (read totals are invariant across compactions). Also reports EVENT-CHAIN health of the evidence logs it computed from (`evidenceLogs` in, `instrumentation.chains` out) — verified / defect kinds / uncovered pre-chain prefix, with no logs handed in producing no line at all rather than a vacuous "clean" |
|
|
20
20
|
| `event-chain` | `fnv1a32`, `nextChainFields`, `appendChainedLines`, `chainRewrite`, `guardedRewrite`, `verifyEventChain`, `EVENT_CHAIN_SCOPE` | Pure hash-chain over the two learning-evidence logs (`.dz/recall-usage.jsonl`, `.dz/guard-audit.jsonl`): each appended record carries `seq` + `prevHash` (FNV-1a over the previous line AS WRITTEN, so key order cannot make writer and verifier disagree), derived from the LAST LINE ONLY so a per-prompt hook stays O(1). `verifyEventChain` names eight classes — `BrokenLink`, `DuplicateSeq`, `NonMonotonicSeq`, `TornTail`, `DoubleCounted`, `LedgerImbalance`, `MalformedLedger`, `ClaimInterrupted`. The last four exist because a rewriter must not be able to certify itself: the compaction ledger's arithmetic (`Σ weight + dropped === source`, `dropped ∈ [0, source]`) is enforced with NO clamps in the verifier (the clamp belongs to the writer), a damaged ledger line is a defect rather than a silently-disabled check, and a claim that never reached its `throughSeq` — because the segment restarted or the file ended — is reported instead of escaping through the discontinuity. `guardedRewrite` is the concurrency guard for any whole-file rewrite: exclusive lock, plus a re-read of the live file after computing the new text and BEFORE the rename, so a concurrent append aborts the attempt and is folded into a bounded retry rather than overwritten (it narrows the read→rename window; it cannot close it, and says so). Records written before chaining existed stay LEGAL and are counted as an uncovered `preChainPrefix`; an unreadable tail never blocks a write (fresh MARKED segment — an unreadable tail WINDOW is distinguished from an empty file — and the appender starts on a new line so one torn write cannot eat the next record); an unmarked restart is reported once and then re-anchored, so one incident is one defect instead of a cascade. HONEST SCOPE, carried in every result and printed by every surface: corruption detection for our own bugs — FNV-1a is not cryptography, its collisions are constructible, the threat model has no adversary, and a regression test fails if the module regrows tamper-proofing vocabulary |
|
|
21
|
+
| `feature-adr-checkpoints` | `checkpointInputHash`, `decideCheckpointResume`, `parseCheckpointRead`, `serializeCheckpoint`, `fnv1a64`, `CKPT_SCHEMA_VERSION`, `STAGE_ARTIFACTS` | The PURE half of feature-adr's durable per-stage checkpoints (`features/<slug>/.fa-state/checkpoints.jsonl`): a dead L/XL run — or the standard stop-after-plan re-invoke — resumes completed stages instead of re-spending them. Resume = INPUT-identity (64-bit salted FNV over a schema-versioned JSON tuple incl. upstream stage results) + presence of EVERY tier-required artifact; a stale-input hash never resumes in ANY mode (`force` relaxes only the artifact probe — the tested load-bearing property). HONEST SCOPE: it does NOT fingerprint the working tree (a crash-resume legitimately sees the dead run's uncommitted writes) — after manual edits use `resume:'never'` and re-QE. Null results are never persisted or resumable; a stage-identifiable corrupt record ERASES its older entry (last-wins holds for corruption too); a codex code stage whose landing barrier said `genuinely-not-landed` is never checkpointed. The workflow mirrors this inline (wiring-guarded); RU: чекпоинт после каждой дорогой стадии — упавший ран возобновляется, а не пере-тратит завершённое |
|
|
21
22
|
| `operations` | `runInit`, `runSync`, `runVerify`, `runDoctor` | The harness operations, returning structured reports |
|
|
22
23
|
| `release` | `collectPackageFacts`, `selectAffectedPackages`, `planReleaseGates`, `classifyGateExecutions`, `buildFailureIssue`, `firstOutputLine` | Pure verified-release engine behind `dz release`: plans 4 HARD gates (tests / `pnpm audit --prod` / `node --check` / bin smoke-boot) as DATA and classifies injected results fail-closed — an unbuilt package (declared `build` script, no dist JS) is a `MISSING_DIST` failure, a template-only pack is a named `SKIP_NO_ARTIFACTS` skip, `selectAffectedPackages` fail-opens to the full set when the changed-file list is unavailable |
|
|
23
24
|
| `parity` | `TARGET_CAPABILITIES`, `PARITY_FEATURES`, `computeParity`, `buildParityMatrix` | Declarative target-parity model behind `dz parity`: verified capability flags per target × feature FORMS with requirements; the feature×target matrix is always COMPUTED (never hand-written), and the model must classify exactly `TARGET_NAMES` — an unclassified new target refuses to compile |
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* feature-adr durable checkpoints — the PURE half (backlog 49e4a95b).
|
|
3
|
+
*
|
|
4
|
+
* Problem: .claude/workflows/feature-adr.js restarts an L/XL run from scratch when its session dies
|
|
5
|
+
* (the exact failure that forced usage-adaptive routing — one run cost 623k subagent tokens), and the
|
|
6
|
+
* STANDARD L/XL two-phase flow (stop-after-plan → re-invoke) re-runs router+design+plan wholesale.
|
|
7
|
+
* The Workflow harness's own resumeFromRunId is same-session only, so it cannot cover either case.
|
|
8
|
+
*
|
|
9
|
+
* Design: the heavyweight state is ALREADY durable — the 00–09 artifacts in features/<slug>/. The
|
|
10
|
+
* checkpoint layer is deliberately THIN: after each expensive stage the workflow appends one JSONL
|
|
11
|
+
* line { stage, inputHash, result } to features/<slug>/.fa-state/checkpoints.jsonl (via a cheap
|
|
12
|
+
* effort-low agent — the workflow sandbox has no fs). On the next run with the same slug, a stage is
|
|
13
|
+
* SKIPPED only when its recorded inputHash matches the freshly computed one AND its expected artifact
|
|
14
|
+
* is still on disk. Granularity is per-STAGE, not per-agent-call: a death mid-Step-7 re-runs Step 7,
|
|
15
|
+
* never Steps 0–6.
|
|
16
|
+
*
|
|
17
|
+
* Provenance: concept (checkpoint keyed by input hash + call cache) from ADR-157
|
|
18
|
+
* darwin-checkpoints-durable-execution (status PROPOSED) in agent-harness-generator. Its "~39% resume
|
|
19
|
+
* saving" figure is from a SYNTHETIC deterministic simulation — deliberately NOT quoted as expected
|
|
20
|
+
* field saving anywhere in this feature.
|
|
21
|
+
*
|
|
22
|
+
* Everything here is pure and deterministic (no Date/random — the workflow sandbox forbids them);
|
|
23
|
+
* the workflow script mirrors these functions inline (it is self-contained and cannot import), and
|
|
24
|
+
* the wiring test asserts the mirror stays present.
|
|
25
|
+
*/
|
|
26
|
+
/** Stages the workflow checkpoints, in pipeline order. Cheap side-channel agents (usage probes,
|
|
27
|
+
* fa-record, auto-cost selects) are never checkpointed; the opt-in Delivery gate re-runs by design
|
|
28
|
+
* (advisory verdicts should reflect the CURRENT tree). */
|
|
29
|
+
export declare const CHECKPOINT_STAGES: readonly ["router", "design", "plan", "code", "qe", "fleet"];
|
|
30
|
+
export type CheckpointStage = (typeof CHECKPOINT_STAGES)[number];
|
|
31
|
+
/** The artifact(s) (relative to features/<slug>/) whose PRESENCE a resume additionally requires in
|
|
32
|
+
* 'auto' mode — EVERY listed path must exist. null = result-only stage (hash match suffices).
|
|
33
|
+
* Tier-dependent stages (design) take extra artifacts at the call site via `extraArtifacts` —
|
|
34
|
+
* an M+ design must probe its ADR/ideation/architecture files too, not just requirements
|
|
35
|
+
* (Codex QE #2: a one-file probe accepted a materially incomplete design). */
|
|
36
|
+
export declare const STAGE_ARTIFACTS: Record<CheckpointStage, string | null>;
|
|
37
|
+
/** A checkpoint line as persisted (one JSON object per line). */
|
|
38
|
+
export interface CheckpointEntry {
|
|
39
|
+
stage: string;
|
|
40
|
+
inputHash: string;
|
|
41
|
+
result: unknown;
|
|
42
|
+
}
|
|
43
|
+
/** Oversize guard: a result JSON above this is NOT checkpointed (the stage simply re-runs on resume).
|
|
44
|
+
* Keeps the read-back prompt bounded; artifacts on disk carry the heavy state anyway. */
|
|
45
|
+
export declare const CHECKPOINT_MAX_RESULT_CHARS = 12000;
|
|
46
|
+
/** Checkpoint format/logic version — SALTED into every input hash. Bump it whenever the workflow's
|
|
47
|
+
* stage semantics, prompts, or composite result shapes change: every pre-existing checkpoint then
|
|
48
|
+
* hashes stale and re-runs, instead of an old-format entry resuming into new logic (Codex QE #5). */
|
|
49
|
+
export declare const CKPT_SCHEMA_VERSION = "fa-ckpt-2";
|
|
50
|
+
/** FNV-1a 32-bit over UTF-16 code units, hex-encoded (one pass; building block for the 64-bit form). */
|
|
51
|
+
export declare function fnv1a(str: string): string;
|
|
52
|
+
/** 64 bits from two independent FNV-1a passes (plain + salted). A single 32-bit hash admits
|
|
53
|
+
* findable collisions (Codex QE #9 produced a real pair at `11a08b58`); two passes make the
|
|
54
|
+
* single-pair collision odds ~2^-64 — adequate for one slug's checkpoint file. */
|
|
55
|
+
export declare function fnv1a64(str: string): string;
|
|
56
|
+
/** The stage's input fingerprint: a JSON-tuple (delimiter-ambiguity class — never a separator join)
|
|
57
|
+
* of the schema version + stage name + every input that would change the stage's output, hashed.
|
|
58
|
+
* Upstream stage RESULTS are included as their serialized form, so a stale upstream auto-invalidates
|
|
59
|
+
* downstream. HONEST SCOPE: the hash proves the run INPUTS are unchanged — it does NOT fingerprint
|
|
60
|
+
* the working tree (a crash-resume legitimately sees the dead run's uncommitted writes, so a tree
|
|
61
|
+
* hash would invalidate every real resume). Tree-level staleness is out of the checkpoint contract:
|
|
62
|
+
* use resume:'never' (or delete .fa-state/) after manual edits, and re-QE independently — the ADR
|
|
63
|
+
* names this as the accepted limitation (Codex QE #1). */
|
|
64
|
+
export declare function checkpointInputHash(stage: string, parts: readonly unknown[]): string;
|
|
65
|
+
export type ResumeMode = 'auto' | 'never' | 'force';
|
|
66
|
+
/** Normalize args.resume: anything but the two explicit strings means the default 'auto'. */
|
|
67
|
+
export declare function resumeMode(raw: unknown): ResumeMode;
|
|
68
|
+
export interface ResumeDecision {
|
|
69
|
+
resume: boolean;
|
|
70
|
+
reason: 'resumed' | 'resumed-force' | 'mode-never' | 'no-checkpoint' | 'stale-input' | 'artifact-missing';
|
|
71
|
+
}
|
|
72
|
+
/** The pure resume decision. 'auto' resumes only on (hash match AND every required artifact
|
|
73
|
+
* present); 'force' trusts the hash alone; 'never' always runs live. A STALE-INPUT hash NEVER
|
|
74
|
+
* resumes in any mode — force skips only the artifact probe, never the input check (a checkpoint
|
|
75
|
+
* for different inputs is a different feature). A malformed/null recorded result is treated as
|
|
76
|
+
* no-checkpoint (Codex QE #8 — a null result must not resume as a real one). */
|
|
77
|
+
export declare function decideCheckpointResume(opts: {
|
|
78
|
+
mode: ResumeMode;
|
|
79
|
+
entry: CheckpointEntry | undefined;
|
|
80
|
+
inputHash: string;
|
|
81
|
+
artifactRel: string | readonly string[] | null;
|
|
82
|
+
listing: ReadonlySet<string>;
|
|
83
|
+
}): ResumeDecision;
|
|
84
|
+
/** Serialize one checkpoint line, or null when the result is null/oversize/unserializable —
|
|
85
|
+
* the caller logs the skip loudly; a missing checkpoint only costs a re-run, never corrupts.
|
|
86
|
+
* A null result is never persisted (Codex QE #8: it would later parse as a resumable entry). */
|
|
87
|
+
export declare function serializeCheckpoint(stage: string, inputHash: string, result: unknown): string | null;
|
|
88
|
+
export interface ParsedCheckpointRead {
|
|
89
|
+
entries: Record<string, CheckpointEntry>;
|
|
90
|
+
listing: Set<string>;
|
|
91
|
+
malformedLines: number;
|
|
92
|
+
}
|
|
93
|
+
/** Sentinel separating the checkpoint file body from the artifact listing in the single read-back
|
|
94
|
+
* command's stdout. */
|
|
95
|
+
export declare const CHECKPOINT_LS_SENTINEL = "---FA-CKPT-LS---";
|
|
96
|
+
/** Parse the read-back agent's stdout: JSONL entries (LAST occurrence of a stage wins — a re-run
|
|
97
|
+
* overwrites by append), then the sentinel ON ITS OWN LINE, then one artifact path per line
|
|
98
|
+
* (relative to the feature dir). The sentinel match is LINE-ANCHORED: JSON.stringify never emits
|
|
99
|
+
* literal newlines, so a sentinel string INSIDE a recorded result shares its line with JSON syntax
|
|
100
|
+
* and can never split the stream (Codex QE #10). Malformed JSONL lines are COUNTED, never silently
|
|
101
|
+
* ignored (corruption is named); entries with a null result are malformed, not resumable. */
|
|
102
|
+
export declare function parseCheckpointRead(text: string): ParsedCheckpointRead;
|
|
103
|
+
/** Single-quote shell escaping (the workflow's shq twin). */
|
|
104
|
+
export declare function shellQuote(s: string): string;
|
|
105
|
+
/** The one Bash command the read-back agent runs: checkpoint file body (absent file = empty),
|
|
106
|
+
* the sentinel, then the artifact listing as feature-dir-relative paths (find prints them with a
|
|
107
|
+
* leading ./ that sed strips). Never fails: every leg is || true. */
|
|
108
|
+
export declare function checkpointReadCmd(fdirAbs: string): string;
|
|
109
|
+
/** The one Bash command the write agent runs: mkdir the state dir, then append ONE line. The line
|
|
110
|
+
* is single-quote-escaped as a whole — JSON.stringify output never contains literal newlines, so
|
|
111
|
+
* printf '%s\n' emits exactly one record. */
|
|
112
|
+
export declare function checkpointAppendCmd(fdirAbs: string, line: string): string;
|
|
113
|
+
//# sourceMappingURL=feature-adr-checkpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-adr-checkpoints.d.ts","sourceRoot":"","sources":["../src/feature-adr-checkpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;0DAE0D;AAC1D,eAAO,MAAM,iBAAiB,8DAA+D,CAAC;AAC9F,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE;;;;8EAI8E;AAC9E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAOlE,CAAC;AAEF,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;yFACyF;AACzF,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD;;qGAEqG;AACrG,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,wGAAwG;AACxG,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzC;AAED;;kFAEkF;AAClF,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;0DAO0D;AAC1D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAEpF;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO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MAAM,GAAG,MAAM,CAIzE"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* feature-adr durable checkpoints — the PURE half (backlog 49e4a95b).
|
|
3
|
+
*
|
|
4
|
+
* Problem: .claude/workflows/feature-adr.js restarts an L/XL run from scratch when its session dies
|
|
5
|
+
* (the exact failure that forced usage-adaptive routing — one run cost 623k subagent tokens), and the
|
|
6
|
+
* STANDARD L/XL two-phase flow (stop-after-plan → re-invoke) re-runs router+design+plan wholesale.
|
|
7
|
+
* The Workflow harness's own resumeFromRunId is same-session only, so it cannot cover either case.
|
|
8
|
+
*
|
|
9
|
+
* Design: the heavyweight state is ALREADY durable — the 00–09 artifacts in features/<slug>/. The
|
|
10
|
+
* checkpoint layer is deliberately THIN: after each expensive stage the workflow appends one JSONL
|
|
11
|
+
* line { stage, inputHash, result } to features/<slug>/.fa-state/checkpoints.jsonl (via a cheap
|
|
12
|
+
* effort-low agent — the workflow sandbox has no fs). On the next run with the same slug, a stage is
|
|
13
|
+
* SKIPPED only when its recorded inputHash matches the freshly computed one AND its expected artifact
|
|
14
|
+
* is still on disk. Granularity is per-STAGE, not per-agent-call: a death mid-Step-7 re-runs Step 7,
|
|
15
|
+
* never Steps 0–6.
|
|
16
|
+
*
|
|
17
|
+
* Provenance: concept (checkpoint keyed by input hash + call cache) from ADR-157
|
|
18
|
+
* darwin-checkpoints-durable-execution (status PROPOSED) in agent-harness-generator. Its "~39% resume
|
|
19
|
+
* saving" figure is from a SYNTHETIC deterministic simulation — deliberately NOT quoted as expected
|
|
20
|
+
* field saving anywhere in this feature.
|
|
21
|
+
*
|
|
22
|
+
* Everything here is pure and deterministic (no Date/random — the workflow sandbox forbids them);
|
|
23
|
+
* the workflow script mirrors these functions inline (it is self-contained and cannot import), and
|
|
24
|
+
* the wiring test asserts the mirror stays present.
|
|
25
|
+
*/
|
|
26
|
+
/** Stages the workflow checkpoints, in pipeline order. Cheap side-channel agents (usage probes,
|
|
27
|
+
* fa-record, auto-cost selects) are never checkpointed; the opt-in Delivery gate re-runs by design
|
|
28
|
+
* (advisory verdicts should reflect the CURRENT tree). */
|
|
29
|
+
export const CHECKPOINT_STAGES = ['router', 'design', 'plan', 'code', 'qe', 'fleet'];
|
|
30
|
+
/** The artifact(s) (relative to features/<slug>/) whose PRESENCE a resume additionally requires in
|
|
31
|
+
* 'auto' mode — EVERY listed path must exist. null = result-only stage (hash match suffices).
|
|
32
|
+
* Tier-dependent stages (design) take extra artifacts at the call site via `extraArtifacts` —
|
|
33
|
+
* an M+ design must probe its ADR/ideation/architecture files too, not just requirements
|
|
34
|
+
* (Codex QE #2: a one-file probe accepted a materially incomplete design). */
|
|
35
|
+
export const STAGE_ARTIFACTS = {
|
|
36
|
+
router: null,
|
|
37
|
+
design: '01_requirements.md',
|
|
38
|
+
plan: '06_implementation_plan.md',
|
|
39
|
+
code: '07_code_changes/change_manifest.md',
|
|
40
|
+
qe: '08_qe_report.md',
|
|
41
|
+
fleet: '09_fleet_qe_assessment.md',
|
|
42
|
+
};
|
|
43
|
+
/** Oversize guard: a result JSON above this is NOT checkpointed (the stage simply re-runs on resume).
|
|
44
|
+
* Keeps the read-back prompt bounded; artifacts on disk carry the heavy state anyway. */
|
|
45
|
+
export const CHECKPOINT_MAX_RESULT_CHARS = 12_000;
|
|
46
|
+
/** Checkpoint format/logic version — SALTED into every input hash. Bump it whenever the workflow's
|
|
47
|
+
* stage semantics, prompts, or composite result shapes change: every pre-existing checkpoint then
|
|
48
|
+
* hashes stale and re-runs, instead of an old-format entry resuming into new logic (Codex QE #5). */
|
|
49
|
+
export const CKPT_SCHEMA_VERSION = 'fa-ckpt-2';
|
|
50
|
+
/** FNV-1a 32-bit over UTF-16 code units, hex-encoded (one pass; building block for the 64-bit form). */
|
|
51
|
+
export function fnv1a(str) {
|
|
52
|
+
let h = 0x811c9dc5;
|
|
53
|
+
for (let i = 0; i < str.length; i++) {
|
|
54
|
+
h ^= str.charCodeAt(i);
|
|
55
|
+
h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0;
|
|
56
|
+
}
|
|
57
|
+
return h.toString(16).padStart(8, '0');
|
|
58
|
+
}
|
|
59
|
+
/** 64 bits from two independent FNV-1a passes (plain + salted). A single 32-bit hash admits
|
|
60
|
+
* findable collisions (Codex QE #9 produced a real pair at `11a08b58`); two passes make the
|
|
61
|
+
* single-pair collision odds ~2^-64 — adequate for one slug's checkpoint file. */
|
|
62
|
+
export function fnv1a64(str) {
|
|
63
|
+
return fnv1a(str) + fnv1a('fa-ckpt-salt' + str);
|
|
64
|
+
}
|
|
65
|
+
/** The stage's input fingerprint: a JSON-tuple (delimiter-ambiguity class — never a separator join)
|
|
66
|
+
* of the schema version + stage name + every input that would change the stage's output, hashed.
|
|
67
|
+
* Upstream stage RESULTS are included as their serialized form, so a stale upstream auto-invalidates
|
|
68
|
+
* downstream. HONEST SCOPE: the hash proves the run INPUTS are unchanged — it does NOT fingerprint
|
|
69
|
+
* the working tree (a crash-resume legitimately sees the dead run's uncommitted writes, so a tree
|
|
70
|
+
* hash would invalidate every real resume). Tree-level staleness is out of the checkpoint contract:
|
|
71
|
+
* use resume:'never' (or delete .fa-state/) after manual edits, and re-QE independently — the ADR
|
|
72
|
+
* names this as the accepted limitation (Codex QE #1). */
|
|
73
|
+
export function checkpointInputHash(stage, parts) {
|
|
74
|
+
return fnv1a64(JSON.stringify([CKPT_SCHEMA_VERSION, stage, ...parts.map((p) => (p === undefined ? null : p))]));
|
|
75
|
+
}
|
|
76
|
+
/** Normalize args.resume: anything but the two explicit strings means the default 'auto'. */
|
|
77
|
+
export function resumeMode(raw) {
|
|
78
|
+
return raw === 'never' ? 'never' : raw === 'force' ? 'force' : 'auto';
|
|
79
|
+
}
|
|
80
|
+
/** The pure resume decision. 'auto' resumes only on (hash match AND every required artifact
|
|
81
|
+
* present); 'force' trusts the hash alone; 'never' always runs live. A STALE-INPUT hash NEVER
|
|
82
|
+
* resumes in any mode — force skips only the artifact probe, never the input check (a checkpoint
|
|
83
|
+
* for different inputs is a different feature). A malformed/null recorded result is treated as
|
|
84
|
+
* no-checkpoint (Codex QE #8 — a null result must not resume as a real one). */
|
|
85
|
+
export function decideCheckpointResume(opts) {
|
|
86
|
+
if (opts.mode === 'never')
|
|
87
|
+
return { resume: false, reason: 'mode-never' };
|
|
88
|
+
if (!opts.entry || opts.entry.result === null || opts.entry.result === undefined) {
|
|
89
|
+
return { resume: false, reason: 'no-checkpoint' };
|
|
90
|
+
}
|
|
91
|
+
if (opts.entry.inputHash !== opts.inputHash)
|
|
92
|
+
return { resume: false, reason: 'stale-input' };
|
|
93
|
+
if (opts.mode === 'force')
|
|
94
|
+
return { resume: true, reason: 'resumed-force' };
|
|
95
|
+
const required = opts.artifactRel === null ? [] : (typeof opts.artifactRel === 'string' ? [opts.artifactRel] : opts.artifactRel);
|
|
96
|
+
for (const rel of required) {
|
|
97
|
+
if (!opts.listing.has(rel))
|
|
98
|
+
return { resume: false, reason: 'artifact-missing' };
|
|
99
|
+
}
|
|
100
|
+
return { resume: true, reason: 'resumed' };
|
|
101
|
+
}
|
|
102
|
+
/** Serialize one checkpoint line, or null when the result is null/oversize/unserializable —
|
|
103
|
+
* the caller logs the skip loudly; a missing checkpoint only costs a re-run, never corrupts.
|
|
104
|
+
* A null result is never persisted (Codex QE #8: it would later parse as a resumable entry). */
|
|
105
|
+
export function serializeCheckpoint(stage, inputHash, result) {
|
|
106
|
+
if (result === null || result === undefined)
|
|
107
|
+
return null;
|
|
108
|
+
let line;
|
|
109
|
+
try {
|
|
110
|
+
line = JSON.stringify({ stage, inputHash, result });
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
if (typeof line !== 'string' || line.length > CHECKPOINT_MAX_RESULT_CHARS)
|
|
116
|
+
return null;
|
|
117
|
+
return line;
|
|
118
|
+
}
|
|
119
|
+
/** Sentinel separating the checkpoint file body from the artifact listing in the single read-back
|
|
120
|
+
* command's stdout. */
|
|
121
|
+
export const CHECKPOINT_LS_SENTINEL = '---FA-CKPT-LS---';
|
|
122
|
+
/** Parse the read-back agent's stdout: JSONL entries (LAST occurrence of a stage wins — a re-run
|
|
123
|
+
* overwrites by append), then the sentinel ON ITS OWN LINE, then one artifact path per line
|
|
124
|
+
* (relative to the feature dir). The sentinel match is LINE-ANCHORED: JSON.stringify never emits
|
|
125
|
+
* literal newlines, so a sentinel string INSIDE a recorded result shares its line with JSON syntax
|
|
126
|
+
* and can never split the stream (Codex QE #10). Malformed JSONL lines are COUNTED, never silently
|
|
127
|
+
* ignored (corruption is named); entries with a null result are malformed, not resumable. */
|
|
128
|
+
export function parseCheckpointRead(text) {
|
|
129
|
+
const out = { entries: {}, listing: new Set(), malformedLines: 0 };
|
|
130
|
+
const raw = String(text ?? '');
|
|
131
|
+
const lines = raw.split('\n');
|
|
132
|
+
const sentinelAt = lines.findIndex((l) => l.trim() === CHECKPOINT_LS_SENTINEL);
|
|
133
|
+
const body = sentinelAt === -1 ? lines : lines.slice(0, sentinelAt);
|
|
134
|
+
const ls = sentinelAt === -1 ? [] : lines.slice(sentinelAt + 1);
|
|
135
|
+
for (const line of body) {
|
|
136
|
+
const t = line.trim();
|
|
137
|
+
if (t === '')
|
|
138
|
+
continue;
|
|
139
|
+
try {
|
|
140
|
+
const e = JSON.parse(t);
|
|
141
|
+
if (e && typeof e === 'object' && typeof e.stage === 'string' && typeof e.inputHash === 'string' && 'result' in e && e.result !== null && e.result !== undefined) {
|
|
142
|
+
out.entries[e.stage] = e;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
// last-wins holds for BAD records too: a stage-identifiable null/invalid record ERASES the
|
|
146
|
+
// older entry for that stage instead of silently reactivating it (Codex QE r2 #6).
|
|
147
|
+
if (e && typeof e === 'object' && typeof e.stage === 'string')
|
|
148
|
+
delete out.entries[e.stage];
|
|
149
|
+
out.malformedLines++;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
out.malformedLines++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
for (const line of ls) {
|
|
157
|
+
const t = line.trim();
|
|
158
|
+
if (t !== '')
|
|
159
|
+
out.listing.add(t);
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
/** Single-quote shell escaping (the workflow's shq twin). */
|
|
164
|
+
export function shellQuote(s) {
|
|
165
|
+
return "'" + String(s).replace(/'/g, "'\\''") + "'";
|
|
166
|
+
}
|
|
167
|
+
/** The one Bash command the read-back agent runs: checkpoint file body (absent file = empty),
|
|
168
|
+
* the sentinel, then the artifact listing as feature-dir-relative paths (find prints them with a
|
|
169
|
+
* leading ./ that sed strips). Never fails: every leg is || true. */
|
|
170
|
+
export function checkpointReadCmd(fdirAbs) {
|
|
171
|
+
const q = shellQuote(fdirAbs);
|
|
172
|
+
return ('cat ' + q + '/.fa-state/checkpoints.jsonl 2>/dev/null || true; ' +
|
|
173
|
+
"echo '" + CHECKPOINT_LS_SENTINEL + "'; " +
|
|
174
|
+
'cd ' + q + ' 2>/dev/null && find . -maxdepth 2 -type f 2>/dev/null | sed "s|^\\./||" || true');
|
|
175
|
+
}
|
|
176
|
+
/** The one Bash command the write agent runs: mkdir the state dir, then append ONE line. The line
|
|
177
|
+
* is single-quote-escaped as a whole — JSON.stringify output never contains literal newlines, so
|
|
178
|
+
* printf '%s\n' emits exactly one record. */
|
|
179
|
+
export function checkpointAppendCmd(fdirAbs, line) {
|
|
180
|
+
const dir = shellQuote(fdirAbs + '/.fa-state');
|
|
181
|
+
const file = shellQuote(fdirAbs + '/.fa-state/checkpoints.jsonl');
|
|
182
|
+
return 'mkdir -p ' + dir + " && printf '%s\\n' " + shellQuote(line) + ' >> ' + file;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=feature-adr-checkpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-adr-checkpoints.js","sourceRoot":"","sources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W,GAAG,GAAG,GAAG,qBAAqB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;AACtF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export { hookDecision, isFenced, isNewLine, ESCAPE_TEACHING } from './claim-chec
|
|
|
55
55
|
export type { HookDecision, HookDecisionOpts } from './claim-check-hook-policy.js';
|
|
56
56
|
export { step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
57
57
|
export type { Step8ClaimCounts, Step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
58
|
+
export { CHECKPOINT_STAGES, STAGE_ARTIFACTS, CHECKPOINT_MAX_RESULT_CHARS, CHECKPOINT_LS_SENTINEL, CKPT_SCHEMA_VERSION, fnv1a, fnv1a64, checkpointInputHash, resumeMode, decideCheckpointResume, serializeCheckpoint, parseCheckpointRead, checkpointReadCmd, checkpointAppendCmd, } from './feature-adr-checkpoints.js';
|
|
59
|
+
export type { CheckpointStage, CheckpointEntry, ResumeMode, ResumeDecision, ParsedCheckpointRead } from './feature-adr-checkpoints.js';
|
|
58
60
|
export { detectQueryLang, relevanceFloorFor, selectHookHits, renderHookContext, hasEnoughSignal, DEFAULT_RECALL_FLOORS, DEFAULT_RECALL_HOOK_LIMIT, DEFAULT_RECALL_HOOK_BUDGET_CHARS, MIN_PROMPT_CHARS, MIN_CONTENT_TOKENS, } from './recall-hook-policy.js';
|
|
59
61
|
export type { QueryLang, RecallFloors, HookCandidate, HookSelection } from './recall-hook-policy.js';
|
|
60
62
|
export { RECALL_USAGE_LOG_RELATIVE, RECALL_USAGE_LOG_MAX_BYTES, RECALL_USAGE_COMPACT_TARGET_BYTES, formatRecallUsageRecord, buildRecallUsageRecord, parseRecallUsageLog, aggregateRecallUsage, buildRecallUsageReport, shouldCompactRecallUsageLogSize, compactRecallUsageLog, compactRecallUsageLogChecked, } from './recall-usage.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|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cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAI3B,cAAc,YAAY,CAAC;AAK3B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export { generatePlugin } from './plugin.js';
|
|
|
36
36
|
export { claimCheck, summarize, decideClaimCheckText, severityCounts, isGated } from './claim-check.js';
|
|
37
37
|
export { hookDecision, isFenced, isNewLine, ESCAPE_TEACHING } from './claim-check-hook-policy.js';
|
|
38
38
|
export { step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
39
|
+
export { CHECKPOINT_STAGES, STAGE_ARTIFACTS, CHECKPOINT_MAX_RESULT_CHARS, CHECKPOINT_LS_SENTINEL, CKPT_SCHEMA_VERSION, fnv1a, fnv1a64, checkpointInputHash, resumeMode, decideCheckpointResume, serializeCheckpoint, parseCheckpointRead, checkpointReadCmd, checkpointAppendCmd, } from './feature-adr-checkpoints.js';
|
|
39
40
|
export { detectQueryLang, relevanceFloorFor, selectHookHits, renderHookContext, hasEnoughSignal, DEFAULT_RECALL_FLOORS, DEFAULT_RECALL_HOOK_LIMIT, DEFAULT_RECALL_HOOK_BUDGET_CHARS, MIN_PROMPT_CHARS, MIN_CONTENT_TOKENS, } from './recall-hook-policy.js';
|
|
40
41
|
export { RECALL_USAGE_LOG_RELATIVE, RECALL_USAGE_LOG_MAX_BYTES, RECALL_USAGE_COMPACT_TARGET_BYTES, formatRecallUsageRecord, buildRecallUsageRecord, parseRecallUsageLog, aggregateRecallUsage, buildRecallUsageReport, shouldCompactRecallUsageLogSize, compactRecallUsageLog, compactRecallUsageLogChecked, } from './recall-usage.js';
|
|
41
42
|
export { EVENT_CHAIN_SCOPE, EVENT_CHAIN_GENESIS_HASH, EVENT_CHAIN_TAIL_BYTES, EVENT_CHAIN_FIELD_OVERHEAD_BYTES, EVENT_CHAIN_LEDGER_KIND, EVENT_CHAIN_DEFECT_KINDS, fnv1a32, chainHashOf, chainLinesOf, lastChainLine, readTailInfo, appendChainedLines, EMPTY_LOG_TAIL, nextChainFields, withChainFields, chainRecordLines, chainRewrite, defaultEventWeight, eventWeightOfText, verifyEventChain, verifyEventChainText, renderEventChainVerification, rewriteSnapshot, rewriteSnapshotUnchanged, guardedRewrite, DEFAULT_REWRITE_ATTEMPTS, } from './event-chain.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAC9B,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAC;AAErF,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,cAAc,cAAc,CAAC;AAC7B,iGAAiG;AACjG,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,E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G,mGAAmG;AACnG,mGAAmG;AACnG,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dzhechkov/harness-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.148",
|
|
4
4
|
"description": "Shared harness logic - skill loading, additive apply, and the init/sync/verify/doctor operations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@dzhechkov/adapter-openclaude": "^0.1.0",
|
|
33
33
|
"@dzhechkov/adapter-opencode": "^0.2.0",
|
|
34
34
|
"yaml": "^2.0.0",
|
|
35
|
-
"@dzhechkov/adapter-agents-md": "0.1.1",
|
|
36
35
|
"@dzhechkov/adapter-copilot": "0.1.1",
|
|
36
|
+
"@dzhechkov/adapter-cursor": "0.1.1",
|
|
37
37
|
"@dzhechkov/adapter-windsurf": "0.1.1",
|
|
38
38
|
"@dzhechkov/adapter-gemini": "0.1.1",
|
|
39
|
-
"@dzhechkov/adapter-
|
|
39
|
+
"@dzhechkov/adapter-agents-md": "0.1.1",
|
|
40
40
|
"@dzhechkov/core": "0.2.14",
|
|
41
41
|
"@dzhechkov/memory": "0.2.9"
|
|
42
42
|
},
|
package/sbom.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"hashes": [
|
|
26
26
|
{
|
|
27
27
|
"alg": "SHA-256",
|
|
28
|
-
"content": "
|
|
28
|
+
"content": "4710903a3f0f81d2163062977f6471f29073d2c516209f875c09cc54e75ea099"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
},
|
|
@@ -1009,6 +1009,46 @@
|
|
|
1009
1009
|
}
|
|
1010
1010
|
]
|
|
1011
1011
|
},
|
|
1012
|
+
{
|
|
1013
|
+
"type": "file",
|
|
1014
|
+
"name": "dist/feature-adr-checkpoints.d.ts",
|
|
1015
|
+
"hashes": [
|
|
1016
|
+
{
|
|
1017
|
+
"alg": "SHA-256",
|
|
1018
|
+
"content": "e93790da411c0385feb2153a6cd424b2305773a9709582eafe7f2adc8ab45c36"
|
|
1019
|
+
}
|
|
1020
|
+
]
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"type": "file",
|
|
1024
|
+
"name": "dist/feature-adr-checkpoints.d.ts.map",
|
|
1025
|
+
"hashes": [
|
|
1026
|
+
{
|
|
1027
|
+
"alg": "SHA-256",
|
|
1028
|
+
"content": "28f030188a9061ebab709bd2ce90d06ebff69f8baef39551df7dd25520b801a2"
|
|
1029
|
+
}
|
|
1030
|
+
]
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
"type": "file",
|
|
1034
|
+
"name": "dist/feature-adr-checkpoints.js",
|
|
1035
|
+
"hashes": [
|
|
1036
|
+
{
|
|
1037
|
+
"alg": "SHA-256",
|
|
1038
|
+
"content": "88120bc4dc1a3fbab9b051434103936ea769978e66d7aada30589cf96602d46c"
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"type": "file",
|
|
1044
|
+
"name": "dist/feature-adr-checkpoints.js.map",
|
|
1045
|
+
"hashes": [
|
|
1046
|
+
{
|
|
1047
|
+
"alg": "SHA-256",
|
|
1048
|
+
"content": "361699e01e18cf80f46602673dc1ee8e13ec63bee1d37fe120e4275b052b265d"
|
|
1049
|
+
}
|
|
1050
|
+
]
|
|
1051
|
+
},
|
|
1012
1052
|
{
|
|
1013
1053
|
"type": "file",
|
|
1014
1054
|
"name": "dist/feature-adr-claim-gate.d.ts",
|
|
@@ -1255,7 +1295,7 @@
|
|
|
1255
1295
|
"hashes": [
|
|
1256
1296
|
{
|
|
1257
1297
|
"alg": "SHA-256",
|
|
1258
|
-
"content": "
|
|
1298
|
+
"content": "ecf62c0372ef24516aa12797719b0cedfbfea1cf0f92d573baea8e9d9dea45b8"
|
|
1259
1299
|
}
|
|
1260
1300
|
]
|
|
1261
1301
|
},
|
|
@@ -1265,7 +1305,7 @@
|
|
|
1265
1305
|
"hashes": [
|
|
1266
1306
|
{
|
|
1267
1307
|
"alg": "SHA-256",
|
|
1268
|
-
"content": "
|
|
1308
|
+
"content": "ef7b4183ebdd16a162e00960b8070207901d6d3b4415c2ff78da0a762e713a78"
|
|
1269
1309
|
}
|
|
1270
1310
|
]
|
|
1271
1311
|
},
|
|
@@ -1275,7 +1315,7 @@
|
|
|
1275
1315
|
"hashes": [
|
|
1276
1316
|
{
|
|
1277
1317
|
"alg": "SHA-256",
|
|
1278
|
-
"content": "
|
|
1318
|
+
"content": "25595cd5c6d53c4376571a9bf52444778a749fc22f50c64d15c38b248c12ed1f"
|
|
1279
1319
|
}
|
|
1280
1320
|
]
|
|
1281
1321
|
},
|
|
@@ -1285,7 +1325,7 @@
|
|
|
1285
1325
|
"hashes": [
|
|
1286
1326
|
{
|
|
1287
1327
|
"alg": "SHA-256",
|
|
1288
|
-
"content": "
|
|
1328
|
+
"content": "c07373c4a1ad8ec473dcd01852cbffc6b5641e78bbf629dd8b5060dda94eea5e"
|
|
1289
1329
|
}
|
|
1290
1330
|
]
|
|
1291
1331
|
},
|
|
@@ -2735,7 +2775,7 @@
|
|
|
2735
2775
|
"hashes": [
|
|
2736
2776
|
{
|
|
2737
2777
|
"alg": "SHA-256",
|
|
2738
|
-
"content": "
|
|
2778
|
+
"content": "1a64e1ded35c482214c3426808b24bcf7048041d716e375f101e228931c28248"
|
|
2739
2779
|
}
|
|
2740
2780
|
]
|
|
2741
2781
|
},
|
|
@@ -2979,6 +3019,16 @@
|
|
|
2979
3019
|
}
|
|
2980
3020
|
]
|
|
2981
3021
|
},
|
|
3022
|
+
{
|
|
3023
|
+
"type": "file",
|
|
3024
|
+
"name": "src/feature-adr-checkpoints.ts",
|
|
3025
|
+
"hashes": [
|
|
3026
|
+
{
|
|
3027
|
+
"alg": "SHA-256",
|
|
3028
|
+
"content": "17278275695f9bbec9f48628853659c9d8b5dfcdc6bb2b03e0c88648f95a446d"
|
|
3029
|
+
}
|
|
3030
|
+
]
|
|
3031
|
+
},
|
|
2982
3032
|
{
|
|
2983
3033
|
"type": "file",
|
|
2984
3034
|
"name": "src/feature-adr-claim-gate.ts",
|
|
@@ -3045,7 +3095,7 @@
|
|
|
3045
3095
|
"hashes": [
|
|
3046
3096
|
{
|
|
3047
3097
|
"alg": "SHA-256",
|
|
3048
|
-
"content": "
|
|
3098
|
+
"content": "537dc4dc55cb43f11f2f0cee45ea53ec6fe362df470948408c49bb11fe972d9f"
|
|
3049
3099
|
}
|
|
3050
3100
|
]
|
|
3051
3101
|
},
|
|
@@ -3719,6 +3769,16 @@
|
|
|
3719
3769
|
}
|
|
3720
3770
|
]
|
|
3721
3771
|
},
|
|
3772
|
+
{
|
|
3773
|
+
"type": "file",
|
|
3774
|
+
"name": "test/feature-adr-checkpoints.test.ts",
|
|
3775
|
+
"hashes": [
|
|
3776
|
+
{
|
|
3777
|
+
"alg": "SHA-256",
|
|
3778
|
+
"content": "8564e1953e6da1f5a2b0990b1e5d8c78b24cc268a2c4eea15609d90b8fbda6f6"
|
|
3779
|
+
}
|
|
3780
|
+
]
|
|
3781
|
+
},
|
|
3722
3782
|
{
|
|
3723
3783
|
"type": "file",
|
|
3724
3784
|
"name": "test/feature-adr-claim-gate.test.ts",
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* feature-adr durable checkpoints — the PURE half (backlog 49e4a95b).
|
|
3
|
+
*
|
|
4
|
+
* Problem: .claude/workflows/feature-adr.js restarts an L/XL run from scratch when its session dies
|
|
5
|
+
* (the exact failure that forced usage-adaptive routing — one run cost 623k subagent tokens), and the
|
|
6
|
+
* STANDARD L/XL two-phase flow (stop-after-plan → re-invoke) re-runs router+design+plan wholesale.
|
|
7
|
+
* The Workflow harness's own resumeFromRunId is same-session only, so it cannot cover either case.
|
|
8
|
+
*
|
|
9
|
+
* Design: the heavyweight state is ALREADY durable — the 00–09 artifacts in features/<slug>/. The
|
|
10
|
+
* checkpoint layer is deliberately THIN: after each expensive stage the workflow appends one JSONL
|
|
11
|
+
* line { stage, inputHash, result } to features/<slug>/.fa-state/checkpoints.jsonl (via a cheap
|
|
12
|
+
* effort-low agent — the workflow sandbox has no fs). On the next run with the same slug, a stage is
|
|
13
|
+
* SKIPPED only when its recorded inputHash matches the freshly computed one AND its expected artifact
|
|
14
|
+
* is still on disk. Granularity is per-STAGE, not per-agent-call: a death mid-Step-7 re-runs Step 7,
|
|
15
|
+
* never Steps 0–6.
|
|
16
|
+
*
|
|
17
|
+
* Provenance: concept (checkpoint keyed by input hash + call cache) from ADR-157
|
|
18
|
+
* darwin-checkpoints-durable-execution (status PROPOSED) in agent-harness-generator. Its "~39% resume
|
|
19
|
+
* saving" figure is from a SYNTHETIC deterministic simulation — deliberately NOT quoted as expected
|
|
20
|
+
* field saving anywhere in this feature.
|
|
21
|
+
*
|
|
22
|
+
* Everything here is pure and deterministic (no Date/random — the workflow sandbox forbids them);
|
|
23
|
+
* the workflow script mirrors these functions inline (it is self-contained and cannot import), and
|
|
24
|
+
* the wiring test asserts the mirror stays present.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/** Stages the workflow checkpoints, in pipeline order. Cheap side-channel agents (usage probes,
|
|
28
|
+
* fa-record, auto-cost selects) are never checkpointed; the opt-in Delivery gate re-runs by design
|
|
29
|
+
* (advisory verdicts should reflect the CURRENT tree). */
|
|
30
|
+
export const CHECKPOINT_STAGES = ['router', 'design', 'plan', 'code', 'qe', 'fleet'] as const;
|
|
31
|
+
export type CheckpointStage = (typeof CHECKPOINT_STAGES)[number];
|
|
32
|
+
|
|
33
|
+
/** The artifact(s) (relative to features/<slug>/) whose PRESENCE a resume additionally requires in
|
|
34
|
+
* 'auto' mode — EVERY listed path must exist. null = result-only stage (hash match suffices).
|
|
35
|
+
* Tier-dependent stages (design) take extra artifacts at the call site via `extraArtifacts` —
|
|
36
|
+
* an M+ design must probe its ADR/ideation/architecture files too, not just requirements
|
|
37
|
+
* (Codex QE #2: a one-file probe accepted a materially incomplete design). */
|
|
38
|
+
export const STAGE_ARTIFACTS: Record<CheckpointStage, string | null> = {
|
|
39
|
+
router: null,
|
|
40
|
+
design: '01_requirements.md',
|
|
41
|
+
plan: '06_implementation_plan.md',
|
|
42
|
+
code: '07_code_changes/change_manifest.md',
|
|
43
|
+
qe: '08_qe_report.md',
|
|
44
|
+
fleet: '09_fleet_qe_assessment.md',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** A checkpoint line as persisted (one JSON object per line). */
|
|
48
|
+
export interface CheckpointEntry {
|
|
49
|
+
stage: string;
|
|
50
|
+
inputHash: string;
|
|
51
|
+
result: unknown;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Oversize guard: a result JSON above this is NOT checkpointed (the stage simply re-runs on resume).
|
|
55
|
+
* Keeps the read-back prompt bounded; artifacts on disk carry the heavy state anyway. */
|
|
56
|
+
export const CHECKPOINT_MAX_RESULT_CHARS = 12_000;
|
|
57
|
+
|
|
58
|
+
/** Checkpoint format/logic version — SALTED into every input hash. Bump it whenever the workflow's
|
|
59
|
+
* stage semantics, prompts, or composite result shapes change: every pre-existing checkpoint then
|
|
60
|
+
* hashes stale and re-runs, instead of an old-format entry resuming into new logic (Codex QE #5). */
|
|
61
|
+
export const CKPT_SCHEMA_VERSION = 'fa-ckpt-2';
|
|
62
|
+
|
|
63
|
+
/** FNV-1a 32-bit over UTF-16 code units, hex-encoded (one pass; building block for the 64-bit form). */
|
|
64
|
+
export function fnv1a(str: string): string {
|
|
65
|
+
let h = 0x811c9dc5;
|
|
66
|
+
for (let i = 0; i < str.length; i++) {
|
|
67
|
+
h ^= str.charCodeAt(i);
|
|
68
|
+
h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0;
|
|
69
|
+
}
|
|
70
|
+
return h.toString(16).padStart(8, '0');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** 64 bits from two independent FNV-1a passes (plain + salted). A single 32-bit hash admits
|
|
74
|
+
* findable collisions (Codex QE #9 produced a real pair at `11a08b58`); two passes make the
|
|
75
|
+
* single-pair collision odds ~2^-64 — adequate for one slug's checkpoint file. */
|
|
76
|
+
export function fnv1a64(str: string): string {
|
|
77
|
+
return fnv1a(str) + fnv1a('fa-ckpt-salt' + str);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The stage's input fingerprint: a JSON-tuple (delimiter-ambiguity class — never a separator join)
|
|
81
|
+
* of the schema version + stage name + every input that would change the stage's output, hashed.
|
|
82
|
+
* Upstream stage RESULTS are included as their serialized form, so a stale upstream auto-invalidates
|
|
83
|
+
* downstream. HONEST SCOPE: the hash proves the run INPUTS are unchanged — it does NOT fingerprint
|
|
84
|
+
* the working tree (a crash-resume legitimately sees the dead run's uncommitted writes, so a tree
|
|
85
|
+
* hash would invalidate every real resume). Tree-level staleness is out of the checkpoint contract:
|
|
86
|
+
* use resume:'never' (or delete .fa-state/) after manual edits, and re-QE independently — the ADR
|
|
87
|
+
* names this as the accepted limitation (Codex QE #1). */
|
|
88
|
+
export function checkpointInputHash(stage: string, parts: readonly unknown[]): string {
|
|
89
|
+
return fnv1a64(JSON.stringify([CKPT_SCHEMA_VERSION, stage, ...parts.map((p) => (p === undefined ? null : p))]));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type ResumeMode = 'auto' | 'never' | 'force';
|
|
93
|
+
|
|
94
|
+
/** Normalize args.resume: anything but the two explicit strings means the default 'auto'. */
|
|
95
|
+
export function resumeMode(raw: unknown): ResumeMode {
|
|
96
|
+
return raw === 'never' ? 'never' : raw === 'force' ? 'force' : 'auto';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ResumeDecision {
|
|
100
|
+
resume: boolean;
|
|
101
|
+
reason:
|
|
102
|
+
| 'resumed'
|
|
103
|
+
| 'resumed-force'
|
|
104
|
+
| 'mode-never'
|
|
105
|
+
| 'no-checkpoint'
|
|
106
|
+
| 'stale-input'
|
|
107
|
+
| 'artifact-missing';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The pure resume decision. 'auto' resumes only on (hash match AND every required artifact
|
|
111
|
+
* present); 'force' trusts the hash alone; 'never' always runs live. A STALE-INPUT hash NEVER
|
|
112
|
+
* resumes in any mode — force skips only the artifact probe, never the input check (a checkpoint
|
|
113
|
+
* for different inputs is a different feature). A malformed/null recorded result is treated as
|
|
114
|
+
* no-checkpoint (Codex QE #8 — a null result must not resume as a real one). */
|
|
115
|
+
export function decideCheckpointResume(opts: {
|
|
116
|
+
mode: ResumeMode;
|
|
117
|
+
entry: CheckpointEntry | undefined;
|
|
118
|
+
inputHash: string;
|
|
119
|
+
artifactRel: string | readonly string[] | null;
|
|
120
|
+
listing: ReadonlySet<string>;
|
|
121
|
+
}): ResumeDecision {
|
|
122
|
+
if (opts.mode === 'never') return { resume: false, reason: 'mode-never' };
|
|
123
|
+
if (!opts.entry || opts.entry.result === null || opts.entry.result === undefined) {
|
|
124
|
+
return { resume: false, reason: 'no-checkpoint' };
|
|
125
|
+
}
|
|
126
|
+
if (opts.entry.inputHash !== opts.inputHash) return { resume: false, reason: 'stale-input' };
|
|
127
|
+
if (opts.mode === 'force') return { resume: true, reason: 'resumed-force' };
|
|
128
|
+
const required = opts.artifactRel === null ? [] : (typeof opts.artifactRel === 'string' ? [opts.artifactRel] : opts.artifactRel);
|
|
129
|
+
for (const rel of required) {
|
|
130
|
+
if (!opts.listing.has(rel)) return { resume: false, reason: 'artifact-missing' };
|
|
131
|
+
}
|
|
132
|
+
return { resume: true, reason: 'resumed' };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Serialize one checkpoint line, or null when the result is null/oversize/unserializable —
|
|
136
|
+
* the caller logs the skip loudly; a missing checkpoint only costs a re-run, never corrupts.
|
|
137
|
+
* A null result is never persisted (Codex QE #8: it would later parse as a resumable entry). */
|
|
138
|
+
export function serializeCheckpoint(stage: string, inputHash: string, result: unknown): string | null {
|
|
139
|
+
if (result === null || result === undefined) return null;
|
|
140
|
+
let line: string;
|
|
141
|
+
try {
|
|
142
|
+
line = JSON.stringify({ stage, inputHash, result });
|
|
143
|
+
} catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
if (typeof line !== 'string' || line.length > CHECKPOINT_MAX_RESULT_CHARS) return null;
|
|
147
|
+
return line;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ParsedCheckpointRead {
|
|
151
|
+
entries: Record<string, CheckpointEntry>;
|
|
152
|
+
listing: Set<string>;
|
|
153
|
+
malformedLines: number;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Sentinel separating the checkpoint file body from the artifact listing in the single read-back
|
|
157
|
+
* command's stdout. */
|
|
158
|
+
export const CHECKPOINT_LS_SENTINEL = '---FA-CKPT-LS---';
|
|
159
|
+
|
|
160
|
+
/** Parse the read-back agent's stdout: JSONL entries (LAST occurrence of a stage wins — a re-run
|
|
161
|
+
* overwrites by append), then the sentinel ON ITS OWN LINE, then one artifact path per line
|
|
162
|
+
* (relative to the feature dir). The sentinel match is LINE-ANCHORED: JSON.stringify never emits
|
|
163
|
+
* literal newlines, so a sentinel string INSIDE a recorded result shares its line with JSON syntax
|
|
164
|
+
* and can never split the stream (Codex QE #10). Malformed JSONL lines are COUNTED, never silently
|
|
165
|
+
* ignored (corruption is named); entries with a null result are malformed, not resumable. */
|
|
166
|
+
export function parseCheckpointRead(text: string): ParsedCheckpointRead {
|
|
167
|
+
const out: ParsedCheckpointRead = { entries: {}, listing: new Set(), malformedLines: 0 };
|
|
168
|
+
const raw = String(text ?? '');
|
|
169
|
+
const lines = raw.split('\n');
|
|
170
|
+
const sentinelAt = lines.findIndex((l) => l.trim() === CHECKPOINT_LS_SENTINEL);
|
|
171
|
+
const body = sentinelAt === -1 ? lines : lines.slice(0, sentinelAt);
|
|
172
|
+
const ls = sentinelAt === -1 ? [] : lines.slice(sentinelAt + 1);
|
|
173
|
+
for (const line of body) {
|
|
174
|
+
const t = line.trim();
|
|
175
|
+
if (t === '') continue;
|
|
176
|
+
try {
|
|
177
|
+
const e = JSON.parse(t) as CheckpointEntry;
|
|
178
|
+
if (e && typeof e === 'object' && typeof e.stage === 'string' && typeof e.inputHash === 'string' && 'result' in e && e.result !== null && e.result !== undefined) {
|
|
179
|
+
out.entries[e.stage] = e;
|
|
180
|
+
} else {
|
|
181
|
+
// last-wins holds for BAD records too: a stage-identifiable null/invalid record ERASES the
|
|
182
|
+
// older entry for that stage instead of silently reactivating it (Codex QE r2 #6).
|
|
183
|
+
if (e && typeof e === 'object' && typeof (e as CheckpointEntry).stage === 'string') delete out.entries[(e as CheckpointEntry).stage];
|
|
184
|
+
out.malformedLines++;
|
|
185
|
+
}
|
|
186
|
+
} catch {
|
|
187
|
+
out.malformedLines++;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
for (const line of ls) {
|
|
191
|
+
const t = line.trim();
|
|
192
|
+
if (t !== '') out.listing.add(t);
|
|
193
|
+
}
|
|
194
|
+
return out;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** Single-quote shell escaping (the workflow's shq twin). */
|
|
198
|
+
export function shellQuote(s: string): string {
|
|
199
|
+
return "'" + String(s).replace(/'/g, "'\\''") + "'";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** The one Bash command the read-back agent runs: checkpoint file body (absent file = empty),
|
|
203
|
+
* the sentinel, then the artifact listing as feature-dir-relative paths (find prints them with a
|
|
204
|
+
* leading ./ that sed strips). Never fails: every leg is || true. */
|
|
205
|
+
export function checkpointReadCmd(fdirAbs: string): string {
|
|
206
|
+
const q = shellQuote(fdirAbs);
|
|
207
|
+
return (
|
|
208
|
+
'cat ' + q + '/.fa-state/checkpoints.jsonl 2>/dev/null || true; ' +
|
|
209
|
+
"echo '" + CHECKPOINT_LS_SENTINEL + "'; " +
|
|
210
|
+
'cd ' + q + ' 2>/dev/null && find . -maxdepth 2 -type f 2>/dev/null | sed "s|^\\./||" || true'
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** The one Bash command the write agent runs: mkdir the state dir, then append ONE line. The line
|
|
215
|
+
* is single-quote-escaped as a whole — JSON.stringify output never contains literal newlines, so
|
|
216
|
+
* printf '%s\n' emits exactly one record. */
|
|
217
|
+
export function checkpointAppendCmd(fdirAbs: string, line: string): string {
|
|
218
|
+
const dir = shellQuote(fdirAbs + '/.fa-state');
|
|
219
|
+
const file = shellQuote(fdirAbs + '/.fa-state/checkpoints.jsonl');
|
|
220
|
+
return 'mkdir -p ' + dir + " && printf '%s\\n' " + shellQuote(line) + ' >> ' + file;
|
|
221
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -138,6 +138,23 @@ export { hookDecision, isFenced, isNewLine, ESCAPE_TEACHING } from './claim-chec
|
|
|
138
138
|
export type { HookDecision, HookDecisionOpts } from './claim-check-hook-policy.js';
|
|
139
139
|
export { step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
140
140
|
export type { Step8ClaimCounts, Step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
141
|
+
export {
|
|
142
|
+
CHECKPOINT_STAGES,
|
|
143
|
+
STAGE_ARTIFACTS,
|
|
144
|
+
CHECKPOINT_MAX_RESULT_CHARS,
|
|
145
|
+
CHECKPOINT_LS_SENTINEL,
|
|
146
|
+
CKPT_SCHEMA_VERSION,
|
|
147
|
+
fnv1a,
|
|
148
|
+
fnv1a64,
|
|
149
|
+
checkpointInputHash,
|
|
150
|
+
resumeMode,
|
|
151
|
+
decideCheckpointResume,
|
|
152
|
+
serializeCheckpoint,
|
|
153
|
+
parseCheckpointRead,
|
|
154
|
+
checkpointReadCmd,
|
|
155
|
+
checkpointAppendCmd,
|
|
156
|
+
} from './feature-adr-checkpoints.js';
|
|
157
|
+
export type { CheckpointStage, CheckpointEntry, ResumeMode, ResumeDecision, ParsedCheckpointRead } from './feature-adr-checkpoints.js';
|
|
141
158
|
export {
|
|
142
159
|
detectQueryLang,
|
|
143
160
|
relevanceFloorFor,
|