@dzhechkov/harness-cli 0.3.201 → 0.3.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -531,11 +531,21 @@ pre-emptive probe, not reactive detection, is the real defense.
|
|
|
531
531
|
|
|
532
532
|
### Claim check (`dz claim-check`)
|
|
533
533
|
|
|
534
|
-
|
|
535
|
-
|
|
534
|
+
**Why you want this.** Docs accumulate numbers nobody can reproduce — things like `99% accuracy`,
|
|
535
|
+
`10× faster`, `100% coverage` — and an AI agent writing your README is especially good at inventing
|
|
536
|
+
them. A rule like *"no fake claims; verify before claiming success"* enforced only by discipline
|
|
537
|
+
eventually loses. This makes it a runnable check with an exit code.
|
|
538
|
+
|
|
539
|
+
**What it does.** Every quantitative claim (coverage, test/skill/command counts, benchmarks) must be
|
|
536
540
|
tagged `MEASURED` / `CLAIMED` / `SYNTHETIC` / `ESTIMATED` / `UNVALIDATED` / `BASELINE`, and a
|
|
537
541
|
`MEASURED` claim must name its reproducer (`npm test`, a coverage report, `npm view`, a git ref).
|
|
538
|
-
|
|
542
|
+
A `100%` or `perfect` framing is always high severity — it is the claim most likely to be untrue.
|
|
543
|
+
(The backticks are load-bearing: this paragraph quotes the claims it forbids, and a backticked
|
|
544
|
+
literal reads as code, not as an assertion.)
|
|
545
|
+
|
|
546
|
+
So `coverage 92%` is flagged; `coverage 92% (MEASURED — npm test)` is not. `2136 tests` is flagged;
|
|
547
|
+
a shields.io badge URL is not (the URL is machinery, not prose). A number inside backticks still
|
|
548
|
+
counts: ``accuracy reached `0.95` `` is a claim.
|
|
539
549
|
|
|
540
550
|
```bash
|
|
541
551
|
dz claim-check # scans root README, every package README, features/*/08_qe_report.md
|
|
@@ -557,6 +567,64 @@ dz publish --filter harness-cli --claim-check error # a high finding fails THIS
|
|
|
557
567
|
dz publish --filter harness-cli --claim-check off # disable the gate entirely
|
|
558
568
|
```
|
|
559
569
|
|
|
570
|
+
#### From Claude Code — just ask in plain language
|
|
571
|
+
|
|
572
|
+
There is no slash command: `dz` is a CLI, and the agent runs it for you.
|
|
573
|
+
|
|
574
|
+
> "Проверь наши README на непроверяемые утверждения перед релизом"
|
|
575
|
+
>
|
|
576
|
+
> "Run dz claim-check and fix the high findings by tagging them MEASURED with a reproducer"
|
|
577
|
+
>
|
|
578
|
+
> "Before we publish, make sure no doc claims 100% of anything"
|
|
579
|
+
|
|
580
|
+
Claude runs `dz claim-check --json`, reads the findings, and edits the offending lines. Two habits
|
|
581
|
+
worth asking for explicitly: **do not silence a finding by deleting the number** (a claim you cannot
|
|
582
|
+
reproduce should be removed or downgraded, not hidden), and **do not weaken the rules** to make the
|
|
583
|
+
gate green.
|
|
584
|
+
|
|
585
|
+
#### Authoring-time hook — catch a claim WHEN IT IS WRITTEN
|
|
586
|
+
|
|
587
|
+
The CLI and the `dz publish` gate both fire *after* a false claim is already on disk. The
|
|
588
|
+
authoring-time hook closes that gap: it is a Claude Code **`PreToolUse` hook** that runs the same
|
|
589
|
+
`claimCheck` engine over the Markdown text an agent is *about to write*, **before the `Write`/`Edit`
|
|
590
|
+
lands**, and surfaces the findings to the agent so it can self-correct in the same turn.
|
|
591
|
+
|
|
592
|
+
- **Scope.** It runs only on `Write` / `Edit` / `MultiEdit` whose `file_path` ends in `.md`.
|
|
593
|
+
Everything else exits immediately at zero cost.
|
|
594
|
+
- **Severity policy.** `medium` findings (untagged counts — the exact failure class the publish
|
|
595
|
+
gate misses, because publish defaults to `--fail-on high`) are surfaced as a **warning** the agent
|
|
596
|
+
sees; they never block. `high` findings (the `100%` / `perfect` framing) warn **loudly** — and the
|
|
597
|
+
message always teaches the escape below — but **do not block by default**.
|
|
598
|
+
- **Never blocks.** A broken, slow, or misfed hook can never stop you working: malformed input, a
|
|
599
|
+
missing field, an unresolvable engine, or any exception all resolve to a silent no-op. The default
|
|
600
|
+
policy has no code path that denies a write.
|
|
601
|
+
- **Opt-in strict mode.** Set `DZ_CLAIM_CHECK_HOOK=deny` to let a `high` finding actually block a
|
|
602
|
+
write — but even then it is doubly guarded: it fires only on a **new** claim line that is **not**
|
|
603
|
+
inside a fenced code block, so editing around pre-existing text is never blocked.
|
|
604
|
+
|
|
605
|
+
**The backtick escape (important when you write docs about honesty).** Honest documentation
|
|
606
|
+
sometimes has to *quote* a forbidden claim as an example of what not to write — this very section
|
|
607
|
+
does. Wrap the literal in backticks: a backticked `` `100% coverage` `` reads as a code literal, not
|
|
608
|
+
an assertion, and is not flagged. That is the sanctioned fix; **do not weaken the checker** to quiet
|
|
609
|
+
a quotation.
|
|
610
|
+
|
|
611
|
+
**Enable / disable.** The hook is wired via one additive `PreToolUse` group in
|
|
612
|
+
`.claude/settings.json` (command: `node ".../.claude/helpers/claim-check-hook.cjs"`). Remove that
|
|
613
|
+
group to disable it. It is also inert automatically if `@dzhechkov/harness-core` cannot be resolved,
|
|
614
|
+
so it never breaks a checkout that hasn't built the package.
|
|
615
|
+
|
|
616
|
+
> **Plain-language scenario.** You ask Claude to write this package's README and it drafts a line
|
|
617
|
+
> asserting a bare `100% coverage` claim. Before the `Write` lands, the hook runs `claimCheck` and
|
|
618
|
+
> you see a warning: this is the retracted all-passing framing — either state a `MEASURED` number
|
|
619
|
+
> against a baseline (naming a reproducer like `npx vitest run`), or, if you are only quoting it as
|
|
620
|
+
> an example, backtick the literal. Claude backticks it and the write proceeds — no block, no thrash.
|
|
621
|
+
|
|
622
|
+
#### In CI
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
dz claim-check --fail-on high || exit 1 # block a release on a "100%" claim
|
|
626
|
+
```
|
|
627
|
+
|
|
560
628
|
Ported from rUv's [`ruview`](https://www.npmjs.com/package/@ruvnet/ruview) `src/guardrails.js` (MIT),
|
|
561
629
|
which was itself written after a documented AI-slop incident. The detection semantics are kept
|
|
562
630
|
verbatim — including a deliberately `\b`-free `100%` regex that looks like a bug and is not.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dzhechkov/harness-cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.203",
|
|
4
4
|
"description": "The dz CLI — install AI skills for Claude Code, Codex, OpenCode, Hermes, OpenClaude, GitHub Copilot. 35 commands, 13 presets, 6 platform targets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@dzhechkov/skills-reverse-engineering": "^0.1.0",
|
|
55
55
|
"@dzhechkov/skills-presentation-storyteller": "^0.1.0",
|
|
56
56
|
"@dzhechkov/skills-website-cloner": "^0.1.0",
|
|
57
|
-
"@dzhechkov/harness-core": "0.3.
|
|
57
|
+
"@dzhechkov/harness-core": "0.3.102"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "^25.6.0",
|