cliewen-openspec 0.1.0-alpha.1 → 0.2.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +87 -54
  2. package/README.md +106 -104
  3. package/adapters/node-test.mjs +21 -4
  4. package/dist/cli.js +7 -31
  5. package/dist/compatibility.d.ts +12 -0
  6. package/dist/compatibility.js +87 -0
  7. package/dist/core.d.ts +23 -4
  8. package/dist/core.js +107 -35
  9. package/dist/quality.d.ts +27 -0
  10. package/dist/quality.js +412 -0
  11. package/dist/release.d.ts +9 -0
  12. package/dist/release.js +23 -0
  13. package/dist/schema-source.js +1 -1
  14. package/docs/configuration.md +317 -265
  15. package/docs/testing/evidence.md +88 -86
  16. package/docs/testing/pilot-prompt.md +1 -1
  17. package/docs/testing/test-quality.md +84 -0
  18. package/package.json +9 -5
  19. package/schemas/all/templates/tasks.md +1 -5
  20. package/schemas/base/instructions/closure.md +33 -0
  21. package/schemas/base/instructions/humanizer.md +7 -0
  22. package/schemas/base/instructions/learnings.md +6 -0
  23. package/schemas/base/instructions/planning.md +31 -0
  24. package/schemas/base/instructions/product-context.md +31 -0
  25. package/schemas/base/instructions/prototyping.md +33 -0
  26. package/schemas/base/instructions/routing.md +1 -0
  27. package/schemas/base/instructions/testing-approach.md +14 -13
  28. package/schemas/base/instructions/work-scoping.md +12 -0
  29. package/schemas/base/instructions/writing.md +8 -0
  30. package/schemas/base/templates/learning.md +19 -0
  31. package/schemas/delivery/instructions/apply.md +2 -1
  32. package/schemas/delivery/instructions/tasks.md +3 -2
  33. package/schemas/delivery/templates/tasks.md +5 -7
  34. package/schemas/discovery/instructions/apply.md +1 -0
  35. package/schemas/discovery/instructions/investigation.md +1 -0
  36. package/dist/tdd.d.ts +0 -8
  37. package/dist/tdd.js +0 -276
@@ -1,86 +1,88 @@
1
- ---
2
- type: testing
3
- ---
4
- # Evidence alpha contract
5
-
6
- The alpha supports `init`, `update`, `uninstall`, `ac next`, `ac rename-prefix`, `check`, and `recover`, and installs `cliewen-delivery`, `cliewen-discovery`, and `cliewen-all`. Package CI exercises OpenSpec 1.15.0 on Windows and Linux. Existing-registry adapters, structural checks for your project's documentation and Mermaid, and independent review tooling remain planned.
7
-
8
- Initialize OpenSpec first. Install this package from a locally built tarball. Run `cliewen-openspec init --default` to explicitly select delivery; omit `--default` to preserve the existing schema. `--root PATH` supports an explicit target, and `init --dry-run` makes no changes.
9
-
10
- Register a capability-to-prefix mapping, then allocate IDs using `cliewen-openspec ac next --capability export`. Keep the committed `.cliewen-openspec/ac-registry.json`; numbers are never reclaimed. This initial allocator supports sequential work; parallel branches must resolve collisions. Do not use it alongside another allocator until an adapter exists.
11
-
12
- `ac.capabilities` maps each OpenSpec capability to its prefix. `ac.padding` controls minimum digit width (default 3). Use `ac rename-prefix CAPABILITY PREFIX` to change an established prefix while retaining its sequence and historical references. See [configuration](../configuration.md) for prefix selection and the default per-task testing workflow.
13
-
14
- After implementing and committing the project inputs, run the reference adapter with explicit Node test paths:
15
-
16
- ```text
17
- node node_modules/cliewen-openspec/adapters/node-test.mjs --change add-export test/export.test.mjs
18
- cliewen-openspec check --change add-export --json
19
- ```
20
-
21
- Finish README changes, task notes, results, and any PR draft before the final commit. Collect and check on that clean HEAD. A later commit makes the report stale even if it changes only documentation or metadata; collect and check again after that commit. Keep collection logs outside tracked/untracked inputs, such as a project-local ignored directory.
22
-
23
- Report the final tested revision and check result in the terminal handoff or an ignored file. A tracked record can describe an earlier tested revision, labeled as historical. Writing the latest revision into that record and committing it creates another revision that needs fresh evidence.
24
-
25
- Tests use titles such as `exports rows [EXPORT-001] [Test-type: Unit]`. The reference adapter supports one AC tag and requires exactly one configured test-type tag per mapped test title. It records the declared type, real Node TAP results, and the runner exit code, so failures outside mapped tests also block the check. Reports must be Git-ignored and untracked. The adapter rejects dirty input revisions and changes during execution, and invalidates older evidence when a new run starts. A crash cannot leave an earlier passing report usable.
26
-
27
- ```json
28
- {
29
- "version": 1,
30
- "revision": "<full Git commit>",
31
- "scope": {"change": "add-export"},
32
- "execution": {"exitCode": 0},
33
- "results": [
34
- {"scenario":"EXPORT-001","test":"exports rows","testType":"Unit","outcome":"passed"}
35
- ]
36
- }
37
- ```
38
-
39
- Allowed outcomes: passed, failed, skipped, pending and manual. Pending requires a reason; `--fail-on-pending` makes it blocking. Manual results are reported as warnings and are never described as automated proof. Report schema failures exit 2; failed checks exit 1; checks without errors exit 0. Reviewed sufficiency remains explicitly unassessed in this slice.
40
-
41
- `check --change NAME` checks active delta scenarios (REMOVED scenarios are excluded). Without it, check all permanent specs. OpenSpec retains responsibility for semantic merging. After archive changes the tree, commit and regenerate evidence without the adapter's `--change` before checking permanent specs.
42
-
43
- ## Collect evidence for one change
44
-
45
- Pass `--change NAME` once to the Node adapter, followed by explicit test file paths. It runs every test in those files, then includes only results whose AC IDs appear in the selected change's delta specs. This supports files containing both existing tests and tests for the current change. The flag selects report results, not which tests execute.
46
-
47
- The report records `scope: {"change": "NAME"}` and the full runner exit code. A failure in any executed test, including an unmapped test or a test outside the change, still produces a failing runner status and blocks `check`. AC-tagged tests across the run must have valid test-type metadata, including tests filtered out of the report.
48
-
49
- Run `check --change` with the same name. A named report used for another change or for permanent specs produces `evidence-scope-mismatch`, even if its IDs overlap. Scoped reports require `execution.exitCode`. The report envelope remains version 1.
50
-
51
- Without the adapter flag, collection retains all mapped results and omits `scope`, preserving the existing behavior. Reports without scope metadata remain accepted; the checker still detects unrelated or missing scenario references. The checker cannot infer a collection scope that an older report does not declare.
52
-
53
- The adapter exits 0 when the runner passes, 1 when it fails with reportable results, and 2 for collection errors. Missing change specs, invalid names or options, no selected scenarios, no matching results, and incomplete runner execution are collection errors. Once collection starts from valid clean inputs and an ignored output path, an earlier report is removed before scope validation and execution, so failed recollection cannot reuse a previous pass. Scenario completeness and exact test-type matching remain the checker's responsibility.
54
-
55
- The current alpha validates installation hashes and evidence only. Enabling other features supplies schema guidance, not implemented structural validators. The schema does not add a post-implementation artifact as an apply prerequisite. Archive is deliberately performed with OpenSpec, after reviewing evidence.
56
-
57
- For `cliewen-discovery` changes, `check --change NAME` reads the schema selection from OpenSpec metadata and checks installation and registry health only. With evidence enabled, it reports `discovery-review-required` instead of requesting a product test report. Review research sources, actual observations, uncertainty, and the recommendation yourself. An `ok: true` result does not validate discovery documents or prove product behavior. See [the discovery guide](../guide/discovery.md).
58
-
59
- For `cliewen-all`, check first validates decision frontmatter and the outcome branch. Delivery needs accepted status and must not skip specs, then follows this product evidence contract. No-change or further-investigation needs native `skip_specs: true` and no Markdown product deltas; it reports `discovery-review-required` without assessing product evidence. Outcome consistency and accepted-status checks remain active if evidence is disabled. Metadata cannot prove real human approval. See [the combined guide](../guide/all.md).
60
-
61
- ## Troubleshooting
62
-
63
- | Finding or error | What to do |
64
- |---|---|
65
- | `evidence-not-configured` | Commit inputs, run the test adapter, and check that `evidence.report` points to its output |
66
- | `stale-evidence` | Regenerate the report after committing the intended inputs; archive also changes the revision |
67
- | `unverifiable-evidence` | Resolve tracked and untracked changes, then commit and rerun; confirm the project has a Git HEAD |
68
- | `test-failed`, `test-skipped`, or `runner-failed` | Inspect real test output, fix failures, and collect a new report; do not edit a report to claim a pass |
69
- | `missing-ac-id` or `missing-evidence` | Check scenario headings and bracketed IDs in test titles; supply a test result for each selected scenario |
70
- | `unknown-ac-reference` | Use the matching `--change` scope or collect a report containing only the scenarios being checked |
71
- | `evidence-scope-mismatch` | Collect for the requested change and pass the same name to `check`; after archive, recollect without the adapter's `--change` for permanent specs |
72
- | `duplicate-ac-id` or `duplicate-test-result` | Inspect duplicate scenario identities or repeated test result entries before recollecting |
73
- | `pending-without-reason` | Record why execution is pending; use `--fail-on-pending` when pending work must block |
74
- | `owned-file-modified` | Review edits to installer-owned files; update replaces unmodified owned content and rejects conflicting local edits. See the update guide |
75
- | `invalid-ac-registry` | Restore a manually changed prefix mapping and use `ac rename-prefix`; preserve the registry and reserved numbers |
76
- | `interrupted-transaction` | Run `cliewen-openspec recover`, then review the restored files |
77
- | Adapter says the output is not ignored | Add the custom report path to `.gitignore`; default output is ignored by init |
78
- | `sufficiency-not-assessed` | Expected informational finding; review whether assertions actually establish the scenarios |
79
-
80
- A `manual` result is reported as a warning and does not become automated proof. The current format records free-text context, not a reviewed-sufficiency verdict. A pending result with a reason also remains a warning unless explicitly made blocking.
81
-
82
- Each selected scenario requires exactly one nonempty `Test-type` line. Each result requires `testType`, including pending and manual results. Types must belong to `testing.types` and match the scenario exactly. Findings are `invalid-scenario-test-type`, `missing-test-type`, `unknown-test-type`, and `test-type-mismatch`. Fix the scenario or test metadata, commit, and recollect evidence. Reports without types must be regenerated. The report envelope remains version 1 with stricter result checks.
83
-
84
- The adapter records explicit metadata; it cannot establish whether a test actually exercises the claimed boundary. Review that boundary and task descriptions alongside assertions. See [test-type configuration](../configuration.md#test-types).
85
-
86
- TDD execution history is separate from this final-result report. When `testing.approach: tdd` is selected, `check --change NAME` also requires completed task metadata and recorded command/file snapshots, even if product evidence is disabled. A passing report cannot establish a missing red phase. See [TDD recording and completion checks](../configuration.md#test-driven-development); assertion quality and failure causes still require review.
1
+ ---
2
+ type: testing
3
+ ---
4
+ # Execution evidence and review
5
+
6
+ Version `0.2.0` provides the execution checks below and [test quality and lifecycle checks](test-quality.md), using optional case metadata in the same version-1 report. Policies default to advisory review. Case counts and reviewed statuses do not establish semantic correctness.
7
+
8
+ The candidate supports `init`, `update`, `uninstall`, `ac next`, `ac rename-prefix`, `check`, and `recover`, and installs `cliewen-delivery`, `cliewen-discovery`, and `cliewen-all`. Package CI exercises OpenSpec 1.15.0 on Windows and Linux. Existing-registry adapters, structural checks for your project's documentation and Mermaid, and independent review tooling remain planned.
9
+
10
+ Initialize OpenSpec first, then install the local `cliewen-openspec-0.2.0.tgz` built in [Your first change](../guide/getting-started.md). Run `cliewen-openspec init --default` to explicitly select delivery; omit `--default` to preserve the existing schema. `--root PATH` supports an explicit target, and `init --dry-run` makes no changes. The earlier npm alpha is not the package exercised by this contract.
11
+
12
+ Register a capability-to-prefix mapping, then allocate IDs using `cliewen-openspec ac next --capability export`. Keep the committed `.cliewen-openspec/ac-registry.json`; numbers are never reclaimed. This initial allocator supports sequential work; parallel branches must resolve collisions. Do not use it alongside another allocator until an adapter exists.
13
+
14
+ `ac.capabilities` maps each OpenSpec capability to its prefix. `ac.padding` controls minimum digit width (default 3). Use `ac rename-prefix CAPABILITY PREFIX` to change an established prefix while retaining its sequence and historical references. See [configuration](../configuration.md) for prefix selection and the default per-task testing workflow.
15
+
16
+ After implementing and committing the project inputs, run the reference adapter with explicit Node test paths:
17
+
18
+ ```text
19
+ node node_modules/cliewen-openspec/adapters/node-test.mjs --change add-export test/export.test.mjs
20
+ cliewen-openspec check --change add-export --json
21
+ ```
22
+
23
+ Finish README changes, task notes, results, and any PR draft before the final commit. Collect and check on that clean HEAD. A later commit makes the report stale even if it changes only documentation or metadata; collect and check again after that commit. Keep collection logs outside tracked/untracked inputs, such as a project-local ignored directory.
24
+
25
+ Report the final tested revision and check result in the terminal handoff or an ignored file. A tracked record can describe an earlier tested revision, labeled as historical. Writing the latest revision into that record and committing it creates another revision that needs fresh evidence.
26
+
27
+ Tests use titles such as `exports rows [EXPORT-001] [Test-type: Unit]`. The reference adapter supports one AC tag and requires exactly one configured test-type tag per mapped test title. It records the declared type, real Node TAP results, and the runner exit code, so failures outside mapped tests also block the check. Reports must be Git-ignored and untracked. The adapter rejects dirty input revisions and changes during execution, and invalidates older evidence when a new run starts. A crash cannot leave an earlier passing report usable.
28
+
29
+ ```json
30
+ {
31
+ "version": 1,
32
+ "revision": "<full Git commit>",
33
+ "scope": {"change": "add-export"},
34
+ "execution": {"exitCode": 0},
35
+ "results": [
36
+ {"scenario":"EXPORT-001","test":"exports rows","testType":"Unit","outcome":"passed"}
37
+ ]
38
+ }
39
+ ```
40
+
41
+ Allowed outcomes: passed, failed, skipped, pending and manual. Pending requires a reason; `--fail-on-pending` makes it blocking. Manual results are reported as warnings and are never described as automated proof. Report schema failures exit 2; failed checks exit 1; checks without errors exit 0. Reviewed sufficiency remains explicitly unassessed.
42
+
43
+ `check --change NAME` checks active delta scenarios (REMOVED scenarios are excluded). Without it, check all permanent specs. OpenSpec retains responsibility for semantic merging. After archive changes the tree, commit and regenerate evidence without the adapter's `--change` before checking permanent specs.
44
+
45
+ ## Collect evidence for one change
46
+
47
+ Pass `--change NAME` once to the Node adapter, followed by explicit test file paths. It runs every test in those files, then includes only results whose AC IDs appear in the selected change's delta specs. This supports files containing both existing tests and tests for the current change. The flag selects report results, not which tests execute.
48
+
49
+ The report records `scope: {"change": "NAME"}` and the full runner exit code. A failure in any executed test, including an unmapped test or a test outside the change, still produces a failing runner status and blocks `check`. AC-tagged tests across the run must have valid test-type metadata, including tests filtered out of the report.
50
+
51
+ Run `check --change` with the same name. A named report used for another change or for permanent specs produces `evidence-scope-mismatch`, even if its IDs overlap. Scoped reports require `execution.exitCode`. The report envelope remains version 1.
52
+
53
+ Without the adapter flag, collection retains all mapped results and omits `scope`, preserving the existing behavior. Reports without scope metadata remain accepted; the checker still detects unrelated or missing scenario references. The checker cannot infer a collection scope that an older report does not declare.
54
+
55
+ The adapter exits 0 when the runner passes, 1 when it fails with reportable results, and 2 for collection errors. Missing change specs, invalid names or options, no selected scenarios, no matching results, and incomplete runner execution are collection errors. Once collection starts from valid clean inputs and an ignored output path, an earlier report is removed before scope validation and execution, so failed recollection cannot reuse a previous pass. Scenario completeness and exact test-type matching remain the checker's responsibility.
56
+
57
+ The candidate validates installation version/hashes, registry state, execution evidence, and configured test-policy records. It does not authenticate the semantic quality or approval of a review. Enabling documentation features supplies schema guidance, not document-structure validators. The schema does not add a post-implementation artifact as an apply prerequisite. Archive is deliberately performed with OpenSpec, after reviewing evidence.
58
+
59
+ For `cliewen-discovery` changes, `check --change NAME` reads the schema selection from OpenSpec metadata and checks installation and registry health only. With evidence enabled, it reports `discovery-review-required` instead of requesting a product test report. Review research sources, actual observations, uncertainty, and the recommendation yourself. An `ok: true` result does not validate discovery documents or prove product behavior. See [the discovery guide](../guide/discovery.md).
60
+
61
+ For `cliewen-all`, check first validates decision frontmatter and the outcome branch. Delivery needs accepted status and must not skip specs, then follows this product evidence contract. No-change or further-investigation needs native `skip_specs: true` and no Markdown product deltas; it reports `discovery-review-required` without assessing product evidence. Outcome consistency and accepted-status checks remain active if evidence is disabled. Metadata cannot prove real human approval. See [the combined guide](../guide/all.md).
62
+
63
+ ## Troubleshooting
64
+
65
+ | Finding or error | What to do |
66
+ |---|---|
67
+ | `evidence-not-configured` | Commit inputs, run the test adapter, and check that `evidence.report` points to its output |
68
+ | `stale-evidence` | Regenerate the report after committing the intended inputs; archive also changes the revision |
69
+ | `unverifiable-evidence` | Resolve tracked and untracked changes, then commit and rerun; confirm the project has a Git HEAD |
70
+ | `test-failed`, `test-skipped`, or `runner-failed` | Inspect real test output, fix failures, and collect a new report; do not edit a report to claim a pass |
71
+ | `missing-ac-id` or `missing-evidence` | Check scenario headings and bracketed IDs in test titles; supply a test result for each selected scenario |
72
+ | `unknown-ac-reference` | Use the matching `--change` scope or collect a report containing only the scenarios being checked |
73
+ | `evidence-scope-mismatch` | Collect for the requested change and pass the same name to `check`; after archive, recollect without the adapter's `--change` for permanent specs |
74
+ | `duplicate-ac-id` or `duplicate-test-result` | Inspect duplicate scenario identities or repeated test result entries before recollecting |
75
+ | `pending-without-reason` | Record why execution is pending; use `--fail-on-pending` when pending work must block |
76
+ | `owned-file-modified` | Review edits to installer-owned files; update replaces unmodified owned content and rejects conflicting local edits. See the update guide |
77
+ | `invalid-ac-registry` | Restore a manually changed prefix mapping and use `ac rename-prefix`; preserve the registry and reserved numbers |
78
+ | `interrupted-transaction` | Run `cliewen-openspec recover`, then review the restored files |
79
+ | Adapter says the output is not ignored | Add the custom report path to `.gitignore`; default output is ignored by init |
80
+ | `sufficiency-not-assessed` | Expected informational finding; review whether assertions actually establish the scenarios |
81
+
82
+ A `manual` result is reported as a warning and does not become automated proof. The current format records free-text context, not a reviewed-sufficiency verdict. A pending result with a reason also remains a warning unless explicitly made blocking.
83
+
84
+ Each selected scenario requires exactly one nonempty `Test-type` line. Each result requires `testType`, including pending and manual results. Types must belong to `testing.types` and match the scenario exactly. Findings are `invalid-scenario-test-type`, `missing-test-type`, `unknown-test-type`, and `test-type-mismatch`. Fix the scenario or test metadata, commit, and recollect evidence. Reports without types must be regenerated. The report envelope remains version 1 with stricter result checks.
85
+
86
+ The adapter records explicit metadata; it cannot establish whether a test actually exercises the claimed boundary. Review that boundary and task descriptions alongside assertions. See [test-type configuration](../configuration.md#test-types).
87
+
88
+ Execution reports establish observed outcomes and revision freshness. Follow [evidence-first verification](../configuration.md#evidence-first-verification) to plan acceptance cases, assess assertion quality, and maintain tests. Historical recorder logs are preserved but no longer gate completion.
@@ -17,4 +17,4 @@ The prompt describes the task and the review boundary. The schema supplies the w
17
17
 
18
18
  During review, assess whether the agent follows the schema without additional workflow instructions, whether the scenarios cover the requested behavior, and whether uncertainties become visible before implementation. With the default testing configuration, each implementation task should include its own tests and completion check.
19
19
 
20
- The user reported that the first pilot worked. This is informal feedback; detailed pilot results have not been recorded here.
20
+ A successful copied example does not establish that an agent can implement or verify a new change. Review an agent-authored result against the requested behavior and actual evidence.
@@ -0,0 +1,84 @@
1
+ ---
2
+ type: reference
3
+ ---
4
+ # Test quality and lifecycle
5
+
6
+ These checks are included in `0.1.0`. The earlier published `0.1.0-alpha.1` does not include them. They assess case declarations and review records. You still review whether assertions prove the intended behavior.
7
+
8
+ ## Choose the checks your project needs
9
+
10
+ Coverage, effectiveness, and lifecycle each have an independent mode: `off`, `review` (the default), or `enforce`. Review produces warnings; enforce makes incomplete or invalid records blocking and requires evidence enabled. See [configuration](../configuration.md#test-quality-and-lifecycle) for defaults and overrides.
11
+
12
+ Add case tags to Node tests, alongside their existing scenario and test type:
13
+
14
+ ```js
15
+ test('parses one [COUNT-001] [Test-type: Unit] [Case: ordinary] [Coverage: positive]', () => {
16
+ assert.equal(count('1'), 1);
17
+ });
18
+ ```
19
+
20
+ Each case needs a unique kebab-case ID within its scenario and one category: `positive`, `negative`, or `boundary`. Passing distinct cases count toward configured minima. Retries, skipped tests, manual results, wrong test types, and stale evidence do not count. Missing or ambiguous tags remain visible in the report; review mode does not stop collection because of optional metadata.
21
+
22
+ ## Plan interacting cases
23
+
24
+ Some requirements depend on both the input and the selected option. Before implementation, identify those interactions and choose combinations that could expose a behavior failure. A preservation claim needs exact assertions for relevant default, disabled, and enabled paths, using content that could be changed accidentally.
25
+
26
+ For example, an optional text prefix must preserve caller content whether prefix insertion is enabled or disabled. Testing ordinary text with insertion disabled and unusual characters only with insertion enabled leaves an interaction untested. Include that content on the other relevant paths and compare the complete expected output.
27
+
28
+ Use a small table in the acceptance plan when it helps. Explain why combinations matter and disclose those left untested. Exhaustive combinations are not required, and unsupported inputs need no invented behavior. Case counts alone do not show that these interactions are covered. This is agent planning and review guidance; `check` does not infer missing combinations from test code.
29
+
30
+ ## Record what you reviewed
31
+
32
+ For a change named `add-count`, author `.cliewen-openspec/reviews/change-add-count.yaml`. For permanent specs, use `.cliewen-openspec/reviews/specs.yaml`. These are project documents, preserved by update and uninstall.
33
+
34
+ The record contains `version: 1`, matching `scope` (`{change: add-count}` or `{specs: true}`), a full Git `baseline` commit, an `inputs` mapping, and `effectiveness`, `lifecycle`, and `exceptions` lists. Unknown fields are rejected. The baseline must be available locally and an ancestor of HEAD.
35
+
36
+ Inputs map inspected paths to SHA-256 digests of Git blob bytes. Include configuration, assessed specs, change tasks when present, tests, implementation, and relevant helpers or dependency files. Use `null` for an inspected file removed by the change. Exclude the review record itself.
37
+
38
+ Lifecycle comparison reads the permanent spec set as well as the change's deltas, so include all current permanent spec files when that policy is active.
39
+
40
+ To calculate a digest, stage the intended files, then run this in your project, replacing `src/count.mjs` with an inspected path:
41
+
42
+ ```sh
43
+ git add .
44
+ node --input-type=module -e 'import {execFileSync} from "node:child_process"; import {createHash} from "node:crypto"; console.log(createHash("sha256").update(execFileSync("git", ["show", ":src/count.mjs"])).digest("hex"));'
45
+ ```
46
+
47
+ After authoring the record, commit project inputs, recollect execution evidence, and run `check` as usual. Changed declared inputs invalidate the review. Undeclared dependencies can escape this check, so review dependency completeness. Every commit still requires fresh execution evidence, including edits to review prose.
48
+
49
+ ### Assertion effectiveness
50
+
51
+ Each assessment identifies `scenario`, `cases`, `testFiles`, `sourceFiles`, `method` (`controlled-fault` or `behavior-failure`), `assertion`, `defect`, `command` (an argument list), `observation`, `failureKind`, and `status`.
52
+
53
+ Only `failureKind: behavior` with `status: reviewed` satisfies the obligation. Setup and unrelated failures do not demonstrate assertion effectiveness. Referenced test/source files must have inspected input digests; case IDs must exist in the report. One relevant experiment can cover several cases. Commands are recorded evidence and are never executed by `check`.
54
+
55
+ Choose a fault that exercises the input and path being assessed. Credit only assertions that actually fail: an enabled-path failure does not prove detection on a disabled path, and a loop that stops at its first failure does not demonstrate later assertions. Restore the intended behavior and rerun the relevant tests before collecting final evidence.
56
+
57
+ ### Test maintenance and retirement
58
+
59
+ Lifecycle entries identify `scenario`, `change` (`unchanged`, `modified`, or `retired`), `reason`, `status`, and affected `tests`. Each test declares `file`, its exact `test` name, `action` (`retain`, `update`, `remap`, or `remove`), and `remainingScenarios`. Remapping also needs `replacementScenarios` with passing evidence.
60
+
61
+ Retirement needs `retirement: {status: accepted, source: PATH}` pointing to an inspected document recording agreement. A missing criterion alone never authorizes test removal. Removing a shared test while it declares active obligations is rejected. Retain or remap those assertions instead. Out-of-scope retained obligations require review and verification with the full suite and permanent evidence; a change-scoped report does not prove their execution individually.
62
+
63
+ The checker projects added, modified, and removed requirement blocks against permanent specs, including removal blocks without scenario text. Requirement renames currently produce an unresolved-lifecycle finding; use review mode until rename projection is supported. Refactoring still needs a reviewed disposition or scoped exception for affected unchanged criteria. Review whether the impact analysis found all affected tests.
64
+
65
+ For delivery refactoring with no behavior delta, native `skip_specs: true` selects permanent scenarios for scoped execution evidence and lifecycle checks. Keep the change free of product delta files. This preserves test obligations without inventing new requirements.
66
+
67
+ ### Scoped exceptions
68
+
69
+ Exceptions declare `policy`, `scenario`, `reason`, and `status: reviewed`. Coverage exceptions also name `category`. They waive only that category minimum or the named scenario's effectiveness/lifecycle review obligation. Duplicate or unknown references are invalid. Exceptions cannot waive explicit retirement, removal of active assertions, failed execution, stale results, installation checks.
70
+
71
+ ## Resolve findings
72
+
73
+ | Finding | Action |
74
+ |---|---|
75
+ | `coverage-metadata-missing` / `coverage-case-invalid` | Correct tags and recollect results |
76
+ | `coverage-minimum-unmet` | Add meaningful cases or review a scoped exception |
77
+ | `test-review-missing` / `test-review-invalid` | Author or correct the record and commit it |
78
+ | `test-review-scope-mismatch` | Use the record matching the command |
79
+ | `test-review-stale` | Reinspect changed inputs and update their digests |
80
+ | `effectiveness-unreviewed` | Review a relevant failure or a justified exception |
81
+ | `lifecycle-unresolved` / `retirement-unaccepted` | Explain affected tests and establish retirement agreement |
82
+ | `active-test-removal` | Preserve or remap active assertions |
83
+
84
+ After archive, refresh the permanent-spec review and its input paths before claiming enforced permanent checks. Recollect evidence after committing it. Discovery-only and genuine no-delivery combined changes do not require product-quality records. A reviewed status records a claim; it cannot authenticate who approved it.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "cliewen-openspec",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.2.0",
4
4
  "description": "OpenSpec workflows with durable decisions and behavioral evidence",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/flemming-n-larsen/cliewen-openspec.git"
9
+ "url": "git+https://github.com/cliewen-openspec/cliewen-openspec.git"
10
10
  },
11
- "homepage": "https://flemming-n-larsen.github.io/cliewen-openspec/",
11
+ "homepage": "https://cliewen-openspec.github.io/cliewen-openspec/",
12
12
  "engines": {
13
13
  "node": ">=20.19.0"
14
14
  },
@@ -24,16 +24,20 @@
24
24
  "LICENSE",
25
25
  "docs/configuration.md",
26
26
  "docs/testing/evidence.md",
27
+ "docs/testing/test-quality.md",
27
28
  "docs/testing/pilot-prompt.md"
28
29
  ],
29
30
  "scripts": {
30
- "build": "tsc",
31
+ "build": "node scripts/clean-retired-build.mjs && tsc",
31
32
  "test": "npm run build && node --test test/*.test.mjs",
32
33
  "prepack": "npm run build",
33
34
  "docs:build": "npm run build && node scripts/build-docs.mjs",
34
35
  "docs:serve": "node scripts/serve-docs.mjs",
35
36
  "docs:check": "node scripts/check-docs-browser.mjs",
36
37
  "trial:prepare": "node scripts/prepare-csv-bom-trial.mjs",
38
+ "trial:knowledge:prepare": "node scripts/prepare-knowledge-writing-trial.mjs",
39
+ "trial:quality:prepare": "node scripts/prepare-quality-lifecycle-trial.mjs",
40
+ "trial:quality:combined": "node scripts/prepare-combined-quality-trial.mjs",
37
41
  "trial:discovery": "node scripts/prepare-csv-discovery-trial.mjs",
38
42
  "eval:check": "npm run build && node scripts/check-agent-evaluation.mjs",
39
43
  "trial:all": "node scripts/prepare-csv-all-trial.mjs",
@@ -44,7 +48,7 @@
44
48
  "yaml": "2.9.1"
45
49
  },
46
50
  "devDependencies": {
47
- "@fission-ai/openspec": "1.15.0",
51
+ "@fission-ai/openspec": "1.17.0",
48
52
  "@types/node": "26.6.6",
49
53
  "jsdom": "26.1.0",
50
54
  "markdown-it": "15.0.3",
@@ -1,13 +1,9 @@
1
1
  # Tasks
2
2
 
3
- <!-- Read decision.md first. For delivery, use small implementation tasks with each task's concrete test/type/boundary and configured placement/TDD. For no-change or further-investigation, list only actual review, documentation retention, or experiment cleanup; no fake implementation or product tests. -->
4
-
5
- <!-- For delivery with testing.approach: tdd, include one fenced yaml cliewen-tasks block (version: 1, tasks keyed by every numbered checkbox ID). Each task declares method, command argument list, explicit tests/implementation file lists, and a reason for an exception. Record start and actual runs through the tdd CLI. No-delivery closure does not need this metadata or product execution history. -->
3
+ <!-- Read decision.md first. Delivery uses planned acceptance cases and verified small tasks. Investigation-only outcomes use genuine review and closure work, without invented product tests. -->
6
4
 
7
5
  ## Work and completion checks
8
6
 
9
7
  ## Final review
10
8
 
11
9
  ## Workflow follow-up
12
-
13
- <!-- Delivery: finish and verify numbered tasks, then commit, collect evidence, and run the completion check on clean final HEAD; repeat after any later commit. Keep collection and check outside numbered checkboxes and recorded task commands. Archive needs its own authorization. No delivery: preserve skip_specs: true and review the recommendation before authorized archive --skip-specs. -->
@@ -0,0 +1,33 @@
1
+ # Close a Cliewen change
2
+
3
+ Use native OpenSpec status and the selected change's metadata to establish its schema, outcome, and resolved paths. Apply this reference to cliewen-delivery, cliewen-discovery, and cliewen-all changes. For other schemas, continue their native workflow. Read .cliewen-openspec/config.yaml and respect existing project conventions and authorization. This reference is advisory agent guidance, not a CLI hook or proof that review happened.
4
+
5
+ ## Before archive
6
+
7
+ Compare the actual result with the agreed scope, delta specs, and unresolved work. Preserve deferred obligations at the project's selected authority when planning is enabled. Review only affected records; useful findings can stay in an existing handoff or document. No separate closure report, new decision, lesson, or empty index is required when it adds no useful information.
8
+
9
+ Use the shared manual-step and observation guidance in .cliewen-openspec/planning.md independently of its optional planning settings. Automate feasible authorized checks before asking for manual work, explain any residual human need, and retain actual observation context and limits in existing records. Distinguish agent checks, human feedback, change approval, and release authorization. Reassess observations affected by later changes; manual evidence retains its existing warnings and freshness requirements. Missing feedback alone adds no routine approval gate.
10
+
11
+ With features.documentation enabled, reconcile affected explanations, architecture/design documents, examples, and links with the delivered result, using docsRoot and existing paths. With features.decisions enabled, maintain relevant Decision Records and their genuine acceptance status. Disabled facilities impose no matching optional work and preserve authored files.
12
+
13
+ For affected product intent or journeys, follow .cliewen-openspec/product-context.md. Reconcile enabled documentation with actual behavior and keep desired outcomes distinct from implementation and observed user results. Surface drift or additional wishes through existing scope rules; archive does not authorize them or establish user success.
14
+
15
+ With learnings.enabled and features.documentation enabled, follow the installed learning guidance: read the index before selecting notes, verify against current authority, retain only reusable evidence-backed observations, and merge or retire stale guidance in place. Otherwise skip learning retrieval and maintenance.
16
+
17
+ For delivery, apply the existing coverage, assertion-effectiveness, lifecycle, and evidence policies independently. Off skips its matching policy; review discloses unresolved findings and enforce resolves blocking findings. Preserve valid and shared active assertions. Remove obsolete assertions only following explicit accepted retirement, retain reserved IDs, and refresh review records when their inputs change. Evidence failures stay blocking when evidence is enabled.
18
+
19
+ For discovery or a combined no-change/further-investigation outcome, retain actual findings, uncertainty, recommendation, decision status, and experiment cleanup results. Follow that workflow's native skip-specs contract. These findings do not establish unimplemented product behavior and require no synthetic product execution evidence. Existing outcome consistency and approval rules still apply.
20
+
21
+ Obtain the required archive authorization without asking again when it was already given. Follow native OpenSpec synchronization and archive, using resolved paths and explicit user choices. Report pending synchronization honestly if the selected native route leaves specs unsynchronized. Do not infer acceptance, ticket completion, deployment, or Git integration from archive alone.
22
+
23
+ ## After the native operation
24
+
25
+ Inspect the actual result, archive destination, and permanent specs. If archive or synchronization failed or completed only part of the work, inspect current paths and changed files before retrying. State what actually changed, what remains, and the next action; do not report full closure or blindly repeat the operation. A failed or partial operation does not establish successful completion for planning purposes.
26
+
27
+ After successful archive, repair affected moved-file links and preserve useful knowledge at its established locations. With features.planning enabled, use .cliewen-openspec/planning.md to reassess affected tickets or plan items against actual results, dependencies, and the project's completion criteria. Seek direction for material changes in agreed scope. Prepare the next detailed proposal only when that work is selected. With planning disabled, skip ticket access and plan maintenance.
28
+
29
+ Use existing authorized ticket tools when applicable. Distinguish read access, write capability, and authorization. If access is read-only, unavailable, fails, or lacks authorization, report the archive result and concrete pending update separately without claiming ticket closure. A ticket may require additional deployment or human verification before completion.
30
+
31
+ For delivered behavior with evidence enabled, finish all intended tracked closure edits, commit the reviewed inputs, then recollect evidence for permanent specs without the Node adapter's --change flag and run Cliewen check. Archive or any later commit makes earlier revision-bound reports historical until refreshed. Keep reports ignored and untracked. Report the actual tested revision and check outcome; pending verification remains pending. No-delivery outcomes retain their own review contract.
32
+
33
+ Finish with a brief handoff: actual archive location, spec synchronization result, remaining work or pending updates, and relevant verification limits. Use existing records rather than a mandatory new artifact.
@@ -0,0 +1,7 @@
1
+ Read writing.humanizer (default auto; values auto, on, off). With off, Cliewen requests no skill discovery, use, installation suggestion, or Humanizer status; baseline writing rules and independent host mandates still apply.
2
+ With auto or on, inspect the host's exposed skills/capabilities for a usable Humanizer skill, including namespaced forms. Read and apply its instructions before claiming use. A listing or file alone does not prove invocation is permitted. Do not scan global directories or infer absence when inventory is unavailable.
3
+ A failed load of a guessed skill name without an inventory entry establishes neither detection nor absence. Report availability unknown and describe the failed invocation separately; reserve detected but inaccessible for a skill the host actually identifies. Do not combine these states into an ambiguous status.
4
+ When first handling prose under this policy, give the user one brief status per session: actually used; detected but inaccessible; confirmed absent; or availability unknown. Wait until availability and any actual application are known; do not announce an intention to use the skill and then announce its use again. Detection without application must never be reported as use. Keep the status out of project artifacts and do not repeat it in later replies.
5
+ For confirmed absence, combine a once-per-session installation suggestion with the status, linking https://github.com/blader/humanizer#installation and current host instructions. Respect an existing refusal. For unknown inventory or unavailable invocation, describe that limitation without claiming absence or successful use. On explicitly requests use but remains nonblocking when unavailable. Continue with baseline guidance in every fallback.
6
+ Never install/update skills, enable plugins, or modify global configuration automatically. Re-evaluate in a new session; no persistent machine-wide detection cache is required.
7
+ Apply the skill to all authored prose, including proposals, specs, tasks, guides, comments, docstrings, commit and PR descriptions, messages, and replies. Preserve code behavior, requirements, commands, identifiers, examples, links, and structured syntax. Check factual claims after rewriting; stylistic editing does not establish correctness. See the installed docs/configuration.md for defaults and limits.
@@ -0,0 +1,6 @@
1
+ Read learnings.enabled (default false), learnings.directory (default learnings, relative to docsRoot), and features.documentation. If learnings are disabled or documentation guidance is disabled, skip lesson retrieval and maintenance; preserve authored files.
2
+ When active, read only the collection's index first, in a separate tool call from note contents. Use its scope and status to select relevant active note paths, then open those selected files. Do not batch the index with notes, glob-read the collection, or include unselected notes in broad content searches. Filename listings are allowed. If the index lacks enough detail, ask for clarification or report that limitation; do not resolve it by reading everything. A missing index is an empty collection; do not create an empty directory or require a lesson for every task.
3
+ Skip unrelated and retired note contents during ordinary work. For an explicit lesson-maintenance task, select the affected current and historical notes from the index first; reading a retired note to review its history does not make its advice authoritative. Preserve unrelated notes.
4
+ Check applicable notes against current specs, accepted decisions, and source evidence. Tentative notes need verification; retired notes do not guide work. Even verified lessons never override current project authorities. Reference an established knowledge authority elsewhere instead of copying it.
5
+ At closure, retain only useful reusable observations. Use the installed .cliewen-openspec/templates/learning.md for new notes, while preserving existing formats and paths. Record situation, observed mistake, evidence/source, correction, scope, limits, and last verification when verified. Link the note from the existing index, or create a short README.md index with title, scope, status, and link when a first useful note exists.
6
+ Merge duplicates by linking a canonical note and retiring old ones in place with reasons. Retire stale guidance without deleting its history; promote recurring lessons into suitable tests, rules, or durable documents. Never invent evidence or turn lessons into new requirements or approval authority. This is agent guidance, not a structural or factual content validator.
@@ -0,0 +1,31 @@
1
+ # Scope work from the project's plan
2
+
3
+ Read .cliewen-openspec/config.yaml. Apply the installed shared work-scoping guidance below for change assessment, assumptions, and resumption. These are agent instructions; they do not establish that assessment or approval happened.
4
+
5
+ ## Before context collection
6
+
7
+ Read this reference and configuration before broad project-content reads or searches. Do not batch that initial read with project documents or lesson contents. Resolve the learning policy before collecting further context, independently of features.planning.
8
+
9
+ Read learnings.enabled (default false) and features.documentation. If either disables learning guidance, skip the collection and preserve authored notes. Otherwise resolve the collection under docsRoot (default docs) and learnings.directory (default learnings). Read only its README.md index in a separate tool call, use scope and status to select relevant active notes, then open selected notes in a later call. Exclude unselected and retired notes from ordinary broad reads and searches. Missing or insufficient index information is a limitation to report, not permission to read the whole collection. Follow the selected workflow's full learning-maintenance instructions when retrieved.
10
+
11
+ After resolving this policy and selecting any relevant lessons, gather the remaining context needed for the task. Planning may be disabled while learning guidance remains enabled; its planning opt-out below does not skip this context policy.
12
+
13
+ ## Optional product context
14
+
15
+ After resolving the context policy above, use .cliewen-openspec/product-context.md when relevant intent or a cross-capability journey helps assess the work. Existing supplied context can inform scope independently of optional plan maintenance. features.documentation controls optional record maintenance; features.planning controls ticket/plan access. Routine work needs no new record.
16
+
17
+ ## Optional planning
18
+
19
+ For optional prototype experiments after resolving the context policy, use .cliewen-openspec/prototyping.md. Its user-selection and native-workflow rules apply independently of features.planning; understood work requires no experiment.
20
+
21
+ Read features.planning (default true). When false, skip planning-authority discovery, ticket access, and plan maintenance; preserve authored documents. Behavior scoping, relevant verification, and existing approval boundaries still apply.
22
+
23
+ When enabled and planning is useful, use one project-selected authority: its existing ticket system or a lightweight local plan using existing paths and conventions. Record the chosen system and project/backlog reference in that authority or an existing project reference. Link to it from the proposal when relevant. Keep goals and milestones together if sufficient; separate goal documents and a backlog for standalone tasks are optional.
24
+
25
+ Keep dependent future deliveries as tickets or plan items with purpose, desired outcome, scope, and known dependencies. Prepare their detailed proposals when actionable using current knowledge. For an oversized proposal, narrow the current delivery, preserve rationale and deferred obligations in the authority, and reconcile current artifacts. Reference ticket status at its source rather than maintaining a second status list.
26
+
27
+ Discover suitable ticket access through the host's exposed MCP servers, connectors, or CLI capabilities. Distinguish read access, write capability, and authorization for the particular action. The user connects services and grants access; credentials alone do not authorize writes. Use existing authorization and project policy rather than requesting it again when already given.
28
+
29
+ If discovery is unavailable, report availability as unknown. If a tool is missing, inaccessible, or fails, report what was actually observed, explain the needed connection when known, and provide links or concrete pending manual updates. Do not claim an unperformed update succeeded or infer that a hidden integration does not exist. Do not install integrations or change host configuration automatically.
30
+
31
+ Use descriptive OpenSpec kebab-case change names. Preserve original ticket IDs and descriptive links in proposal content when applicable, and preserve existing names and paths.
@@ -0,0 +1,31 @@
1
+ # Keep changes connected to the user's outcome
2
+
3
+ Use relevant agreed product context during scoping, design, investigation, review, and closure. Keep the explanation proportional to the decision. Routine understood work needs no new goal, journey, interview, approval step, or explanation for skipping them.
4
+
5
+ ## Reuse the intent
6
+
7
+ Look first at relevant context already supplied or available in the project's authoritative product brief, README, documents, or selected planning authority. Link to the existing source instead of copying its facts or status. Preserve paths, identifiers, and lifecycle meanings. Resolve learning policy before broader context collection as described in .cliewen-openspec/planning.md.
8
+
9
+ Use the known audience, problem, desired outcome, constraints, and supported success signals needed for this change. Keep missing intent or metrics unknown; do not invent accepted goals, numerical targets, or user research from implementation details. Clarify consequential missing information through existing project authority. A qualitative goal does not require a fabricated metric.
10
+
11
+ ## Explain a journey only when it helps
12
+
13
+ For consequential work across capabilities, describe the actor's starting need, relevant steps and handoffs, meaningful failure/recovery paths, and intended outcome. Use a short explanation with a diagram when it makes the path clearer; a table or prose can suffice. Do not require a complete product map, separate goal file, or journey ID.
14
+
15
+ Link behavioral rules to authoritative OpenSpec specs with descriptive titles and, when useful, exact scenario IDs alongside their meaning. Do not copy the rules into the journey, allocate parallel acceptance IDs, or use a journey as product execution evidence. Label aspirational steps and identify missing or contradictory spec behavior for normal change assessment. A desired recovery step does not establish that it exists.
16
+
17
+ ## Detect drift and scope creep
18
+
19
+ Compare consequential emerging work with the agreed problem, user outcome, and delivery scope. Surface an approach that no longer serves that outcome; do not rewrite the goal to justify work that has drifted.
20
+
21
+ Distinguish a necessary in-scope correction from an additional wish. An idea can support the product goal while remaining outside this delivery. Use existing work-scoping rules to retain deferred work in the selected authority when features.planning is enabled and obtain direction before materially expanding agreed scope. With planning disabled, report the additional scope in the current handoff without creating a backlog. A goal or journey does not authorize extra work. Ordinary authorized implementation choices proceed independently with relevant verification.
22
+
23
+ ## Respect settings and preserve useful knowledge
24
+
25
+ With features.documentation enabled, create or maintain a durable intent/journey explanation only when useful, using configured docsRoot or existing project locations and conventions. Keep each fact in one authoritative home and link to it. Existing records may be sufficient. Without an existing convention, optional examples include product-intent.md and journeys/<name>.md under docsRoot; installation creates neither.
26
+
27
+ With features.documentation disabled, add no optional intent/journey creation or maintenance requests and preserve authored files. Relevant context already supplied can still inform ordinary scoping and native behavioral specs. Ticket discovery, access, and plan updates independently follow features.planning and the existing planning reference; documentation guidance does not enable ticket access when planning is disabled. Report unavailable external context and pending authorized updates honestly, without inventing their contents or claiming updates succeeded.
28
+
29
+ Before archive, reconcile only affected explanations with the actual delivery under the enabled settings. Preserve unresolved/deferred work at its existing authority. Follow .cliewen-openspec/closure.md for native archive and moved-link maintenance.
30
+
31
+ Keep desired outcomes, implemented behavior, and actual observations distinct. Passing capability tests, a completed diagram, and archive alone do not prove user success or human approval. State when no actual user feedback was collected; label illustrative feedback and proposed outcomes. Discovery and combined no-delivery findings require no fabricated product evidence or delivery proposal. Reuse existing project approval and evidence boundaries.
@@ -0,0 +1,33 @@
1
+ # Try a bounded prototype
2
+
3
+ Use a prototype when something concrete can resolve material uncertainty. First inspect available evidence and clarify questions that can be answered directly. Suggest an experiment only when a specific remaining question can change the solution. Users can also request one directly. Clear, understood work proceeds normally without a prototype, interview, or explanation for skipping them.
4
+
5
+ ## Agree the experiment
6
+
7
+ Describe the question, expected learning, estimated effort, proposed workspace and outputs, meaningful time/resource limits, and the decision the result will inform. Clarify material missing limits. The user chooses whether to proceed. Reuse sufficient existing agreement within its scope instead of asking for the same permission again. If the user declines, continue ordinary clarification or planning and retain relevant uncertainty; do not create the prototype. Stop affected work and seek direction before materially expanding scope or resources.
8
+
9
+ Existing optional grill-me guidance applies. Suggest the interview when useful and use it on user request through exposed host capabilities. Neither availability nor an interview starts or authorizes a prototype. A prototype does not require the interview. If the skill is unavailable or declined, normal clarification remains available.
10
+
11
+ ## Follow the native handoff
12
+
13
+ Native OpenSpec explore is read-only for code. Keep conversational sketches and read-only inspection there; name the supported change handoff and obtain any capture confirmation required by that workflow before writing experimental code or prototype files. Do not bypass explore's rules by calling the code temporary.
14
+
15
+ Recommend a short cliewen-discovery change for the agreed experiment before a separate delivery proposal. Use its existing proposal to state the question, limits, workspace, and decision criteria; run the bounded experiment during investigation and record its findings in investigation.md. A small experiment needs only a concise investigation proposal, not premature production specs or delivery tasks. If cliewen-all is explicitly selected, use its investigation and preserve its existing decision boundary before product implementation. Follow the selected workflow's native instructions and paths; add no new schema or prototype artifact prerequisite.
16
+
17
+ ## Work within the agreed boundary
18
+
19
+ Use the agreed isolated experimental workspace, preferably an existing ignored project-local scratch location. Keep alternatives identifiable and label mock data, stubs, unsupported behavior, and checks honestly. Preserve production code, product acceptance tests, permanent specs, AC allocation, and capability mappings during investigation. Prototype checks establish observations about the experiment, not acceptance of unimplemented product behavior.
20
+
21
+ Describe actual isolation: an ignored directory or prompt instruction is not an OS-enforced sandbox. Existing project authority and external-action permissions still apply. Prototype agreement does not authorize production changes, purchases, installation, external access, or publication outside its described scope. Apply any permission already given to the required actions without redundant confirmation.
22
+
23
+ If a limit is reached, a check fails, or a measurement is invalid, record the actual outcome and what remains unknown. Do not report a stopped or unperformed experiment as successful. Reassess conclusions based on invalid measurements.
24
+
25
+ ## Preserve findings and choose the next step
26
+
27
+ Use the existing investigation artifact to record method, inputs or revision, observations, actual user feedback and its source, agent interpretation, remaining uncertainty, and the next decision. Missing feedback is not positive feedback or approval. Distinguish supplied example feedback from a live user observation. Native investigation artifacts remain available even when optional documentation or planning is disabled.
28
+
29
+ With features.planning enabled, reference or update the selected planning authority using existing access and authorization; do not duplicate ticket status. When disabled, skip ticket access and plan maintenance and preserve authored files. With learnings.enabled and features.documentation enabled, follow the index-first learning policy and retain only useful reusable findings. Otherwise skip optional lesson maintenance. An experiment does not require a new decision record, lesson, or separate report when existing records suffice.
30
+
31
+ Use the findings to proceed, investigate further, choose an alternative, or stop. Record whether prototype code is discarded, retained as reference, or reviewed for further development. Respect the agreed cleanup scope and preserve authored work that should remain. Prototype code is not automatically production-ready.
32
+
33
+ If a delivery is selected, carry relevant findings and limits into its current proposal or the combined workflow's decision/specs. Review reused code and verify the actual delivery contract. Preserve existing approval and archive boundaries; an agreed experiment or positive result is not approval of a later production delivery.
@@ -1,4 +1,5 @@
1
1
  Read .cliewen-openspec/config.yaml before applying feature-specific guidance.
2
+ Before broad document reads or content searches, resolve the learning policy and select any relevant notes from their index as described below. Do not preload the learning collection as general project context.
2
3
  Disabled facilities impose no additional work.
3
4
  Read relevant existing specs, documents and accepted Decision Records.
4
5
  Never invent intent.