Skip to main content

Crate speccoder_openspec

Crate speccoder_openspec 

Source
Expand description

OpenSpec adapter for speccoder.

Finds an OpenSpec project and its active changes, parses a change’s tasks.md (as OpenSpec counts tasks) and spec deltas (scenarios included), and checks before any model call what openspec archive would refuse later. Read-only except write::tick and write::append_convergence; it never runs OpenSpec’s CLI (crosscheck only reads its JSON).

Modules§

crosscheck
speccoder’s parse against OpenSpec’s own answer: the JSON of openspec validate <id> --strict --json and openspec instructions apply --change <id> --json, which the runtime may run. A disagreement is evidence of a parser gap: shown, never resolved silently. This module only reads JSON; it runs nothing.
delta
Spec deltas of a change (openspec/changes/<id>/specs/<capability>/spec.md) and the requirement names of the main specs (openspec/specs/**/spec.md).
discover
Where the OpenSpec project is, how it is configured, and which change is selected — without OpenSpec’s CLI: the nearest openspec/ with config.yaml, specs/ or changes/, as OpenSpec’s “nearest” root.
preflight
What openspec archive would refuse, found before any model call: validate --strict passes a MODIFIED requirement that does not exist, and only archive fails on it — after the work is done.
tasks
tasks.md of an OpenSpec change.
write
The engine’s two writes to a change’s tasks.md: a one-byte tick and the convergence append. Both re-read the file and refuse when it changed since speccoder read it.

Structs§

Change
A change’s files, read.
NotAProject
No OpenSpec directory was found from the start path upward.

Functions§

change_dir
The change directory of id, relative to the root.
inspect
Inspects the OpenSpec project containing start, selecting change if given, else the only active change. Preflight problems of the selected change are among the diagnostics.
load_change
Reads change id of the project at root, with the deltas’ problems.
main_specs
Requirement names per capability of the main specs of root.
sha256_hex
Lowercase hex SHA-256 of bytes.