Stable IDs for requirements, scenarios and decisions

Open
#2,167 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
markdown, node.js, typescript

Research direction

Read the CLI work in #1979 and the related discussions in #2056, #2113, #743, #2157, #1967, and #2033 to understand the intended behavior. Identify the validation and archive matching entry points and their tests; the issue does not name specific files. Done means IDs in bracketed headings are validated and matched before names, duplicate IDs are rejected, and specs without IDs remain unchanged.

Written by the indexing model from the issue text.

Description

enhancement
The problem

Links to a requirement, scenario or decision point at its heading text, so rewording a heading breaks them, and archive refuses a renamed scenario (#1697).

Who this affects

Anyone who links tests, tasks or code to specs. In epam/ai-dial-chat, about 1 in 4 broken spec links was just a reworded heading.

What we have in mind
### Requirement: [AUTH-3] Users sign in
#### Scenario: [AUTH-3.1] Correct password

### D1
Use Redis for sessions, because restarts must not sign users out.
  • The agent writes a visible ID in square brackets at the start of the heading. There's no hidden metadata and no new command, and the CLI only reads IDs.
  • Brackets are required, so ordinary headings like SHA-256 checksum or HTTP-2 support are never mistaken for IDs.
  • Validate and archive match on the ID before the name, so renames work. Dropping an ID is still refused, and a bare prefix like NAV-5 can gain brackets.
  • Duplicate IDs are refused, which catches two parallel changes picking the same number.
  • Decisions are a ### D1 heading plus one or two sentences. There are no Rationale or Alternatives fields (the concern on #2113).
  • Specs without IDs are unchanged.

Evidence: agents kept IDs in 264 of 265 runs (details), and all 2,022 past archives in five repos rebuild byte-identical with the change.

Plan: #1979 is the CLI side; #2134 teaches the openspec-beta skills.

Not in scope: coverage reports, checking task links to removed decisions (#2056 step 2), deliberate removals (#1843), parallel-change overlap (#1669, #1387), and databases or two-way traceability.

Consolidates #2056, #2113, #743 (discussion) and #2157, plus #1967's first two directions and #2033's Direction 3.

Dominant language
TypeScript
Stars
76k
Forks
5.2k
Avg merge
1d 5h
Merged PRs (30d)
58

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Fission-AI/OpenSpec

All issues in Fission-AI/OpenSpec

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.