planr 1.9.0 → 1.10.0-alpha.2

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.
Files changed (67) hide show
  1. package/README.md +32 -5
  2. package/docs/ARCHITECTURE.md +1 -1
  3. package/docs/RELEASE.md +37 -7
  4. package/docs/contracts/EVIDENCE_CONTRACT_V1.md +283 -0
  5. package/docs/contracts/fixtures/evidence/v1/examples/coverage-verdict.json +66 -0
  6. package/docs/contracts/fixtures/evidence/v1/examples/evidence-attempt.json +39 -0
  7. package/docs/contracts/fixtures/evidence/v1/examples/evidence-policy.json +117 -0
  8. package/docs/contracts/fixtures/evidence/v1/examples/evidence-receipt.json +93 -0
  9. package/docs/contracts/fixtures/evidence/v1/examples/evidence-waiver.json +31 -0
  10. package/docs/contracts/fixtures/evidence/v1/examples/proof-obligation.json +67 -0
  11. package/docs/contracts/fixtures/evidence/v1/examples/proof-preset.json +28 -0
  12. package/docs/contracts/fixtures/evidence/v1/examples/untrusted-evidence-proposal.json +20 -0
  13. package/docs/contracts/fixtures/evidence/v1/examples/verification-capability-instance.json +39 -0
  14. package/docs/contracts/fixtures/evidence/v1/examples/verification-capability-manifest.json +52 -0
  15. package/docs/contracts/fixtures/evidence/v1/negative/aborted-zero-exit-attempt.json +39 -0
  16. package/docs/contracts/fixtures/evidence/v1/negative/adapter-registration-missing-execution-contract.json +97 -0
  17. package/docs/contracts/fixtures/evidence/v1/negative/available-empty-probe-capability.json +27 -0
  18. package/docs/contracts/fixtures/evidence/v1/negative/blocked-coverage-with-stale-reason.json +27 -0
  19. package/docs/contracts/fixtures/evidence/v1/negative/empty-trust-bindings-receipt.json +72 -0
  20. package/docs/contracts/fixtures/evidence/v1/negative/failed-zero-exit-attempt.json +39 -0
  21. package/docs/contracts/fixtures/evidence/v1/negative/forged-trusted-receipt.json +35 -0
  22. package/docs/contracts/fixtures/evidence/v1/negative/inconclusive-clean-exit-attempt.json +39 -0
  23. package/docs/contracts/fixtures/evidence/v1/negative/inconclusive-coverage-with-blocked-reason.json +27 -0
  24. package/docs/contracts/fixtures/evidence/v1/negative/minimal-policy-missing-owned-inputs.json +5 -0
  25. package/docs/contracts/fixtures/evidence/v1/negative/mismatched-probe-execution-id-capability.json +42 -0
  26. package/docs/contracts/fixtures/evidence/v1/negative/passed-empty-attempt.json +22 -0
  27. package/docs/contracts/fixtures/evidence/v1/negative/policy-default-preset-unregistered.json +111 -0
  28. package/docs/contracts/fixtures/evidence/v1/negative/policy-weakening-without-waiver.json +111 -0
  29. package/docs/contracts/fixtures/evidence/v1/negative/process-probe-missing-output-limits.json +49 -0
  30. package/docs/contracts/fixtures/evidence/v1/negative/satisfied-empty-coverage-verdict.json +14 -0
  31. package/docs/contracts/fixtures/evidence/v1/negative/skipped-zero-exit-attempt.json +39 -0
  32. package/docs/contracts/fixtures/evidence/v1/negative/stale-coverage-with-inconclusive-reason.json +27 -0
  33. package/docs/contracts/fixtures/evidence/v1/negative/timed-out-zero-exit-attempt.json +39 -0
  34. package/docs/contracts/fixtures/evidence/v1/negative/unavailable-zero-exit-attempt.json +39 -0
  35. package/docs/contracts/fixtures/evidence/v1/negative/unbound-waiver.json +21 -0
  36. package/docs/contracts/fixtures/evidence/v1/negative/unsatisfied-coverage-without-gap.json +63 -0
  37. package/docs/contracts/fixtures/evidence/v1/negative/waived-coverage-forbidden-gap-reason.json +28 -0
  38. package/docs/contracts/fixtures/evidence/v1/negative/waived-coverage-missing-waiver-id.json +27 -0
  39. package/docs/contracts/fixtures/evidence/v1/schemas/evidence-contract-v1.schema.json +2705 -0
  40. package/docs/documentation/CONTRACT.md +1 -1
  41. package/docs/documentation/COVERAGE.md +8 -5
  42. package/docs/documentation/INFORMATION_ARCHITECTURE.md +1 -1
  43. package/docs/fixtures/mcp-contract.json +18 -0
  44. package/npm/native/darwin-arm64/planr +0 -0
  45. package/npm/native/darwin-arm64/planr-host-capability-validator +0 -0
  46. package/npm/native/darwin-x86_64/planr +0 -0
  47. package/npm/native/darwin-x86_64/planr-host-capability-validator +0 -0
  48. package/npm/native/linux-arm64/planr +0 -0
  49. package/npm/native/linux-arm64/planr-host-capability-validator +0 -0
  50. package/npm/native/linux-x86_64/planr +0 -0
  51. package/npm/native/linux-x86_64/planr-host-capability-validator +0 -0
  52. package/package.json +15 -2
  53. package/plugins/planr/.claude-plugin/plugin.json +1 -1
  54. package/plugins/planr/.codex-plugin/plugin.json +1 -1
  55. package/plugins/planr/skills/planr-goal/SKILL.md +7 -4
  56. package/plugins/planr/skills/planr-loop/SKILL.md +11 -8
  57. package/plugins/planr/skills/planr-loop/references/recovery-and-verification.md +5 -4
  58. package/plugins/planr/skills/planr-plan/SKILL.md +1 -1
  59. package/plugins/planr/skills/planr-review/SKILL.md +5 -1
  60. package/plugins/planr/skills/planr-status/SKILL.md +3 -1
  61. package/plugins/planr/skills/planr-verify-web/SKILL.md +9 -6
  62. package/plugins/planr/skills/planr-work/SKILL.md +17 -3
  63. package/scripts/host-capability-experiment.mjs +2477 -0
  64. package/scripts/host-capability-runtime/v1/schemas/host-capability-expected-manifest.schema.json +377 -0
  65. package/scripts/host-capability-runtime/v1/schemas/host-capability-observed-raw.schema.json +439 -0
  66. package/scripts/host-capability-runtime/v1/schemas/host-capability-provenance.schema.json +178 -0
  67. package/scripts/planr-host-capability-validator +51 -0
@@ -0,0 +1,439 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "planr.host_capability_observed_raw.schema.v1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schema_version",
8
+ "payload_version",
9
+ "experiment_id",
10
+ "host_identity",
11
+ "surface",
12
+ "tool_name",
13
+ "event_source",
14
+ "started_at",
15
+ "ended_at",
16
+ "input",
17
+ "events",
18
+ "result",
19
+ "provenance_ref"
20
+ ],
21
+ "properties": {
22
+ "schema_version": {
23
+ "const": "planr.host_capability_observed_raw.v1"
24
+ },
25
+ "payload_version": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "experiment_id": {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "host_identity": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": [
37
+ "host",
38
+ "surface",
39
+ "version",
40
+ "adapter_version"
41
+ ],
42
+ "properties": {
43
+ "host": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "surface": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "version": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ },
55
+ "adapter_version": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ }
59
+ }
60
+ },
61
+ "surface": {
62
+ "type": "string",
63
+ "minLength": 1
64
+ },
65
+ "tool_name": {
66
+ "type": "string",
67
+ "minLength": 1
68
+ },
69
+ "event_source": {
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "started_at": {
74
+ "type": "string",
75
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
76
+ },
77
+ "ended_at": {
78
+ "type": "string",
79
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
80
+ },
81
+ "input": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": [
85
+ "input_kind"
86
+ ],
87
+ "properties": {
88
+ "input_kind": {
89
+ "type": "string",
90
+ "minLength": 1
91
+ },
92
+ "command": {
93
+ "oneOf": [
94
+ {
95
+ "type": "string",
96
+ "minLength": 1
97
+ },
98
+ {
99
+ "type": "array"
100
+ }
101
+ ]
102
+ },
103
+ "cwd": {
104
+ "type": "string",
105
+ "minLength": 1
106
+ },
107
+ "javascript": {
108
+ "type": "string",
109
+ "minLength": 1
110
+ },
111
+ "probe": {
112
+ "type": "string",
113
+ "minLength": 1
114
+ },
115
+ "replay_mode": {
116
+ "type": "string",
117
+ "minLength": 1
118
+ },
119
+ "attempts": {
120
+ "type": "integer"
121
+ },
122
+ "reset_between_attempts": {
123
+ "type": "boolean"
124
+ },
125
+ "tool": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "arguments": {
130
+ "type": "object"
131
+ },
132
+ "navigation": {
133
+ "oneOf": [
134
+ {
135
+ "type": "string",
136
+ "minLength": 1
137
+ },
138
+ {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "properties": {
142
+ "url": {
143
+ "type": "string",
144
+ "minLength": 1
145
+ }
146
+ }
147
+ }
148
+ ]
149
+ },
150
+ "setup": {
151
+ "oneOf": [
152
+ {
153
+ "type": "string",
154
+ "minLength": 1
155
+ },
156
+ {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "properties": {}
160
+ }
161
+ ]
162
+ },
163
+ "operations": {
164
+ "type": "array"
165
+ },
166
+ "ui_write_actions": {
167
+ "oneOf": [
168
+ {
169
+ "type": "boolean"
170
+ },
171
+ {
172
+ "type": "array"
173
+ }
174
+ ]
175
+ },
176
+ "function": {
177
+ "type": "string",
178
+ "minLength": 1
179
+ },
180
+ "args": {
181
+ "type": "array"
182
+ }
183
+ }
184
+ },
185
+ "events": {
186
+ "type": "array",
187
+ "minItems": 1,
188
+ "items": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": [
192
+ "sequence",
193
+ "event_name",
194
+ "payload_version",
195
+ "tool_name",
196
+ "event_source",
197
+ "payload"
198
+ ],
199
+ "properties": {
200
+ "sequence": {
201
+ "type": "integer"
202
+ },
203
+ "event_name": {
204
+ "type": "string",
205
+ "minLength": 1
206
+ },
207
+ "final": {
208
+ "type": "boolean"
209
+ },
210
+ "payload_version": {
211
+ "type": "string",
212
+ "minLength": 1
213
+ },
214
+ "tool_name": {
215
+ "type": "string",
216
+ "minLength": 1
217
+ },
218
+ "event_source": {
219
+ "type": "string",
220
+ "minLength": 1
221
+ },
222
+ "payload": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "properties": {
226
+ "input_kind": {
227
+ "type": "string",
228
+ "minLength": 1
229
+ },
230
+ "final_status": {
231
+ "type": "string",
232
+ "minLength": 1
233
+ },
234
+ "status": {
235
+ "type": "string",
236
+ "minLength": 1
237
+ },
238
+ "isError": {
239
+ "type": "boolean"
240
+ },
241
+ "error": {
242
+ "type": "string",
243
+ "minLength": 1
244
+ },
245
+ "redacted_message": {
246
+ "type": "string",
247
+ "minLength": 1
248
+ },
249
+ "exit_code": {
250
+ "type": "integer"
251
+ },
252
+ "call_tool_keys": {
253
+ "type": "array",
254
+ "items": {
255
+ "type": "string",
256
+ "minLength": 1
257
+ }
258
+ },
259
+ "title": {
260
+ "type": "string",
261
+ "minLength": 1
262
+ },
263
+ "url": {
264
+ "type": "string",
265
+ "minLength": 1
266
+ },
267
+ "heading_count": {
268
+ "type": "integer"
269
+ },
270
+ "bodyVisible": {
271
+ "type": "boolean"
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+ },
278
+ "result": {
279
+ "type": "object",
280
+ "additionalProperties": false,
281
+ "required": [
282
+ "final_status",
283
+ "availability_reason",
284
+ "permissions",
285
+ "sandbox",
286
+ "missing_fields",
287
+ "blind_spots",
288
+ "artifact_refs",
289
+ "artifact_digests"
290
+ ],
291
+ "properties": {
292
+ "final_status": {
293
+ "type": "string",
294
+ "minLength": 1
295
+ },
296
+ "availability_reason": {
297
+ "type": "string",
298
+ "minLength": 1
299
+ },
300
+ "permissions": {
301
+ "type": "object",
302
+ "additionalProperties": false,
303
+ "required": [
304
+ "network",
305
+ "filesystem"
306
+ ],
307
+ "properties": {
308
+ "network": {
309
+ "type": "string",
310
+ "minLength": 1
311
+ },
312
+ "filesystem": {
313
+ "type": "string",
314
+ "minLength": 1
315
+ },
316
+ "environment": {
317
+ "type": "string",
318
+ "minLength": 1
319
+ },
320
+ "secrets": {
321
+ "type": "string",
322
+ "minLength": 1
323
+ }
324
+ }
325
+ },
326
+ "sandbox": {
327
+ "type": "object",
328
+ "additionalProperties": false,
329
+ "required": [
330
+ "mode",
331
+ "writable_roots"
332
+ ],
333
+ "properties": {
334
+ "mode": {
335
+ "type": "string",
336
+ "minLength": 1
337
+ },
338
+ "writable_roots": {
339
+ "type": "array",
340
+ "items": {
341
+ "type": "string",
342
+ "minLength": 1
343
+ }
344
+ }
345
+ }
346
+ },
347
+ "missing_fields": {
348
+ "type": "array",
349
+ "items": {
350
+ "type": "string",
351
+ "minLength": 1
352
+ }
353
+ },
354
+ "blind_spots": {
355
+ "type": "array",
356
+ "items": {
357
+ "type": "string",
358
+ "minLength": 1
359
+ }
360
+ },
361
+ "artifact_refs": {
362
+ "type": "array",
363
+ "items": {
364
+ "type": "object",
365
+ "additionalProperties": false,
366
+ "required": [
367
+ "id",
368
+ "kind",
369
+ "root_kind",
370
+ "path",
371
+ "digest"
372
+ ],
373
+ "properties": {
374
+ "id": {
375
+ "type": "string",
376
+ "minLength": 1
377
+ },
378
+ "kind": {
379
+ "type": "string",
380
+ "minLength": 1
381
+ },
382
+ "root_kind": {
383
+ "type": "string",
384
+ "minLength": 1
385
+ },
386
+ "path": {
387
+ "type": "string",
388
+ "minLength": 1
389
+ },
390
+ "digest": {
391
+ "type": "string",
392
+ "pattern": "^sha256:[0-9a-f]{64}$"
393
+ }
394
+ }
395
+ }
396
+ },
397
+ "artifact_digests": {
398
+ "type": "object",
399
+ "additionalProperties": {
400
+ "type": "string",
401
+ "pattern": "^sha256:[0-9a-f]{64}$"
402
+ }
403
+ },
404
+ "experiment_plan": {
405
+ "type": "array",
406
+ "items": {
407
+ "type": "string",
408
+ "minLength": 1
409
+ }
410
+ },
411
+ "notes": {
412
+ "type": "array",
413
+ "items": {
414
+ "type": "string",
415
+ "minLength": 1
416
+ }
417
+ }
418
+ }
419
+ },
420
+ "provenance_ref": {
421
+ "type": "object",
422
+ "additionalProperties": false,
423
+ "required": [
424
+ "path",
425
+ "digest"
426
+ ],
427
+ "properties": {
428
+ "path": {
429
+ "type": "string",
430
+ "minLength": 1
431
+ },
432
+ "digest": {
433
+ "type": "string",
434
+ "pattern": "^sha256:[0-9a-f]{64}$"
435
+ }
436
+ }
437
+ }
438
+ }
439
+ }
@@ -0,0 +1,178 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "planr.host_capability_provenance.schema.v1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schema_version",
8
+ "schema_ref",
9
+ "schema_digest",
10
+ "suite_id",
11
+ "captures"
12
+ ],
13
+ "properties": {
14
+ "schema_version": {
15
+ "const": "planr.host_capability_provenance.v1"
16
+ },
17
+ "schema_ref": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "schema_digest": {
22
+ "type": "string",
23
+ "pattern": "^sha256:[0-9a-f]{64}$"
24
+ },
25
+ "suite_id": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "captures": {
30
+ "type": "array",
31
+ "minItems": 1,
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": [
36
+ "experiment_id",
37
+ "source_kind",
38
+ "host",
39
+ "surface",
40
+ "input_kind",
41
+ "observation_mode",
42
+ "tool_name",
43
+ "event_source",
44
+ "host_version",
45
+ "adapter_version",
46
+ "claim_source",
47
+ "availability_reason",
48
+ "probe_checks",
49
+ "missing_fields",
50
+ "artifact_ids",
51
+ "captured_at"
52
+ ],
53
+ "properties": {
54
+ "experiment_id": {
55
+ "type": "string",
56
+ "minLength": 1
57
+ },
58
+ "source_kind": {
59
+ "type": "string",
60
+ "minLength": 1
61
+ },
62
+ "host": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "surface": {
67
+ "type": "string",
68
+ "minLength": 1
69
+ },
70
+ "input_kind": {
71
+ "type": "string",
72
+ "minLength": 1
73
+ },
74
+ "observation_mode": {
75
+ "type": "string",
76
+ "minLength": 1
77
+ },
78
+ "tool_name": {
79
+ "type": "string",
80
+ "minLength": 1
81
+ },
82
+ "event_source": {
83
+ "type": "string",
84
+ "minLength": 1
85
+ },
86
+ "host_version": {
87
+ "type": "string",
88
+ "minLength": 1
89
+ },
90
+ "adapter_version": {
91
+ "type": "string",
92
+ "minLength": 1
93
+ },
94
+ "claim_source": {
95
+ "type": "string",
96
+ "minLength": 1
97
+ },
98
+ "availability_reason": {
99
+ "type": "string",
100
+ "minLength": 1
101
+ },
102
+ "probe_checks": {
103
+ "type": "array",
104
+ "minItems": 1,
105
+ "items": {
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "required": [
109
+ "name",
110
+ "outcome"
111
+ ],
112
+ "properties": {
113
+ "name": {
114
+ "type": "string",
115
+ "minLength": 1
116
+ },
117
+ "outcome": {
118
+ "type": "string",
119
+ "minLength": 1
120
+ },
121
+ "detail": {
122
+ "type": "string",
123
+ "minLength": 1
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "missing_fields": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "string",
132
+ "minLength": 1
133
+ }
134
+ },
135
+ "artifact_ids": {
136
+ "type": "array",
137
+ "items": {
138
+ "type": "string",
139
+ "minLength": 1
140
+ }
141
+ },
142
+ "captured_at": {
143
+ "type": "string",
144
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
145
+ },
146
+ "external_producer": {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": [
150
+ "name",
151
+ "version",
152
+ "captured_at",
153
+ "envelope_digest"
154
+ ],
155
+ "properties": {
156
+ "name": {
157
+ "type": "string",
158
+ "minLength": 1
159
+ },
160
+ "version": {
161
+ "type": "string",
162
+ "minLength": 1
163
+ },
164
+ "captured_at": {
165
+ "type": "string",
166
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
167
+ },
168
+ "envelope_digest": {
169
+ "type": "string",
170
+ "pattern": "^sha256:[0-9a-f]{64}$"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ script_dir="$(CDPATH=; cd -- "$(dirname -- "$0")" && pwd)"
5
+ package_root="$(CDPATH=; cd -- "$script_dir/.." && pwd)"
6
+
7
+ detect_target() {
8
+ os_name="$(uname -s | tr '[:upper:]' '[:lower:]')"
9
+ arch_name="$(uname -m)"
10
+
11
+ case "$os_name" in
12
+ darwin) os_name="darwin" ;;
13
+ linux) os_name="linux" ;;
14
+ *)
15
+ echo "unsupported OS for planr-host-capability-validator: $os_name" >&2
16
+ exit 127
17
+ ;;
18
+ esac
19
+
20
+ case "$arch_name" in
21
+ arm64 | aarch64) arch_name="arm64" ;;
22
+ x86_64 | amd64) arch_name="x86_64" ;;
23
+ *)
24
+ echo "unsupported architecture for planr-host-capability-validator: $arch_name" >&2
25
+ exit 127
26
+ ;;
27
+ esac
28
+
29
+ printf '%s-%s\n' "$os_name" "$arch_name"
30
+ }
31
+
32
+ target="${PLANR_TARGET:-$(detect_target)}"
33
+
34
+ for candidate in \
35
+ "$package_root/npm/native/$target/planr-host-capability-validator" \
36
+ "$package_root/target/release/planr-host-capability-validator" \
37
+ "$package_root/target/debug/planr-host-capability-validator"
38
+ do
39
+ if [ -x "$candidate" ]; then
40
+ exec "$candidate" "$@"
41
+ fi
42
+ done
43
+
44
+ if [ -f "$package_root/Cargo.toml" ]; then
45
+ cargo build --manifest-path "$package_root/Cargo.toml" --bin planr-host-capability-validator >/dev/null
46
+ exec "$package_root/target/debug/planr-host-capability-validator" "$@"
47
+ fi
48
+
49
+ echo "planr-host-capability-validator binary was not found for $target" >&2
50
+ echo "Expected npm/native/$target/planr-host-capability-validator or a local cargo build." >&2
51
+ exit 127