Repository navigation
Description
Status
This item is step 2 of 8 of the OpenSpec adoption. Issue #1753 and docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md decided that adoption.
Pull request #1868 (c63daf9f, Part of #1844) delivered the first part on 2026-10-22. It added the scaffold, the gate and the openspec row of devops ci. The gate passes on the tree at the tip.
ADR 0012 (docs/adr/0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md) moves the archive of a change into the pull request that closes it. So a release cut no longer archives. Two pieces of #1868 then have no purpose: the archive-ordering function and the rehearsal of the cut. Issue #1846 deletes them. The overlap check stays, because it reads no git history and archives nothing.
This issue stays open for the last part. The last part adds the wrapper devops openspec archive and its tests. The person set the permissions of .claude/settings.json on 2026-10-22: the allow list holds Bash(uv run devops *), Bash(openspec *) and Bash(tuicr *), and no deny list exists. So the last part adds no settings test and no settings change.
Friction
Before #1868, the repository had nowhere to plan into and nothing that kept a plan valid. The pinned tool also has defects that only a mechanical check holds back. Each defect was tried against OpenSpec 1.14.3 on 2026-10-22.
- There was no
openspec/tree, noconfig.yamlwith the planning conventions for every agent, and no committed skills. A cloud agent or a fresh clone reads the checkout and never runs an install. So the generated skills are committed. - The tool has no project-level profile pin. The wider global profile of a developer rewrote six of the eight skill files. It also added the archive and sync skills and a commands tree. Those skills write
openspec/specs/, and only the pull request that closes a change may write it (ADR 0012). config.yamlfails quietly. The tool exits 0 in each case below and prints a warning in some.- A plain scalar with a space and a hash is cut at the comment.
- An unknown top-level key is ignored.
- A plain scalar with a colon and a space becomes a mapping and drops the guidance.
- A rule under an unknown artifact id is ignored.
- A context over 50 KB is ignored.
- A folder of only
.openspec.yamland a delta passesvalidate --strictand a readiness rule that reads paths only. So an empty plan would count as a plan. - AGENTS.md names task files until the switch (feat(sdlc): an OpenSpec change folder is the record of every item, and readiness checks its archive #1847). So a change folder planned before the switch is a second record, and review refuses it. The gate keeps such a folder valid and named
<issue>-<slug>. validatepasses changes that fail when archived. A missing Purpose leaves a placeholder thatvalidatethen rejects. AMODIFIEDof a spec that does not exist makesarchiverefuse. A duplicateADDEDwith other text makesarchiverefuse. Two changes thatMODIFYone requirement both archive, and the spec keeps one text.- ADR 0012 archives in the pull request that closes the change. There the author sees each refusal and fixes it. A git conflict shows two archives that clash. So the gate does not rehearse
archive.
Evidence
- ADR 0010 records the trial. The task file
docs/agent/tasks/task-1844-openspec-scaffold-and-gate.mdrecords the check of 2026-10-22 against OpenSpec 1.14.3. openspec init --tools claude,agentsunder thecustomprofile writes 12 files (127 KB). They are two trees of four byte-identicalSKILL.md,.agents/skills/.openspec-target,openspec/config.yamland two.gitkeep. A second run ofopenspec update --forceunder the isolated configuration changed no file on a second machine.- ADR 0010 records three runs on 16 cores.
validate --all --stricttook 0.4 to 1.5 s with 40 to 50 changes. It took 1.7 to 5.5 s with 600 changes. The whole gate took 4.0 to 4.5 s on this repository (task file). At the tip,uv run devops openspec checkpassed in 7.4 s. - The gate runs in the
staticjob, whose check name isStatic Analysis. ADR 0012 makes that check required for every pull request intomain. After that setting, the gate binds every pull request. - ADR 0012 tried the archive in each pull request. Two modifications of one requirement conflict. Two additions to one capability conflict. A modification and an addition are clean in both orders. A second archive after a rebase gave a result byte-identical to a serial archive.
openspec validate --all --strictcovers the specs on the tree. A scratch spec with a placeholder Purpose failed in the same way under--all --strictand under--specs --strict(OpenSpec 1.14.3, 2026-10-22). So the gate needs no separate--specsrun.
Existing tool considered
OpenSpec is the open tool. The item uses validate, archive, instructions, update and the generated skills as shipped, with the default spec-driven schema. A fork of the schema copies 16 KB of upstream instructions and four templates that change weekly.
Two thin commands are internal: check and regenerate. No open tool pins the profile and the configuration of a project. check runs the pinned tool and reports each problem with the check that found it. regenerate runs openspec update --force under the isolated configuration.
Cost of the glue that stays, as the text of #1868 estimates it: about 60,000 tokens and half a day to write and test. The glue is the runner, the gate, the regeneration, the fake, the recorder and the record. Maintenance is one re-recording of the real tool at each bump of the pin. It takes about 50 seconds of tool time and no tokens beyond reading the diff. tests/test_openspec_contract.py bounds the fixing: it fails when the record is not of the locked version.
The task file estimates the cost of the code that ADR 0012 makes unneeded. The archive function took about 30,000 tokens to write and test and 15,000 more to fix. It took three hours. The total is about 45,000 tokens and three hours. #1846 deletes it. The cost of our own code is no reason to keep it.
The wrapper is the only new code. It is about 20 lines of command plus tests. The permission system of Claude Code is not used for archive: the settings allow the direct tool, so the wrapper is a convention that ADR 0012 requires for the isolated configuration.
The last part also builds the wrapper devops openspec archive of about 20 lines (ADR 0012, What Stays Custom). No open tool keeps the per-user configuration and the telemetry of OpenSpec out of an archive run. So the wrapper runs the pinned tool under the isolated configuration. The author of the last part states the tokens to implement, maintain and fix, and the elapsed time, in the pull request before work starts.
The change
Kept from #1868
- The scaffold is the
openspec initoutput under the isolatedcustomprofile (propose, explore, apply and update; deliveryskills;--tools claude,agents). It holds the eightSKILL.mdfiles in.claude/skills/openspec-*/and.agents/skills/openspec-*/,.agents/skills/.openspec-target,openspec/config.yamland two.gitkeepfiles. openspec/config.yamlis the file of ADR 0010 (Design: Agent files andopenspec/config.yaml). Every rule is a folded scalar (- >-)..gitignorere-includes only.claude/skills/openspec-*/. Other skills,settings.local.jsonandworktreesstay ignored.devops openspec checkanddevops openspec regeneratelive insrc/devops_cli/commands/openspec.py(45 lines) and the packagesrc/devops_cli/openspec/. Every pattern and key list is insrc/devops_cli/config/constants.pyordefaults.py.- The child environment sets
DO_NOT_TRACK=1,OPENSPEC_TELEMETRY=0,OPENSPEC_NO_UPDATE_CHECK=1andOPEN_SPEC_INTERACTIVE=0. It also setsXDG_CONFIG_HOMEto a scratch directory that holds the isolated configuration. The values go through theenvargument, becauseextra_allowed_envkeeps only a variable that the parent process already has. - After feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder #1846,
checkruns five checks:openspec validate --all --strict. It fails an unknown key in.openspec.yaml. It also covers the specs on the tree.openspec validate --archived. It is a separate run, because--archivedreplaces--all. It fails an archived change with unticked tasks.- A regeneration of the skills with
openspec update --forceunder the isolated configuration, in a scratch copy. The gate compares the result with the tree. openspec instructionsfor the proposal, specs, design, tasks and apply operations of a probe change. Any output to standard error is a failure.- The overlap check. It reads
openspec show <change> --json --deltas-onlyfor each active change. It fails when two active changesMODIFY,REMOVEorRENAMEone requirement. It reads no git history.
checkfails first, and namesuv run devops install-tools --tool openspec --only-missing, whenopenspecis not on PATH. A tree with no change and no spec passes.regeneratemakes a scratchXDG_CONFIG_HOME. It setstelemetry.enabled falsewith the opt-out prefix, because the command sends an event otherwise. It setsdelivery skills,profile customand the four workflows. Then it runsopenspec update --forcein the tree. A bareopenspec updateis forbidden, because it takes the global profile of the user.tests/test_change_folders.pyholds every active folder underopenspec/changes/to these rules:- The name matches the closed grammar
openspec/changes/(?P<issue>\d+)-[^/]+/.+. proposal.mdandtasks.mdexist, andtasks.mdholds at least one## <n>.group with a task-list item.proposal.mdhas the headings## Feasibilityand## Existing Tool Considered, found with markdown-it.- No
PR,Status,MilestoneorPriorityline exists.
- The name matches the closed grammar
tests/test_openspec_scaffold.pyparsesopenspec/config.yamlwithyaml.compose. It allows only the keysschema,context,rulesandoperations, and only folded or literal scalars as rule items. It also checks thatmetadata.generatedByin all eightSKILL.mdequals the pin intools.lock, and that the two skill trees are identical.- The
openspecrow ofdevops ci(CheckSpecinsrc/devops_cli/commands/ci.py) runsuv run devops openspec check. It has no path filter and no exemption. The pre-commit hookopenspec-gaterunsuv run devops ci --only openspecon a commit that touchesopenspec/,.claude/skills/or.agents/skills/. - The
staticjob of.github/workflows/ci.ymlrunsactions/setup-node(v7.1.0, pinned by commit949feb2413d6458794dcd2491c4babbbce0c15c1) with.node-version. Then it runsuv run devops install-tools --tool openspec --only-missingbefore the gate. .github/workflows/copilot-setup-steps.ymlis written by hand, with pinned actions, the pinned install and the opt-outs.openspec init --copilot-cloudis not used, because its workflow runs an unpinnedactions/checkout@v4andnpm install -g @fission-ai/openspec. GitHub runs this file only from the default branch.- The documentation inventory (
CONST_DOCS_INVENTORY) classesopenspec/changes/**/*.mdasrecordandopenspec/specs/**/*.mdasrelease artifact, so the inventory does not name-check the specs. The eightSKILL.mdget a new class,tool-generated. Review routing gainsopenspec/**and the generated skill globs, and keeps thedocs/agent/tasks/**entry until the switch. - The header of
tools.lockgains the runbook steps that regenerate the skills and run the gate.devops docs generate --sync-readmecovers the reference of the new commands.
Deleted by #1846
- The archive function in
src/devops_cli/openspec/archive.py(151 lines):merge_order,archive_sequence,archive_complete_changes,scratch_copyandsymlink_refusal. The functionactive_changesserves the gate and stays. - The rehearsal of the cut in the gate. It is
_rehearsal_findings, 15 lines ingate.py. fetch-depth: 0and its comment in thestaticjob of.github/workflows/ci.yml. feat(openspec): gate OpenSpec change folders and committed skills in devops ci #1868 added both only for the merge order.- The tests of these pieces:
tests/test_openspec_archive.py(218 lines) and the rehearsal cases intests/test_openspec_gate.py(373 lines). - feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder #1846 lists the other symbols, messages and texts that name the cut.
- Not deleted: the overlap check (
src/devops_cli/openspec/overlap.pyand_overlap_findingsingate.py) and its tests.
The last part
-
.claude/settings.json: no change in the last part. The person set the allow list and removed the deny list on 2026-10-22 (the pull request that carried the settings change also deletedtests/test_claude_code_settings.py). -
Direct
openspec archiveis therefore not blocked. A closing pull request should still archive with the wrapper, as a convention. -
ADR 0012 (What Stays Custom) requires the wrapper, because the configuration and the telemetry of the tool must stay isolated. The wrapper runs through the entry
Bash(uv run devops *). -
The wrapper
devops openspec archive <name>lives insrc/devops_cli/commands/openspec.pyand the packagesrc/devops_cli/openspec/. It runsopenspec archive <name> --yesunder the isolated configuration with the four opt-outs, and it passes no--skip-specs. It then runsopenspec validate --all --strict. It exits 1 when either run fails. It has--dry-run, asregeneratehas. -
The apply guidance of
openspec/config.yamland each passage of ADR 0010 that tells an agent to runopenspec archivedirectly name the wrapper instead. -
No permission entries and no settings test are part of the last part.
-
While
release/v0.2.39exists, the last part targets it, saysCloses #1844and addschangelog.d/1844.mdunder### Added. After the old pipeline ends, the last part targetsmain, saysCloses #1844and adds no fragment. The pull request title is then the changelog entry.
Planning record: this item is planned under the current rules, with the task file. It has no change folder, because AGENTS.md names task files until the switch (#1847).
What it deletes
The last part deletes one section of the task file. It deletes no code. #1846 deletes the cut-only code of the first part. At the tip, archive.py holds 151 lines and tests/test_openspec_archive.py 218 lines. _rehearsal_findings in gate.py holds 15 lines.
Tests
The test floor refuses every program but git, bwrap and a few kubectl forms. So no test starts openspec or npm.
OpenSpecFake(tests/support/fakes/openspec.py) replays the runs of the real tool, recorded over twelve scenarios intests/fixtures/openspec_runs/recorded_runs.json.tests/test_openspec_contract.pyfails when the record is not of the locked version or holds a run that the gate no longer starts.tests/test_openspec_gate.py,tests/test_openspec_command.pyandtests/test_openspec_tool.pyassert the child environment: the four opt-outs and an isolated configuration directory. They also assert thatregeneratenever runs a bareupdate.tests/test_change_folders.pyand the configuration tests each have a failing fixture.tests/test_workflow_contracts.pycovers the pinnedsetup-nodeandcopilot-setup-steps.yml.- The real tool runs in the
openspecrow on every pull request. That run is the contract check against the pinned binary. - feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder #1846 removes the order tests, which use real
gitintmp_path. It also removes the scenarios that only the rehearsal reads. - The last part adds no settings test.
- The last part adds tests of the wrapper in
tests/test_openspec_command.py. They useOpenSpecFakewith recorded runs ofarchivethattests/support/openspec_recording.pymakes. One test shows the order:archive, thenvalidate --all --strict. Another shows that a failedarchiveskipsvalidateand exits 1.
Order and dependencies
- Depends on feat(install-tools): install OpenSpec from a pinned npm lockfile with telemetry off #1857, "feat(install-tools): install OpenSpec from a pinned npm lockfile with telemetry off". feat(install-tools): install OpenSpec from a pinned npm lockfile with telemetry off #1857 is merged. feat(openspec): gate OpenSpec change folders and committed skills in devops ci #1868 is merged.
- feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder #1846, "feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder", deletes the cut-only code. It does not build the wrapper. The last part of this item builds it.
- feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder #1846 and the last part do not wait for each other. Both edit the task file of this issue, so the second pull request to merge rebases.
- feat(sdlc): an OpenSpec change folder is the record of every item, and readiness checks its archive #1847, "feat(sdlc): replace task files with OpenSpec change folders", may land before the last part. Then the last part creates the whole change folder with the earlier groups ticked (ADR 0010, Cutover and Sequence). It archives the folder as its last commit. The kept settings text moves from the task file into that folder.
- The rewrite of the instructions keeps
openspecin the CI row of AGENTS.md. It also namesdevops openspec regenerate, which exists since feat(openspec): gate OpenSpec change folders and committed skills in devops ci #1868. - ADR 0012 puts no step of its 14 before or after this item. Its Cutover says that OpenSpec items which already target
release/v0.2.39are not part of the sequence. - feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861 rewrites the triggers of
ci.yml, which namerelease/**at line 11. Theopenspecrow has no path filter and no branch name, so it needs no change there. ADR 0012 asks for one test per gate that shows the gate runs for a pull request intomain. - This item keeps three fixed points of ADR 0012: telemetry stays off, tools are pinned with hashes, and tests run offline.
Acceptance criteria
Delivered by #1868. A test checks each one at the tip.
uv run devops ciruns anopenspecrow and passes on the repository tree. It fails with a clear message whenopenspecis missing. The message namesuv run devops install-tools --tool openspec --only-missing.uv run devops openspec regenerateleaves the tree unchanged under a wider global profile.checkfails when a skill file was edited by hand or when the profile is wider.checkfails an unknown key in.openspec.yamland an archived change with an unticked task.tests/test_change_folders.pyfails a folder that is not named<issue>-<slug>, a folder with notasks.mdgroup and a folder with aStatusline.tests/test_openspec_scaffold.pyfails a plain scalar rule and an unknown key inconfig.yaml.- The inventory classifies every new Markdown file, and
devops docs checkpasses. - The pre-commit hook and the
staticjob run the row, andcopilot-setup-steps.ymlexists. AGENTS.md stays withinCONST_AGENTS_MD_MAX_CHARS(40,000 characters; 37,286 at the tip). - The record of the real tool equals the pin in
tools.lock(tests/test_openspec_contract.py).
Open, for the last part:
-
The wrapper has tests in
tests/test_openspec_command.py(see the section Tests). -
uv run devops openspec archive <name>archives the change and then runsopenspec validate --all --strict. It runs both under the isolated configuration, and it exits 1 when either run fails. -
uv run devops cipasses with every row. -
Pending a person: when
.github/workflows/copilot-setup-steps.ymlis onmain, run the workflow once from the Actions tab. Confirm that a Copilot cloud agent session findsopenspecon its PATH. At the tip the file is onrelease/v0.2.39and not onmain, and GitHub runs the file only from the default branch. -
Pending a person: with a devcontainer rebuilt after feat(install-tools): install OpenSpec from a pinned npm lockfile with telemetry off #1857, run
uv run devops ci. Expect every row, theopenspecrow included, to pass withopenspecon PATH.
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 scaffolding OpenSpec and gating its change folders, which is a new feature.This is step 2 of 8 in adopting OpenSpec, and addresses critical friction points in planning and validation.The change enables proper planning and validation of changes, which is essential for the project's development workflow.The effort involves setting up OpenSpec scaffolding, configuring validation rules, and ensuring CI gates work correctly.dan-petty commentedon Oct 22, 2026
Status set to Ready at ae8c2d9 (see proposed design in issue body).
feat(openspec): gate OpenSpec change folders and committed skills in …
chore(settings): allow the devops, openspec and tuicr commands, and d…
feat(openspec): add the command that archives a change and then valid…
dan-petty commentedon Oct 23, 2026
What changed
#1943, merged into
release/v0.2.39as 8f0e1b4.20 file(s) changed.
How it was verified
Check runs at ddaf9f4:
Acceptance Criteria of
docs/agent/tasks/task-1844-openspec-scaffold-and-gate.md:uv run devops ciruns anopenspecrow, passes on the empty tree, and fails with a clear message whenopenspecis missing, naminguv run devops install-tools --tool openspec --only-missing. The real gate passed the repository's empty tree in 4.3 s and failed with the message on a PATH without the tool;tests/test_openspec_gate.pychecks the commands of the empty tree in order and the missing tool (exit code 1,DEPENDENCY_MISSING, no process started), andtests/test_openspec_command.pythe exit code and output of both cases.uv run devops openspec regenerateleaves the tree unchanged under any developer's global profile, andcheckfails when a skill file was hand-edited or the profile is wider. The real tool did, as the Feasibility field records;tests/test_openspec_command.pychecks thatregeneratesets the four isolated settings and runsupdate --forceand never a bareupdate,tests/test_openspec_gate.pythat every run opts out under a configuration directory of its own whatever the environment says, and that a hand-edited skill, an added archive skill, a deleted skill and a skill tree deleted whole are each reported.checkfails a requirement modified by two active changes.tests/test_openspec_gate.pyreports, from the real tool's recorded runs, a requirement modified twice and a requirement renamed and modified, each by the check that finds it; and it checks that a change which modifies a requirement another active change adds passes, that a change declaringskip_specspasses, and that no run of the gate is anarchive. A missing Purpose, aMODIFIEDof a spec that does not exist and a duplicateADDEDshow only in the pull request that closes the change:validate --all --strictfails the placeholder Purpose of the archived spec, andopenspec archiverefuses the other two and changes no file (feat(openspec): the pull request that closes a change archives it, and readiness checks the archived folder #1846).tests/test_change_folders.pyfails a folder not named<issue>-<slug>, one with notasks.mdgroup and one carrying aStatusline, andtests/test_openspec_scaffold.pyfails a plain scalar rule and an unknown key, each with its line.devops docs checkpasses.staticjob run the row,copilot-setup-steps.ymlexists, and AGENTS.md is withinCONST_AGENTS_MD_MAX_CHARS, whichtests/test_agents_md_claims.pychecks.devops ci --dry-runlists the row, andtests/test_openspec_scaffold.pychecks the hook andtests/test_workflow_contracts.pyboth workflows and that every remote action is pinned.tests/test_openspec_contract.pyfails when the record is not of the locked version, when a scenario is not recorded, and when the record holds a run the gate no longer starts.permissionsentries are in.claude/settings.json. A person applied them, because an agent may not edit that file. On 2026-10-22 the person set the allow list toBash(uv run devops *),Bash(openspec *)andBash(tuicr *), and removed the deny list. The same change deletestests/test_claude_code_settings.py. The last part of feat(openspec): scaffold OpenSpec and gate its change folders in devops ci #1844 adds no settings test.uv run devops openspec archive <name>archives the change and then runsopenspec validate --all --strict, both under the isolated configuration, and exits 1 when either run fails.tests/test_openspec_command.pychecks it from the real tool's recorded runs, as the Tests paragraph above lists.openspec/config.yamland each passage of ADR 0010 that told an agent to runopenspec archivedirectly name the wrapper. The copy of the configuration in ADR 0010 equals the file, and the size that ADR 0010 gives for its quoted AGENTS.md wording is 8 characters longer (39,992 of 40,000).openspec-apply-changeandopenspec-update-change, in.claude/skills/and.agents/skills/, tell an agent to runopenspec archive "<name>"directly.devops openspec regenerateowns those files, so nobody edits them. The wrapper is a convention, and the settings enforce neither form..github/workflows/copilot-setup-steps.ymlmerges tomain, run the workflow once from the Actions tab and confirm that a Copilot cloud agent session findsopenspecon its PATH. GitHub runs the file only from the default branch, so until then that agent finds the committed skills and no binary.uv run devops ciand expect every row, theopenspecrow included, to pass withopenspecon PATH.feat(release): v0.2.39 (#1947)