handoff-check 0.5.0 → 0.6.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.
@@ -0,0 +1,78 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Handoff Check project-bound manifest v3",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schemaVersion", "constraints", "projectId"],
7
+ "properties": {
8
+ "schemaVersion": {
9
+ "const": 3
10
+ },
11
+ "constraints": {
12
+ "type": "array",
13
+ "items": {
14
+ "$ref": "#/$defs/constraint"
15
+ },
16
+ "description": "IDs must be unique. Replacement references must exist, share scope, and form an acyclic graph; these checks are enforced by the CLI."
17
+ },
18
+ "projectId": {
19
+ "$ref": "#/$defs/identifier"
20
+ }
21
+ },
22
+ "$defs": {
23
+ "identifier": {
24
+ "type": "string",
25
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(?![\\s\\S])"
26
+ },
27
+ "text": {
28
+ "type": "string",
29
+ "pattern": "\\S"
30
+ },
31
+ "timestamp": {
32
+ "type": "string",
33
+ "format": "date-time",
34
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,3})?Z$",
35
+ "description": "UTC only; real calendar dates required. The CLI also rejects leap seconds and rollover dates."
36
+ },
37
+ "constraint": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["id", "scope", "description", "source", "revision"],
41
+ "dependentRequired": {
42
+ "replacedBy": ["supersededAt"],
43
+ "supersededAt": ["replacedBy"]
44
+ },
45
+ "properties": {
46
+ "id": {
47
+ "$ref": "#/$defs/identifier"
48
+ },
49
+ "scope": {
50
+ "$ref": "#/$defs/identifier"
51
+ },
52
+ "description": {
53
+ "$ref": "#/$defs/text"
54
+ },
55
+ "source": {
56
+ "$ref": "#/$defs/text"
57
+ },
58
+ "expiresAt": {
59
+ "$ref": "#/$defs/timestamp"
60
+ },
61
+ "revokedAt": {
62
+ "$ref": "#/$defs/timestamp"
63
+ },
64
+ "replacedBy": {
65
+ "$ref": "#/$defs/identifier"
66
+ },
67
+ "supersededAt": {
68
+ "$ref": "#/$defs/timestamp"
69
+ },
70
+ "revision": {
71
+ "type": "integer",
72
+ "minimum": 1,
73
+ "maximum": 9007199254740991
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,193 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Handoff Check project-bound handoff v4",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "task",
9
+ "scope",
10
+ "capturedAt",
11
+ "activeConstraints",
12
+ "projectId",
13
+ "contentMode"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": 4
18
+ },
19
+ "task": {
20
+ "type": "string",
21
+ "pattern": "\\S"
22
+ },
23
+ "scope": {
24
+ "$ref": "#/$defs/id"
25
+ },
26
+ "capturedAt": {
27
+ "type": "string",
28
+ "format": "date-time",
29
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,3})?Z$"
30
+ },
31
+ "activeConstraints": {
32
+ "type": "array",
33
+ "description": "Unique IDs; each content id/revision/canonical hash must agree with its reference. The CLI enforces these checks and rejects self-replacements. Replacement targets need not occur in this snapshot.",
34
+ "items": {
35
+ "oneOf": [
36
+ {
37
+ "$ref": "#/$defs/hashReference"
38
+ },
39
+ {
40
+ "$ref": "#/$defs/retainedReference"
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ "projectId": {
46
+ "$ref": "#/$defs/id"
47
+ },
48
+ "contentMode": {
49
+ "enum": ["hashes", "retained"]
50
+ }
51
+ },
52
+ "$defs": {
53
+ "id": {
54
+ "type": "string",
55
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(?![\\s\\S])"
56
+ },
57
+ "identifier": {
58
+ "type": "string",
59
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(?![\\s\\S])"
60
+ },
61
+ "text": {
62
+ "type": "string",
63
+ "pattern": "\\S"
64
+ },
65
+ "timestamp": {
66
+ "type": "string",
67
+ "format": "date-time",
68
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,3})?Z$",
69
+ "description": "UTC only; real calendar dates required. The CLI also rejects leap seconds and rollover dates."
70
+ },
71
+ "constraint": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["id", "scope", "description", "source", "revision"],
75
+ "dependentRequired": {
76
+ "replacedBy": ["supersededAt"],
77
+ "supersededAt": ["replacedBy"]
78
+ },
79
+ "properties": {
80
+ "id": {
81
+ "$ref": "#/$defs/identifier"
82
+ },
83
+ "scope": {
84
+ "$ref": "#/$defs/identifier"
85
+ },
86
+ "description": {
87
+ "$ref": "#/$defs/text"
88
+ },
89
+ "source": {
90
+ "$ref": "#/$defs/text"
91
+ },
92
+ "expiresAt": {
93
+ "$ref": "#/$defs/timestamp"
94
+ },
95
+ "revokedAt": {
96
+ "$ref": "#/$defs/timestamp"
97
+ },
98
+ "replacedBy": {
99
+ "$ref": "#/$defs/identifier"
100
+ },
101
+ "supersededAt": {
102
+ "$ref": "#/$defs/timestamp"
103
+ },
104
+ "revision": {
105
+ "type": "integer",
106
+ "minimum": 1,
107
+ "maximum": 9007199254740991
108
+ }
109
+ }
110
+ },
111
+ "hashReference": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": ["id", "revision", "contentHash"],
115
+ "properties": {
116
+ "id": {
117
+ "$ref": "#/$defs/id"
118
+ },
119
+ "revision": {
120
+ "type": "integer",
121
+ "minimum": 1,
122
+ "maximum": 9007199254740991
123
+ },
124
+ "contentHash": {
125
+ "type": "string",
126
+ "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])"
127
+ }
128
+ }
129
+ },
130
+ "retainedReference": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": ["id", "revision", "contentHash", "content"],
134
+ "properties": {
135
+ "id": {
136
+ "$ref": "#/$defs/id"
137
+ },
138
+ "revision": {
139
+ "type": "integer",
140
+ "minimum": 1,
141
+ "maximum": 9007199254740991
142
+ },
143
+ "contentHash": {
144
+ "type": "string",
145
+ "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])"
146
+ },
147
+ "content": {
148
+ "$ref": "#/$defs/constraint"
149
+ }
150
+ }
151
+ }
152
+ },
153
+ "allOf": [
154
+ {
155
+ "if": {
156
+ "properties": {
157
+ "contentMode": {
158
+ "const": "hashes"
159
+ }
160
+ }
161
+ },
162
+ "then": {
163
+ "properties": {
164
+ "activeConstraints": {
165
+ "items": {
166
+ "$ref": "#/$defs/hashReference"
167
+ },
168
+ "type": "array"
169
+ }
170
+ }
171
+ }
172
+ },
173
+ {
174
+ "if": {
175
+ "properties": {
176
+ "contentMode": {
177
+ "const": "retained"
178
+ }
179
+ }
180
+ },
181
+ "then": {
182
+ "properties": {
183
+ "activeConstraints": {
184
+ "items": {
185
+ "$ref": "#/$defs/retainedReference"
186
+ },
187
+ "type": "array"
188
+ }
189
+ }
190
+ }
191
+ }
192
+ ]
193
+ }
@@ -0,0 +1,168 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Handoff Check reproducibility report v1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "kind",
9
+ "packageVersion",
10
+ "policies",
11
+ "inputs",
12
+ "result",
13
+ "notice"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": 1
18
+ },
19
+ "kind": {
20
+ "const": "verification-report"
21
+ },
22
+ "packageVersion": {
23
+ "type": "string"
24
+ },
25
+ "projectId": {
26
+ "type": "string",
27
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(?![\\s\\S])"
28
+ },
29
+ "profile": {
30
+ "type": "string",
31
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(?![\\s\\S])"
32
+ },
33
+ "policies": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["requireContent", "requireActive"],
37
+ "properties": {
38
+ "requireContent": {
39
+ "type": "boolean"
40
+ },
41
+ "requireActive": {
42
+ "type": "boolean"
43
+ }
44
+ }
45
+ },
46
+ "inputs": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": ["manifest", "handoff", "config"],
50
+ "properties": {
51
+ "manifest": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["path", "sha256"],
55
+ "properties": {
56
+ "path": {
57
+ "type": "string"
58
+ },
59
+ "sha256": {
60
+ "type": "string",
61
+ "pattern": "^sha256:[a-f0-9]{64}$"
62
+ }
63
+ }
64
+ },
65
+ "handoff": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["path", "sha256"],
69
+ "properties": {
70
+ "path": {
71
+ "type": "string"
72
+ },
73
+ "sha256": {
74
+ "type": "string",
75
+ "pattern": "^sha256:[a-f0-9]{64}$"
76
+ }
77
+ }
78
+ },
79
+ "config": {
80
+ "anyOf": [
81
+ {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["path", "sha256"],
85
+ "properties": {
86
+ "path": {
87
+ "type": "string"
88
+ },
89
+ "sha256": {
90
+ "type": "string",
91
+ "pattern": "^sha256:[a-f0-9]{64}$"
92
+ }
93
+ }
94
+ },
95
+ {
96
+ "type": "null"
97
+ }
98
+ ]
99
+ }
100
+ }
101
+ },
102
+ "git": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["worktree", "commit", "branch"],
106
+ "properties": {
107
+ "worktree": {
108
+ "type": "string"
109
+ },
110
+ "commit": {
111
+ "type": "string",
112
+ "pattern": "^[a-f0-9]{40,64}$"
113
+ },
114
+ "branch": {
115
+ "type": ["string", "null"]
116
+ }
117
+ }
118
+ },
119
+ "result": {
120
+ "type": "object",
121
+ "description": "Existing versioned verifier result; its semantics remain governed by verifier contracts.",
122
+ "required": [
123
+ "schemaVersion",
124
+ "status",
125
+ "scope",
126
+ "asOf",
127
+ "expectedConstraints",
128
+ "reportedConstraints",
129
+ "findings"
130
+ ],
131
+ "properties": {
132
+ "schemaVersion": {
133
+ "enum": [1, 2, 3, 4]
134
+ },
135
+ "status": {
136
+ "enum": ["verified", "mismatch"]
137
+ },
138
+ "scope": {
139
+ "type": "string"
140
+ },
141
+ "asOf": {
142
+ "type": "string"
143
+ },
144
+ "expectedConstraints": {
145
+ "type": "array",
146
+ "items": {
147
+ "type": "string"
148
+ }
149
+ },
150
+ "reportedConstraints": {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "string"
154
+ }
155
+ },
156
+ "findings": {
157
+ "type": "array",
158
+ "items": {
159
+ "type": "object"
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "notice": {
165
+ "type": "string"
166
+ }
167
+ }
168
+ }
@@ -46,7 +46,7 @@ report. Keep ordinary task summaries separate from the declared constraint IDs.
46
46
 
47
47
  ## Content-aware handoffs
48
48
 
49
- Report the active-rule count as well as findings. V2/v3 JSON exposes
49
+ Report the active-rule count as well as findings. V2/v3/v4 JSON exposes
50
50
  `activeConstraintCount`; legacy JSON exposes `expectedConstraints.length`.
51
51
  A zero count is not evidence that real active rules were checked. It may mean a
52
52
  starter, another scope, or only inactive rules. Text marks this as PASS (EMPTY)
@@ -54,8 +54,8 @@ when there are no mismatches. If the project explicitly requires a nonempty set,
54
54
  add `--require-active`: zero then produces global NO_ACTIVE_CONSTRAINTS and exit 1.
55
55
  Do not enable this policy silently or invent rules to satisfy it.
56
56
 
57
- Use schemaVersion 2 or 3 handoffs with revision/hash references. `CHANGED` means a
58
- carried active rule has a different revision or content hash. V3 findings include
57
+ Use schemaVersion 2/3 unbound or 4 project-bound handoffs with revision/hash references. `CHANGED` means a
58
+ carried active rule has a different revision or content hash. Retained v3/v4 findings include
59
59
  typed field-level `changes` from saved to current values; null means an absent
60
60
  optional field. V2 stores hashes only, so previous text is unavailable. Report
61
61
  expected/reported values and available changes, then review the current rule.
@@ -80,9 +80,9 @@ a v2 manifest can maintain explicit revisions. Hashes catch content edits even i
80
80
  the revision was not incremented.
81
81
 
82
82
  Only when old-content retention is explicitly chosen, add `--include-content` to
83
- snapshot. This creates a v3 handoff containing full descriptions, sources and
83
+ snapshot. This creates an unbound v3 or project-bound v4 retained handoff containing full descriptions, sources and
84
84
  lifecycle values; consider sensitive content before committing or sharing it.
85
- Default snapshots remain v2. Do not silently upgrade existing files or enable
85
+ Unbound snapshots default to v2; bound manifests create v4. Do not silently upgrade existing files or enable
86
86
  retention. Older CLI versions cannot read v3; upgrade affected consumers first.
87
87
 
88
88
  On resume, verify the saved baseline FIRST. Never run snapshot automatically to
@@ -104,3 +104,18 @@ success and may contain FAIL or NOT VERIFIED. Re-run verify for details and
104
104
  immediately before critical actions; startup context is not authorization or a
105
105
  blocking guarantee. Codex/Cursor adapters are not shipped in 0.5; invoke the CLI
106
106
  explicitly there.
107
+
108
+ ## Explicit project and environment context
109
+
110
+ When config v2 profiles are used, select the user/workflow's explicit --profile;
111
+ do not infer one from a branch/directory. Do not combine it with scope/input-path
112
+ overrides. Bound manifest v3/handoff v4 must match projectId and selected scope;
113
+ do not edit identity or downgrade binding merely to obtain a pass. Upgrade all
114
+ consumers and verify/review the old baseline before deliberately migrating both
115
+ inputs. Existing unbound files remain supported.
116
+
117
+ Use verify --report --format json or markdown only when reproducibility metadata
118
+ is requested. It wraps the result with package/policy/profile/input digests;
119
+ --git-context separately opts into Git reads. A report is not authenticated proof
120
+ of compliance or authorization. Never redirect reports onto input/config files.
121
+ Doctor and the advisory Claude hook support the same explicit profile selection.