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.
- package/CHANGELOG.md +87 -54
- package/README.md +106 -104
- package/adapters/node-test.mjs +21 -4
- package/dist/cli.js +7 -31
- package/dist/compatibility.d.ts +12 -0
- package/dist/compatibility.js +87 -0
- package/dist/core.d.ts +23 -4
- package/dist/core.js +107 -35
- package/dist/quality.d.ts +27 -0
- package/dist/quality.js +412 -0
- package/dist/release.d.ts +9 -0
- package/dist/release.js +23 -0
- package/dist/schema-source.js +1 -1
- package/docs/configuration.md +317 -265
- package/docs/testing/evidence.md +88 -86
- package/docs/testing/pilot-prompt.md +1 -1
- package/docs/testing/test-quality.md +84 -0
- package/package.json +9 -5
- package/schemas/all/templates/tasks.md +1 -5
- package/schemas/base/instructions/closure.md +33 -0
- package/schemas/base/instructions/humanizer.md +7 -0
- package/schemas/base/instructions/learnings.md +6 -0
- package/schemas/base/instructions/planning.md +31 -0
- package/schemas/base/instructions/product-context.md +31 -0
- package/schemas/base/instructions/prototyping.md +33 -0
- package/schemas/base/instructions/routing.md +1 -0
- package/schemas/base/instructions/testing-approach.md +14 -13
- package/schemas/base/instructions/work-scoping.md +12 -0
- package/schemas/base/instructions/writing.md +8 -0
- package/schemas/base/templates/learning.md +19 -0
- package/schemas/delivery/instructions/apply.md +2 -1
- package/schemas/delivery/instructions/tasks.md +3 -2
- package/schemas/delivery/templates/tasks.md +5 -7
- package/schemas/discovery/instructions/apply.md +1 -0
- package/schemas/discovery/instructions/investigation.md +1 -0
- package/dist/tdd.d.ts +0 -8
- package/dist/tdd.js +0 -276
package/CHANGELOG.md
CHANGED
|
@@ -1,55 +1,88 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
Changes that matter to projects using Cliewen for OpenSpec.
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Changes that matter to projects using Cliewen for OpenSpec.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.2.0 (2026-11-13)
|
|
8
|
+
|
|
9
|
+
- Agents now assess automation before requesting manual work and explain any remaining human contribution. Shared guidance helps them prepare concise decision material and retain concrete human observations without treating feedback as release authorization. Existing configuration and evidence formats are unchanged. See [human review and verification](docs/guide/workflow.md#make-decisions-easy-to-assess).
|
|
10
|
+
|
|
11
|
+
- Optional product context helps agents keep changes connected to the agreed user outcome and identify drift or scope creep. Useful cross-capability journeys link to OpenSpec rules, while routine tasks need no new goal or journey document. Existing documentation and planning settings apply. See [product intent and journeys](docs/guide/workflow.md#keep-the-users-outcome-in-view).
|
|
12
|
+
|
|
13
|
+
- Installation and resource-update previews now show detected Node/OpenSpec versions, installed/target Cliewen versions, and files to create, replace, or delete. Init and update check Node 20.19+ and OpenSpec 1.15.0+ before changing files. Published 0.1.0 resources have an explicit supported update route that preserves project configuration, documents, changes, and acceptance identities. See [updating an installation](docs/guide/updating.md) for source-version limits and conflict handling.
|
|
14
|
+
|
|
15
|
+
- Agents can suggest a bounded prototype when material uncertainty needs something concrete to try. Users choose the experiment; clear tasks and declined suggestions continue normally. The installed prototype reference guides native investigative handoff, isolation, honest findings and feedback, and code disposition before delivery planning. See [optional prototypes](docs/guide/workflow.md#try-a-prototype-when-it-can-answer-a-question).
|
|
16
|
+
|
|
17
|
+
- The pre-change planning reference now explains learning-policy resolution before broad context reads, including when planning is disabled. An optional project-entry rule requests a separate initial reference read and index-first lesson selection. This guides agents; it does not enforce read order through the CLI.
|
|
18
|
+
|
|
19
|
+
- A shared closure reference helps agents maintain affected documentation, decisions, tests, and enabled learnings around archive, then revisit affected future work. Projects can opt in through OpenSpec's archive operation guidance so a separate archive session can find it. Native archive remains in OpenSpec; direct CLI calls do not execute the review. See [closure setup](docs/guide/workflow.md#close-the-change-and-preserve-useful-knowledge).
|
|
20
|
+
|
|
21
|
+
- Agents receive guidance for scoping coherent OpenSpec changes, splitting oversized proposals, and revisiting assumptions as work progresses. Optional planning uses your existing ticket system or a lightweight local plan. Ticket access uses the agent's available tools and your authorization.
|
|
22
|
+
- An installed planning reference and an optional project instruction make that guidance available before change creation. Planning can be disabled independently; authored documents are preserved. Agents can suggest a user-requested grill-me interview when available. These are review instructions, not automated guarantees of agent behavior. See [work scoping and planning](docs/guide/workflow.md#choose-the-next-delivery).
|
|
23
|
+
|
|
24
|
+
## 0.1.0 (2026-11-09)
|
|
25
|
+
|
|
26
|
+
- Optional indexed project learnings help agents retrieve relevant lessons and maintain or retire stale guidance. Notes remain project-owned and survive disabling the facility, updates, and uninstall. Learnings are off by default. Agents that gather context before reading schema instructions may need the [project instruction example](docs/configuration.md#instructions-before-context-collection).
|
|
27
|
+
- Optional Humanizer guidance defaults to automatic host discovery, with explicit on/off modes, one status per session, and a clear-writing fallback. Missing skills never block writing or install automatically. See [configuration and host limits](docs/configuration.md#humanizer-and-writing).
|
|
28
|
+
- Shared writing guidance asks agents to validate local document links before handoff and describe future files as planned paths until they exist. This requests an agent check; the CLI does not validate every Markdown link.
|
|
29
|
+
- Technical explanations should distinguish supported inputs from observed runtime behavior and describe what each verification command actually checked. These are review instructions, not an automatic guarantee of factual correctness.
|
|
30
|
+
|
|
31
|
+
- Evidence-first verification plans acceptance cases before implementation, verifies small tasks, reviews effective assertions, and maintains tests as requirements change. It records execution evidence without requiring an order of test and production edits. See [the verification approach](docs/configuration.md#evidence-first-verification).
|
|
32
|
+
- Delivery guidance asks agents to test relevant combinations of input content and options, including preservation on default and disabled paths. These combinations require review; passing case counts do not establish their coverage. See [planning interacting cases](docs/testing/test-quality.md#plan-interacting-cases).
|
|
33
|
+
|
|
34
|
+
- Independently configurable checks for positive/negative case coverage, assertion-effectiveness reviews, and test maintenance when requirements change or are retired. The default warns about missing assessments; projects can disable individual policies or make them blocking.
|
|
35
|
+
- Case IDs and coverage categories in Node test reports, plus scoped exceptions and review records tied to inspected file contents. Passing record checks still require review of assertion meaning and approval claims. See [test quality and lifecycle](docs/testing/test-quality.md) for development-source usage and limitations.
|
|
36
|
+
- The first non-prerelease release starts with the current configuration. Upgrading earlier alpha installations is outside its supported scope; authored-file preservation remains part of the installer contract.
|
|
37
|
+
|
|
38
|
+
## 0.1.0-alpha.1 (2026-11-01)
|
|
39
|
+
|
|
40
|
+
The first public alpha was published as `cliewen-openspec@0.1.0-alpha.1`, with the `alpha` tag. Its features and limitations below describe that historical snapshot. Follow the [installation guide](docs/guide/getting-started.md) for 0.1.0.
|
|
41
|
+
|
|
42
|
+
### OpenSpec workflows
|
|
43
|
+
|
|
44
|
+
Choose from three schemas, which define the documents and instructions for a change:
|
|
45
|
+
|
|
46
|
+
- `cliewen-delivery` takes an understood change through a proposal, behavior specifications, design, implementation tasks, and verification.
|
|
47
|
+
- `cliewen-discovery` helps investigate a question and recommend what to do next. The recommendation can be to make no change.
|
|
48
|
+
- `cliewen-all` combines investigation and delivery. It calls for human agreement before implementation and also supports ending an investigation without changing the product.
|
|
49
|
+
|
|
50
|
+
All three include guidance for maintaining documentation, recording durable decisions, writing clearly, and using diagrams where helpful. OpenSpec manages the change files and incorporates completed changes into the project's specifications when they are archived.
|
|
51
|
+
|
|
52
|
+
### Installation and project settings
|
|
53
|
+
|
|
54
|
+
- `init` installs the schemas and supporting resources. Preview changes before writing files, and keep your existing default schema unless you explicitly select a replacement.
|
|
55
|
+
- `update` refreshes resources installed by Cliewen. It preserves project settings and authored documents, and stops if local edits conflict with the update. Updates support recognized alpha installations; general version migrations are not available yet.
|
|
56
|
+
- `uninstall` removes unchanged resources installed by Cliewen while preserving project documents and data. Resolve active changes using those schemas first, and select a replacement if removing the default schema. Removing the npm package is a separate step.
|
|
57
|
+
- Installation commands support previews and recovery after interrupted writes. Path checks keep managed files inside the project, and file comparisons tolerate Windows line-ending conversion.
|
|
58
|
+
- Project settings let you choose the documentation directory, test workflow, and evidence report location. You can turn individual facilities on or off without deleting authored documents.
|
|
59
|
+
|
|
60
|
+
See the [configuration reference](docs/configuration.md) and [CLI guide](docs/guide/cli.md) for defaults and commands.
|
|
61
|
+
|
|
62
|
+
### Acceptance criteria and tests
|
|
63
|
+
|
|
64
|
+
- Give behavior scenarios stable acceptance criterion IDs so specifications, tests, and results can refer to the same requirement. Choose a prefix for each capability, such as `EXP-001` for an export feature. Allocate IDs and rename prefixes without reusing reserved numbers or losing historical references.
|
|
65
|
+
- Use the default Unit, Integration, and E2E test types, or define your own. Checks require the type declared by a scenario to match its test results.
|
|
66
|
+
- Test each implementation task as you go, or configure testing at the end of a change. The default allows tests before or after code.
|
|
67
|
+
- Optionally select test-driven development (TDD). The `tdd start` and `tdd run` commands record test commands, outcomes, and snapshots of declared files. Completion checks reject missing, stale, or inconsistent records. Tasks using another verification method need a reason.
|
|
68
|
+
|
|
69
|
+
### Test results before archive
|
|
70
|
+
|
|
71
|
+
The Node test adapter runs tagged tests and records which scenarios they cover, whether they passed, and the Git revision tested. You can collect results for one change while retaining the exit status of the entire test run, so failures elsewhere in that run remain visible.
|
|
72
|
+
|
|
73
|
+
Before archive, `check` reports missing or duplicate references, mismatched test types, failed or skipped tests, pending work, and manual verification. It also checks that results belong to the current committed revision and that the working tree is clean. A later commit requires fresh results, including when only documentation changed.
|
|
74
|
+
|
|
75
|
+
See the [evidence guide](docs/testing/evidence.md) for collection commands and help resolving findings.
|
|
76
|
+
|
|
77
|
+
### Guide and examples
|
|
78
|
+
|
|
79
|
+
The [user guide](docs/guide/index.md) covers installation, schema selection, existing projects, configuration, and troubleshooting. A worked CSV example takes a change through implementation, test results, and archive. The documentation site includes search, light and dark appearance, and diagrams.
|
|
80
|
+
|
|
81
|
+
### Current limitations
|
|
82
|
+
|
|
83
|
+
- Passing checks establish test execution, references, and revision freshness. You still need to review whether the assertions prove the intended behavior. Configurable case coverage and test lifecycle checks are not implemented.
|
|
84
|
+
- TDD records check the declared command and file history. They cannot prove why a test failed, prevent every code write, or authenticate the recorded history. Ordinary task-by-task testing remains agent guidance.
|
|
85
|
+
- Discovery findings and combined-workflow approval fields require review. A recorded status cannot prove that a person approved the change.
|
|
86
|
+
- Documentation and diagram guidance does not validate your project's document metadata or diagram syntax.
|
|
87
|
+
- Acceptance ID allocation supports sequential work. Parallel branches may allocate the same number and need conflict resolution.
|
|
55
88
|
- Release validation across the supported coding agents is still incomplete. Treat the package as an alpha; review its output before relying on it.
|
package/README.md
CHANGED
|
@@ -1,104 +1,106 @@
|
|
|
1
|
-
# Cliewen for OpenSpec
|
|
2
|
-
|
|
3
|
-
Durable decisions, living documentation, and evidence for OpenSpec.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
npm
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
npm install --save-dev
|
|
35
|
-
npx --no-install openspec init
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
For an existing installation, install the
|
|
59
|
-
|
|
60
|
-
Configure capability-specific AC prefixes and number padding, and choose test placement in `.cliewen-openspec/config.yaml`. Testing each implementation task before moving on is the default. Use `ac rename-prefix` to change an established prefix without resetting its sequence. See [project configuration](docs/configuration.md) for examples and prefix selection.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
After implementation, commit the project inputs and collect evidence from Node tests:
|
|
65
|
-
|
|
66
|
-
```sh
|
|
67
|
-
node node_modules/cliewen-openspec/adapters/node-test.mjs test/export.test.mjs
|
|
68
|
-
npx --no-install cliewen-openspec check --change add-export --json
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
After reviewing the assertions and evidence, archive with OpenSpec. Commit the archived state, regenerate evidence and check permanent specs. See [the evidence guide](docs/testing/evidence.md) for outcomes, pending/manual verification and current limitations.
|
|
72
|
-
|
|
73
|
-
`npm test` includes an end-to-end example which installs the packed tarball in a temporary repository, creates a real OpenSpec change, runs tagged tests, verifies failure cases, archives the change and checks that the AC ID survives. It cleans up its temporary repository afterward.
|
|
74
|
-
|
|
75
|
-
## Project documents
|
|
76
|
-
|
|
77
|
-
- [User guide source](docs/guide/index.md) and [published documentation](https://
|
|
78
|
-
- [Decisions](docs/decisions/README.md)
|
|
79
|
-
- [Changelog](CHANGELOG.md)
|
|
80
|
-
- [Project configuration](docs/configuration.md)
|
|
81
|
-
- [Pilot reference prompt](docs/testing/pilot-prompt.md)
|
|
82
|
-
- [Implementation plan](plan.md)
|
|
83
|
-
- [Practice mapping](docs/cliewen-mapping.md)
|
|
84
|
-
- [
|
|
85
|
-
- [Website](https://
|
|
86
|
-
- [Credits](CREDITS.md)
|
|
87
|
-
|
|
88
|
-
Implemented commands: `init`, `update`, `uninstall`, `ac next`, `ac rename-prefix`, `check` and `recover`. Review generated/resource changes before applying them. [Uninstall](docs/guide/uninstalling.md) preserves project data and requires an explicit replacement when removing the selected default. Tests never establish assertion quality automatically.
|
|
89
|
-
|
|
90
|
-
## Development checks
|
|
91
|
-
|
|
92
|
-
`npm test` builds TypeScript and runs unit and packed-installation integration tests. GitHub Actions runs the same suite on Windows and Linux with Node 22 and 24. These checks cover the alpha implementation; documentation semantic accuracy and assertion sufficiency still require review.
|
|
93
|
-
|
|
94
|
-
For actual agent trials, use the [CLI evaluation guide](docs/testing/cli-evaluation.md). `npm run trial:cli:prepare` creates matching projects for three pinned CLI profiles; `npm run trial:cli -- SUITE PROFILE SCHEMA` explicitly launches one case and saves raw logs. These commands use local agent authentication and may incur usage charges. CI uses fake CLIs and makes no model calls.
|
|
95
|
-
|
|
96
|
-
Build the documentation with `npm run docs:build` and preview it with `npm run docs:serve`. For browser checks, install Chromium with `npx playwright install chromium`, then run `npm run docs:check`. Documentation tooling uses Node 22.12+ (Node 22 or 24 recommended). See [documentation development](docs/guide/development.md).
|
|
97
|
-
|
|
98
|
-
## Feedback
|
|
99
|
-
|
|
100
|
-
[Report a bug](https://github.com/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
1
|
+
# Cliewen for OpenSpec
|
|
2
|
+
|
|
3
|
+
Durable decisions, living documentation, and evidence for OpenSpec.
|
|
4
|
+
|
|
5
|
+
Built on [OpenSpec](https://openspec.dev/), using its custom-schema workflows. See [Fission-AI/OpenSpec on GitHub](https://github.com/Fission-AI/OpenSpec) for the engine's source and community.
|
|
6
|
+
|
|
7
|
+
**Version `0.2.0`.** Installs `cliewen-delivery`, `cliewen-discovery`, and `cliewen-all`, allocates acceptance IDs, and checks real delivery test evidence through OpenSpec archiving. Discovery supports investigation and recommendation without required production implementation.
|
|
8
|
+
|
|
9
|
+
Version 0.2.0 adds work scoping, optional prototypes and product context, closure guidance, and guidance for automating checks and recording human observations. See [the 0.2.0 release notes](docs/releases/0.2.0-notes.md) for changes and upgrade requirements.
|
|
10
|
+
|
|
11
|
+
The package also includes [test quality and lifecycle checks](docs/testing/test-quality.md), optional project learnings, and Humanizer guidance. Follow [Your first change](docs/guide/getting-started.md) to build and install its local tarball. The published `0.1.0-alpha.1` is an earlier snapshot and does not include these additions; its manifest is not supported by 0.2.0.
|
|
12
|
+
|
|
13
|
+
## Schema collection
|
|
14
|
+
|
|
15
|
+
- **cliewen-delivery** — recommended workflow for understood changes.
|
|
16
|
+
- **cliewen-discovery** — investigation, alternatives and decision handoff.
|
|
17
|
+
- **cliewen-all** — combined discovery and delivery, with explicit no-delivery closure.
|
|
18
|
+
|
|
19
|
+
`cliewen-base` names the internal shared foundation used to build these bundles. It is not a separately selectable schema. Discovery remains the workflow for investigation and decision-making.
|
|
20
|
+
|
|
21
|
+
The shared design covers documentation, Decision Records, Mermaid, optional plans and evidence. Evidence is enabled by default. See the [discovery guide](docs/guide/discovery.md) for investigation, a no-change outcome, and delivery handoff. The package supplies documentation and decision guidance; structural metadata and Mermaid validators remain planned.
|
|
22
|
+
|
|
23
|
+
Use [the combined workflow](docs/guide/all.md) to investigate and deliver in one change, with a proposed decision and human approval before implementation. Its no-delivery branch uses native `skip_specs`, without fake product requirements.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
Requires OpenSpec 1.15.0 or newer, Node.js 20.19 or newer, and Git. The npm commands below install OpenSpec 1.17.0, which requires Node 22.12 or newer. See [version compatibility](docs/configuration.md#version-compatibility) for the Node 20 installation path. Current integration tests target OpenSpec 1.17.0; Windows and Linux CI use Node 22 and 24.
|
|
28
|
+
|
|
29
|
+
In your project, install the versioned packages and initialize OpenSpec:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install --save-dev @fission-ai/openspec@1.17.0
|
|
33
|
+
npx --no-install openspec init
|
|
34
|
+
npm install --save-dev cliewen-openspec@0.2.0
|
|
35
|
+
npx --no-install cliewen-openspec init --default
|
|
36
|
+
npx --no-install openspec new change add-export --schema cliewen-delivery
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Register the capability in `.cliewen-openspec/config.yaml`:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
ac:
|
|
43
|
+
padding: 3
|
|
44
|
+
capabilities:
|
|
45
|
+
export: EXPORT
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then allocate its first ID:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npx --no-install cliewen-openspec ac next --capability export
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`--default` explicitly selects delivery for future changes. Omit it to preserve the existing schema. `init --dry-run` previews writes. Use the generated ID in scenario headings and test titles; commit the ID registry along with specs.
|
|
55
|
+
|
|
56
|
+
The explicit version selects 0.2.0. Earlier alpha installation manifests are unsupported; use a fresh installation rather than editing a manifest version. For the complete CSV example, follow [your first change](docs/guide/getting-started.md).
|
|
57
|
+
|
|
58
|
+
For an existing installation, install the desired package version and use `cliewen-openspec update --dry-run --json`, then `cliewen-openspec update --json` after reviewing the plan. Update refreshes owned resources from supported manifests, preserving configuration, selected schemas, IDs, and authored files. See [updating an installation](docs/guide/updating.md).
|
|
59
|
+
|
|
60
|
+
Configure capability-specific AC prefixes and number padding, and choose test placement in `.cliewen-openspec/config.yaml`. Testing each implementation task before moving on is the default. Use `ac rename-prefix` to change an established prefix without resetting its sequence. See [project configuration](docs/configuration.md) for examples and prefix selection.
|
|
61
|
+
|
|
62
|
+
Use **spec-driven development with evidence-first verification**: plan acceptance cases before implementation, verify small tasks, assess assertion effectiveness, and maintain tests as requirements change. See [the verification approach](docs/configuration.md#evidence-first-verification).
|
|
63
|
+
|
|
64
|
+
After implementation, commit the project inputs and collect evidence from Node tests:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
node node_modules/cliewen-openspec/adapters/node-test.mjs test/export.test.mjs
|
|
68
|
+
npx --no-install cliewen-openspec check --change add-export --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
After reviewing the assertions and evidence, archive with OpenSpec. Commit the archived state, regenerate evidence and check permanent specs. See [the evidence guide](docs/testing/evidence.md) for outcomes, pending/manual verification and current limitations.
|
|
72
|
+
|
|
73
|
+
`npm test` includes an end-to-end example which installs the packed tarball in a temporary repository, creates a real OpenSpec change, runs tagged tests, verifies failure cases, archives the change and checks that the AC ID survives. It cleans up its temporary repository afterward.
|
|
74
|
+
|
|
75
|
+
## Project documents
|
|
76
|
+
|
|
77
|
+
- [User guide source](docs/guide/index.md) and [published documentation](https://cliewen-openspec.github.io/cliewen-openspec/)
|
|
78
|
+
- [Decisions](docs/decisions/README.md)
|
|
79
|
+
- [Changelog](CHANGELOG.md)
|
|
80
|
+
- [Project configuration](docs/configuration.md)
|
|
81
|
+
- [Pilot reference prompt](docs/testing/pilot-prompt.md)
|
|
82
|
+
- [Implementation plan](plan.md)
|
|
83
|
+
- [Practice mapping](docs/cliewen-mapping.md)
|
|
84
|
+
- [Architecture](docs/architecture/README.md)
|
|
85
|
+
- [Website](https://cliewen-openspec.github.io/cliewen-openspec/)
|
|
86
|
+
- [Credits](CREDITS.md)
|
|
87
|
+
|
|
88
|
+
Implemented commands: `init`, `update`, `uninstall`, `ac next`, `ac rename-prefix`, `check` and `recover`. Review generated/resource changes before applying them. [Uninstall](docs/guide/uninstalling.md) preserves project data and requires an explicit replacement when removing the selected default. Tests never establish assertion quality automatically.
|
|
89
|
+
|
|
90
|
+
## Development checks
|
|
91
|
+
|
|
92
|
+
`npm test` builds TypeScript and runs unit and packed-installation integration tests. GitHub Actions runs the same suite on Windows and Linux with Node 22 and 24. These checks cover the alpha implementation; documentation semantic accuracy and assertion sufficiency still require review.
|
|
93
|
+
|
|
94
|
+
For actual agent trials, use the [CLI evaluation guide](docs/testing/cli-evaluation.md). `npm run trial:cli:prepare` creates matching projects for three pinned CLI profiles; `npm run trial:cli -- SUITE PROFILE SCHEMA` explicitly launches one case and saves raw logs. These commands use local agent authentication and may incur usage charges. CI uses fake CLIs and makes no model calls.
|
|
95
|
+
|
|
96
|
+
Build the documentation with `npm run docs:build` and preview it with `npm run docs:serve`. For browser checks, install Chromium with `npx playwright install chromium`, then run `npm run docs:check`. Documentation tooling uses Node 22.12+ (Node 22 or 24 recommended). See [documentation development](docs/guide/development.md).
|
|
97
|
+
|
|
98
|
+
## Feedback
|
|
99
|
+
|
|
100
|
+
[Report a bug](https://github.com/cliewen-openspec/cliewen-openspec/issues/new?template=bug_report.yml) or [suggest an improvement](https://github.com/cliewen-openspec/cliewen-openspec/issues/new?template=idea.yml). Documentation problems and workflow ideas are welcome. A small example helps us understand the problem; a proposed implementation is optional.
|
|
101
|
+
|
|
102
|
+
Maintainers use the [feedback triage guide](docs/feedback-triage.md) to reproduce problems, record decisions, and link accepted work to OpenSpec changes.
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
[MIT](LICENSE).
|
package/adapters/node-test.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { spawnSync, execFileSync } from 'node:child_process';
|
|
6
|
-
import { config, local, scenarios } from '../dist/core.js';
|
|
6
|
+
import { config, local, scenarios, markdowns } from '../dist/core.js';
|
|
7
7
|
const git = (...args) => execFileSync('git', args, { encoding: 'utf8' }).trim();
|
|
8
8
|
try {
|
|
9
9
|
if (git('status', '--porcelain', '--untracked-files=all')) throw Error('Commit project inputs before collecting evidence.');
|
|
@@ -26,7 +26,19 @@ try {
|
|
|
26
26
|
}
|
|
27
27
|
if (!files.length) throw Error('Pass explicit test file paths');
|
|
28
28
|
const selected = change === undefined ? undefined : new Set(scenarios(process.cwd(), change).map(s => s.id));
|
|
29
|
-
|
|
29
|
+
let removedRequirements = 0, activeRequirements = 0;
|
|
30
|
+
if (selected?.size === 0) for (const file of markdowns(local(process.cwd(), `openspec/changes/${change}/specs`))) {
|
|
31
|
+
let fence = '', section = '';
|
|
32
|
+
for (const line of fs.readFileSync(file, 'utf8').replace(/<!--[\s\S]*?-->/g, '').split(/\r?\n/)) {
|
|
33
|
+
const boundary = line.match(/^\s*(`{3,}|~{3,})/);
|
|
34
|
+
if (boundary) { if (!fence) fence = boundary[1]; else if (fence[0] === boundary[1][0] && boundary[1].length >= fence.length) fence = ''; continue; }
|
|
35
|
+
if (fence) continue;
|
|
36
|
+
if (/^## /.test(line)) section = line.trim();
|
|
37
|
+
if (/^### Requirement:/.test(line)) { if (section === '## REMOVED Requirements') removedRequirements++; else activeRequirements++; }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const retirementOnly = selected?.size === 0 && removedRequirements > 0 && activeRequirements === 0;
|
|
41
|
+
if (selected && ((!selected.size && !retirementOnly) || selected.has(''))) throw Error('Selected change requires scenarios with AC IDs');
|
|
30
42
|
const run = spawnSync(process.execPath, ['--test', '--test-reporter=tap', ...files], { encoding: 'utf8' });
|
|
31
43
|
if (run.error) throw run.error;
|
|
32
44
|
process.stdout.write(run.stdout ?? ''); process.stderr.write(run.stderr ?? '');
|
|
@@ -36,12 +48,17 @@ try {
|
|
|
36
48
|
if (m) {
|
|
37
49
|
const tags = [...m[2].matchAll(/\[Test-type: ([^\]\r\n]+)\]/g)];
|
|
38
50
|
if (tags.length !== 1 || !Object.hasOwn(settings.testing.types, tags[0][1])) throw Error(`Test ${m[2]} requires one configured [Test-type: NAME] tag`);
|
|
39
|
-
|
|
51
|
+
const metadata = {};
|
|
52
|
+
for (const [tag, field] of [['Case', 'caseId'], ['Coverage', 'coverage']]) {
|
|
53
|
+
const values = [...m[2].matchAll(new RegExp(`\\[${tag}: ([^\\]\\r\\n]*)\\]`, 'g'))];
|
|
54
|
+
if (values.length) metadata[field] = values.length === 1 ? values[0][1] : null;
|
|
55
|
+
}
|
|
56
|
+
if (!selected || selected.has(m[3])) results.push({ scenario: m[3], test: m[2], testType: tags[0][1], ...metadata, outcome: /#\s*(SKIP|TODO)/i.test(m[2]) ? 'skipped' : m[1] === 'ok' ? 'passed' : 'failed' });
|
|
40
57
|
}
|
|
41
58
|
}
|
|
42
59
|
if (git('rev-parse', 'HEAD') !== revision || git('status', '--porcelain', '--untracked-files=all')) throw Error('Test execution changed repository inputs; evidence cannot be attributed to the original revision.');
|
|
43
60
|
if (run.status === null) throw Error('Test runner did not complete; no report produced');
|
|
44
|
-
if (!results.length) throw Error('No AC-tagged test results found for the selected scope; no report produced');
|
|
61
|
+
if (!results.length && !retirementOnly) throw Error('No AC-tagged test results found for the selected scope; no report produced');
|
|
45
62
|
fs.mkdirSync(path.dirname(output), { recursive: true });
|
|
46
63
|
fs.writeFileSync(output, JSON.stringify({ version: 1, revision, ...(change === undefined ? {} : { scope: { change } }), execution: { exitCode: run.status }, results }, null, 2) + '\n');
|
|
47
64
|
process.exitCode = run.status === 0 ? 0 : 1;
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { check,
|
|
4
|
-
import { startTask, runTask } from './tdd.js';
|
|
3
|
+
import { check, lifecycle, uninstall, nextId, renamePrefix, capabilityForPrefix, recover, version } from './core.js';
|
|
5
4
|
const args = process.argv.slice(2);
|
|
6
|
-
const separator = args.indexOf('--');
|
|
7
|
-
const forwarded = separator < 0 ? [] : args.splice(separator).slice(1);
|
|
8
5
|
const wantsJson = args.includes('--json');
|
|
9
6
|
function option(name) { const i = args.indexOf(name); if (i < 0)
|
|
10
7
|
return undefined; const value = args[i + 1]; if (!value || value.startsWith('--'))
|
|
@@ -17,7 +14,6 @@ try {
|
|
|
17
14
|
const change = option('--change');
|
|
18
15
|
const capability = option('--capability');
|
|
19
16
|
const replacement = option('--default-schema');
|
|
20
|
-
const task = option('--task'), phase = option('--phase'), reason = option('--reason');
|
|
21
17
|
const command = args.shift();
|
|
22
18
|
if (dry && !['init', 'update', 'uninstall'].includes(command ?? ''))
|
|
23
19
|
throw Error('--dry-run is supported only by init, update, and uninstall');
|
|
@@ -25,37 +21,17 @@ try {
|
|
|
25
21
|
throw Error('--default-schema is supported only by uninstall');
|
|
26
22
|
if (makeDefault && command !== 'init')
|
|
27
23
|
throw Error('--default is supported only by init');
|
|
28
|
-
if (change &&
|
|
29
|
-
throw Error('--change is supported only by check
|
|
24
|
+
if (change && command !== 'check')
|
|
25
|
+
throw Error('--change is supported only by check');
|
|
30
26
|
if (failPending && command !== 'check')
|
|
31
27
|
throw Error('--fail-on-pending is supported only by check');
|
|
32
|
-
if ((task || phase || reason || separator >= 0) && command !== 'tdd')
|
|
33
|
-
throw Error('--task, --phase, --reason, and -- command are supported only by tdd');
|
|
34
28
|
if (change && !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(change))
|
|
35
29
|
throw Error('Change must be a kebab-case name');
|
|
36
30
|
if (json && !['init', 'update', 'uninstall', 'check'].includes(command ?? ''))
|
|
37
31
|
throw Error('--json is supported only by init, update, uninstall, and check');
|
|
38
32
|
if (capability && (command !== 'ac' || args[0] !== 'next'))
|
|
39
33
|
throw Error('--capability is supported only by ac next');
|
|
40
|
-
if (command === '
|
|
41
|
-
if (!change || !task)
|
|
42
|
-
throw Error('tdd requires --change NAME and --task ID');
|
|
43
|
-
if (args.length !== 1)
|
|
44
|
-
throw Error('Use tdd start or tdd run');
|
|
45
|
-
if (args[0] === 'start' && !phase && !reason && separator < 0) {
|
|
46
|
-
startTask(root, change, task);
|
|
47
|
-
console.log(`Recorded starting files for ${change} task ${task}`);
|
|
48
|
-
}
|
|
49
|
-
else if (args[0] === 'run' && phase && forwarded.length) {
|
|
50
|
-
const result = runTask(root, change, task, phase, forwarded, reason);
|
|
51
|
-
process.stdout.write(result.stdout);
|
|
52
|
-
process.stderr.write(result.stderr);
|
|
53
|
-
process.exitCode = result.exitCode;
|
|
54
|
-
}
|
|
55
|
-
else
|
|
56
|
-
throw Error('Use tdd start --change NAME --task ID or tdd run --change NAME --task ID --phase PHASE [--reason TEXT] -- COMMAND ARGS');
|
|
57
|
-
}
|
|
58
|
-
else if (command === 'ac') {
|
|
34
|
+
if (command === 'ac') {
|
|
59
35
|
const action = args.shift();
|
|
60
36
|
if (action === 'next') {
|
|
61
37
|
if (capability ? args.length !== 0 : args.length !== 1)
|
|
@@ -74,9 +50,9 @@ try {
|
|
|
74
50
|
else if (command === '--version')
|
|
75
51
|
console.log(version);
|
|
76
52
|
else if (command === 'init')
|
|
77
|
-
console.log(JSON.stringify({ dryRun: dry,
|
|
53
|
+
console.log(JSON.stringify({ dryRun: dry, ...lifecycle(root, 'init', dry, makeDefault) }, null, 2));
|
|
78
54
|
else if (command === 'update')
|
|
79
|
-
console.log(JSON.stringify({ dryRun: dry, ...
|
|
55
|
+
console.log(JSON.stringify({ dryRun: dry, ...lifecycle(root, 'update', dry) }, null, 2));
|
|
80
56
|
else if (command === 'uninstall')
|
|
81
57
|
console.log(JSON.stringify({ dryRun: dry, ...uninstall(root, dry, replacement) }, null, 2));
|
|
82
58
|
else if (command === 'recover') {
|
|
@@ -91,7 +67,7 @@ try {
|
|
|
91
67
|
process.exitCode = ok ? 0 : 1;
|
|
92
68
|
}
|
|
93
69
|
else if (!command || command === '--help')
|
|
94
|
-
console.log('cliewen-openspec
|
|
70
|
+
console.log('cliewen-openspec\ninit [--default] [--dry-run]\nupdate [--dry-run] [--json]\nuninstall [--default-schema NAME] [--dry-run] [--json]\nac next --capability NAME\nac next PREFIX (registered active prefix only)\nac rename-prefix CAPABILITY PREFIX\ncheck [--change NAME] [--json] [--fail-on-pending]\nrecover\nAll commands accept --root PATH.');
|
|
95
71
|
else
|
|
96
72
|
throw Error(`Unknown command: ${command}`);
|
|
97
73
|
}
|