prizmkit 1.1.134 → 1.1.136

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.1.134",
3
- "bundledAt": "2026-07-19T00:56:53.854Z",
4
- "bundledFrom": "09d7b00"
2
+ "frameworkVersion": "1.1.136",
3
+ "bundledAt": "2026-07-19T13:33:37.114Z",
4
+ "bundledFrom": "40a6e49"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.134",
2
+ "version": "1.1.136",
3
3
  "skills": {
4
4
  "prizmkit": {
5
5
  "description": "Framework introduction and navigation for the formal single-requirement lifecycle, project initialization, Prizm docs, and independent deployment.",
@@ -20,23 +20,22 @@ Fix only the protocol mechanisms needed for safe, replayable evidence: project/e
20
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
21
 
22
22
  ```text
23
- init → capture-change → inventory → execute/differential → finalize → render-report → validate --attest → resume
23
+ init → capture-change → inventory → prepare-tests → execute/differential → finalize → render-report → validate --attest → resume
24
24
  ```
25
25
 
26
26
  Use `${SKILL_DIR}/scripts/build_test_evidence.py` for every lifecycle command:
27
27
 
28
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`.
30
- - `inventory`: hashes current source/tests/contracts/lockfiles, rejects category overlap, excludes runtime-only paths, and validates directory roots plus explicit changed-file sets.
31
- - `execute`: runs native project commands and owns `executions.json`, `receipts/`, and `raw/`.
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`.
32
33
  - `differential`: records executable proof or a mechanically validated `NOT_APPLICABLE` decision only for genuinely new behavior or textual-contract behavior.
33
34
  - `finalize`: owns manifest, stage hashes, verdict, generated-test snapshots, and evidence identity.
34
35
  - `render-report`: derives `test-report.md`; it is never authoritative.
35
36
  - `resume`: preserves prior receipts and refuses to rebind an identity-changing package; create a new package after scope/source identity changes.
36
37
 
37
- Before testing, inspect and reuse repository-native tests and their runner configuration. Existing tests are the default. Add or modify a project-native test only after recording a concrete behavior gap. Classify each planned test as `existing`, `added`, or `modified`; `generated-tests/` is empty for unchanged existing tests and contains only snapshots of added/modified native test sources.
38
-
39
- `test-plan.json` is the only source of test IDs. Execution requests may reference only IDs declared there, and the builder rejects unknown IDs 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.
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.
40
39
 
41
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.
42
41
 
@@ -149,7 +148,7 @@ Coverage metrics are diagnostic signals only and never substitute for this matri
149
148
 
150
149
  ### 4. TEST_PLAN
151
150
 
152
- Write `test-plan.json`. Select necessary unit, module/component, contract, integration, and code-level E2E tests by risk. Assess the ordered execution layers:
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:
153
152
 
154
153
  1. focused;
155
154
  2. module/component;
@@ -175,15 +174,15 @@ If a valid test reveals a business/contract defect, do not fix production behavi
175
174
 
176
175
  ### 7. EXECUTE_PROVE
177
176
 
178
- 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.
179
178
 
180
179
  Differentially prove each added/changed necessary behavior test:
181
180
 
182
181
  - Prefer baseline failure plus current success in an isolated/uncontaminated environment.
183
182
  - If baseline is inapplicable, use a minimal controlled mutation tied to the same risk.
184
- - Bind proof to runner receipts, baseline commit, a stable source-snapshot hash, mutation apply/restore hashes, and complete cleanup. The source snapshot excludes runtime-managed `.prizmkit/state/`, evidence output under `.prizmkit/test/evidence/`, `.claude/worktrees/`, Git metadata, and Python bytecode caches because those paths change while the tested code remains identical.
185
- - Keep source identity separate from evidence integrity: the stable snapshot detects behavior-bearing project drift, while `manifest.json` hashes every evidence file and detects report/output tampering.
186
- - Completely remove mutations and verify the stable source snapshot is unchanged. Never rebind completed proof to the mutable live project tree.
183
+ - Bind proof to runner receipts, baseline commit, mutation apply/restore hashes, and complete cleanup. The builder isolates tests to temporary directories so live-workspace drift cannot interfere with differential execution.
184
+ - Keep source identity separate from evidence integrity: the change capture (patch + changed_files) detects behavior-bearing project drift, while `manifest.json` hashes every evidence file and detects report/output tampering.
185
+ - Completely remove mutations and verify the isolated current copy is unchanged. Never rebind completed proof to the mutable live project tree.
187
186
  - Classify each proof as `PROVEN`, structured `NOT_APPLICABLE`, or `UNPROVEN`.
188
187
 
189
188
  Necessary `UNPROVEN` behavior, required flakiness, unavailable infrastructure after bounded recovery, failed cleanup, unreliable execution, or budget truncation yields `TEST_BLOCKED`.
@@ -207,11 +206,23 @@ Create `.prizmkit/test/evidence/<evidence-id>/` from the package template with:
207
206
  - `contracts/` snapshots
208
207
  - derived `test-report.md`
209
208
 
210
- Hash baseline, diff, the stable source snapshot, inventoried source/tests/contracts/lockfiles, environment, plan, and every evidence file. Runtime state, evidence output, linked Agent worktrees, Git metadata, and bytecode caches are outside source identity; evidence files remain independently content-addressed through `manifest.json`. Set `environment_claim=mocked-code-level-only`.
209
+ Hash baseline, diff, inventoried source/tests/contracts/lockfiles, environment, plan, and every evidence file. Evidence files remain individually content-addressed through `manifest.json`. Set `environment_claim=mocked-code-level-only`.
211
210
 
212
211
  ### 9. EVIDENCE_VALIDATE
213
212
 
214
- Run:
213
+ The validator runs in two passes:
214
+
215
+ **First pass (pre-check, no `--attest`):**
216
+
217
+ ```bash
218
+ python3 ${SKILL_DIR}/scripts/validate_test_evidence.py \
219
+ --evidence-dir .prizmkit/test/evidence/<evidence-id> \
220
+ --project-root <target-project-root>
221
+ ```
222
+
223
+ If this pre-check finds errors, fix them in the package before the second pass. The validator checks every authoritative record against its shipped schema, live target inventories, patch/diff binding, stage dependencies, changed-file/module-root/exclusion/Regression Ring cross-links, generated-test snapshots, planned-test execution links, runner-generated receipts/request/raw-output hashes, successful behavior-risk mappings, proof-linked isolated failures/current successes, production/unknown external-target safety, cleanup, and package integrity.
224
+
225
+ **Second pass (attestation, with `--attest`):**
215
226
 
216
227
  ```bash
217
228
  python3 ${SKILL_DIR}/scripts/validate_test_evidence.py \
@@ -220,7 +231,7 @@ python3 ${SKILL_DIR}/scripts/validate_test_evidence.py \
220
231
  --attest
221
232
  ```
222
233
 
223
- The validator checks every authoritative record against its shipped schema, live target inventories, patch/diff binding, stage dependencies, changed-file/module-root/exclusion/Regression Ring cross-links, generated-test snapshots, planned-test execution links, runner-generated receipts/request/raw-output hashes, successful behavior-risk mappings, proof-linked isolated failures/current successes, production/unknown external-target safety, cleanup, and package integrity. `--attest` writes an integrity/protocol attestation, not proof against a malicious same-permission producer. Use builder replay when feasible to rerun recorded requests and create new linked receipts. Store validation output. Tampering, schema/identity/hash mismatch, source/test/lockfile drift, missing matrix mappings, wrong execution order, invalid differential proof, cleanup failure, unjustified structured N/A, unresolved risk, or a false real-environment claim fails validation. `TEST_PASS` requires validator success and means code-level evidence is replayable and validated under this protocol.
234
+ `--attest` writes an integrity/protocol attestation into `validation.json`, re-derives `test-report.md`, re-hashes final records in `manifest.json`, then runs a **second** strict validation against the refreshed package. A package is not a `TEST_PASS` until this second strict validation succeeds. Use builder replay when feasible to rerun recorded requests and create new linked receipts. Store validation output. Tampering, schema/identity/hash mismatch, source/test/lockfile drift, missing matrix mappings, wrong execution order, invalid differential proof, cleanup failure, unjustified structured N/A, unresolved risk, or a false real-environment claim fails validation.
224
235
 
225
236
  ## Resume and Idempotency
226
237
 
@@ -20,7 +20,7 @@
20
20
  "additionalProperties": false,
21
21
  "required": ["kind", "source", "observations"],
22
22
  "properties": {
23
- "kind": { "enum": ["manifest", "runner-config", "filesystem", "contract", "lockfile", "import-graph", "caller-analysis", "project-doc", "model-analysis"] },
23
+ "kind": { "enum": ["manifest", "runner-config", "filesystem", "contract", "lockfile", "import-graph", "caller-analysis", "project-doc", "model-analysis", "shared-contract", "source-inspection", "field-analysis", "runner-inspection", "dependency-scan", "audit-log", "api-spec", "tool-probe"] },
24
24
  "source": { "type": "string", "minLength": 1 },
25
25
  "observations": { "$ref": "#/$defs/stringArray" }
26
26
  }
@@ -104,7 +104,7 @@
104
104
  "required": ["name", "kind", "files", "planned_test_ids", "discovery_evidence"],
105
105
  "properties": {
106
106
  "name": { "type": "string", "minLength": 1 },
107
- "kind": { "enum": ["caller", "consumer", "shared-contract", "state-dependency"] },
107
+ "kind": { "enum": ["caller", "consumer", "shared-contract", "state-dependency", "api-spec", "documentation"] },
108
108
  "files": { "$ref": "#/$defs/stringArray" },
109
109
  "planned_test_ids": { "$ref": "#/$defs/stringArray" },
110
110
  "discovery_evidence": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/discoveryEvidence" } }
@@ -215,6 +215,31 @@
215
215
  "plan_inputs": { "type": "object", "minProperties": 1 }
216
216
  }
217
217
  },
218
+ "changeCapture": {
219
+ "type": "object",
220
+ "additionalProperties": false,
221
+ "required": ["capture_format", "baseline_commit", "patch_path", "patch_sha256", "changed_files"],
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
+ }
242
+ },
218
243
  "testPlan": {
219
244
  "type": "object",
220
245
  "additionalProperties": false,
@@ -250,16 +275,68 @@
250
275
  "project_path": { "$ref": "#/$defs/path" },
251
276
  "snapshot_path": { "type": ["string", "null"] },
252
277
  "inventory_path": { "$ref": "#/$defs/path" },
253
- "layers": { "$ref": "#/$defs/stringArray" }
278
+ "layers": { "$ref": "#/$defs/stringArray" },
279
+ "selector": { "type": "string", "minLength": 1 },
280
+ "runner": { "type": "string", "minLength": 1 }
254
281
  }
255
282
  }
256
283
  }
257
284
  }
258
285
  },
286
+ "testPreparationRequest": {
287
+ "type": "object",
288
+ "additionalProperties": false,
289
+ "required": ["request_version", "layers", "tests"],
290
+ "properties": {
291
+ "request_version": { "const": "1.0" },
292
+ "layers": {
293
+ "type": "array",
294
+ "minItems": 5,
295
+ "items": {
296
+ "type": "object",
297
+ "additionalProperties": false,
298
+ "required": ["name", "required", "not_applicable"],
299
+ "properties": {
300
+ "name": { "enum": ["focused", "module-component", "contract-integration", "affected-module-regression", "regression-ring"] },
301
+ "required": { "type": "boolean" },
302
+ "not_applicable": { "type": ["object", "null"] }
303
+ }
304
+ }
305
+ },
306
+ "tests": {
307
+ "type": "array",
308
+ "minItems": 1,
309
+ "items": {
310
+ "type": "object",
311
+ "additionalProperties": false,
312
+ "required": ["project_path", "behavior_ids", "layers"],
313
+ "properties": {
314
+ "project_path": { "$ref": "#/$defs/path" },
315
+ "behavior_ids": { "$ref": "#/$defs/stringArray" },
316
+ "layers": { "$ref": "#/$defs/stringArray" },
317
+ "selector": { "type": "string", "minLength": 1 },
318
+ "runner": { "type": "string", "minLength": 1 }
319
+ }
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "testPreparation": {
325
+ "type": "object",
326
+ "additionalProperties": false,
327
+ "required": ["format", "request_path", "request_sha256", "tests", "changed_test_statuses"],
328
+ "properties": {
329
+ "format": { "const": "prizmkit-native-test-preparation-v1" },
330
+ "request_path": { "$ref": "#/$defs/path" },
331
+ "request_sha256": { "$ref": "#/$defs/sha256" },
332
+ "tests": { "type": "array", "minItems": 1, "items": { "type": "object" } },
333
+ "changed_test_statuses": { "type": "object", "additionalProperties": { "enum": ["added", "modified"] } }
334
+ }
335
+ },
259
336
  "executionRequest": {
260
337
  "type": "object",
261
338
  "additionalProperties": false,
262
- "required": ["request_version", "purpose", "command", "cwd", "environment", "tool_version_commands", "layer", "test_ids", "external_targets"],
339
+ "required": ["request_version", "purpose", "command", "cwd", "environment", "tool_version_commands", "layer", "external_targets"],
263
340
  "properties": {
264
341
  "request_version": { "const": "1.0" },
265
342
  "purpose": { "type": "string", "minLength": 1 },
@@ -269,6 +346,8 @@
269
346
  "tool_version_commands": { "type": "object" },
270
347
  "layer": { "enum": ["focused", "module-component", "contract-integration", "affected-module-regression", "regression-ring", "lightweight"] },
271
348
  "test_ids": { "type": "array", "items": { "type": "string", "minLength": 1 } },
349
+ "test_paths": { "type": "array", "items": { "$ref": "#/$defs/path" } },
350
+ "auto_bind": { "type": "boolean" },
272
351
  "external_targets": { "type": "array", "items": { "$ref": "#/$defs/externalTarget" } },
273
352
  "timeout_seconds": { "type": "number", "exclusiveMinimum": 0 },
274
353
  "attempt_policy": { "type": "object" },
@@ -294,6 +373,8 @@
294
373
  "tool_versions": { "type": "object" },
295
374
  "layer": { "enum": ["focused", "module-component", "contract-integration", "affected-module-regression", "regression-ring", "lightweight"] },
296
375
  "test_ids": { "type": "array", "items": { "type": "string", "minLength": 1 } },
376
+ "test_paths": { "type": "array", "items": { "$ref": "#/$defs/path" } },
377
+ "auto_bind": { "type": "boolean" },
297
378
  "external_targets": { "type": "array", "items": { "$ref": "#/$defs/externalTarget" } },
298
379
  "exit_code": { "type": "integer" },
299
380
  "stdout_path": { "$ref": "#/$defs/path" },
@@ -316,14 +397,13 @@
316
397
  {
317
398
  "type": "object",
318
399
  "additionalProperties": false,
319
- "required": ["request_version", "behavior_id", "method", "execution_request", "baseline_commit", "current_tree_sha256", "mutation_patch_path", "test_overlay_paths", "expected_failure_signals"],
400
+ "required": ["request_version", "behavior_id", "method", "execution_request", "baseline_commit", "mutation_patch_path", "test_overlay_paths", "expected_failure_signals"],
320
401
  "properties": {
321
402
  "request_version": { "const": "1.0" },
322
403
  "behavior_id": { "type": "string", "minLength": 1 },
323
404
  "method": { "enum": ["baseline", "controlled-mutation"] },
324
405
  "execution_request": { "$ref": "#/$defs/executionRequest" },
325
406
  "baseline_commit": { "type": "string", "minLength": 1 },
326
- "current_tree_sha256": { "$ref": "#/$defs/sha256" },
327
407
  "mutation_patch_path": { "type": ["string", "null"] },
328
408
  "test_overlay_paths": { "$ref": "#/$defs/stringArray" },
329
409
  "expected_failure_signals": { "$ref": "#/$defs/stringArray" }
@@ -365,7 +445,7 @@
365
445
  "items": {
366
446
  "type": "object",
367
447
  "additionalProperties": false,
368
- "required": ["behavior_id", "classification", "method", "differential_request_path", "differential_request_sha256", "baseline_commit", "current_tree_sha256", "baseline_execution_id", "mutation_execution_id", "current_execution_id", "failure_reason_matched", "cleanup_succeeded", "project_tree_before_sha256", "project_tree_after_sha256", "isolation_tree_sha256", "mutation_apply_sha256", "mutation_restore_sha256", "not_applicable"],
448
+ "required": ["behavior_id", "classification", "method", "differential_request_path", "differential_request_sha256", "baseline_commit", "baseline_execution_id", "mutation_execution_id", "current_execution_id", "failure_reason_matched", "cleanup_succeeded", "isolation_tree_sha256", "mutation_apply_sha256", "mutation_restore_sha256", "not_applicable"],
369
449
  "properties": {
370
450
  "behavior_id": { "type": "string", "minLength": 1 },
371
451
  "classification": { "enum": ["PROVEN", "NOT_APPLICABLE", "UNPROVEN"] },
@@ -373,14 +453,11 @@
373
453
  "differential_request_path": { "type": ["string", "null"] },
374
454
  "differential_request_sha256": { "type": ["string", "null"] },
375
455
  "baseline_commit": { "type": ["string", "null"] },
376
- "current_tree_sha256": { "type": ["string", "null"] },
377
456
  "baseline_execution_id": { "type": ["string", "null"] },
378
457
  "mutation_execution_id": { "type": ["string", "null"] },
379
458
  "current_execution_id": { "type": ["string", "null"] },
380
459
  "failure_reason_matched": { "type": "boolean" },
381
460
  "cleanup_succeeded": { "type": "boolean" },
382
- "project_tree_before_sha256": { "type": ["string", "null"] },
383
- "project_tree_after_sha256": { "type": ["string", "null"] },
384
461
  "isolation_tree_sha256": { "type": ["string", "null"] },
385
462
  "mutation_apply_sha256": { "type": ["string", "null"] },
386
463
  "mutation_restore_sha256": { "type": ["string", "null"] },
@@ -4,6 +4,7 @@
4
4
  "init",
5
5
  "capture-change",
6
6
  "inventory",
7
+ "prepare-tests",
7
8
  "execute",
8
9
  "differential",
9
10
  "finalize",
@@ -18,6 +19,7 @@
18
19
  "environment": "environment.json",
19
20
  "behavior_risk_matrix": "behavior-risk-matrix.json",
20
21
  "test_plan": "test-plan.json",
22
+ "test_preparation": "test-preparation.json",
21
23
  "infrastructure_changes": "infrastructure-changes.json",
22
24
  "differential_proof": "differential-proof.json",
23
25
  "executions": "executions.json",
@@ -14,7 +14,6 @@ Store those values as `evidence_id_inputs` in `manifest.json`. Record separate a
14
14
 
15
15
  Use two separate integrity domains:
16
16
 
17
- - **Stable source snapshot:** hash behavior-bearing project files while excluding runtime-managed `.prizmkit/state/`, evidence output under `.prizmkit/test/evidence/`, linked `.claude/worktrees/`, Git metadata, and Python bytecode caches. Builder and validator use the same deterministic exclusion policy, and isolated current execution is copied from that same snapshot scope.
18
17
  - **Evidence package:** hash each evidence record through `manifest.json`; any report, receipt, raw output, request, or proof mutation remains detectable even though evidence output is outside source identity.
19
18
 
20
19
  Runtime-only churn must not invalidate a source proof. Drift in an inventoried source, test, contract, or lockfile must still fail live inventory validation. Never replace a completed proof's stable snapshot identity with a later hash of the mutable parent workspace.
@@ -25,9 +24,9 @@ Hashes and validator receipts provide byte-level binding and drift detection, no
25
24
 
26
25
  ## Existing Tests and Package Finalization
27
26
 
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. `generated-tests/` is a snapshot area for added or modified repository-native tests only; it may be empty when existing tests cover the behavior.
27
+ 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
28
 
30
- The canonical package lifecycle is `init → capture-change → inventory → execute/differential → finalize → render-report → validate --attest → resume`. Builder commands own `source-change.patch`, receipts, raw outputs, manifest, verdict, and report. The validator alone owns `validation.json`. 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.
29
+ 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
30
 
32
31
 
33
32
  Run exactly these states in order:
@@ -138,7 +137,7 @@ For each added or changed necessary behavior test, prove the test:
138
137
  2. If baseline execution is inapplicable (for example, the public behavior did not exist), apply a minimal controlled mutation tied to the same matrix risk, observe failure, restore it completely, and observe current success.
139
138
  3. Record `PROVEN`, justified `NOT_APPLICABLE`, or `UNPROVEN`.
140
139
 
141
- Record baseline/current/mutation runner receipt IDs, request hash, baseline commit, stable source-snapshot and isolation hashes, mutation apply/restore hashes, expected failure signal match, and source-snapshot cleanup result. Necessary `UNPROVEN` behavior prevents `TEST_PASS`.
140
+ Record baseline/current/mutation runner receipt IDs, request hash, baseline commit, isolation hashes, mutation apply/restore hashes, expected failure signal match, and cleanup result. Necessary `UNPROVEN` behavior prevents `TEST_PASS`.
142
141
 
143
142
  ### EVIDENCE_PACKAGE
144
143
 
@@ -169,7 +168,7 @@ python3 ${SKILL_DIR}/scripts/validate_test_evidence.py \
169
168
 
170
169
  When feasible, replay recorded requests through `build_test_evidence.py execute --replay-receipt ...`. Replay performs a new real execution and emits a new linked receipt; it does not pretend the attestation establishes what historically ran.
171
170
 
172
- The validator checks all shipped JSON schemas, evidence-directory identity, live target-project inventories and aggregate hashes, stable source-snapshot identity with runtime paths excluded, changed-file/module-root/exclusion/Regression Ring cross-links, patch/diff binding, stage output ownership and predecessor hashes, generated-test snapshot existence, planned test/inventory/execution linkage, module/matrix completeness, successful selected runner receipts with request/raw-output binding, proof-linked isolated failures/current successes, controlled-mutation apply/restoration hashes, cleanup, structured N/A and obvious signal conflicts, production/unknown external-target safety, strict verdict semantics, and honest mocked-versus-real claims. `TEST_PASS` requires deterministic validator success.
171
+ The validator checks all shipped JSON schemas, evidence-directory identity, live target-project inventories and aggregate hashes, changed-file/module-root/exclusion/Regression Ring cross-links, patch/diff binding, stage output ownership and predecessor hashes, generated-test snapshot existence, planned test/inventory/execution linkage, module/matrix completeness, successful selected runner receipts with request/raw-output binding, proof-linked isolated failures/current successes, controlled-mutation apply/restoration hashes, cleanup, structured N/A and obvious signal conflicts, production/unknown external-target safety, strict verdict semantics, and honest mocked-versus-real claims. `TEST_PASS` requires deterministic validator success.
173
172
 
174
173
  ## Resume and Invalidation
175
174
 
@@ -6,7 +6,7 @@ Load this reference when writing an inventory, execution, differential, resume,
6
6
 
7
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
8
 
9
- Use existing project-native tests first. A test plan must identify each test as `existing`, `added`, or `modified`; only the latter two may receive a `generated-tests/` snapshot. Existing tests are executed from their repository paths and do not need generated snapshots. `test-plan.json` is the sole authority for test IDs, and execution requests with unknown IDs are rejected by the builder.
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
10
 
11
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
12
 
@@ -48,11 +48,11 @@ Record:
48
48
 
49
49
  - behavior ID and model-selected `baseline` or `controlled-mutation` method;
50
50
  - the nested execution request;
51
- - actual baseline commit and the stable source-snapshot hash produced with the builder's runtime exclusions;
51
+ - actual baseline commit;
52
52
  - mutation patch path when applicable;
53
53
  - concrete expected failure signals.
54
54
 
55
- The builder creates isolated copies from the same stable source-snapshot scope, executes the failing and current sides, records receipts, binds the differential request hash, and verifies that behavior-bearing project content is unchanged. Runtime state, evidence output, linked Agent worktrees, Git metadata, and Python bytecode caches do not participate in source identity. A proof is `PROVEN` only when the intended failure signal appears, the failing side exits nonzero, current exits zero, and cleanup/snapshot checks pass.
55
+ The builder copies project content into isolated temporary directories for differential execution, hashes each isolated tree via `isolation_tree_sha256`, and records the hashed evidence files in `manifest.json`. Source drift between capture and validation is detected through change-capture freshness checks (inventory changed_files vs canonical capture) and resume invalidation (live target hashes vs manifest). Runtime state, evidence output, linked Agent worktrees, Git metadata, and Python bytecode caches are excluded from the isolated copy. The builder does not hash the mutable live project tree during differential execution.
56
56
 
57
57
  ## Structured N/A
58
58
 
@@ -4,7 +4,7 @@ Use this reference during `INFRA_READY`, `TEST_BUILD`, and `EXECUTE_PROVE`. The
4
4
 
5
5
  ## Existing-Test-First Rule
6
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 or modify a repository-native test only when a concrete behavior gap is identified and recorded in the test plan. Mark each test `existing`, `added`, or `modified`; only `added` and `modified` tests are copied into `generated-tests/`. An unchanged existing test has no generated snapshot.
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
8
 
9
9
 
10
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.
@@ -32,7 +32,7 @@ For every behavior row:
32
32
  1. Read the public interface, contract source, preconditions, inputs/boundaries, outputs, side effects, transitions, and errors.
33
33
  2. Inspect existing test assertions—not names—to find proven cells.
34
34
  3. Assess all eight risks: functional, boundary, permission, concurrency, idempotency, time, dependency, and consumer.
35
- 4. For every applicable risk, create a distinct test ID and expected execution layer.
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.
36
36
  5. For every non-applicable risk, record a concrete rationale tied to this behavior.
37
37
  6. Keep unresolved truth or untestable necessary behavior explicit; it blocks rather than becoming guessed expected behavior.
38
38