@dzhechkov/harness-cli 0.3.252 → 0.3.254

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 CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  {
11
11
  "path": "README.md",
12
- "sha256": "ff1b1a2239a254f500c999c5c25ab9303561b433fb1cac420a2b28a7bd0d9fd6"
12
+ "sha256": "fc57c105e5031d2d6751ef08b64769dc463cd79c5cf7637b48bc8cb7190e5b3a"
13
13
  },
14
14
  {
15
15
  "path": "coverage/coverage-final.json",
@@ -41,15 +41,15 @@
41
41
  },
42
42
  {
43
43
  "path": "dist/cli.d.ts.map",
44
- "sha256": "c9b415287eda0a7c2ad32dbb7cfc3ecce19aa3b90c96d3fbeedd62d20fe34bc7"
44
+ "sha256": "4268f56e38f72625c2c490add4b17ee12d7ff7db991a2090f426afbb026b98a9"
45
45
  },
46
46
  {
47
47
  "path": "dist/cli.js",
48
- "sha256": "56b4da2639c1721180387f28166d84d065718a4002f556307a6598570d335809"
48
+ "sha256": "fe24568930cc226e0bad8b4ccba559e2f837bb4cb068c2cc37750b5a10c27a70"
49
49
  },
50
50
  {
51
51
  "path": "dist/cli.js.map",
52
- "sha256": "4a172ba5384c9716fa48570979b7ffba969599ed5c639d7e7268a829d2b9b4e1"
52
+ "sha256": "4a0b554fab78cd50fc46cff653411b2003b7dd9a4df1b16af6e9f5a0e24379ff"
53
53
  },
54
54
  {
55
55
  "path": "dist/index.d.ts",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  {
75
75
  "path": "package.json",
76
- "sha256": "65e245ef567ccecdc382bb040f27dd98e01ce2c3a104935aa2dc0558b22220e2"
76
+ "sha256": "c6469d0f7539ce6c0a8176d0b795952a667df2b975c9f93c66e7cd6eba843383"
77
77
  },
78
78
  {
79
79
  "path": "src/bin.ts",
@@ -81,7 +81,7 @@
81
81
  },
82
82
  {
83
83
  "path": "src/cli.ts",
84
- "sha256": "1aceceef391cac55d00f7872632d28c4116a82025b9235343b81398fc515f944"
84
+ "sha256": "13d3946992186e019310c1c8666fd724ce74880b8fda19850eeb8b6e0399e3d7"
85
85
  },
86
86
  {
87
87
  "path": "src/index.ts",
@@ -91,6 +91,10 @@
91
91
  "path": "test/cli.test.ts",
92
92
  "sha256": "7d6ba26ec1188db3b3ac89f50b015ba1f0c6117b5c30d99b22da41da10c96c12"
93
93
  },
94
+ {
95
+ "path": "test/epoch-replay-cli.test.ts",
96
+ "sha256": "a5a48585b565288ca1ea96030b02b2ccb37a621ef7b3cfe54cd7aaa7164d6904"
97
+ },
94
98
  {
95
99
  "path": "tsconfig.json",
96
100
  "sha256": "e80ef2911c3347a713dc3dca6a5f6034d91e938e58e71345ea920dd9833bcdbb"
@@ -101,5 +105,5 @@
101
105
  }
102
106
  ]
103
107
  },
104
- "signature": "QkTucRDewQaD109O+GaZcrFfuzX3jp/bFPbLBYq5CmLT7BCzeHAGDdGfJogI8yZA81HE5oQLRzixyq6IdNPDCw=="
108
+ "signature": "lRzsYJCin4HX25rutyyh0Veo7d29P+AOTtJyKdgPcBrzIY44kdm7AHYRYCKcTrH5esXg8nVfhxd1Uw74PjtZAg=="
105
109
  }
package/README.md CHANGED
@@ -132,7 +132,7 @@ point any tool at (a skill is just Markdown). Dedicated targets are on the [road
132
132
 
133
133
  ## User Journey — from install to mastery
134
134
 
135
- All 43 commands mapped to a real workflow:
135
+ All 62 commands mapped to a real workflow:
136
136
 
137
137
  ```
138
138
  DISCOVER → INSTALL → USE → CREATE → MAINTAIN → SHARE
@@ -236,6 +236,11 @@ dz workflow --task security-audit # adversarial security scan
236
236
 
237
237
  # Cross-host state sync:
238
238
  dz roam --apply # sync agent state across machines
239
+
240
+ # Is the self-learning loop actually paying off?
241
+ dz compounding # readiness + payoff report (INSUFFICIENT_DATA is a real answer)
242
+ dz epoch-replay --mock --n 24 --effect 0.9 # $0 dry run of the cold-vs-warm verdict math
243
+ dz epoch-replay --emit # ready? emit the real cold-vs-warm work order
239
244
  ```
240
245
 
241
246
  ### Phase 6: Share (publish to the world)
@@ -464,6 +469,98 @@ The prompt queries that make replay possible stay on your machine: `.dz/recall-u
464
469
  git-ignored, entries are truncated at 200 chars and flagged when truncated (a prefix is not a prompt,
465
470
  so flagged rows never count as replayable).
466
471
 
472
+ ### Did the lessons actually change outcomes? — `dz epoch-replay`
473
+
474
+ `dz compounding` says a cold-vs-warm replay **can** be run. `dz epoch-replay` **runs** it and reports
475
+ what it found: Epoch 0 (cold — the prompt alone) vs Epoch 1 (warm — the same prompt plus exactly the
476
+ lessons the apply leg injected), on the same instances, scored into a three-valued verdict.
477
+
478
+ **The test is PAIRED.** Each instance is one judgment on one prompt, so the statistic is a single
479
+ binomial over *decisive* pairs: `p̂ = warm wins / (warm wins + cold wins)`, with a `95%` Wilson
480
+ interval reported on the **lift** scale `2p̂ − 1`. Ties carry no direction — they are excluded from
481
+ the denominator and reported separately.
482
+
483
+ **`SUPPORTED` only when the lift interval lies entirely above zero.** `FALSIFIED` only on **harm**
484
+ (entirely below zero) or on a passed **non-superiority** test — the lift upper bound below a
485
+ pre-registered margin, default `0.05`, at 10+ decisive pairs. Everything else is `INCONCLUSIVE`, a
486
+ first-class honest outcome; below 5 decisive pairs there is no verdict at all.
487
+
488
+ **A tie is under-powered, not refuted.** `6/12` gives a lift interval of `[-0.492, 0.492]` — that
489
+ excludes nothing, so it reads `INCONCLUSIVE`. So does a *perfectly* even 500/500 over 1000 pairs
490
+ (lift upper `0.0619`): the most uninformative result the protocol can produce must not be reported
491
+ as a refutation. A refutation has to clear a bar too.
492
+
493
+ **Try it at $0 first — `--mock` generates seeded synthetic outcomes at a TRUE effect you choose, and
494
+ runs them through the real verdict math:**
495
+
496
+ ```
497
+ $ dz epoch-replay --mock --n 24 --effect 0.9 --seed 20260729
498
+ COLD (epoch 0, no injected lessons): 1/24 CI95 [0.007, 0.202]
499
+ WARM (epoch 1, apply-leg lessons): 23/24 CI95 [0.798, 0.993]
500
+ VERDICT: SUPPORTED
501
+ warm 23/24 CI [0.798, 0.993] is DISJOINT above cold 1/24 CI [0.007, 0.202]
502
+
503
+ $ dz epoch-replay --mock --n 24 --effect -0.9 --seed 20260729 # → FALSIFIED (harm)
504
+ $ dz epoch-replay --mock --n 24 --effect 0.4 --seed 20260729 # → INCONCLUSIVE (neither separates nor excludes)
505
+ $ dz epoch-replay --mock --n 12 --effect 0 --seed 7 # → INCONCLUSIVE (6/6 tie: under-powered, NOT refuted)
506
+ ```
507
+
508
+ ```
509
+ $ dz epoch-replay --mock --n 24 --effect 0.9 --seed 20260729
510
+ SLICE: all · 24 scored instance(s) · 24 DECISIVE pair(s)
511
+ COLD (epoch 0, no injected lessons): 1/24 decisive CI95 [0.007, 0.202]
512
+ WARM (epoch 1, apply-leg lessons): 23/24 decisive CI95 [0.798, 0.993]
513
+ LIFT (paired, 2p−1 over decisive pairs): +0.917 [0.595, 0.985]
514
+ VERDICT: SUPPORTED — the lift interval lies ENTIRELY above zero
515
+ ```
516
+
517
+ Every mock run prints `SYNTHETIC … it is NOT evidence about the learning loop`, and the same seed
518
+ gives byte-identical output — a demo is a reproducer.
519
+
520
+ **Real mode: the runner ORCHESTRATES and SCORES — it never calls a model.** Generation and judging
521
+ happen out of band, so the core stays pure, offline and reproducible:
522
+
523
+ ```
524
+ $ dz epoch-replay --emit # → .dz/epoch-replay/work-order.json (git-ignored: raw prompts)
525
+ 25 instance(s) · seed 20260729 · blind A/B assignment PRE-REGISTERED
526
+ # 1. have an agent fill coldPlan / warmPlan for each item (symmetric length, same task)
527
+ $ dz epoch-replay --judge .dz/epoch-replay/work-order.json # → blind judge prompts
528
+ # 2. have an EXTERNAL, cross-model judge answer them → [{ "id": …, "winner": "A|B|TIE" }]
529
+ $ dz epoch-replay --score judgments.json --work-order .dz/epoch-replay/work-order.json --slice task
530
+ ```
531
+
532
+ Three things make that blind real rather than decorative:
533
+
534
+ - **The judge sees `{id, prompt}` and nothing else.** No assignment, no arm names, no slice label,
535
+ not even a path back to the work order. The judge file is byte-identical whichever way the
536
+ assignment fell, so it cannot be decoded. (Skipped items are reported on stdout, not in the file —
537
+ their reasons name arms.)
538
+ - **The work order is integrity-checked.** It carries a sha256 digest over its pre-registered core
539
+ (version, seed, margin, corpus fingerprint, every `[id, warmIsA]`); `--judge` and `--score`
540
+ recompute it *and* re-derive every assignment from the stated seed, refusing on any mismatch. A
541
+ hand-written order does not buy a verdict.
542
+ > **Honest scope:** this is an integrity check against accidental corruption and mismatch — **not
543
+ > a cryptographic commitment.** The hash is self-contained, so a determined operator can re-forge
544
+ > it (seed-searching a matching assignment at n=12 takes a few thousand tries). The threat model
545
+ > is *you making a mistake*: a hand-edited file, a stale order paired with fresh judgments. The
546
+ > honest-use contract is procedural — emit once, then judge, and keep the emitted file. `--emit`
547
+ > records `emittedAt` + a corpus fingerprint and `--score` prints the digest, seed and margin, so
548
+ > a reviewer can ask for the original and compare three numbers.
549
+ - **The non-superiority margin is pre-registered.** `--margin` is accepted only at `--emit`, is
550
+ stored in the work order and covered by the digest, and `--score` **refuses** a `--margin` flag —
551
+ a margin chosen once you can see the counts is not a pre-registration, and `--margin 99` at
552
+ scoring time would simply buy `FALSIFIED`. Out of range (outside `(0, 0.5]`) is refused, not
553
+ clamped.
554
+ - **Corrupt input is refused, not measured.** Duplicate judgement ids exit 1 rather than counting
555
+ one opinion N times. Unknown ids and unparseable winners are skipped **with a reason**, never
556
+ guessed.
557
+
558
+ The warm arm's only delta is the injected lessons: no gold answers, no verdicts, no outcome labels
559
+ ever enter a work order.
560
+
561
+ **When to use:** after `dz compounding` reports the replay as READY; before claiming that recall
562
+ "works"; and any time you want the claim re-checked as the corpus grows.
563
+
467
564
  ### Usage estimates you can act on — `dz usage`
468
565
 
469
566
  `dz usage` estimates how much of your Claude session (5h block) and week you have spent, from local
@@ -672,7 +769,7 @@ Each pack is an npm package — click through for the **full per-skill documenta
672
769
  | [@dzhechkov/skills-book-digitizer](https://www.npmjs.com/package/@dzhechkov/skills-book-digitizer) | 8 | *dz-original* — book → installable methodology pack: `digitize-book` (orchestrator) + ingest/extract/distill/pack/kb-index + `book-brain-register` (CP6 promote → cross-project brain) + `source-brain-ingest` (repo sibling). Verified provenance, IP-safe, resumable (`dz init --select digitize-book`) ([ADR-001](https://github.com/djd1m/dz-harness-hub/blob/main/features/book-knowledge-digitizer/03_adr/001-book-to-skillpack-pipeline.md)) |
673
770
  | [@dzhechkov/skills-12factor](https://www.npmjs.com/package/@dzhechkov/skills-12factor) | 12 | *generated by the digitizer, CC BY 4.0* — The Twelve-Factor App distilled into 12 decision-moment skills (one per factor). The first PUBLIC digitized-book pack; paraphrased (shingling-gated), routing-gated (every factor carries triggers), attributed (`NOTICE`) (`dz init --select 12factor-config-in-environment,…`) |
674
771
 
675
- ### Available Presets (13)
772
+ ### Available Presets (14)
676
773
 
677
774
  | Preset | Skills | Description |
678
775
  |--------|--------|-------------|
@@ -726,7 +823,7 @@ Get the whole set with `dz init --target claude-code --preset meta`, or pick one
726
823
 
727
824
  > **A skill and its npx toolkit are not duplicates — they're a graduation.** Several skills (e.g. `feature-adr`, `design-thinking`) exist BOTH as a skill inside a `dz` preset AND as a standalone `npx` package. The preset's SKILL.md is **fully functional on its own** (the whole methodology — modules + references — travels with it, and it auto-activates by description), and it's the only way to compile that capability to the **non-Claude platforms** (Codex/OpenCode/Hermes/OpenClaude) via `dz`. The npx package adds **project-level runtime governance** around the same skill: a slash command, governance rules, a context shard, and (for feature-adr) reward-learning + `/harvest`. So: pick the **skill/preset** for a working capability across platforms; pick the **npx toolkit** when you want it as a governed, command-driven fixture of one project.
728
825
 
729
- ## All Commands (61)
826
+ ## All Commands (62)
730
827
 
731
828
  ```
732
829
  dz setup --target <name> [--preset <name>] [--select id,id,...] [--skills-dir <dir>] [--memory agentdb] [--no-memory] [--no-hooks] [--install-driver] [--force]
@@ -784,6 +881,10 @@ dz discrimination-check --test <f[,f]> [--base <ref>] [--name <filter>] [--runne
784
881
  dz delivery-check --slug <slug> [--context-only] [--findings <f.json>] [--strict] [--author <model>] [--json] # portable Step-10 Delivery Gate: the `manual` form that travels to every shell target — prints the 4-plane review brief (regressions ‖ security ‖ code-quality ‖ product-honesty) + artifact probes; --findings classifies a fed-back review into a fail-closed ready|blocked hand-off (only cross-validated BLOCKER/HIGH count) and writes features/<slug>/10_delivery_review.md; --strict exits 1 on blocked
785
882
  dz skills-verify [--dir <project>] [--expect a,b] [--static] [--strict] [--timeout <s>] [--json] # does .claude/skills/ actually REGISTER? --static = instant layout scan (CI-safe, no session): flags dirs that can never register; default also starts a real session and reads the authoritative system/init listing. exit 0 pass / 1 fail / 2 inconclusive — an unobservable registration is NEVER a pass
786
883
  dz compounding [--project <dir>] [--json] # honest learning-loop payoff report: pool write-only ratio, guard repeat-violation trajectory (rate per audit-half), cold-vs-warm replay readiness over unique untruncated prompt events, apply-leg staleness — a gate without enough data says INSUFFICIENT_DATA, never a verdict
884
+ dz epoch-replay --mock [--n <N>] [--effect <-1..1>] [--tie-rate <0..1>] [--seed <N>] [--slice <name>] [--margin <0..0.5>] [--json] # $0 synthetic run through the REAL verdict math; labelled SYNTHETIC, same seed = byte-identical
885
+ dz epoch-replay --emit [--project <dir>] [--limit <N>] [--seed <N>] [--margin <0..0.5>] [--out <file>] [--json] # cold-vs-warm work order: replayable instances + PRE-REGISTERED blind A/B assignment + the PRE-REGISTERED non-superiority margin + a sha256 integrity digest + emittedAt/corpus fingerprint (raw prompts — defaults into the git-ignored .dz/epoch-replay/)
886
+ dz epoch-replay --judge <filled-work-order.json> [--out <file>] [--json] # blind judge prompts from the filled plans — the file carries {id, prompt} ONLY (no assignment, no arm names); refuses an order whose digest or seed-derived assignment does not check out; half-pairs skipped WITH A REASON, on stdout
887
+ dz epoch-replay --score <judgments.json> --work-order <file> [--slice <name>] [--json] # un-blind against the VERIFIED pre-registered assignment; ONE paired binomial over DECISIVE pairs (ties excluded, reported) → SUPPORTED only when the lift interval (2p−1) lies entirely above zero; FALSIFIED only on harm or a passed non-superiority test (lift upper bound below the margin PRE-REGISTERED in the work order, default 0.05, at 10+ decisive pairs); else INCONCLUSIVE (min 5 decisive pairs). Refuses a forged work order, a --margin flag, or duplicate judgement ids; the verdict is data, not an exit code
787
888
  dz score --slug <feature> [--project <dir>] [--json] # process scorecard for ONE feature-adr run, from its artifacts: ADR confirmation, discrimination proof, cross-model QE grade, live verification, README-first, learning loop, amendments — DESCRIPTIVE-ONLY (a low score exits 0); evidence lines are shown so the reader judges the heuristics
788
889
  dz backlog <sub> add "<idea>" | list | show <id> | goals [--validate] | roulette [--seed n] [--commit <id>] | enrich <id> | jira <id> | harmonize [--apply] # brain-backed idea backlog: capture an idea → semantic dedup against past ideas/features via the REUSED agentdb vector engine (DUPLICATE≥0.92 / RELATED / NEW) + GoalMap alignment ("map+compass") → weighted seeded roulette picks one to work on → enrich STAGES an idea2prd hand-off → jira writes an auditable outbox via a configurable MCP adapter seam (jira-mcp|copilot-mcp|none). No 2nd vector store; without agentdb it degrades to exact-text dedup (honest)
789
890
  dz sign --init --out <path> | --pack <dir> --key <path> # --init: generate the Ed25519 keypair (private OUTSIDE the repo, prints the public key for keys/dz.pub); else sign a pack's manifest + CycloneDX SBOM
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkUH,2EAA2E;AAC3E,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;CAC5C;AAED,yFAAyF;AACzF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,GAAG,EAAE,MAAM,EACX,IA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