handoff-check 0.8.0 → 0.10.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.
@@ -9,8 +9,8 @@ infers rules from a summary.
9
9
  From the consuming repository root:
10
10
 
11
11
  ```sh
12
- npx handoff-check@0.8.0 init --scope staging --agent both --dry-run
13
- npx handoff-check@0.8.0 init --scope staging --agent both
12
+ npx handoff-check@0.10.0 init --scope staging --agent both --dry-run
13
+ npx handoff-check@0.10.0 init --scope staging --agent both
14
14
  ```
15
15
 
16
16
  Choose `codex`, `claude`, `both` (default), or `none`. Generated integrations:
@@ -39,8 +39,8 @@ npm pack
39
39
  From a separate consuming project, substitute the actual absolute tarball path:
40
40
 
41
41
  ```sh
42
- npx --offline --yes --package=/absolute/path/handoff-check-0.8.0.tgz handoff-check init --scope staging --agent both
43
- npx --offline --yes --package=/absolute/path/handoff-check-0.8.0.tgz handoff-check verify --format json --require-content
42
+ npx --offline --yes --package=/absolute/path/handoff-check-0.10.0.tgz handoff-check init --scope staging --agent both
43
+ npx --offline --yes --package=/absolute/path/handoff-check-0.10.0.tgz handoff-check verify --format json --require-content
44
44
  ```
45
45
 
46
46
  Bun is not required for these consumer commands. Generated agent commands use the
@@ -42,6 +42,18 @@ are inherited and exit codes preserved. It never expands the pure verifier into
42
42
  an execution engine. See ADR 0008 for cancellation, time-of-check/time-of-use and
43
43
  platform limits; the supplied program's side effects are outside verification.
44
44
 
45
+ Review maintenance is independent of verification. A strict separate registry
46
+ binds ownership/deadlines to existing rule references; review reuses explain's
47
+ active selection and never modifies applicability. Review-record explicitly
48
+ captures selected active references without merging or refreshing handoffs.
49
+ Neither verify/run nor lifecycle/doctor load the registry. See ADR 0009.
50
+
51
+ Source inspection is another explicit adapter. Pure source selection/checking
52
+ accepts CLI-supplied observations; only the filesystem adapter resolves declared
53
+ local bindings and streams bounded raw-byte hashes. Independent plan/registry/
54
+ result schemas preserve existing rule hashes and policy. Default commands do not
55
+ read these files. See ADR 0010 for path, byte, race and OS/platform limits.
56
+
45
57
  Exit codes: 0 for verified IDs, 1 for rule mismatches, 2 for invalid input or an
46
58
  unreadable input file. JSON output is intended for agent adapters and automation.
47
59
 
@@ -0,0 +1,34 @@
1
+ # ADR 0009: independent, reference-bound rule review maintenance
2
+
3
+ Status: accepted for 0.9.0.
4
+
5
+ Track owner/review windows separately from constraint applicability. Registry v1
6
+ stores exact id/revision/canonicalHash references plus owner/reviewedAt/reviewBy,
7
+ with matching optional portable project binding. Strict UTC/window/unique-ID
8
+ validation prevents ambiguous records. Reuse existing canonical hashes; do not
9
+ add maintenance fields to old manifests, snapshots or verification results.
10
+
11
+ Review uses explain's scope/global/lifecycle selection, then compares references
12
+ before temporal metadata. Primary precedence is missing, stale, future-reviewed,
13
+ overdue, current; reviewedAt <= evaluation < reviewBy is current. Known inactive
14
+ entries are ignored/count; true orphan IDs need attention project-wide. Zero
15
+ active rules also need attention. Exit 0 means current maintenance, 1 attention,
16
+ 2 invalid. Output JSON has its own v1 schema, independent of verification.
17
+
18
+ Review-record is an explicit record-after-review operation: capture selected/global
19
+ active references at one time with one chosen owner/deadline. Emit stdout JSON or
20
+ create an exclusive new file; no overwrite, merge, adoption, missing-directory
21
+ creation or implicit changes to handoffs. The output is a subset of a project-wide
22
+ registry; adopting it requires preserving/reviewing other scopes deliberately.
23
+
24
+ Overdue review is not expiration and must never silently deactivate restrictions.
25
+ Neither verify/run nor advisory lifecycle/doctor implicitly read the registry.
26
+ Records are unauthenticated declarations and may include personal owner data.
27
+ Do not claim authenticated authorship, review time, behavioral compliance or
28
+ permission. No source inspection, contact lookup, notification or model calls.
29
+ Explicit fixed clocks remain useful for reproducible fixtures, not authority.
30
+
31
+ Future source-file change checks and relationship diagnostics remain separate
32
+ proposals. A metadata feature must not evolve into implicit source fetching or
33
+ free-text contradiction inference. Pilot recruitment and real-user measurements
34
+ remain future work; implementation does not claim those experiments happened.
@@ -0,0 +1,39 @@
1
+ # ADR 0010: explicit bounded whole-file source checks
2
+
3
+ Status: accepted for 0.10.0.
4
+
5
+ Keep source inspection separate from default verification. A v1 binding plan
6
+ declares rule IDs and portable project-relative paths; source-record captures
7
+ selected/global active rules into a v1 registry with existing rule revision/hash,
8
+ whole-file SHA-256 and informational capturedAt. Both metadata formats support
9
+ strict matching optional project binding without evolving old manifest/handoff/
10
+ review contracts. No URL, source-reference or directory-scan inference.
11
+
12
+ Source-check uses explain's lifecycle selection and validates current rule
13
+ references before file I/O. Missing/stale/inactive/orphan entries do not trigger
14
+ source reads. Orphan registry IDs need attention project-wide; known inactive
15
+ ones are ignored/count. Empty active sets need attention. Source-record requires
16
+ every selected active rule mapped and rejects unknown plan IDs before reading.
17
+ Capture is explicit after review, stdout or exclusive new output only; no merge,
18
+ adoption, overwrite, baseline refresh or implicit enforcement.
19
+
20
+ Files resolve below the canonical config-directory project root. Portable path
21
+ validation, component symlink rejection, realpath containment, nonblocking /
22
+ no-follow open where available, regular-file and device/inode agreement provide
23
+ ordinary filesystem safeguards. Bound reads stream raw bytes up to an inclusive
24
+ 10 MiB with growth enforcement; metadata allows at most 256 entries. Cache each
25
+ exact path string's observation (including failures) once per invocation. Source
26
+ text is never rendered/retained; no semantic diff, mtime shortcuts or sections.
27
+
28
+ Source-check exits 0 unchanged, 1 attention, 2 invalid metadata/invocation. Source
29
+ unavailability/unsafe/oversize is per-file attention; capture failure is invalid
30
+ and produces no registry. Report JSON is independently versioned. Existing verify,
31
+ run, review, doctor and lifecycle behavior must not implicitly load these files.
32
+
33
+ This is not authentication, permission or a race-free sandbox. Root symlinks may
34
+ resolve to an explicitly selected project; descendants reject links. OS/platform/
35
+ hard-link semantics and concurrent replacement/writes remain limitations, with no
36
+ atomic historical read or guaranteed timeout for stuck OS I/O. Fixed as-of affects
37
+ rule selection only; file bytes are current, capturedAt unauthenticated metadata.
38
+ Pilot measurements, section bindings and relationship diagnostics remain future
39
+ work, not validation claims attached to this implementation.
@@ -1,6 +1,6 @@
1
1
  # Development plan
2
2
 
3
- Status: milestones through 0.8 are implemented; later milestones remain proposed.
3
+ Status: milestones through 0.10 are implemented; later milestones remain proposed.
4
4
  Research reviewed: 2026-11-24. Version labels below are targets, not release promises.
5
5
 
6
6
  ## Product direction
@@ -143,18 +143,32 @@ successful launch inherits process context and preserves results. It is not a
143
143
  sandbox, permission grant, atomic transaction or enforcement outside the wrapper.
144
144
  See [usage and limits](verified-commands.md). Existing contracts remain compatible.
145
145
 
146
- ## 0.9 candidate: rule maintenance, gated by pilot demand
146
+ ## 0.9: rule ownership and review maintenance (implemented)
147
+
148
+ Implemented under [ADR 0009](decisions/0009-independent-rule-review-maintenance.md):
149
+ an independent reference-bound registry, explicit review-record capture and review
150
+ reports. Review deadlines never deactivate constraints or alter verify/run/hooks.
151
+ See [usage](rule-reviews.md). No human identity/time authentication, implicit
152
+ notifications, baseline refresh or automatic registry merge. Pilot evidence and
153
+ real-world maintenance measurements remain future work.
154
+
155
+ ## 0.10: explicit local source changes (implemented)
156
+
157
+ Implemented under [ADR 0010](decisions/0010-explicit-local-source-checks.md): explicit
158
+ binding plans, source-record capture and source-check reports for bounded raw
159
+ whole-file hashes. Rule/reference/project/lifecycle checks precede explicit file
160
+ reads. No URL fetching, semantic diff, automatic refresh or implicit enforcement.
161
+ See [usage and filesystem limits](local-sources.md). Section bindings and actual
162
+ pilot measurements remain future work.
163
+
164
+ ## Later: relationship maintenance, gated by pilot demand
147
165
 
148
166
  Priority: medium. Keep source inspection separate from normal verify semantics.
149
167
 
150
- - Explore explicit local source bindings and a separate read-only source-check
151
- command. A referenced file edit can signal review needed; it does not prove the
152
- rule's meaning changed. Decide full-file versus section binding deliberately.
153
- - Consider owner/review-by metadata. Overdue review is distinct from rule expiry;
154
- it must not silently deactivate a restriction.
155
- - Decide whether review metadata belongs in a separate versioned registry or a
156
- new content contract before implementation. Keep existing canonical hashes and
157
- baseline meaning stable; provide migration and independent maintenance output.
168
+ - Whole-file source bindings shipped in 0.10. Consider section-level bindings only
169
+ with pilot demand and explicit versioned parsing/normalization semantics.
170
+ - Ownership/review-by shipped in 0.9 in a separate registry. Revisit team-specific
171
+ policies only with pilot demand, keeping overdue review distinct from expiry.
158
172
  - Consider explicitly declared relationships such as conflicts/requires. Validate
159
173
  these deterministically; defer free-text contradiction inference.
160
174
 
@@ -6,8 +6,8 @@ No service, model call or API key is needed.
6
6
  ## Understand the active set
7
7
 
8
8
  ```sh
9
- npx handoff-check@0.8.0 explain --format json
10
- npx handoff-check@0.8.0 explain --scope production --format markdown
9
+ npx handoff-check@0.10.0 explain --format json
10
+ npx handoff-check@0.10.0 explain --scope production --format markdown
11
11
  ```
12
12
 
13
13
  Explain reads the manifest but not the handoff. Every rule has an applicability
@@ -20,8 +20,8 @@ exits 0 even with zero active rules: use verify to compare a handoff.
20
20
  At a reviewed handoff creation, after upgrading all consumers to 0.4+:
21
21
 
22
22
  ```sh
23
- npx handoff-check@0.8.0 snapshot --task "Review staging migrations" --include-content --output handoff.reviewed.json
24
- npx handoff-check@0.8.0 verify --handoff handoff.reviewed.json --require-content --require-active --format markdown
23
+ npx handoff-check@0.10.0 snapshot --task "Review staging migrations" --include-content --output handoff.reviewed.json
24
+ npx handoff-check@0.10.0 verify --handoff handoff.reviewed.json --require-content --require-active --format markdown
25
25
  ```
26
26
 
27
27
  Review the new file before explicitly adopting it in config. Snapshot never
@@ -8,8 +8,8 @@ Bun, API keys, and GitHub Actions are not required. All rules below are syntheti
8
8
  ```sh
9
9
  mkdir handoff-check-demo
10
10
  cd handoff-check-demo
11
- npx handoff-check@0.8.0 init --scope staging --agent none
12
- npx handoff-check@0.8.0 verify --require-content
11
+ npx handoff-check@0.10.0 init --scope staging --agent none
12
+ npx handoff-check@0.10.0 verify --require-content
13
13
  ```
14
14
 
15
15
  The starter passes with `PASS (EMPTY)` and `0 active constraints checked`.
@@ -41,7 +41,7 @@ does not fetch it or check the contents of a referenced document.
41
41
  Before capturing a baseline, run:
42
42
 
43
43
  ```sh
44
- npx handoff-check@0.8.0 verify --require-content --require-active
44
+ npx handoff-check@0.10.0 verify --require-content --require-active
45
45
  ```
46
46
 
47
47
  Expect `MISSING MIGRATION-REVIEW`, one active constraint, and exit 1. The old
@@ -50,8 +50,8 @@ starter handoff does not include the new rule yet.
50
50
  ## Capture and verify a reviewed baseline
51
51
 
52
52
  ```sh
53
- npx handoff-check@0.8.0 snapshot --task "Review staging migration" --output handoff.reviewed.json
54
- npx handoff-check@0.8.0 verify --handoff handoff.reviewed.json --require-content --require-active
53
+ npx handoff-check@0.10.0 snapshot --task "Review staging migration" --output handoff.reviewed.json
54
+ npx handoff-check@0.10.0 verify --handoff handoff.reviewed.json --require-content --require-active
55
55
  ```
56
56
 
57
57
  Review the generated file before relying on it. The verification command should
@@ -70,7 +70,7 @@ In `constraints.json`, change the description to
70
70
  handoff unchanged, then run:
71
71
 
72
72
  ```sh
73
- npx handoff-check@0.8.0 verify --handoff handoff.reviewed.json --require-content --require-active --format json
73
+ npx handoff-check@0.10.0 verify --handoff handoff.reviewed.json --require-content --require-active --format json
74
74
  ```
75
75
 
76
76
  Expect `status: "mismatch"`, `activeConstraintCount: 1`, a `CHANGED` finding, and
package/docs/lifecycle.md CHANGED
@@ -6,8 +6,8 @@ calls, source fetches, API keys or transcript access.
6
6
  ## Diagnose the intended repository/worktree root
7
7
 
8
8
  ```sh
9
- npx handoff-check@0.8.0 doctor --format json
10
- npx handoff-check@0.8.0 doctor --host claude
9
+ npx handoff-check@0.10.0 doctor --format json
10
+ npx handoff-check@0.10.0 doctor --host claude
11
11
  ```
12
12
 
13
13
  Doctor reports resolved input paths/versions, managed integrations/pins and
@@ -22,10 +22,10 @@ host settings and effective trust are not comprehensively inspected.
22
22
 
23
23
  1. Initialize/review inputs and deliberately adopt a content-aware baseline.
24
24
  2. Install the exact package in the consuming project. For npm:
25
- `npm install --save-dev --save-exact handoff-check@0.8.0`. Installation uses
25
+ `npm install --save-dev --save-exact handoff-check@0.10.0`. Installation uses
26
26
  the registry; the hook later uses only this local package. Temporary npx caches
27
27
  and global installs do not meet that prerequisite.
28
- 3. Run `npx handoff-check@0.8.0 hook-config --host claude` and inspect the JSON.
28
+ 3. Run `npx handoff-check@0.10.0 hook-config --host claude` and inspect the JSON.
29
29
  4. In an editor, merge the returned SessionStart entries into the existing
30
30
  `.claude/settings.json` hooks object. Preserve other events, handlers,
31
31
  permissions and settings. Do not replace the whole file or blindly redirect
@@ -0,0 +1,158 @@
1
+ # Explicit local source change checks
2
+
3
+ Some rules point to a policy document that can change while the rule's own
4
+ description/source reference stays the same. Optional local source registries
5
+ record an exact whole-file SHA-256 alongside the existing rule revision/hash.
6
+ `source-check` reports changed bytes as a reason to review, never as proof that
7
+ the policy's meaning changed. Existing verification does not read source files.
8
+
9
+ ## Declare bindings and record reviewed files
10
+
11
+ Create a binding plan deliberately, using actual rule IDs and local files:
12
+
13
+ ```json
14
+ {
15
+ "schemaVersion": 1,
16
+ "projectId": "your-project-id",
17
+ "bindings": [{ "id": "C-01", "path": "docs/deployment-policy.md" }]
18
+ }
19
+ ```
20
+
21
+ For unbound manifests, omit projectId from both plan and registry. Bound inputs
22
+ must match manifest/config identity exactly. Every selected/global active rule
23
+ needs an explicit binding for capture. One rule maps to one file in v1; several
24
+ rules may explicitly map to the same path. Unknown plan IDs are invalid, while
25
+ known inactive/out-of-scope bindings are ignored without reading their files.
26
+
27
+ After reviewing the current rules and those files, run:
28
+
29
+ ```sh
30
+ npx handoff-check@0.10.0 source-record --profile production --bindings source-bindings.json --output sources.next.json
31
+ ```
32
+
33
+ Choose the intended configured profile. The plan path is relative to cwd; each
34
+ bound file path is relative to the config's directory, or cwd when using the
35
+ implicit default/no config. `--constraints` can select a manifest elsewhere but
36
+ does not move that source root. `--config` and explicit profiles follow existing
37
+ selection rules; profiles reject scope/manifest overrides. Neither new command
38
+ reads a handoff or infers paths from manifest source text/URLs.
39
+
40
+ Capture freezes one evaluation time and writes only references, relative paths,
41
+ file hashes and capturedAt, not source text. Without `--output` it prints JSON.
42
+ With output it exclusively creates a new file with an existing parent, refusing
43
+ existing files/directories/symlink leaves. Any missing/unsafe/unreadable/oversize
44
+ selected file makes capture fail with exit 2 and no registry output. A failure
45
+ while writing can leave a partial new output: inspect before retrying. Never
46
+ redirect stdout onto an existing config, manifest, plan, registry or handoff.
47
+
48
+ The record is a selected/global **subset** of a project-wide registry, not a merge
49
+ or update of an existing file. Review/adopt it explicitly, preserving records for
50
+ other scopes as needed. There is no automatic merge, adoption, overwrite, missing
51
+ directory creation or refresh. Do not capture again merely to clear a finding.
52
+
53
+ ## Check an explicit registry
54
+
55
+ ```sh
56
+ npx handoff-check@0.10.0 source-check --profile production --sources sources.next.json
57
+ npx handoff-check@0.10.0 source-check --profile production --sources sources.next.json --format json
58
+ npx handoff-check@0.10.0 source-check --profile production --sources sources.next.json --format markdown
59
+ ```
60
+
61
+ `--sources` is required and resolves from cwd. Each active rule first compares
62
+ the saved revision/hash with the current rule. Missing or stale bindings never
63
+ trigger guessed file reads. Known inactive rules and unknown registry IDs are
64
+ also not read. Truly unknown IDs require project-wide cleanup attention; known
65
+ inactive entries are only ignored/count. Selection uses explain's same scope,
66
+ global and lifecycle classifier at one evaluation time.
67
+
68
+ | Status | Meaning |
69
+ | ----------------- | -------------------------------------------------------------------- |
70
+ | UNCHANGED | Current rule reference and identical source file bytes. |
71
+ | MISSING_BINDING | Active rule has no source registry entry. No file read. |
72
+ | STALE_BINDING | Revision or canonical rule hash differs. No file read. |
73
+ | SOURCE_CHANGED | Current rule reference but the whole-file hash differs. |
74
+ | SOURCE_MISSING | The explicit file or a parent is absent. |
75
+ | SOURCE_UNREADABLE | Filesystem access/read/close failed. |
76
+ | SOURCE_UNSAFE | Symlink/special-file/path containment or file-identity check failed. |
77
+ | SOURCE_TOO_LARGE | File is larger than 10 MiB, including growth during reading. |
78
+
79
+ Reports include active/unchanged/registry/ignored counts, per-rule expected and
80
+ observed hashes when available, and deterministic ID ordering. UNKNOWN_RULE
81
+ findings flag orphan IDs, and NO_ACTIVE_CONSTRAINTS marks zero-active checks
82
+ without a fabricated ID. An unchanged source cannot approve a changed rule:
83
+ STALE_BINDING takes precedence over all file observations.
84
+
85
+ Exit codes: **0** all active sources unchanged and no orphan IDs; **1** attention
86
+ (including unavailable/unsafe/oversize files, missing/stale bindings, orphan IDs
87
+ and zero active); **2** invalid invocation/contract/project binding or unreadable
88
+ metadata. Source-record succeeds with 0 or fails with 2. Reports use stdout;
89
+ invalid errors use stderr. `--format` on source-record only controls its saved-file
90
+ acknowledgement; its actual record is always JSON, and Markdown is unsupported.
91
+
92
+ ## Paths, bytes and resource limits
93
+
94
+ Bound paths are portable relative POSIX paths using `/`, up to 1024 Unicode
95
+ characters and 255 per component. Absolute/drive/UNC/URL paths, backslashes,
96
+ empty/dot/dotdot components, trailing dots/spaces, Windows reserved device names,
97
+ invalid Unicode and control/format characters are rejected. No environment,
98
+ tilde, shell or glob expansion is performed. Spaces and ordinary Unicode are
99
+ literal file-name data. All metadata entries are validated, even ignored ones.
100
+
101
+ The selected project directory itself is canonicalized (an explicit config root
102
+ may resolve through a symlink). Every component **below** that canonical root,
103
+ including the file, rejects symlinks, even ones pointing inside the project.
104
+ Resolved containment is checked by path components, and open uses nonblocking /
105
+ no-follow flags where available with regular-file and file-identity checks.
106
+ Directories, FIFOs, devices and other nonregular sources are not read. Metadata
107
+ JSON files are explicitly chosen separately and can be regular-file symlinks.
108
+
109
+ Each plan/registry allows at most 256 entries. Files may contain binary data, but
110
+ each is limited to **10 MiB inclusive**. A 64 KiB read buffer and a maximum-limit
111
+ plus one byte probe enforce the bound even when stat size is stale or a file grows.
112
+ Identical path strings share one successful or failed observation per invocation;
113
+ case/Unicode aliases are not silently normalized into a different declared path.
114
+ Hashing is SHA-256 of raw bytes: CRLF/LF, BOM, whitespace and invalid UTF-8 all count.
115
+ No mtime/size-only shortcut, section parsing, recursive scan or source text storage.
116
+
117
+ JSON schemas describe the independent [binding plan](../schemas/source-bindings.v1.schema.json),
118
+ [registry](../schemas/source-registry.v1.schema.json) and
119
+ [result](../schemas/source-result.v1.schema.json). Runtime additionally enforces
120
+ unique IDs, portable path component rules, real calendar timestamps, project and
121
+ reference agreement, and filesystem safety/limits. The existing canonical rule
122
+ hash contract and manifest/handoff schemas are unchanged.
123
+
124
+ ## Limits and privacy
125
+
126
+ Source-check is opt-in local inspection, not an authenticated review, semantic
127
+ policy diff, authorization grant or sandbox. The explicit binding is a local
128
+ declaration; manifest source text is never fetched/interpreted. Hashes and file
129
+ paths can still reveal information: review metadata before sharing it. Reports
130
+ never include file contents or raw operating-system error messages.
131
+
132
+ Checks are not atomic with file changes or adversarial directory replacement.
133
+ Concurrent writes can produce a hash of bytes observed during a changing read;
134
+ the command does not lock files or prove an authorized historical state. Hard
135
+ links and platform filesystem behavior retain normal OS semantics. No guaranteed
136
+ wall-clock timeout is imposed on unresponsive OS/network-mounted filesystem I/O.
137
+ There are no HTTP/model/Git subprocess calls; an OS-mounted filesystem may itself
138
+ use a network. Resource limits bound bytes/entry count, not every OS operation.
139
+
140
+ `capturedAt` is informational, not evidence of review or an instruction to reuse
141
+ an old clock. `--as-of` supports reproducible applicability selection; it does
142
+ not read historical file contents. File bytes are read now. Verify/run/review,
143
+ doctor and lifecycle hooks never implicitly load this registry or the bound files.
144
+ A new source record does not clear a CHANGED handoff or stale review record.
145
+
146
+ ## Reproducible synthetic example
147
+
148
+ From a checkout, without creating any handoff:
149
+
150
+ ```sh
151
+ npx handoff-check@0.10.0 source-check --config examples/local-sources/config.json --profile stage --sources examples/local-sources/sources.json --as-of 2026-11-27T08:00:00Z --format json
152
+ ```
153
+
154
+ Expect unchanged/exit 0 for two active rules sharing policy.md. In a disposable
155
+ copy, edit policy.md and repeat: expect SOURCE_CHANGED/exit 1. Changing only a
156
+ rule description instead yields STALE_BINDING for that rule without reading its
157
+ source. The shipped stage registry is a subset; profile prod reports missing P-01
158
+ and ignores the known staging-only entry.
@@ -56,10 +56,10 @@ Author `.handoff-check.json` as config v2:
56
56
  ```
57
57
 
58
58
  ```sh
59
- npx handoff-check@0.8.0 explain --profile stage
60
- npx handoff-check@0.8.0 snapshot --profile stage --task "Review staging work" --output handoffs/staging.reviewed.json
61
- npx handoff-check@0.8.0 verify --profile stage --require-content
62
- npx handoff-check@0.8.0 doctor --profile stage
59
+ npx handoff-check@0.10.0 explain --profile stage
60
+ npx handoff-check@0.10.0 snapshot --profile stage --task "Review staging work" --output handoffs/staging.reviewed.json
61
+ npx handoff-check@0.10.0 verify --profile stage --require-content
62
+ npx handoff-check@0.10.0 doctor --profile stage
63
63
  ```
64
64
 
65
65
  These assume you deliberately adopted a baseline at the configured handoff path;
@@ -83,8 +83,8 @@ bindings produce NOT VERIFIED context; hook transport success is not a pass.
83
83
  ## Record exactly what was checked
84
84
 
85
85
  ```sh
86
- npx handoff-check@0.8.0 verify --profile stage --require-content --report --format json
87
- npx handoff-check@0.8.0 verify --profile stage --require-content --report --git-context --format markdown
86
+ npx handoff-check@0.10.0 verify --profile stage --require-content --report --format json
87
+ npx handoff-check@0.10.0 verify --profile stage --require-content --report --git-context --format markdown
88
88
  ```
89
89
 
90
90
  --report is optional and verify-only. It adds package version, requested policies,
package/docs/releasing.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Releasing
2
2
 
3
3
  The npm package name is `handoff-check`; the binary is `handoff-check` and the
4
- current version is 0.8.0. The package is already published; subsequent releases
4
+ current version is 0.10.0. The package is already published; subsequent releases
5
5
  use the configured trusted publisher and the reviewed-artifact process below.
6
6
 
7
7
  ## Release a reviewed version
@@ -19,12 +19,12 @@ use the configured trusted publisher and the reviewed-artifact process below.
19
19
  publish-run artifact and compare it before claiming artifact continuity.
20
20
  For first-publication bootstrap or an explicitly chosen manual release, use
21
21
  `npm login` and publish the reviewed tarball directly with
22
- `npm publish /absolute/path/handoff-check-0.8.0.tgz --ignore-scripts --access public`.
22
+ `npm publish /absolute/path/handoff-check-0.10.0.tgz --ignore-scripts --access public`.
23
23
  Complete interactive two-factor authentication directly with npm.
24
24
  5. Verify registry name, version, binary and integrity, then test
25
- `npx --yes handoff-check@0.8.0 --version` and fresh-project init/verify using a
25
+ `npx --yes handoff-check@0.10.0 --version` and fresh-project init/verify using a
26
26
  new package cache and the public registry, rather than the local tarball.
27
- 6. Create tag `v0.8.0` and a GitHub release on the reviewed main commit, attach the
27
+ 6. Create tag `v0.10.0` and a GitHub release on the reviewed main commit, attach the
28
28
  same tarball, and describe features, requirements and known limits.
29
29
 
30
30
  Publishing is immutable for a given npm name/version. Fix failed candidates on a
package/docs/roadmap.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Roadmap
2
2
 
3
+ Implemented in 0.10.0: opt-in explicit local source bindings and bounded whole-file
4
+ change checks independent of verification. See [local sources](local-sources.md).
5
+
6
+ Implemented in 0.9.0: independent rule ownership/review windows and reference-bound
7
+ maintenance reports, without changing verification policy.
8
+ See [rule reviews](rule-reviews.md).
9
+
3
10
  Implemented in 0.8.0: explicit current-clock verification before a supplied
4
11
  command, with mandatory content/nonempty checks and preserved child results.
5
12
  See [verified commands](verified-commands.md).
@@ -0,0 +1,120 @@
1
+ # Rule ownership and review deadlines
2
+
3
+ Maintenance metadata lives in a separate versioned registry. It identifies an
4
+ owner and review window for an exact rule revision/hash without changing a rule,
5
+ handoff, canonical hash or existing verification result. A deadline needing
6
+ attention never expires, revokes or disables the underlying constraint.
7
+
8
+ ## Record a deliberate review
9
+
10
+ Read the current applicable descriptions with explain, then review them through
11
+ your normal process. Only after that review, explicitly record the selected
12
+ scope's active rules (including global rules):
13
+
14
+ ```sh
15
+ npx handoff-check@0.10.0 explain --profile stage
16
+ npx handoff-check@0.10.0 review-record --profile stage --owner platform-team --review-by 2027-01-01T00:00:00Z --output rules.review.next.json
17
+ ```
18
+
19
+ The owner/deadline are examples. One owner and deadline apply to **every** active
20
+ rule captured by that invocation, including global rules. Choose the intended
21
+ owner and review interval explicitly. Review the resulting file before adopting
22
+ it as your team's registry. To assign different owners, deliberately edit and
23
+ validate the separate entries or combine independently reviewed records by unique
24
+ ID. This command does not discover people, send notifications or authenticate
25
+ who reviewed a rule.
26
+
27
+ Without `--output`, review-record writes JSON to stdout. With it, exclusive
28
+ creation requires a new file with an existing parent; existing files, symlink
29
+ leaves and directories are refused. The record is computed once and input files
30
+ are never rewritten. An I/O failure can leave a partial new output; inspect it
31
+ before retrying. Shell redirection can itself truncate files, so do not redirect
32
+ stdout onto an existing registry, config, manifest or handoff.
33
+
34
+ This captures a **subset**, not an update/merge of an existing project registry.
35
+ Replacing an aggregate registry with one scope's subset can drop ownership data
36
+ for other scopes. There is no automatic merge, adoption, baseline refresh or
37
+ registry discovery. Record after reviewing changes, never merely to clear a
38
+ maintenance finding. No-active-rules capture fails with exit 2.
39
+
40
+ ## Check maintenance independently
41
+
42
+ ```sh
43
+ npx handoff-check@0.10.0 review --profile stage --registry rules.review.next.json
44
+ npx handoff-check@0.10.0 review --profile stage --registry rules.review.next.json --format json
45
+ npx handoff-check@0.10.0 review --profile stage --registry rules.review.next.json --format markdown
46
+ ```
47
+
48
+ An explicit `--registry` path is required and resolves from cwd. `--config`
49
+ chooses the config, configured manifest paths resolve from its directory, and
50
+ explicit `--constraints` paths resolve from cwd. Profiles are explicit and reject
51
+ scope/manifest overrides, exactly as other commands. Neither command reads a
52
+ handoff, even if config contains a missing handoff path. Config project binding
53
+ still applies. Both unbound inputs and same-project bound manifests/registries
54
+ are supported; mixed binding or different IDs are invalid. No data migration or
55
+ new config/manifest/handoff format is needed. Inputs must be regular readable
56
+ files (symlinks to regular files work); no source references are fetched.
57
+
58
+ The current clock is captured after reads. `--as-of <UTC time>` is available for
59
+ reproducible checks and records, not proof that a person reviewed at that time.
60
+ Rule applicability uses the same scope/global/lifecycle decisions as explain.
61
+
62
+ Each active rule has one primary status, in this order:
63
+
64
+ | Status | Meaning |
65
+ | -------------- | ----------------------------------------------------------------------------------------------------------- |
66
+ | MISSING_REVIEW | No entry exists for this active ID. |
67
+ | STALE_REVIEW | Recorded revision or canonical content hash differs. Owner/time shown belong to the old reviewed reference. |
68
+ | FUTURE_REVIEW | The matching record claims a reviewedAt later than the evaluation time. |
69
+ | OVERDUE_REVIEW | The matching record's reviewBy is at or before evaluation time. |
70
+ | CURRENT | Matching reference and reviewedAt <= evaluation time < reviewBy. |
71
+
72
+ Revision-only changes, including regressions, are stale even when the content hash
73
+ is unchanged. Same-ID content edits are stale without requiring a revision bump.
74
+ Stale takes precedence over future/overdue time. Known inactive/out-of-scope entries
75
+ are ignored and counted; they are not orphaned. IDs absent from the whole manifest
76
+ produce UNKNOWN_RULE findings regardless of the selected scope, because the registry
77
+ is project-wide. A zero-active check produces NO_ACTIVE_CONSTRAINTS without a fake ID.
78
+ Output sorts IDs and reports active/current/registry/ignored counts separately.
79
+
80
+ Exit codes: **0** all selected active rules have current review and no orphan IDs;
81
+ **1** maintenance attention (including zero active); **2** invalid invocation,
82
+ contract, project binding or unreadable file. Review-record succeeds with 0 or
83
+ fails with 2. Reports go to stdout, invalid errors to stderr. Text and Markdown
84
+ escape untrusted owner data. JSON remains structured data, not executable text.
85
+
86
+ ## Registry contract and privacy
87
+
88
+ See [registry schema](../schemas/review-registry.v1.schema.json) and
89
+ [result schema](../schemas/review-result.v1.schema.json). Each registry entry
90
+ requires id, positive safe revision, canonical lowercase SHA-256, nonempty owner,
91
+ reviewedAt and reviewBy. Runtime validation additionally requires unique IDs,
92
+ real calendar dates and reviewBy strictly later than reviewedAt. Timestamps use
93
+ UTC with up to millisecond precision. Rule references reuse the existing frozen
94
+ hash contract; owner/review times do not enter that hash. Registries store no full
95
+ rule text but owner names may still be sensitive; review before sharing them.
96
+
97
+ This is an unauthenticated local declaration of review, not an attestation,
98
+ authorization grant, human identity check or evidence of agent behavior. It does
99
+ not inspect the contents of referenced policy documents. An unchanged source
100
+ reference does not detect edits inside the referenced document.
101
+
102
+ `verify`, `run`, doctor and lifecycle hooks never implicitly load this registry.
103
+ An overdue/missing/broken registry cannot silently change their policy. A fresh
104
+ review record also cannot clear a CHANGED handoff: verify the saved handoff and
105
+ resolve its findings through the existing explicit workflow. If a team wants
106
+ maintenance attention to stop a pipeline, invoke review as a separate explicit
107
+ step and handle its exit code through that team's normal process.
108
+
109
+ ## Reproducible synthetic example
110
+
111
+ From a checkout, use the shipped fixtures:
112
+
113
+ ```sh
114
+ npx handoff-check@0.10.0 review --config examples/rule-reviews/config.json --profile stage --registry examples/rule-reviews/reviews.json --as-of 2026-11-26T08:00:00Z --format json
115
+ ```
116
+
117
+ Expect current/exit 0 with two active rules. At `2026-11-27T08:00:00Z` expect two
118
+ OVERDUE_REVIEW findings/exit 1. Selecting `--profile prod` at the first time instead
119
+ reports missing P-01 and one known inactive entry ignored. These fixtures are
120
+ maintenance-only and intentionally contain no handoff.
@@ -5,7 +5,7 @@
5
5
  With Node.js 22 or newer, run in the intended project root:
6
6
 
7
7
  ```sh
8
- npx handoff-check@0.8.0 setup
8
+ npx handoff-check@0.10.0 setup
9
9
  ```
10
10
 
11
11
  Enter a portable project ID, comma-separated environments, a rule ID, a real rule
@@ -31,7 +31,7 @@ For environments `staging,production`, setup creates `.handoff-check.json`,
31
31
  is no default profile. Choose the intended environment explicitly:
32
32
 
33
33
  ```sh
34
- npx handoff-check@0.8.0 verify --profile staging --require-content --require-active
34
+ npx handoff-check@0.10.0 verify --profile staging --require-content --require-active
35
35
  ```
36
36
 
37
37
  Add environment-specific rules later through deliberate review and capture;
@@ -44,9 +44,9 @@ portable skill. Do not use setup as a migration or baseline-repair command.
44
44
  ## Compare two saved snapshots
45
45
 
46
46
  ```sh
47
- npx handoff-check@0.8.0 diff --before handoff.saved.json --after handoff.next.json
48
- npx handoff-check@0.8.0 diff --before handoff.saved.json --after handoff.next.json --format json
49
- npx handoff-check@0.8.0 diff --before handoff.saved.json --after handoff.next.json --format markdown
47
+ npx handoff-check@0.10.0 diff --before handoff.saved.json --after handoff.next.json
48
+ npx handoff-check@0.10.0 diff --before handoff.saved.json --after handoff.next.json --format json
49
+ npx handoff-check@0.10.0 diff --before handoff.saved.json --after handoff.next.json --format markdown
50
50
  ```
51
51
 
52
52
  Both operands are strictly validated handoff files. Unbound v2/v3 can be compared