handoff-check 0.3.0 → 0.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Add manifest-only explain in text, JSON and Markdown using verifier lifecycle decisions.
6
+ - Add opt-in snapshot --include-content with strictly validated retained-content v3 handoffs.
7
+ - Show ordered field-level before/after changes for active CHANGED rules in v3 results.
8
+ - Add Markdown verification reports with scope/time, count, tracking, policies and findings.
9
+ - Preserve v1/v2 JSON contracts, default v2 snapshots and read-only verification.
10
+ - Escape untrusted Markdown structure/HTML and terminal formatting controls.
11
+
12
+ ## 0.3.1
13
+
14
+ - Replace obsolete pre-publication onboarding instructions with registry usage.
15
+ - Document all commands, verification policies, and rule/policy exit semantics.
16
+ - Add a reproducible first-rule walkthrough with a passing snapshot and CHANGED failure.
17
+ - Record the research-backed development plan with priorities and acceptance gates.
18
+ - Keep verifier behavior and input/output contracts unchanged.
19
+
3
20
  ## 0.3.0
4
21
 
5
22
  - Show the expected active-rule count in every text verification summary.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  A deterministic, local CLI that verifies active constraints before a coding agent
4
4
  resumes work.
5
5
 
6
- **Version: 0.3.0.**
6
+ **Version: 0.4.0.**
7
7
 
8
8
  A task summary may preserve the goal while losing an active rule, carrying an
9
9
  expired restriction, or moving a staging-only instruction into production.
@@ -15,11 +15,11 @@ Source references are review metadata and are never fetched.
15
15
 
16
16
  ## Quick start
17
17
 
18
- Once the npm package is published, run in the repository where your agent works:
18
+ Run in the repository where your agent works:
19
19
 
20
20
  ```sh
21
- npx handoff-check@0.3.0 init --scope staging --agent both --dry-run
22
- npx handoff-check@0.3.0 init --scope staging --agent both
21
+ npx handoff-check@0.4.0 init --scope staging --agent both --dry-run
22
+ npx handoff-check@0.4.0 init --scope staging --agent both
23
23
  ```
24
24
 
25
25
  This creates `.handoff-check.json`, starter `constraints.json` and `handoff.json`,
@@ -33,7 +33,7 @@ on verification. Revisions and hashes detect edits under an unchanged rule ID.
33
33
  Ask a resuming agent to use the installed skill, or run:
34
34
 
35
35
  ```sh
36
- npx handoff-check@0.3.0 verify --format json --require-content
36
+ npx handoff-check@0.4.0 verify --format json --require-content
37
37
  ```
38
38
 
39
39
  The saved config supplies paths and scope. `init --ci` also creates a pinned GitHub
@@ -41,9 +41,12 @@ Actions verification workflow. Skill/instruction installation does not guarantee
41
41
  agent execution; CI enforces the declared-ID comparison when its workflow runs.
42
42
  Neither checks whether the agent obeys a rule's meaning.
43
43
 
44
- Until publication, use a local package via the [setup guide](docs/agent-integration.md).
45
- Node.js 22+ is required; end users do not need Bun. After publication, global
46
- installation is also available: `npm install --global handoff-check@0.3.0`.
44
+ Node.js 22+ is required; end users do not need Bun. Global installation is also
45
+ available: `npm install --global handoff-check@0.4.0`. For contributor builds or
46
+ offline package testing, see the [setup guide](docs/agent-integration.md).
47
+
48
+ For a complete first-rule walkthrough, including a passing baseline and a detected
49
+ edit, see [your first real check](docs/first-check.md).
47
50
 
48
51
  ## See how many rules were checked
49
52
 
@@ -62,7 +65,7 @@ default but are explicitly marked. Unexpected reported IDs still fail.
62
65
  To require actual active rules, opt in:
63
66
 
64
67
  ```sh
65
- npx handoff-check@0.3.0 verify --require-content --require-active --format json
68
+ npx handoff-check@0.4.0 verify --require-content --require-active --format json
66
69
  ```
67
70
 
68
71
  A zero active set produces global NO_ACTIVE_CONSTRAINTS (no fake ID), mismatch
@@ -80,8 +83,8 @@ init and snapshot reject it. See the
80
83
  After reviewing rules at handoff creation, capture a new baseline:
81
84
 
82
85
  ```sh
83
- npx handoff-check@0.3.0 snapshot --task "Resume migration review" --output handoff.next.json
84
- npx handoff-check@0.3.0 verify --handoff handoff.next.json --require-content --format json
86
+ npx handoff-check@0.4.0 snapshot --task "Resume migration review" --output handoff.next.json
87
+ npx handoff-check@0.4.0 verify --handoff handoff.next.json --require-content --format json
85
88
  ```
86
89
 
87
90
  Snapshot creates a new file exclusively. Review it before deliberately replacing
@@ -97,9 +100,42 @@ CHANGED C-07 Review changed constraint: ...; handoff revision 1, current r
97
100
  ```
98
101
 
99
102
  JSON findings include expected/reported revision and hash. This detects a change;
100
- it does not show a text diff or authenticate either file. Source reference text is
103
+ v2 does not retain old text or authenticate either file. Source reference text is
101
104
  hashed, but referenced documents are not fetched or checked.
102
105
 
106
+ ## Explain rules and review field changes
107
+
108
+ ```sh
109
+ npx handoff-check@0.4.0 explain --format markdown
110
+ npx handoff-check@0.4.0 snapshot --task "Review migration" --include-content --output handoff.reviewed.json
111
+ npx handoff-check@0.4.0 verify --handoff handoff.reviewed.json --require-content --format markdown
112
+ ```
113
+
114
+ `explain` shows every manifest rule's applicability for the selected scope/time,
115
+ including global, out-of-scope and inactive rules. It uses the same lifecycle
116
+ precedence as verify, never reads the handoff, and exits 0 for a valid explanation.
117
+ It is not a handoff verification. Text, JSON and Markdown are supported.
118
+
119
+ Snapshot still creates v2 by default. Explicit `--include-content` creates a
120
+ **v3 handoff** retaining complete old rule content. For active `CHANGED` rules,
121
+ v3 JSON adds ordered `changes` with typed `before` (saved) and `after` (current)
122
+ values; null means an absent optional field. Text/Markdown show these field deltas,
123
+ including revision-only changes. Lifecycle findings retain precedence. V2 reports
124
+ say previous content is unavailable; hashes cannot reconstruct it.
125
+
126
+ Retained descriptions and source references may contain sensitive data. Review
127
+ before storing or sharing snapshots/reports; retention is never automatic. V3
128
+ validates each stored rule against its ID, revision and hash, but this does not
129
+ authenticate either file. Upgrade all consumers before adopting v3: older CLIs
130
+ cannot read it. No input migration is needed to keep using v1/v2 on 0.4.
131
+
132
+ `verify --format markdown` preserves exit codes 0/1/2 and includes scope, time,
133
+ active count, tracking mode, requested policies and findings. To save a report,
134
+ redirect stdout to a separate file; a shell creates/truncates the destination, so
135
+ never choose a manifest or handoff path. Markdown is verify/explain-only.
136
+ See [ADR 0004](docs/decisions/0004-explainable-verification.md) and the
137
+ [retained-content example](examples/retained-content/handoff.json).
138
+
103
139
  See the [v2 handoff schema](schemas/handoff.v2.schema.json),
104
140
  [v2 manifest schema](schemas/constraints.v2.schema.json), and
105
141
  [canonicalization contract](docs/decisions/0002-content-aware-handoffs.md).
@@ -110,13 +146,13 @@ manifest; its current manifest edits the description without bumping revision.
110
146
 
111
147
  V1 handoffs remain supported in ID-only mode with unchanged v1 JSON result fields.
112
148
  They cannot detect content edits. `--require-content` rejects them instead of
113
- silently falling back. V2 handoffs work with either v1 manifests (implicit revision `1`)
149
+ silently falling back. V2/v3 handoffs work with either v1 manifests (implicit revision `1`)
114
150
  or revisioned v2 manifests. Scope must match the v2 handoff's saved scope.
115
151
 
116
152
  Review current rules, capture a new v2 baseline, and deliberately update the saved
117
153
  handoff. Existing inputs are preserved by init, not silently upgraded. Review
118
154
  installed skills, instruction blocks and CI commands to update their pinned
119
- version to 0.3.0 and add `--require-content`. Init refuses to overwrite differing
155
+ version to 0.4.0 and add `--require-content`. Init refuses to overwrite differing
120
156
  integrations; compare them with the new packaged templates and update reviewed
121
157
  copies explicitly. Never refresh before checking resumed work or reuse capturedAt
122
158
  as the clock for real resumed work.
@@ -161,7 +197,8 @@ bun run check
161
197
  ```
162
198
 
163
199
  Bun 1.2.10 is used in CI. Build output runs on Node.js 22 or newer. The package
164
- name is `handoff-check`; claiming it requires authenticated npm publication.
200
+ name is `handoff-check`; release operations use reviewed artifacts and trusted
201
+ publishing as described in [the release guide](docs/releasing.md).
165
202
 
166
203
  ## Try the reproducible demo
167
204
 
@@ -240,9 +277,28 @@ handoff-check verify --scope <scope>
240
277
  [--constraints <path>] default: constraints.json
241
278
  [--handoff <path>] default: handoff.json
242
279
  [--as-of <UTC time>] default: current time, captured once
243
- [--format text|json] default: text
280
+ [--format text|json|markdown] default: text
281
+ [--require-content] require a v2/v3 content-aware handoff
282
+ [--require-active] fail when no active constraints apply
283
+
284
+ handoff-check snapshot --task <task>
285
+ [--config <path>] [--constraints <path>] [--scope <scope>]
286
+ [--as-of <UTC time>] [--output <new-file>] [--format text|json]
287
+ [--include-content] opt-in v3 retained content; default v2
288
+
289
+ handoff-check explain
290
+ [--config <path>] [--constraints <path>] [--scope <scope>]
291
+ [--as-of <UTC time>] [--format text|json|markdown]
292
+
293
+ handoff-check init --scope <scope>
294
+ [--agent codex|claude|both|none] [--dry-run] [--ci] [--format text|json]
244
295
  ```
245
296
 
297
+ Snapshot writes v2 JSON to stdout unless `--output` creates a new file. Its
298
+ `--format` option controls the saved-file acknowledgement when an output path is
299
+ used. The two `--require-*` policies and `--handoff` are verify-only. Run
300
+ `handoff-check --help` for the complete option list.
301
+
246
302
  The same inputs, scope, and time produce the same output. Use `--as-of` for
247
303
  reproducible CI checks. Explicit CLI paths resolve from the current working directory;
248
304
  configured paths resolve from the config file's directory.
@@ -251,8 +307,8 @@ include global rules even when no scope-specific rules exist.
251
307
 
252
308
  | Exit code | Meaning |
253
309
  | --------- | ---------------------------------------------------------- |
254
- | 0 | Declared IDs match the active manifest rules |
255
- | 1 | Rule mismatch; inspect findings |
310
+ | 0 | Verification succeeded, or explain/init/snapshot succeeded |
311
+ | 1 | Rule or active-set policy mismatch; inspect findings |
256
312
  | 2 | Invalid arguments, invalid input, or unreadable input file |
257
313
 
258
314
  Per-rule findings include `MISSING`, `EXPIRED`, `REVOKED`, `SUPERSEDED`, `OUT_OF_SCOPE`,