Repository navigation
Description
Friction
Issue #1753 and docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md adopt OpenSpec 1.14.3 as the planning layer for every agent. This is step 1 of 8: the tool has to be installable, reproducible and silent before anything else in the adoption can use it. Four gaps stand in the way today.
tools.lockhas binary and Python kinds only, and the repository has nopackage.json, no lockfile and no npm step. OpenSpec is a Node tool.- The tool's own integrity data is too loose to pin on. The root tarball's sha512 covers 1 of the 57 installed packages, 11 of the 12 direct dependencies are caret ranges, and the same pin resolved on 2026-10-17 differs in 12
@inquirer/*packages from its resolution on 2026-10-22. - Telemetry is on by default. In text mode,
openspec validate,list,updateandversion --checkeach tried to POST to the PostHog proxy atedge.openspec.devon every run, andupdateandversion --checkalso askedregistry.npmjs.org(observed in an empty network namespace).DO_NOT_TRACK=1,OPENSPEC_TELEMETRY=0or a truthyCIstops both requests,OPENSPEC_NO_UPDATE_CHECK=1alone stops only the update check, andopenspec config set telemetry.enabled falsesends one event unless one of those is set first. AGENTS.md requires every third-party telemetry channel to be off. devopsbuilds a sanitized child environment: withDO_NOT_TRACKand theOPENSPEC_*variables set in the parent, the child saw none of them. The devcontainer'snodefeature also floats to the current LTS (24.22 at the time of the ADR), while the tool needs Node 20.19 or later.
Evidence
- Trial of 2026-10-22 against OpenSpec 1.14.3 in scratch directories, recorded in the ADR's Evaluation and Trial sections.
npm install --ignore-scriptsof the pin added 57 packages in 2 s and the package declares no install scripts.npm cichecks the sha512 of every package: one flipped integrity character failed with EINTEGRITY (and left a partialnode_moduleswhen the package was the first or the last in the lock, which is why the installer stages the install and renames it only on success), and two clean installs gave the same tree hash.npm audit signaturesverified all 57 packages andnpm auditfound nothing.npm audit --package-lock-only --prefix <dir of the pin>needs no install. - The repository's own installer already stages installs and renames them into place:
_stagedand_link_commandsinsrc/devops_cli/commands/install_tools.py, andPythonToolinsrc/devops_cli/tools_lock/__init__.pyis the precedent for a kind whose integrity data lives in a file besidetools.lock.
Feasibility to confirm in the change's proposal: that npm audit --package-lock-only runs in the static job of .github/workflows/ci.yml before the scaffold item adds actions/setup-node (hosted runner images ship Node and npm; confirm on the runner image in use), and if it does not, that this item adds the Node step itself.
Existing tool considered
The open tools are npm itself (npm ci from a committed package-lock.json is the standard reproducible install) and the installer the repository already has. The alternatives were rejected in the ADR's Considered Options: a root package.json is a second install path outside tools.lock with a 2,094-file node_modules at the root, and a global install or npx float. Nothing is built that npm already does; the new installer branch only stages, runs npm ci and links.
The change
src/devops_cli/tools_lock/tools.lock: a[npm.openspec]table withversion = "1.14.3",description,source, andbin = "openspec". The header comment gains the bump runbook for an npm tool: set the version intools.lockand inpackage.json, runnpm install --package-lock-only --ignore-scripts, runnpm audit signaturesandosv-scanner scan source --lockfile package-lock.json, run the lock and installer tests, and rundevops install-tools --check. The runbook steps that regenerate the skills and run the gate are added by the scaffold item, because those commands do not exist until it lands.src/devops_cli/tools_lock/openspec/package.json(the exact version as the one dependency) andpackage-lock.json(lockfileVersion3, 57 packages, every entry sha512 and onregistry.npmjs.org, none with an install script).src/devops_cli/tools_lock/__init__.py: anNpmToolmodel besideBinaryToolandPythonTool(extra="forbid", frozen),ToolsLock.npm,ToolsLock.tools()including it,installed_commandsresolvingnode_modules/.bin/<bin>, andtools_lock_digest()covering each npm tool'spackage.jsonandpackage-lock.jsonso a change to either changes the digest.src/devops_cli/commands/install_tools.py:install_npm_tool(name, entry, target_dir)besideinstall_python_tool. It fails early withrequire_binary("npm", ...)(the installer provisions no runtime, Python's included), stages beside the version directory, copies the two files and two empty npmrc files, runsnpm ci --ignore-scripts --no-audit --no-fund --engine-strict --replace-registry-host=neverthroughrun_subprocesswith an explicitnpm_config_cache,npm_config_userconfigandnpm_config_globalconfig(npm refuses a user and a global config that are one file, and a configured registry would otherwise rewrite the lock's URLs), renames the stage into<user_data_root>/tools/openspec/1.14.3and linksnode_modules/.bin/openspecinto the target directory (~/.local/bin).install_tooland_at_pindispatch the third kind by a table keyed on the model type rather than a longerisinstancechain.devops devcontainer post-createalready installs every lock tool (install_managed_tools(only_missing=True)). It must report a missingnpmor a failednpm cias a warning, so the hard failure isdevops install-toolsand, from the scaffold item, the gate row..node-versionholds24. The devcontainer'snodefeature in.devcontainer/devcontainer.jsonand insrc/devops_cli/templates/devcontainer.json.j2is pinned to24, with.devcontainer/devcontainer-lock.jsonkept consistent, and a contract test keeps the two equal.- The opt-out environment. The devcontainer (
.devcontainer/devcontainer.json, the template andtests/test_third_party_telemetry.py) setsOPENSPEC_TELEMETRY=0andOPENSPEC_NO_UPDATE_CHECK=1beside itsDO_NOT_TRACK=1..github/workflows/ci.ymlsetsDO_NOT_TRACK: "1"at the top of the workflow (the runner'sCI=truealready suffices; this makes it explicit). The committed.claude/settings.jsongains anenvblock withDO_NOT_TRACK,OPENSPEC_TELEMETRYandOPENSPEC_NO_UPDATE_CHECK. The variables the gate module passes throughextra_allowed_env(OPEN_SPEC_INTERACTIVE,XDG_CONFIG_HOME) belong to the scaffold item. - The
auditcheck insrc/devops_cli/commands/ci.pyrunsnpm audit --package-lock-only --prefix src/devops_cli/tools_lock/openspecbesideuv audit, so a vulnerable pin fails the gate. The check's spec carries onecmdtoday anddevops ci auditand the_returncode(get_check_spec("audit").cmd)call in the same module read it, so the spec has to carry both commands without a shell. .github/renovate.json: apackageRulesentry{"matchManagers": ["npm"], "enabled": false}. Renovate can edit neithertools.locknor the generated files, and no pull request by Renovate was found. A bump is one deliberate pull request with the runbook.- AGENTS.md: the telemetry opt-out list gains
OPENSPEC_TELEMETRY=0. The file ends this step at 39,943 of its 40,000 characters (tests/test_agents_md_claims.pyenforces the cap). devops docs generate --sync-readmefor any generated reference the change touches.
What it deletes
Nothing is removed in this step. It replaces the floating node feature version with a pin, and it adds no second install path: the Python and binary kinds stay as they are.
Tests
The test floor refuses every program but git, bwrap and a few kubectl forms, so no test starts npm or openspec.
- Lock tests read the JSON: the exact version in
package.jsonequalstools.lock,lockfileVersionis 3, every entry has a sha512 and an https registry URL, and none has an install script. tests/test_tools_lock.py: the model rejects an unknown key, andtools_lock_digest()changes when either lock file changes.tests/test_install_tools.py: the installer fakesinstall_tools.run_subprocessas the Python-tool tests do, and asserts the argv, the explicitnpm_config_*environment, the staged rename, the link, that a failednpm cileaves an earlier install untouched, and that a missingnpmraises throughrequire_binary.- A contract test that
.node-versionequals the devcontainer feature option. tests/test_third_party_telemetry.pygains the two variables for the devcontainer, its template and the committed.claude/settings.json.- A test of the
auditcheck's commands, and of the Renovate setting.
Dependencies
None. This is the first step. Every later step depends on it.
Planning record: this item is planned under the current rules (a task file), since AGENTS.md names task files until the switch item merges.
Acceptance criteria
uv run devops install-tools --tool openspecinstalls 1.14.3 from the committed lockfile withnpm ci, linksopenspeconto the PATH, anddevops install-tools --checkreports it at the pin.- A flipped integrity character in
package-lock.jsonmakes the install fail and leaves no partial install of the version. - Without
npm,devops install-toolsfails early namingnpm, anddevops devcontainer post-createwarns instead of failing. - The
auditcheck fails on a vulnerable pin and runs indevops ci. - The devcontainer, CI and
.claude/settings.jsonset the three opt-outs, and.node-versionand the devcontainer's Node pin are equal. devops cipasses, with AGENTS.md within its 40,000-character cap (39,943 with the wording the ADR gives).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate proposes a new feature to install OpenSpec from a pinned npm lockfile with telemetry off.This is a prerequisite for adopting OpenSpec 1.14.3 as the planning layer for every agent, which is part of a larger plan.The change enables reproducible and silent installation of OpenSpec, which is critical for adoption by all agents.It requires modifying the tools.lock file, adding npm-related tooling, and ensuring telemetry is disabled.feat(install-tools): install OpenSpec from a pinned npm lockfile with…
dan-petty commentedon Oct 22, 2026
What changed
#1857, merged into
release/v0.2.39as ae8c2d9.44 file(s) changed.
How it was verified
Check runs at 04a9930:
Acceptance Criteria of
docs/agent/tasks/task-1842-openspec-pinned-npm-install.md:uv run devops install-tools --tool openspecinstalls 1.14.3 from the committed lockfile withnpm ci, linksopenspeconto the PATH, anddevops install-tools --checkreports it at the pin. Red first: the lock had no Node kind. Nowtests/test_install_tools.pyinstalls it through a double of npm atsubprocess.runandshutil.whichand asserts the whole argument list, the environment npm gets (the fivenpm_config_settings and none of the caller's), the files in the stage, the two locked files in the version directory, the link and--check. The installer also ran against the real npm into a scratch data root, as the Feasibility field records.package-lock.jsonmakes the install fail and leaves no partial install of the version. The double answers with the integrity failure of the real npm 11.19.1, recorded on 2026-10-22, after writing a partialnode_modules; the tests check the error text, no stage, no link and no version directory, and that an earlier install of the same version keeps its files and its link. The real npm failed the same way on the committed lockfile with a flipped character.npm,devops install-toolsfails first namingnpm, anddevops devcontainer post-createwarns instead of failing.tests/test_install_tools.pychecks the dependency error (exit code 1,DEPENDENCY_MISSING, no stage, no process started) and the exit code of the command, andtests/test_devcontainer.pyrunspost-createwith nonpmand finds exit 0 and the warning.package.jsonnames one dependency at the exact version oftools.lockand the lockfile resolved it to the same version,lockfileVersionis 3, every package has a sha512 and an https URL onregistry.npmjs.org, none has an install script,NpmToolrejects an unknown key, and the digest changes with either file.auditcheck fails on a vulnerable pin and runs indevops ci.tests/test_ci.pyandtests/test_ci_maintain.pycheck the argument lists of both commands, thatdevops ci auditfails when either fails and still runs the other, the one-plan dry run, that the gate's check merges the output of both and fails when either fails, and thatmaintainand the gate's row namenpm. A lockfile with a vulnerable package madenpm audit --package-lock-onlyexit 1.maintaintook npm's exit 1 for vulnerabilities. Nowtests/test_dependency_audit.pyreads the four npm reports recorded intests/fixtures/npm_audit/(clean, vulnerable, registry unreachable, advisories endpoint missing) and uv's statuses, andtests/test_ci_maintain.pyandtests/test_ci.pycheck thatdevops ci maintain,devops ci auditand the gate's row say "found vulnerabilities" for the vulnerable report and "could not run" for the two failures, with the report shown above.ci.ymland.claude/settings.jsonset the opt-outs, and.node-versionand the devcontainer's Node pin are equal:tests/test_third_party_telemetry.py,tests/test_devcontainer.py, and a Renovate test intests/test_tools_lock.py.AGENTS.mdis within its 40,000-character cap (39,943).uv run devops docs checkfinds the generated documents current.node --version(expectv24.x),env | grep -E 'OPENSPEC|DO_NOT_TRACK'(expectDO_NOT_TRACK=1,OPENSPEC_TELEMETRY=0andOPENSPEC_NO_UPDATE_CHECK=1) anddevops devcontainer post-create, which installsopenspecinto~/.local/bin.feat(release): v0.2.39 (#1947)