Repository navigation
Description
Problem
devops install-tools installs OpenSpec (@fission-ai/openspec) and Style Dictionary from the package folders src/devops_cli/tools_lock/openspec/ and src/devops_cli/tools_lock/style-dictionary/. Both tools write committed output in this repository: the OpenSpec skills and the design tokens. A different version writes different text. version_finding (src/devops_cli/openspec/gate.py:111-131, #5355, #5375) compares the version that openspec on PATH prints with the version in tools.lock. The devtools image (dan-petty/devtools#1) and the removal of tools.lock (#4363) take that source away.
Change
Owner decision of 2026-11-19: OpenSpec and Style Dictionary become devDependencies of a devops-cli package.json, so npm checks the installed version.
- Add
package.jsonandpackage-lock.jsonat the repository root, with@fission-ai/openspecandstyle-dictionaryas devDependencies at the versions of the current tool lock. Move the overrides of the style-dictionary folder with it, scoped understyle-dictionary. - The devcontainer post-create step and the CI jobs that run OpenSpec or Style Dictionary run
npm ci --ignore-scriptsand call the tools fromnode_modules/.bin. version_findinganddevops openspec regeneratecompare with the version ofpackage-lock.json(or runnpm ls @fission-ai/openspec, which exits 1 when the installed version differs) in place oftools.lock. The guard of fix(openspec): openspec regenerate reads no openspec version #5375 stays.- Point every other reader of the two versions at
package-lock.json, and delete the two package folders and theirtools.lockentries. - Tests: change test_openspec_gate.py:176,195,225 and tests/core/test_openspec_command.py:145, which read the
tools.lockversion. - CONTRIBUTING.md names
npm ciin the setup steps.
Renovate. The built-in npm manager updates package.json and package-lock.json (with lockFileMaintenance). Move the note of the OpenSpec rule (packageRule 23: regenerate the skills) to that rule.
Risk. The devtools image also holds OpenSpec. When its version differs from package-lock.json, the gate fails in a Job that uses the runner image. The plan decides how the runner gets the locked version (for example npm ci of this lock in the runner image).
Proof
npm ci --ignore-scripts && npx openspec --versionprints the locked version.- A unit test: an
openspecon PATH whose version differs frompackage-lock.jsonmakesdevops openspec checkanddevops openspec regenerateexit 1, and regenerate writes nothing. uv run devops openspec checkpasses in CI with the npm-installed OpenSpec.
Depends on: none
Alternatives check of 2026-11-19: in-use.
The repository already uses this tool.
Tool: npm/cli (https://github.com/npm/cli), NOASSERTION, last activity 2026-11-18, maintained.
Reason: Searches found no dedicated tool beyond npm: a root package.json with both tools as devDependencies and a package-lock that npm ci enforces gives the pinned install the issue needs; only the OpenSpec version guard stays custom.
Covers:
- Pins both tools in package.json and package-lock.json
- npm ci refuses a lockfile that does not match the manifest
- Installs devDependencies by default into node_modules/.bin
- Leaves the lockfile unwritten during a clean install
Lacks:
- No OpenSpec-specific version guard; version_finding stays
- No check of the version an openspec on PATH prints
- No regeneration of skills or design tokens after an upgrade
- No update automation without a separate bot
Proposed design
Problem statement
devops install-tools installs OpenSpec and Style Dictionary from package folders and tools.lock. npm does not check those versions, but both tools write committed skills and design tokens. The change makes both tools devDependencies of a root package.json and package-lock.json. It installs them with npm ci --ignore-scripts, points the version guard and every reader at the root lockfile, and deletes the two package folders and their tools.lock entries.
Acceptance criteria
Requirement: Root npm manifest pins both tools
The root package.json and package-lock.json MUST pin @fission-ai/openspec 2.1.0 and style-dictionary 5.8.0 as devDependencies, with the glob 14.0.6 and minimatch 11.0.9 overrides scoped under style-dictionary and private set true.
Scenario: npm ci installs the locked tools
- WHEN a developer runs npm ci --ignore-scripts && npm ls
@fission-ai/openspec style-dictionary - THEN the command exits 0 and prints 2.1.0 and 5.8.0 from package-lock.json.
Requirement: The OpenSpec gate reads the root lockfile
version_finding MUST compare the version that openspec on PATH prints with the @fission-ai/openspec version in the root package-lock.json, not with tools.lock.
Scenario: A mismatched OpenSpec stops check and regenerate
- WHEN a unit test runs devops openspec check and devops openspec regenerate with an openspec on PATH whose version differs from package-lock.json
- THEN both commands exit 1, the finding names both versions, and regenerate writes no skill.
Requirement: Regenerate keeps the version guard
devops openspec regenerate MUST read the locked version before it writes and stop when the installed OpenSpec version differs from package-lock.json.
Scenario: Regenerate writes no skill on a version difference
- WHEN a unit test runs devops openspec regenerate with an openspec whose version differs from the lockfile
- THEN the command exits 1 and the fake records no update --force call.
Requirement: The dependency audit audits the root lockfile
The audit row of devops ci MUST run npm audit --package-lock-only --json --prefix . against the root package-lock.json in place of the two deleted tool lockfiles.
Scenario: The audit row names the root lockfile
- WHEN a developer runs uv run devops ci --check --only audit
- THEN the check exits 0 and its npm audit command names --package-lock-only --json --prefix .
Requirement: The old package folders and lock entries are gone
The two tool package folders and their tools.lock entries MUST be deleted, and no reader MUST name them.
Scenario: No path names the deleted folders or entries
- WHEN a developer runs git grep -n -I -F -e src/devops_cli/tools_lock/openspec -e src/devops_cli/tools_lock/style-dictionary -- README.md CONTRIBUTING.md AGENTS.md CONTEXT.md .devcontainer .github docs src tests Dockerfile Makefile and git grep -n -I -F -e [npm.openspec] -e [npm.style-dictionary] -- src/devops_cli/tools_lock/tools.lock
- THEN both commands print no match and exit 1.
Requirement: The devcontainer image uses the root lockfile
The devcontainer image build MUST install the root package-lock.json with npm ci --ignore-scripts and link openspec and style-dictionary from node_modules/.bin.
Scenario: The devcontainer image holds the locked tools
- WHEN the Devcontainer Image CI job builds .devcontainer/Dockerfile
- THEN the build exits 0 and openspec --version and style-dictionary --version print the versions in package-lock.json.
Requirement: The CI jobs use the root lockfile
Each CI job that runs OpenSpec or Style Dictionary MUST run npm ci --ignore-scripts and put node_modules/.bin before the image PATH.
Scenario: Static Analysis and Design Tokens use the locked tools
- WHEN the Static Analysis and Design Tokens jobs run
- THEN both jobs install the root lock, uv run devops openspec check passes, and make design-tokens exits 0.
Requirement: The service and runner images use the root lockfile
The service and runner images MUST install OpenSpec from the root package-lock.json at build time, and the runner MUST keep npm out.
Scenario: The runner image holds the locked OpenSpec
- WHEN the Runner Image and Service Image CI jobs build their targets
- THEN both builds exit 0, openspec --version prints the version in package-lock.json, and the runner stage has no npm.
Requirement: The version readers use the root lockfile
Every reader of the two tool versions MUST read the root package-lock.json and MUST NOT read the deleted tools.lock entries.
Scenario: The version readers agree
- WHEN a unit test loads the OpenSpec gate, the dependency audit, the review environment facts and the tool-lock digest with the root package-lock.json
- THEN each reader reports
@fission-ai/openspec 2.1.0 and style-dictionary 5.8.0 and reads no tools.lock entry for the two tools.
Requirement: The root install leaves the tree clean
The root npm install MUST leave node_modules out of git.
Scenario: npm ci leaves no untracked path
- WHEN a developer runs npm ci --ignore-scripts && git status --porcelain
- THEN the command exits 0 and prints no path.
Requirement: The setup and records name the root lockfile
CONTRIBUTING.md and ADR 0010 and ADR 0024 MUST name the root package-lock.json and the npm ci setup in place of the deleted folders and tools.lock.
Scenario: The records agree with the code
- WHEN a unit test reads CONTRIBUTING.md and the two ADR files
- THEN each names package-lock.json, npm ci --ignore-scripts and node_modules/.bin, and neither names a deleted tool package folder.
Requirement: Renovate uses the built-in npm manager
Renovate MUST update package.json and package-lock.json with its built-in npm manager, and the @fission-ai/openspec rule MUST keep the skill-regeneration note.
Scenario: The Renovate config validates and names the root manifest
- WHEN a developer runs npx --yes --package renovate
@44.239.1 renovate-config-validator --strict --no-global .github/renovate.json .github/renovate/base.json - THEN the validator exits 0 and prints Config validated successfully against 2 file(s), the two regex managers are gone, and the OpenSpec rule keeps its prBodyNotes.
Requirement: The install command no longer uses the deleted folders
devops install-tools MUST NOT install OpenSpec or Style Dictionary from the deleted tool-lock folders.
Scenario: install-tools names npm ci for a deleted tool
- WHEN a unit test runs devops install-tools --tool openspec --only-missing
- THEN the command reports npm ci --ignore-scripts and reads no path under src/devops_cli/tools_lock/openspec.
Existing Tool Considered
The alternatives check in the issue body records npm/cli (https://github.com/npm/cli) as in-use: the repository already uses npm. The block lists what npm covers and lacks. This proposal uses npm ci --ignore-scripts with the root package-lock.json. The OpenSpec-specific version guard stays in version_finding and reads the root lockfile. Renovate's npm manager updates the manifest and lockfile.
Key questions
- Should OpenSpec and Style Dictionary become devDependencies of a root npm package?: Yes. The owner decision of 2026-11-19 in the issue body replaces ADR 0010's rejection of a root package.json. The root package.json and package-lock.json pin both tools, and npm ci refuses a lockfile that does not match the manifest. ADR 0010 and ADR 0024 record the replacement in the same pull request. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md, docs/adr/0024-the-project-owns-its-design-tokens-in-the-dtcg-format-and-style-dictionary-builds-them.md, src/devops_cli/tools_lock/tools.lock]
- Chosen: Root npm devDependencies. The owner decision sets it, and npm ci enforces the lockfile.
- Rejected: Keep the package folders and tools.lock. The devtools image and chore(tools): remove devops install-tools and tools.lock #4363 remove that source.
- Rejected: One npm workspace for each tool. The owner decision names one root manifest, and two tools need no workspace.
- Which code and tests read the two tool versions today?: version_finding reads the OpenSpec version from load_tools_lock, and devops openspec regenerate calls it. devops install-tools special-cases OpenSpec, the audit row builds npm audit commands from the lock, and the review environment facts and tool-lock digest read the lock. The tests that read the versions include tests/openspec/test_openspec_gate.py, tests/core/test_openspec_command.py, tests/commands/test_install_tools.py, tests/commands/test_ci.py, tests/commands/test_dependency_audit.py and tests/invariants/test_workflow_contracts.py. [sources: src/devops_cli/openspec/gate.py:111, src/devops_cli/commands/openspec.py, src/devops_cli/commands/install_tools.py, src/devops_cli/commands/ci.py, src/devops_cli/tools_lock/init.py, tests/openspec/test_openspec_gate.py, tests/core/test_openspec_command.py, tests/commands/test_install_tools.py, tests/commands/test_ci.py, tests/commands/test_dependency_audit.py, tests/invariants/test_workflow_contracts.py]
- Should version_finding read the locked version from package-lock.json or run npm ls?: Read the version directly from the root package-lock.json with a small helper that takes the worktree root. It gives the locked version with no subprocess and no node_modules, so the guard works in a fresh clone. npm ls exits 1 when node_modules is absent, so it cannot report the version difference. (best practice) [sources: src/devops_cli/openspec/gate.py:111]
- Chosen: Read package-lock.json. No subprocess and no dependency on node_modules; it works in a fresh clone.
- Rejected: Run npm ls
@fission-ai/openspec. It exits 1 when node_modules is absent, and version_finding must report the version difference. - Rejected: Keep tools.lock. The issue deletes that source.
- How does the runner image get the locked OpenSpec version when the devtools image also holds OpenSpec?: The runner image is built in this repository from the root Dockerfile. Its builder stage runs npm ci --ignore-scripts from the root package-lock.json into /opt/devops-tools, links openspec into /opt/devops-tools/bin, and the runner and service stages copy that directory. The runner stage keeps no npm: the Job root filesystem is read-only and a Job installs no tool. If a Job uses the external devtools image, that image must install the same root lock; the gate then compares its OpenSpec with the lockfile. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:109, tests/invariants/test_runner_image.py:40]
- Chosen: Install at image build. It matches the runner image's no-npm and read-only-root rules and its smoke test.
- Rejected: Run npm ci in each Job step. The runner image holds no npm and the Job root filesystem is read-only.
- Rejected: Use the external devtools image. That image is outside this repository and its version is not the root lockfile; the gate would fail until it installs the same lock.
- Where does the devcontainer get the two tools?: The devcontainer image's npm-tools stage, not post-create. devops devcontainer post-create installs no locked tool after fix(devcontainer): the image holds the locked tools in standard locations #4359. The image build copies the root package files, runs npm ci --ignore-scripts, and links both binaries into /usr/local/bin. (best practice) [sources: docs/DEVCONTAINER_USAGE.md, .devcontainer/devcontainer.json]
- Chosen: Install in the image build. The devcontainer image already holds the Node tools, and post-create installs no locked tool (fix(devcontainer): the image holds the locked tools in standard locations #4359).
- Rejected: Install in post-create. docs/DEVCONTAINER_USAGE.md says post-create installs no locked tool, and a rebuild of the image is the way to change one.
- Rejected: Install in each shell. The image would not hold the tools for an agent that never runs the setup.
- Should the devcontainer and CI call the tools from node_modules/.bin or with npx?: Call them from node_modules/.bin after npm ci --ignore-scripts. The image links them into /usr/local/bin, CI adds node_modules/.bin to GITHUB_PATH, and CONTRIBUTING adds the same directory to PATH. npx can fetch a version that package-lock.json does not hold. (best practice) [sources: CONTRIBUTING.md, .github/workflows/ci.yml:76]
- Chosen: Call node_modules/.bin. It uses only the version that npm ci installed.
- Rejected: Call npx. npx can download a version that package-lock.json does not hold.
- Should Renovate use its built-in npm manager for the two tools?: Yes. Remove the two custom regex managers. The built-in npm manager updates the root package.json and package-lock.json, and lockFileMaintenance rewrites the lockfile. Keep the OpenSpec skill-regeneration note in packageRule 23 with the npm ci --ignore-scripts and devops openspec regenerate steps, and add a Style Dictionary note to run make design-tokens. (best practice) [sources: .github/renovate.json]
- Chosen: Built-in npm manager. It updates the manifest and the lockfile in one pull request, and lockFileMaintenance covers the lockfile.
- Rejected: Custom regex manager. It does not update package-lock.json.
- Rejected: Keep the tools.lock manager. The issue deletes the tools.lock entries.
- Should devops ci audit audit the root lockfile, and should the root install ignore node_modules?: Yes to both. The audit row reads the npm entries of tools.lock today; after the entries are deleted it runs one npm audit --package-lock-only --json --prefix . and the ignore file's paths name package-lock.json. Add node_modules/ to .gitignore because the root npm ci writes it and the tree must stay clean. (best practice) [sources: src/devops_cli/commands/ci.py, tests/commands/test_ci.py, tests/commands/test_dependency_audit.py]
- Chosen: Audit the root lockfile and ignore node_modules. The root lockfile holds both tools, one audit covers both, and npm ci writes node_modules at the root.
- Rejected: Keep per-tool audits. The folders and their lockfiles are deleted.
- Rejected: Drop the npm audit. A vulnerable root lockfile would then pass the gate.
- Should CONTRIBUTING.md add npm ci to the setup steps?: Yes. Add npm ci --ignore-scripts after uv sync and before the pre-commit install, and add export PATH="$PWD/node_modules/.bin:$PATH" so openspec and style-dictionary resolve. The devcontainer and CI then use the same lockfile. (best practice) [sources: CONTRIBUTING.md, .pre-commit-config.yaml]
- Chosen: Add npm ci and the PATH entry. A contributor gets the same tool versions as CI, and the pre-commit hook finds openspec.
- Rejected: Add npm ci only. The pre-commit hook calls devops openspec check, which looks up openspec on PATH, so a fresh clone would fail.
- Rejected: Leave setup unchanged. A contributor can use a different OpenSpec version.
- Should the ADRs record the replacement of the tool lock?: Yes. ADR 0010 rejected a root package.json and ADR 0024 named the style-dictionary folder as its lock. The change edits both records to name the root npm lockfile and the npm ci setup, and the OpenSpec regeneration note moves with it. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md, docs/adr/0024-the-project-owns-its-design-tokens-in-the-dtcg-format-and-style-dictionary-builds-them.md, AGENTS.md]
- Chosen: Update both ADRs. AGENTS.md rule 8 says a change that makes a document wrong fixes it in the same pull request.
- Rejected: Leave the ADRs. They would contradict the code and the owner decision.
- Rejected: Add a new ADR only. The old records would still state the opposite decision.
- Should devops install-tools stop installing the two tools from the deleted folders?: Yes. The root npm ci installs both tools. devops install-tools must remove the OpenSpec and Style Dictionary special cases and must not read the deleted package folders or tools.lock entries. (best practice) [sources: src/devops_cli/commands/install_tools.py, src/devops_cli/tools_lock/tools.lock]
- Chosen: Remove the special cases. The folders and entries are deleted, and npm ci installs both tools from the root lockfile.
- Rejected: Keep the special cases. They would read paths that the change deletes.
- Rejected: Make install-tools run npm ci. The devcontainer and CI already run npm ci, and a second installer adds a second source.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
npm, and .github/labels.yml declares no scope/npm label. Add the label to the file to give the scope to this item.Both touch version_finding for openspec, but #5375 fixes regenerate not reading a version while the candidate changes the version source from tools.lock to package-lock.json.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (4)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 20, 2026
This item also removes a circular dependency. Since #6414 the devcontainer takes OpenSpec from the devtools image, but
version_findingcompares it withtools.lock. So a devtools update fails the local openspec row untiltools.lockmoves, and atools.lockmove fails it until the devtools update arrives. The owner direction of 2026-11-20 forbids such a cycle. Acceptance therefore includes: the project gates call OpenSpec fromnode_modules/.bin, so the devtools OpenSpec version has no effect on them. The runner Job gets the same install through the coder bootstrap (#6517).refactor(docker): keep OpenSpec out of the devtools image updates
docs: name the OpenSpec pin of the project, not of tools.lock
14 remaining items
build(npm): pin OpenSpec and Style Dictionary in a root package-lock
test(research): count the package of the root lockfile in the invento…
test(openspec): take the fake OpenSpec version from package-lock.json
docs(openspec): name the root lockfile in the remaining docs and specs (
refactor(openspec): read the version line from core, not from tools_l…
build(npm): pin OpenSpec and Style Dictionary in a root package-lock
test(research): count the package of the root lockfile in the invento…
test(openspec): take the fake OpenSpec version from package-lock.json
docs(openspec): name the root lockfile in the remaining docs and specs (
refactor(openspec): read the version line from core, not from tools_l…
devops-cli-service commentedon Nov 20, 2026
Released in v0.184.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.184.0
devops-cli-service commentedon Nov 20, 2026
Live since 2026-11-20 19:43 UTC