Skip to content

fix(cli): require OpenSpec 1.x and add the verify-and-ask clause - #58

Merged
wxhou merged 6 commits into
mainfrom
fix/openspec-1x-pin
Nov 17, 2026
Merged

wxhou merged 6 commits into
mainfrom
fix/openspec-1x-pin

Conversation

@wxhou

@wxhou wxhou commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • OpenSpec 2.x no longer generates the /opsx:* command files that templates/auto-pipeline.yml asserts on, so the pipeline breaks under 2.x. Install commands pin @1; doctor reports a 2.x install as unsupported and exits 1, init aborts on 2.x.
  • The npm package no longer ships the v1-generated .claude/ commands and skills — nothing at runtime reads them.
  • The employee standards gain a §0 "核实与求助" clause: facts the agent is unsure of are verified through installed source/types → official docs → web search, and only then escalated to the user.

Test plan

  • npm run lint
  • npm run typecheck
  • npm run build && npx vitest run — 1536 passed, 5 skipped
  • npm pack --dry-run — no .claude/ entries; standards, templates and scripts present
  • openspec-pw doctor against a fake OpenSpec 2.1.0 on PATH — red cli-version row, exit 1; against real 1.17.0 — green, exit 0
  • openspec-pw init against a fake OpenSpec 2.1.0 — red prerequisite line, aborts
  • version probe: 2.1.0 → major 2, 1.6.0-beta.1 → major 1, unparseable output → reason kept

OpenSpec 2.x removed the /opsx:* commands and --profile that the pipeline
template asserts on. Install commands pin @1; init and doctor report a 2.x
install as unsupported. The package stops shipping v1-generated .claude/ files.

Tests: 1528/1528 pass. lint, typecheck, build clean. No version bump.
Section 0 routes facts the agent is unsure of through installed source/types
then official docs then web search, and only then asks the user. The trigger is
the agent's own uncertainty, so design trade-offs stay out of scope.

Tests: 1528/1528 pass. lint, typecheck, build clean. No version bump.
2.x still takes --profile; what it dropped is the generated /opsx:* command
files. The probe now says why a version could not be read, doctor always shows
the cli-version row, init aborts on 2.x, and both paths have tests.

Tests: 1536/1536 pass. lint, typecheck, build clean. No version bump.
init throws instead of exiting, so the CLI prints the reason once. One status
helper now feeds init, doctor and the new non-blocking update warning; tests
pin the version module instead of probing the host CLI.

Tests: 1543/1543 pass (also with a fake 2.x CLI on PATH). lint, typecheck, build clean. No version bump.
… breakage

Version parsing now prefers a bare version or a tool-named semver, so a Node
version in the banner no longer flips a 1.x install to unsupported; a broken
PATH binary is reported instead of hidden behind an npx copy. doctor drops the
init hint when init would abort, and the guard tests leave the CodeGraph suite.

Tests: 1546/1546 pass (also with a fake 2.x on PATH). lint, typecheck, build clean. No version bump.
The guard tests pushed doctor.test.ts past the 1500-line CI cap; they move out
with the same doctor mocks. No behavior change.

Tests: 1546/1546 pass. lint, typecheck, build, size check clean. No version bump.
@wxhou
wxhou merged commit 11e89ab into main Nov 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant