prizmkit 1.1.131 → 1.1.135
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/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/command-adapter.js +0 -2
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
- package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +104 -17
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -13
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +3 -13
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -4
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -9
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -7
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -5
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +2 -3
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -5
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +5 -5
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
- package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
- package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +39 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +7 -10
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +3 -3
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +156 -5
- package/bundled/dev-pipeline/tests/test_unified_cli.py +34 -7
- package/bundled/skills/_metadata.json +3 -3
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-code-review/SKILL.md +22 -6
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +41 -0
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
- package/bundled/skills/prizmkit-committer/SKILL.md +6 -13
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +17 -3
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-test/SKILL.md +26 -3
- package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +147 -14
- package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
- package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +15 -0
- package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
- package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +5 -2
- package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +1144 -27
- package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +336 -18
- package/bundled/skills/prizmkit-workflow/SKILL.md +1 -1
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +3 -3
- package/package.json +1 -1
|
@@ -15,7 +15,30 @@ Choose project-semantic parameters from the target project: framework, commands,
|
|
|
15
15
|
|
|
16
16
|
Fix only the protocol mechanisms needed for safe, replayable evidence: project/evidence/request locators, schema-shaped requests, path confinement, real process execution, complete raw capture, runner-generated chained receipts, hash binding, append-only history, differential isolation/cleanup, and resume invalidation. Read `${SKILL_DIR}/references/trusted-evidence-execution.md` before inventory, execution, differential proof, resume, or replay; it defines the trust boundary and builder commands. Read `${SKILL_DIR}/references/evidence-request-protocol.md` when authoring any request or authoritative JSON record; it defines request ownership, structured N/A, and the schema map.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Canonical Evidence Builder Lifecycle
|
|
19
|
+
|
|
20
|
+
The Main Agent supplies semantic requests only; it does not author authoritative package records. Initialize and drive one evidence directory through the builder in this order:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
init → capture-change → inventory → prepare-tests → execute/differential → finalize → render-report → validate --attest → resume
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use `${SKILL_DIR}/scripts/build_test_evidence.py` for every lifecycle command:
|
|
27
|
+
|
|
28
|
+
- `init`: creates the package directories and immutable baseline identity.
|
|
29
|
+
- `capture-change`: captures the complete canonical change, including untracked, deleted, renamed, and copied files; never substitute plain `git diff`. `inventory` then requires its changed-file set to match the capture exactly and rejects stale captures or unaccounted live paths.
|
|
30
|
+
- `inventory`: hashes current source/tests/contracts/lockfiles, rejects category overlap, excludes runtime-only paths, and validates directory roots plus the complete capture-derived changed-file set.
|
|
31
|
+
- `prepare-tests`: discovers repository-native test files from the canonical capture and inventory, generates stable builder-owned test IDs, derives existing/added/modified status, and snapshots only added/modified live test sources.
|
|
32
|
+
- `execute`: runs native project commands and owns `executions.json`, `receipts/`, and `raw/`. For `auto_bind=true`, the builder resolves recognized package-wide commands or explicit file/directory/glob arguments to the prepared tests they cover; ambiguous commands are blocked and must use `test_paths`.
|
|
33
|
+
- `differential`: records executable proof or a mechanically validated `NOT_APPLICABLE` decision only for genuinely new behavior or textual-contract behavior.
|
|
34
|
+
- `finalize`: owns manifest, stage hashes, verdict, generated-test snapshots, and evidence identity.
|
|
35
|
+
- `render-report`: derives `test-report.md`; it is never authoritative.
|
|
36
|
+
- `resume`: preserves prior receipts and refuses to rebind an identity-changing package; create a new package after scope/source identity changes.
|
|
37
|
+
|
|
38
|
+
`test-plan.json` is the only source of builder-generated test IDs. Execution requests may provide native `test_paths`, `auto_bind=true`, or legacy IDs; the builder resolves paths to IDs before execution and rejects unknown/unbound tests or layer mappings. Assess all five layers explicitly, but set `required=true` only when risk requires it; every omitted layer needs structured N/A evidence. The same binding applies test ↔ behavior ↔ execution ↔ differential proof.
|
|
39
|
+
|
|
40
|
+
The builder/validator, not the Main Agent, produces or updates `manifest.json`, `executions.json`, `receipts/*`, `validation.json`, `verdict.json`, `test-report.md`, and `source-change.patch`. `validation.json` is produced only by `validate_test_evidence.py --attest`; a package is not a `TEST_PASS` until the second strict validation succeeds.
|
|
41
|
+
|
|
19
42
|
|
|
20
43
|
For a formal requirement, `/prizmkit-test` runs after the Main-Agent code-review stage reaches `PASS` and before retrospective:
|
|
21
44
|
|
|
@@ -125,7 +148,7 @@ Coverage metrics are diagnostic signals only and never substitute for this matri
|
|
|
125
148
|
|
|
126
149
|
### 4. TEST_PLAN
|
|
127
150
|
|
|
128
|
-
Write `test-plan.json`.
|
|
151
|
+
Write the semantic preparation request under `requests/` and invoke `prepare-tests`; do not hand-author the resulting `test-plan.json`. Provide only repository-native `project_path` values, behavior mappings, selectors/runner hints, and the five layer decisions. The builder derives test IDs, status, snapshots, and hashes from inventory and canonical Git capture. Assess the ordered execution layers:
|
|
129
152
|
|
|
130
153
|
1. focused;
|
|
131
154
|
2. module/component;
|
|
@@ -151,7 +174,7 @@ If a valid test reveals a business/contract defect, do not fix production behavi
|
|
|
151
174
|
|
|
152
175
|
### 7. EXECUTE_PROVE
|
|
153
176
|
|
|
154
|
-
Run required layers in plan order through `${SKILL_DIR}/scripts/build_test_evidence.py execute`. The model selects project-native argv, cwd, timeout, attempts, concurrency, layer, environment classification, and tool probes in schema-shaped requests. The runner performs the actual process execution and appends complete environment/tool versions, raw stdout/stderr hashes, request hash, runner hash, unique receipt, and receipt-chain binding to `executions.json`. Do not accept caller-authored execution JSON and do not retry until green.
|
|
177
|
+
Run required layers in plan order through `${SKILL_DIR}/scripts/build_test_evidence.py execute`. Use `test_paths` or `auto_bind=true` for new requests; the builder resolves and persists canonical test IDs before the native command runs. The model selects project-native argv, cwd, timeout, attempts, concurrency, layer, environment classification, and tool probes in schema-shaped requests. The runner performs the actual process execution and appends complete environment/tool versions, raw stdout/stderr hashes, request hash, runner hash, unique receipt, and receipt-chain binding to `executions.json`. Do not accept caller-authored execution JSON and do not retry until green.
|
|
155
178
|
|
|
156
179
|
Differentially prove each added/changed necessary behavior test:
|
|
157
180
|
|
|
@@ -183,17 +183,64 @@
|
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
"changed_files": { "$ref": "#/$defs/stringArray" },
|
|
186
|
-
"module_roots": {
|
|
186
|
+
"module_roots": {
|
|
187
|
+
"type": "array",
|
|
188
|
+
"minItems": 1,
|
|
189
|
+
"items": {
|
|
190
|
+
"oneOf": [
|
|
191
|
+
{ "$ref": "#/$defs/path" },
|
|
192
|
+
{
|
|
193
|
+
"type": "object",
|
|
194
|
+
"additionalProperties": false,
|
|
195
|
+
"required": ["path", "changed_files"],
|
|
196
|
+
"properties": {
|
|
197
|
+
"path": { "$ref": "#/$defs/path" },
|
|
198
|
+
"changed_files": { "$ref": "#/$defs/stringArray" }
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
},
|
|
187
204
|
"module_root_files": {
|
|
188
205
|
"type": "object",
|
|
189
206
|
"minProperties": 1,
|
|
190
207
|
"additionalProperties": { "$ref": "#/$defs/stringArray" }
|
|
191
208
|
},
|
|
209
|
+
"module_root_changed_files": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"additionalProperties": { "$ref": "#/$defs/stringArray" }
|
|
212
|
+
},
|
|
192
213
|
"exclusions": { "type": "array", "items": { "$ref": "#/$defs/path" } },
|
|
193
214
|
"discovery_evidence": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/discoveryEvidence" } },
|
|
194
215
|
"plan_inputs": { "type": "object", "minProperties": 1 }
|
|
195
216
|
}
|
|
196
217
|
},
|
|
218
|
+
"changeCapture": {
|
|
219
|
+
"type": "object",
|
|
220
|
+
"additionalProperties": false,
|
|
221
|
+
"required": ["capture_format", "baseline_commit", "patch_path", "patch_sha256", "changed_files", "source_tree_sha256"],
|
|
222
|
+
"properties": {
|
|
223
|
+
"capture_format": { "const": "prizmkit-canonical-change-v1" },
|
|
224
|
+
"baseline_commit": { "type": "string", "minLength": 1 },
|
|
225
|
+
"patch_path": { "$ref": "#/$defs/path" },
|
|
226
|
+
"patch_sha256": { "$ref": "#/$defs/sha256" },
|
|
227
|
+
"changed_files": {
|
|
228
|
+
"type": "array",
|
|
229
|
+
"items": {
|
|
230
|
+
"type": "object",
|
|
231
|
+
"additionalProperties": false,
|
|
232
|
+
"required": ["path", "status", "old_path"],
|
|
233
|
+
"properties": {
|
|
234
|
+
"path": { "$ref": "#/$defs/path" },
|
|
235
|
+
"status": { "type": "string", "minLength": 1 },
|
|
236
|
+
"old_path": { "type": ["string", "null"] },
|
|
237
|
+
"role": { "const": "source" }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"source_tree_sha256": { "$ref": "#/$defs/sha256" }
|
|
242
|
+
}
|
|
243
|
+
},
|
|
197
244
|
"testPlan": {
|
|
198
245
|
"type": "object",
|
|
199
246
|
"additionalProperties": false,
|
|
@@ -225,19 +272,72 @@
|
|
|
225
272
|
"properties": {
|
|
226
273
|
"id": { "type": "string", "minLength": 1 },
|
|
227
274
|
"behavior_ids": { "$ref": "#/$defs/stringArray" },
|
|
275
|
+
"change_status": { "enum": ["existing", "added", "modified"] },
|
|
228
276
|
"project_path": { "$ref": "#/$defs/path" },
|
|
229
|
-
"snapshot_path": { "
|
|
277
|
+
"snapshot_path": { "type": ["string", "null"] },
|
|
230
278
|
"inventory_path": { "$ref": "#/$defs/path" },
|
|
231
|
-
"layers": { "$ref": "#/$defs/stringArray" }
|
|
279
|
+
"layers": { "$ref": "#/$defs/stringArray" },
|
|
280
|
+
"selector": { "type": "string", "minLength": 1 },
|
|
281
|
+
"runner": { "type": "string", "minLength": 1 }
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"testPreparationRequest": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"additionalProperties": false,
|
|
290
|
+
"required": ["request_version", "layers", "tests"],
|
|
291
|
+
"properties": {
|
|
292
|
+
"request_version": { "const": "1.0" },
|
|
293
|
+
"layers": {
|
|
294
|
+
"type": "array",
|
|
295
|
+
"minItems": 5,
|
|
296
|
+
"items": {
|
|
297
|
+
"type": "object",
|
|
298
|
+
"additionalProperties": false,
|
|
299
|
+
"required": ["name", "required", "not_applicable"],
|
|
300
|
+
"properties": {
|
|
301
|
+
"name": { "enum": ["focused", "module-component", "contract-integration", "affected-module-regression", "regression-ring"] },
|
|
302
|
+
"required": { "type": "boolean" },
|
|
303
|
+
"not_applicable": { "type": ["object", "null"] }
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"tests": {
|
|
308
|
+
"type": "array",
|
|
309
|
+
"minItems": 1,
|
|
310
|
+
"items": {
|
|
311
|
+
"type": "object",
|
|
312
|
+
"additionalProperties": false,
|
|
313
|
+
"required": ["project_path", "behavior_ids", "layers"],
|
|
314
|
+
"properties": {
|
|
315
|
+
"project_path": { "$ref": "#/$defs/path" },
|
|
316
|
+
"behavior_ids": { "$ref": "#/$defs/stringArray" },
|
|
317
|
+
"layers": { "$ref": "#/$defs/stringArray" },
|
|
318
|
+
"selector": { "type": "string", "minLength": 1 },
|
|
319
|
+
"runner": { "type": "string", "minLength": 1 }
|
|
232
320
|
}
|
|
233
321
|
}
|
|
234
322
|
}
|
|
235
323
|
}
|
|
236
324
|
},
|
|
325
|
+
"testPreparation": {
|
|
326
|
+
"type": "object",
|
|
327
|
+
"additionalProperties": false,
|
|
328
|
+
"required": ["format", "request_path", "request_sha256", "tests", "changed_test_statuses"],
|
|
329
|
+
"properties": {
|
|
330
|
+
"format": { "const": "prizmkit-native-test-preparation-v1" },
|
|
331
|
+
"request_path": { "$ref": "#/$defs/path" },
|
|
332
|
+
"request_sha256": { "$ref": "#/$defs/sha256" },
|
|
333
|
+
"tests": { "type": "array", "minItems": 1, "items": { "type": "object" } },
|
|
334
|
+
"changed_test_statuses": { "type": "object", "additionalProperties": { "enum": ["added", "modified"] } }
|
|
335
|
+
}
|
|
336
|
+
},
|
|
237
337
|
"executionRequest": {
|
|
238
338
|
"type": "object",
|
|
239
339
|
"additionalProperties": false,
|
|
240
|
-
"required": ["request_version", "purpose", "command", "cwd", "environment", "tool_version_commands", "layer", "
|
|
340
|
+
"required": ["request_version", "purpose", "command", "cwd", "environment", "tool_version_commands", "layer", "external_targets"],
|
|
241
341
|
"properties": {
|
|
242
342
|
"request_version": { "const": "1.0" },
|
|
243
343
|
"purpose": { "type": "string", "minLength": 1 },
|
|
@@ -247,6 +347,8 @@
|
|
|
247
347
|
"tool_version_commands": { "type": "object" },
|
|
248
348
|
"layer": { "enum": ["focused", "module-component", "contract-integration", "affected-module-regression", "regression-ring", "lightweight"] },
|
|
249
349
|
"test_ids": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
350
|
+
"test_paths": { "type": "array", "items": { "$ref": "#/$defs/path" } },
|
|
351
|
+
"auto_bind": { "type": "boolean" },
|
|
250
352
|
"external_targets": { "type": "array", "items": { "$ref": "#/$defs/externalTarget" } },
|
|
251
353
|
"timeout_seconds": { "type": "number", "exclusiveMinimum": 0 },
|
|
252
354
|
"attempt_policy": { "type": "object" },
|
|
@@ -272,6 +374,8 @@
|
|
|
272
374
|
"tool_versions": { "type": "object" },
|
|
273
375
|
"layer": { "enum": ["focused", "module-component", "contract-integration", "affected-module-regression", "regression-ring", "lightweight"] },
|
|
274
376
|
"test_ids": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
377
|
+
"test_paths": { "type": "array", "items": { "$ref": "#/$defs/path" } },
|
|
378
|
+
"auto_bind": { "type": "boolean" },
|
|
275
379
|
"external_targets": { "type": "array", "items": { "$ref": "#/$defs/externalTarget" } },
|
|
276
380
|
"exit_code": { "type": "integer" },
|
|
277
381
|
"stdout_path": { "$ref": "#/$defs/path" },
|
|
@@ -289,19 +393,47 @@
|
|
|
289
393
|
},
|
|
290
394
|
"executionLog": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/executionReceipt" } },
|
|
291
395
|
"differentialRequest": {
|
|
396
|
+
"type": "object",
|
|
397
|
+
"oneOf": [
|
|
398
|
+
{
|
|
399
|
+
"type": "object",
|
|
400
|
+
"additionalProperties": false,
|
|
401
|
+
"required": ["request_version", "behavior_id", "method", "execution_request", "baseline_commit", "current_tree_sha256", "mutation_patch_path", "test_overlay_paths", "expected_failure_signals"],
|
|
402
|
+
"properties": {
|
|
403
|
+
"request_version": { "const": "1.0" },
|
|
404
|
+
"behavior_id": { "type": "string", "minLength": 1 },
|
|
405
|
+
"method": { "enum": ["baseline", "controlled-mutation"] },
|
|
406
|
+
"execution_request": { "$ref": "#/$defs/executionRequest" },
|
|
407
|
+
"baseline_commit": { "type": "string", "minLength": 1 },
|
|
408
|
+
"current_tree_sha256": { "$ref": "#/$defs/sha256" },
|
|
409
|
+
"mutation_patch_path": { "type": ["string", "null"] },
|
|
410
|
+
"test_overlay_paths": { "$ref": "#/$defs/stringArray" },
|
|
411
|
+
"expected_failure_signals": { "$ref": "#/$defs/stringArray" }
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"type": "object",
|
|
416
|
+
"additionalProperties": false,
|
|
417
|
+
"required": ["request_version", "behavior_id", "method", "not_applicable"],
|
|
418
|
+
"properties": {
|
|
419
|
+
"request_version": { "const": "1.0" },
|
|
420
|
+
"behavior_id": { "type": "string", "minLength": 1 },
|
|
421
|
+
"method": { "const": "not-applicable" },
|
|
422
|
+
"not_applicable": { "$ref": "#/$defs/differentialNotApplicable" }
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
]
|
|
426
|
+
},
|
|
427
|
+
"differentialNotApplicable": {
|
|
292
428
|
"type": "object",
|
|
293
429
|
"additionalProperties": false,
|
|
294
|
-
"required": ["
|
|
430
|
+
"required": ["reason", "rationale", "evidence", "considered_signals", "conflicts"],
|
|
295
431
|
"properties": {
|
|
296
|
-
"
|
|
297
|
-
"
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
301
|
-
"current_tree_sha256": { "$ref": "#/$defs/sha256" },
|
|
302
|
-
"mutation_patch_path": { "type": ["string", "null"] },
|
|
303
|
-
"test_overlay_paths": { "$ref": "#/$defs/stringArray" },
|
|
304
|
-
"expected_failure_signals": { "$ref": "#/$defs/stringArray" }
|
|
432
|
+
"reason": { "enum": ["new-behavior", "textual-contract"] },
|
|
433
|
+
"rationale": { "type": "string", "minLength": 16 },
|
|
434
|
+
"evidence": { "$ref": "#/$defs/stringArray" },
|
|
435
|
+
"considered_signals": { "$ref": "#/$defs/stringArray" },
|
|
436
|
+
"conflicts": { "type": "array", "items": { "type": "object" } }
|
|
305
437
|
}
|
|
306
438
|
},
|
|
307
439
|
"differentialProof": {
|
|
@@ -375,6 +507,7 @@
|
|
|
375
507
|
"real_environment_validated": { "const": false },
|
|
376
508
|
"repairs_business_defects": { "const": false },
|
|
377
509
|
"code_evidence_replayable": { "type": "boolean" },
|
|
510
|
+
"repair_scope": { "enum": ["test-infrastructure", "production", "runtime", "schema", "dependency", "public-interface"] },
|
|
378
511
|
"blockers": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
379
512
|
"reproduced_failures": { "type": "array", "items": { "type": "string", "minLength": 1 } }
|
|
380
513
|
}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol_version": "1.0",
|
|
3
|
+
"lifecycle_commands": [
|
|
4
|
+
"init",
|
|
5
|
+
"capture-change",
|
|
6
|
+
"inventory",
|
|
7
|
+
"prepare-tests",
|
|
8
|
+
"execute",
|
|
9
|
+
"differential",
|
|
10
|
+
"finalize",
|
|
11
|
+
"render-report",
|
|
12
|
+
"resume"
|
|
13
|
+
],
|
|
14
|
+
"generated_tests_policy": "Only added or modified repository-native tests are snapshotted; existing tests have no generated snapshot.",
|
|
3
15
|
"records": {
|
|
4
16
|
"change_classification": "change-classification.json",
|
|
5
17
|
"scope": "scope.json",
|
|
@@ -7,12 +19,15 @@
|
|
|
7
19
|
"environment": "environment.json",
|
|
8
20
|
"behavior_risk_matrix": "behavior-risk-matrix.json",
|
|
9
21
|
"test_plan": "test-plan.json",
|
|
22
|
+
"test_preparation": "test-preparation.json",
|
|
10
23
|
"infrastructure_changes": "infrastructure-changes.json",
|
|
11
24
|
"differential_proof": "differential-proof.json",
|
|
12
25
|
"executions": "executions.json",
|
|
13
26
|
"verdict": "verdict.json",
|
|
14
27
|
"validation": "validation.json",
|
|
15
28
|
"source_patch": "source-change.patch",
|
|
29
|
+
"change_capture": "change-capture.json",
|
|
30
|
+
"lifecycle": "lifecycle.json",
|
|
16
31
|
"derived_report": "test-report.md"
|
|
17
32
|
},
|
|
18
33
|
"directories": {
|
|
@@ -23,7 +23,12 @@ Hashes and validator receipts provide byte-level binding and drift detection, no
|
|
|
23
23
|
|
|
24
24
|
`source-change.patch` preserves the complete target diff. Snapshot generated/changed tests under `generated-tests/`, contracts under `contracts/`, and raw stdout/stderr under `raw/`. Never replace old execution/output records.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Existing Tests and Package Finalization
|
|
27
|
+
|
|
28
|
+
The evidence package is an audit of repository behavior, not a request to invent a parallel test suite. Discover and execute the smallest relevant native tests before adding anything. Add, modify, or delete tests only in the target repository. The builder's `prepare-tests` command derives stable test IDs and change status from canonical Git capture, and snapshots only added or modified repository-native tests. `generated-tests/` is an evidence archive, never an execution workspace; it may be empty when existing tests cover the behavior.
|
|
29
|
+
|
|
30
|
+
The canonical package lifecycle is `init → capture-change → inventory → prepare-tests → execute/differential → finalize → render-report → validate --attest → resume`. Builder commands own `source-change.patch`, native test preparation, receipts, raw outputs, manifest, verdict, and report. The validator alone owns `validation.json`. Inventory must consume a fresh capture and exactly preserve its complete changed-file set. Canonical behavior packages require a schema-valid `test-preparation.json` bound byte-for-byte to the builder-generated `test-plan.json` and its hashed semantic request. Evidence identity is derived from the resolved baseline, canonical patch hash, and scope hash; identity-changing resume creates a new package instead of rewriting the old directory.
|
|
31
|
+
|
|
27
32
|
|
|
28
33
|
Run exactly these states in order:
|
|
29
34
|
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Load this reference when writing an inventory, execution, differential, resume, or replay request. Validate every authoritative record against `${SKILL_DIR}/assets/authoritative-records.schema.json`; the validator loads the named `$defs` for each file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Canonical Lifecycle Ownership
|
|
6
|
+
|
|
7
|
+
Start every new package with `init`, then run builder-owned `capture-change` before semantic inventory. `capture-change` is the only producer of `source-change.patch`; it records tracked, untracked, deleted, renamed, and copied paths against the resolved baseline. The Main Agent must not create or edit the patch.
|
|
8
|
+
|
|
9
|
+
Use existing project-native tests first. The Main Agent supplies only semantic test paths, behavior mappings, selectors, runner hints, and layer decisions. Run `prepare-tests` after inventory: it derives stable file/test-unit IDs and existing/added/modified status from canonical capture, snapshots added/modified repository tests, and writes normalized `test-plan.json`. The Main Agent must not hand-author IDs, status, snapshot paths, hashes, or receipt fields. Inventory `changed_files` must exactly match the fresh canonical capture, and every live captured path must be inventoried or explicitly excluded. Execution requests may use `test_paths`, `auto_bind: true`, or legacy IDs; `auto_bind` resolves only recognized package-wide commands or explicit file/directory/glob command scope, while ambiguous commands must provide `test_paths`. The builder records canonical test IDs before running. Every changed native test must be bound, and package-wide commands must not silently hide added or modified tests.
|
|
10
|
+
|
|
11
|
+
`finalize` creates the manifest, stage dependency hashes, verdict, evidence identity, and deterministic report inputs. `render-report` only renders the derived Markdown view. The validator alone creates `validation.json` during `--attest`; never hand-author a validation attestation or rebind a finalized package after identity inputs change.
|
|
12
|
+
|
|
6
13
|
|
|
7
14
|
The model writes project-semantic requests after inspecting manifests, runner configuration, contracts, test conventions, changed files, and module boundaries. The bundled builder owns process execution, raw output, receipts, isolation, tree hashes, and invalidation calculations.
|
|
8
15
|
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Use this reference during `INFRA_READY`, `TEST_BUILD`, and `EXECUTE_PROVE`. The authoritative scope and completeness inputs are `scope.json`, `behavior-risk-matrix.json`, and `test-plan.json`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Existing-Test-First Rule
|
|
6
|
+
|
|
7
|
+
Before creating a test, inspect the repository's native test files, runner configuration, and existing behavior assertions. Execute the smallest relevant existing tests first. Add, modify, or delete a repository-native test only when a concrete behavior gap is identified and recorded in the semantic preparation request. Supply project paths and behavior/layer mappings only; `prepare-tests` derives IDs, status, snapshots, and hashes from the repository and canonical Git capture. An unchanged existing test has no generated snapshot, and `generated-tests/` is never an execution workspace.
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
For `scope=this-change`, changed files locate the affected module; they do not restrict tests to changed lines. Fill observable behavior/risk gaps across the whole affected module and execute its Regression Ring. Unrelated modules remain out of scope unless they are direct callers, consumers, shared contracts, or state dependencies.
|
|
8
11
|
|
|
@@ -29,7 +32,7 @@ For every behavior row:
|
|
|
29
32
|
1. Read the public interface, contract source, preconditions, inputs/boundaries, outputs, side effects, transitions, and errors.
|
|
30
33
|
2. Inspect existing test assertions—not names—to find proven cells.
|
|
31
34
|
3. Assess all eight risks: functional, boundary, permission, concurrency, idempotency, time, dependency, and consumer.
|
|
32
|
-
4. For every applicable risk,
|
|
35
|
+
4. For every applicable risk, map one or more builder-generated test units and expected execution layer; do not invent a separate AI-maintained ID for every test function.
|
|
33
36
|
5. For every non-applicable risk, record a concrete rationale tied to this behavior.
|
|
34
37
|
6. Keep unresolved truth or untestable necessary behavior explicit; it blocks rather than becoming guessed expected behavior.
|
|
35
38
|
|
|
@@ -41,6 +41,21 @@ Treat evidence as auditable project-controlled provenance, not a defense against
|
|
|
41
41
|
|
|
42
42
|
## Builder Commands
|
|
43
43
|
|
|
44
|
+
Drive a new package through the canonical lifecycle. Semantic request files remain model-authored; authoritative package records remain tool-owned:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> init --baseline <commit>
|
|
48
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> capture-change
|
|
49
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> inventory --request requests/inventory.json
|
|
50
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> execute --request requests/focused.json
|
|
51
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> differential --request requests/differential.json
|
|
52
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> finalize --request requests/finalize.json
|
|
53
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> render-report
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`capture-change` includes tracked modifications, untracked files, deletions, renames, and copies. `finalize` owns the manifest, verdict, stage hashes, evidence identity, and generated-test snapshots. The validator is the only producer of `validation.json`.
|
|
57
|
+
|
|
58
|
+
|
|
44
59
|
Write requests beneath the evidence directory, then invoke the bundled script:
|
|
45
60
|
|
|
46
61
|
```bash
|
|
@@ -157,12 +157,12 @@ Trusted headless execution:
|
|
|
157
157
|
```text
|
|
158
158
|
a trusted host explicitly authorizes the current local task commit
|
|
159
159
|
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
160
|
+
local_commit_authorized=true
|
|
161
161
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→ no question
|
|
162
|
+
→ no question or wait is permitted
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
A self-declared or otherwise untrusted headless context does not authorize a commit.
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
|
|
166
166
|
|
|
167
167
|
## Recovery
|
|
168
168
|
|