clone

a hermes agent plugin for openspec: tools for spec workflows and a dashboard tab for browsing changes and specs

main
hermes-openspec / openspec / changes / archive / spec-browser-structured-rendering / specs / spec-browser / spec.md
spec.md 2.2K rendered
1# Spec Browser Delta — Structured Rendering23## MODIFIED Requirements45### Requirement: Dirty worktree diff mode6The dashboard API SHALL compare a git ref to current worktree specs when dirty mode is requested, and the UI SHALL render diffs using structured spec content views.78#### Scenario: Dirty diff defaults9- **WHEN** dirty mode is requested without an explicit before ref10- **THEN** the API compares `HEAD` to the working tree1112#### Scenario: Dirty diff filters unchanged specs13- **GIVEN** some specs match the selected before ref exactly14- **WHEN** dirty mode is requested15- **THEN** unchanged specs are omitted from the returned files list1617#### Scenario: Dirty diff entry18- **GIVEN** a spec was added, modified, or deleted relative to the before ref19- **WHEN** dirty mode is requested20- **THEN** the API returns before content, after content, status, changed flag, unified diff, and available timestamps for that spec2122#### Scenario: Dirty mode structured rendering23- **WHEN** the spec browser is in dirty mode and a changed spec is selected24- **THEN** the before and after panels render using `SpecContentView` with structured requirement and scenario sections instead of raw markdown2526### Requirement: Ref-to-ref diff mode27The dashboard API SHALL compare specs between two explicit git refs when both before and after refs are supplied, and the UI SHALL render diffs using structured spec content views.2829#### Scenario: Valid ref comparison30- **GIVEN** both before and after refs are supplied31- **WHEN** the dashboard requests the spec browser32- **THEN** the API returns mode `refs`, both labels, all spec paths present in either ref, per-spec status, before content, after content, changed flag, and unified diff when changed3334#### Scenario: Incomplete ref comparison35- **WHEN** only one of before or after is supplied outside dirty mode36- **THEN** the API rejects the request with a 400-level error explaining that both refs are required3738#### Scenario: Refs mode structured rendering39- **WHEN** the spec browser is in refs mode and a changed spec is selected40- **THEN** the before and after panels render using `SpecContentView` with structured requirement and scenario sections instead of raw markdown