<!-- specsmith:generated -- do not edit; regenerated by specsmith sync -->
# Test Specification

## TEST-001. Specsmith Must Govern Itself
- **ID:** TEST-001
- **Title:** Specsmith Must Govern Itself
- **Description:** Specsmith must govern its own governance layer and use it for all changes.
- **Requirement ID:** REQ-001
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-002. Governance Files Must Be Owned by Specsmith
- **ID:** TEST-002
- **Title:** Governance Files Must Be Owned by Specsmith
- **Description:** Only Specsmith may create, update, or delete the human‑readable governance files `ARCHITECTURE.md`, `REQUIREMENTS.md`, `TESTS.md`, and `LEDGER.md`.
- **Requirement ID:** REQ-002
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-003. Machine State Must Reflect Governance State
- **ID:** TEST-003
- **Title:** Machine State Must Reflect Governance State
- **Description:** Every machine‑readable state file under `.specsmith/` must be derived from its corresponding human‑readable governance file and remain in sync.
- **Requirement ID:** REQ-003
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-004. Requirements Must Be Derived from Architecture
- **ID:** TEST-004
- **Title:** Requirements Must Be Derived from Architecture
- **Description:** Specsmith must parse `ARCHITECTURE.md` to produce initial requirements.
- **Requirement ID:** REQ-004
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-005. Requirement IDs Must Be Stable
- **ID:** TEST-005
- **Title:** Requirement IDs Must Be Stable
- **Description:** Once assigned, a requirement ID must never change or be reused.
- **Requirement ID:** REQ-005
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-006. Preflight Validation Must Be Performed
- **ID:** TEST-006
- **Title:** Preflight Validation Must Be Performed
- **Description:** Before any governance action, the system must validate inputs and produce structured output with required fields.
- **Requirement ID:** REQ-006
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-007. Test Cases Must Be Generated from Requirements
- **ID:** TEST-007
- **Title:** Test Cases Must Be Generated from Requirements
- **Description:** For each requirement, Specsmith must create or link a test case that can prove the requirement.
- **Requirement ID:** REQ-007
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-008. Each Requirement Must Link to At Least One Test
- **ID:** TEST-008
- **Title:** Each Requirement Must Link to At Least One Test
- **Description:** Each requirement must be traceable to at least one test case.
- **Requirement ID:** REQ-008
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-009. Work Items Must Be Created for Accepted Requirements
- **ID:** TEST-009
- **Title:** Work Items Must Be Created for Accepted Requirements
- **Description:** When a requirement is accepted, a unique work item must be created.
- **Requirement ID:** REQ-009
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-010. Requirements Must Include Priority and Status
- **ID:** TEST-010
- **Title:** Requirements Must Include Priority and Status
- **Description:** Each requirement record must contain `priority` and `status` attributes.
- **Requirement ID:** REQ-010
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-011. Verification Must Include Confidence Scoring
- **ID:** TEST-011
- **Title:** Verification Must Include Confidence Scoring
- **Description:** Every verification run must produce a numeric confidence score along with pass/fail.
- **Requirement ID:** REQ-011
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-012. Equilibrium Must Be Reached Before Finalizing
- **ID:** TEST-012
- **Title:** Equilibrium Must Be Reached Before Finalizing
- **Description:** A work item may be marked finished only when its verification confidence meets or exceeds the configured threshold and no contradictions remain.
- **Requirement ID:** REQ-012
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-013. Retry Recommendations Must Be Provided
- **ID:** TEST-013
- **Title:** Retry Recommendations Must Be Provided
- **Description:** Specsmith must output retry recommendations when verification fails.
- **Requirement ID:** REQ-013
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-014. Retries Must Be Bounded
- **ID:** TEST-014
- **Title:** Retries Must Be Bounded
- **Description:** Each retry mechanism may not exceed a fixed maximum number of attempts.
- **Requirement ID:** REQ-014
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-015. Every Governance Action Must Record a Ledger Event
- **ID:** TEST-015
- **Title:** Every Governance Action Must Record a Ledger Event
- **Description:** All changes are logged to `LEDGER.md` and `.specsmith/ledger.jsonl` with timestamp and type.
- **Requirement ID:** REQ-015
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-016. Trace Chain Must Be Tamper‑Evident
- **ID:** TEST-016
- **Title:** Trace Chain Must Be Tamper‑Evident
- **Description:** The trace chain must use chained cryptographic hashes to provide tamper evidence.
- **Requirement ID:** REQ-016
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-017. OpenCode Must Own Execution and Tools
- **ID:** TEST-017
- **Title:** OpenCode Must Own Execution and Tools
- **Description:** All filesystem operations and tool executions are performed by OpenCode.
- **Requirement ID:** REQ-017
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-018. Specsmith Core Must Be Integration‑Agnostic
- **ID:** TEST-018
- **Title:** Specsmith Core Must Be Integration‑Agnostic
- **Description:** The core logic must run without dependency on any implementation.
- **Requirement ID:** REQ-018
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-019. Verification Must Evaluate Changed Files
- **ID:** TEST-019
- **Title:** Verification Must Evaluate Changed Files
- **Description:** Verification must analyze file changes.
- **Requirement ID:** REQ-019
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-020. Verification Must Evaluate Diff Relevance
- **ID:** TEST-020
- **Title:** Verification Must Evaluate Diff Relevance
- **Description:** Verification must ignore irrelevant diffs.
- **Requirement ID:** REQ-020
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-021. Verification Must Evaluate Test Results
- **ID:** TEST-021
- **Title:** Verification Must Evaluate Test Results
- **Description:** Verification must compare outputs.
- **Requirement ID:** REQ-021
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-022. Verification Must Evaluate Contradictions and Uncertainty
- **ID:** TEST-022
- **Title:** Verification Must Evaluate Contradictions and Uncertainty
- **Description:** Identify contradictions.
- **Requirement ID:** REQ-022
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-023. Requirement Schema Must Include Source Location, Type, Priority, Confidence, Status, and Timestamps
- **ID:** TEST-023
- **Title:** Requirement Schema Must Include Source Location, Type, Priority, Confidence, Status, and Timestamps
- **Description:** Schema must include these.
- **Requirement ID:** REQ-023
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-024. Test Case Model Must Include Required Fields
- **ID:** TEST-024
- **Title:** Test Case Model Must Include Required Fields
- **Description:** All test case records must contain required fields.
- **Requirement ID:** REQ-024
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-025. Work Item Model Must Include Required Fields
- **ID:** TEST-025
- **Title:** Work Item Model Must Include Required Fields
- **Description:** Each work item record must contain required fields.
- **Requirement ID:** REQ-025
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-026. Preflight Output Schema Must Include Decision, Work Item ID, Priority, Requirement IDs, Test Case IDs, Confidence Target
- **ID:** TEST-026
- **Title:** Preflight Output Schema Must Include Decision, Work Item ID, Priority, Requirement IDs, Test Case IDs, Confidence Target
- **Description:** Structured preflight output.
- **Requirement ID:** REQ-026
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-027. Verification Input Must Include Diffs, Tests, Logs, and Changed Files
- **ID:** TEST-027
- **Title:** Verification Input Must Include Diffs, Tests, Logs, and Changed Files
- **Description:** Input contains diffs, logs.
- **Requirement ID:** REQ-027
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-028. Retry Strategy Mapping Must Be Defined
- **ID:** TEST-028
- **Title:** Retry Strategy Mapping Must Be Defined
- **Description:** Map strategies.
- **Requirement ID:** REQ-028
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-029. Integration Adapter Interface Must Provide Capabilities
- **ID:** TEST-029
- **Title:** Integration Adapter Interface Must Provide Capabilities
- **Description:** Provide adapter.
- **Requirement ID:** REQ-029
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-030. Specsmith CLI Commands Must Be Explicitly Defined
- **ID:** TEST-030
- **Title:** Specsmith CLI Commands Must Be Explicitly Defined
- **Description:** Expose commands.
- **Requirement ID:** REQ-030
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-031. Sequencing Rules Must Enforce Valid States
- **ID:** TEST-031
- **Title:** Sequencing Rules Must Enforce Valid States
- **Description:** Bootstrap sequencing.
- **Requirement ID:** REQ-031
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-032. Configuration Settings for Optional Features
- **ID:** TEST-032
- **Title:** Configuration Settings for Optional Features
- **Description:** Read config.
- **Requirement ID:** REQ-032
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-033. Default Enablement of Optional Features
- **ID:** TEST-033
- **Title:** Default Enablement of Optional Features
- **Description:** Enabled by default.
- **Requirement ID:** REQ-033
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-034. Evidence ZIP Archive Generation
- **ID:** TEST-034
- **Title:** Evidence ZIP Archive Generation
- **Description:** Generate evidence ZIP.
- **Requirement ID:** REQ-034
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-035. Evidence Manifest Generation
- **ID:** TEST-035
- **Title:** Evidence Manifest Generation
- **Description:** Generate evidence manifest.
- **Requirement ID:** REQ-035
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-036. Per‑File SHA‑256 Hashing in Evidence
- **ID:** TEST-036
- **Title:** Per‑File SHA‑256 Hashing in Evidence
- **Description:** Hash every file.
- **Requirement ID:** REQ-036
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-037. Final Evidence ZIP SHA‑256 Hash
- **ID:** TEST-037
- **Title:** Final Evidence ZIP SHA‑256 Hash
- **Description:** Hash final zip.
- **Requirement ID:** REQ-037
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-038. Author/Owner Metadata Capture
- **ID:** TEST-038
- **Title:** Author/Owner Metadata Capture
- **Description:** Capture metadata.
- **Requirement ID:** REQ-038
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-039. Git Commit Metadata Inclusion
- **ID:** TEST-039
- **Title:** Git Commit Metadata Inclusion
- **Description:** Include git commit.
- **Requirement ID:** REQ-039
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-040. Ledger Reference Inclusion
- **ID:** TEST-040
- **Title:** Ledger Reference Inclusion
- **Description:** Reference ledger.
- **Requirement ID:** REQ-040
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-041. Trusted Timestamp Token Support
- **ID:** TEST-041
- **Title:** Trusted Timestamp Token Support
- **Description:** Include timestamp token.
- **Requirement ID:** REQ-041
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-042. Legal/IP Disclaimer Requirement
- **ID:** TEST-042
- **Title:** Legal/IP Disclaimer Requirement
- **Description:** Provide disclaimer.
- **Requirement ID:** REQ-042
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-043. Ledger Event Hash Chaining
- **ID:** TEST-043
- **Title:** Ledger Event Hash Chaining
- **Description:** Chain events.
- **Requirement ID:** REQ-043
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-044. Ledger Event on Work Proposal
- **ID:** TEST-044
- **Title:** Ledger Event on Work Proposal
- **Description:** Create event on proposal.
- **Requirement ID:** REQ-044
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-045. Ledger Event on Work Completion
- **ID:** TEST-045
- **Title:** Ledger Event on Work Completion
- **Description:** Create event on completion.
- **Requirement ID:** REQ-045
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-046. README.md Generation and Synchronization
- **ID:** TEST-046
- **Title:** README.md Generation and Synchronization
- **Description:** Generate README.
- **Requirement ID:** REQ-046
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-047. CHANGELOG.md Generation and Synchronization
- **ID:** TEST-047
- **Title:** CHANGELOG.md Generation and Synchronization
- **Description:** Generate CHANGELOG.
- **Requirement ID:** REQ-047
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-048. Keep a Changelog Compliance
- **ID:** TEST-048
- **Title:** Keep a Changelog Compliance
- **Description:** Compliance.
- **Requirement ID:** REQ-048
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-049. Semantic Versioning Support
- **ID:** TEST-049
- **Title:** Semantic Versioning Support
- **Description:** Support semantic versioning.
- **Requirement ID:** REQ-049
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-050. Guided Version Bump Workflow
- **ID:** TEST-050
- **Title:** Guided Version Bump Workflow
- **Description:** Guided bump.
- **Requirement ID:** REQ-050
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-051. Guided Release Strategy Workflow
- **ID:** TEST-051
- **Title:** Guided Release Strategy Workflow
- **Description:** Guided release.
- **Requirement ID:** REQ-051
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-052. Guided Branching Strategy Workflow
- **ID:** TEST-052
- **Title:** Guided Branching Strategy Workflow
- **Description:** Guided branching.
- **Requirement ID:** REQ-052
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-053. Default GitFlow Branching Model
- **ID:** TEST-053
- **Title:** Default GitFlow Branching Model
- **Description:** Default GitFlow.
- **Requirement ID:** REQ-053
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-054. Guided Branching Modification
- **ID:** TEST-054
- **Title:** Guided Branching Modification
- **Description:** Guided branching mod.
- **Requirement ID:** REQ-054
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-055. GitHub License Generation
- **ID:** TEST-055
- **Title:** GitHub License Generation
- **Description:** Generate GitHub license.
- **Requirement ID:** REQ-055
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-056. Commercial License Drafting Guidance
- **ID:** TEST-056
- **Title:** Commercial License Drafting Guidance
- **Description:** Draft commercial license.
- **Requirement ID:** REQ-056
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-057. Local Git Commit After Work
- **ID:** TEST-057
- **Title:** Local Git Commit After Work
- **Description:** Commit after work.
- **Requirement ID:** REQ-057
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-058. Confidence Threshold Configuration
- **ID:** TEST-058
- **Title:** Confidence Threshold Configuration
- **Description:** Configure threshold.
- **Requirement ID:** REQ-058
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-059. Iteration Continuation Until Threshold
- **ID:** TEST-059
- **Title:** Iteration Continuation Until Threshold
- **Description:** Continue until threshold.
- **Requirement ID:** REQ-059
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-060. Indefinite Iteration Default
- **ID:** TEST-060
- **Title:** Indefinite Iteration Default
- **Description:** Indefinite iteration default.
- **Requirement ID:** REQ-060
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-061. Max Iterations Configuration
- **ID:** TEST-061
- **Title:** Max Iterations Configuration
- **Description:** Max iterations config.
- **Requirement ID:** REQ-061
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-062. Token/Cost/Time Limits Configuration
- **ID:** TEST-062
- **Title:** Token/Cost/Time Limits Configuration
- **Description:** Token/Cost/Time limits.
- **Requirement ID:** REQ-062
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-063. Stop‑and‑Align Behavior
- **ID:** TEST-063
- **Title:** Stop‑and‑Align Behavior
- **Description:** Stop‑align behavior.
- **Requirement ID:** REQ-063
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-064. Interactive Correction Workflow
- **ID:** TEST-064
- **Title:** Interactive Correction Workflow
- **Description:** Interactive correction workflow.
- **Requirement ID:** REQ-064
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-065. Nexus Runtime Must Not Own Governance
- **ID:** TEST-065
- **Title:** Nexus Runtime Must Not Own Governance
- **Description:** Nexus orchestrator module documents that Specsmith owns governance and Nexus only executes.
- **Requirement ID:** REQ-065
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-066. Nexus Must Provide Required Agent Roles
- **ID:** TEST-066
- **Title:** Nexus Must Provide Required Agent Roles
- **Description:** Orchestrator instantiates Planner, Shell, Code, Reviewer, Memory, Git, HumanProxy, and Executor agents.
- **Requirement ID:** REQ-066
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-067. Nexus Tool Layer Must Expose Required Tools
- **ID:** TEST-067
- **Title:** Nexus Tool Layer Must Expose Required Tools
- **Description:** specsmith.agent.tools.AVAILABLE_TOOLS contains the 12 required tools by name.
- **Requirement ID:** REQ-067
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-068. Nexus Safety Middleware Must Block Unsafe Commands
- **ID:** TEST-068
- **Title:** Nexus Safety Middleware Must Block Unsafe Commands
- **Description:** is_safe_command returns False for unsafe patterns and True for safe ones.
- **Requirement ID:** REQ-068
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-069. Nexus Tool Arguments Must Be JSON Validated
- **ID:** TEST-069
- **Title:** Nexus Tool Arguments Must Be JSON Validated
- **Description:** validate_json_args raises ValueError for non-serializable arguments.
- **Requirement ID:** REQ-069
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-070. Nexus Must Normalize File Paths
- **ID:** TEST-070
- **Title:** Nexus Must Normalize File Paths
- **Description:** normalize_path returns absolute resolved paths.
- **Requirement ID:** REQ-070
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-071. Nexus Must Index the Repository
- **ID:** TEST-071
- **Title:** Nexus Must Index the Repository
- **Description:** generate_index populates files.json, architecture.md, and conventions.md in .repo-index/.
- **Requirement ID:** REQ-071
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-072. Nexus REPL Must Support Slash Commands
- **ID:** TEST-072
- **Title:** Nexus REPL Must Support Slash Commands
- **Description:** repl.py source defines /plan, /ask, /fix, /test, /commit, /pr, /undo, /context, /exit handlers.
- **Requirement ID:** REQ-072
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-073. Nexus Output Contract
- **ID:** TEST-073
- **Title:** Nexus Output Contract
- **Description:** Orchestrator.run_task issues an initial message containing the required sections.
- **Requirement ID:** REQ-073
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-074. vLLM Image Must Be Pinned
- **ID:** TEST-074
- **Title:** vLLM Image Must Be Pinned
- **Description:** docker-compose.yml uses vllm/vllm-openai:v0.8.5 and does not use :latest.
- **Requirement ID:** REQ-074
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-075. vLLM Must Serve l1-nexus Model
- **ID:** TEST-075
- **Title:** vLLM Must Serve l1-nexus Model
- **Description:** docker-compose.yml configures --served-model-name l1-nexus and --tool-call-parser hermes.
- **Requirement ID:** REQ-075
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-076. Nexus Tool Executor Registration Must Be Unique
- **ID:** TEST-076
- **Title:** Nexus Tool Executor Registration Must Be Unique
- **Description:** Orchestrator.register_tools calls executor.register_for_execution exactly once per tool.
- **Requirement ID:** REQ-076
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-077. Safe Cleanup Defaults to Dry-Run
- **ID:** TEST-077
- **Title:** Safe Cleanup Defaults to Dry-Run
- **Description:** clean_repo(apply=False) must not delete files even if matching targets exist.
- **Requirement ID:** REQ-077
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-078. Safe Cleanup Uses Hard-Coded Target List
- **ID:** TEST-078
- **Title:** Safe Cleanup Uses Hard-Coded Target List
- **Description:** clean_repo enumerates only canonical targets defined in the module CANONICAL_TARGETS constant.
- **Requirement ID:** REQ-078
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-079. Safe Cleanup Protects Governance and Source
- **ID:** TEST-079
- **Title:** Safe Cleanup Protects Governance and Source
- **Description:** clean_repo with apply=True must not delete .git, .specsmith, governance files, pyproject.toml, README.md, LICENSE, CHANGELOG.md, src/, tests/, docs/.
- **Requirement ID:** REQ-079
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-080. Safe Cleanup Emits Structured Report
- **ID:** TEST-080
- **Title:** Safe Cleanup Emits Structured Report
- **Description:** clean_repo returns a CleanupReport with removed, skipped, and bytes_reclaimed fields.
- **Requirement ID:** REQ-080
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-081. specsmith clean CLI Subcommand
- **ID:** TEST-081
- **Title:** specsmith clean CLI Subcommand
- **Description:** Invoking `specsmith clean` via click's CliRunner returns 0; defaults to dry-run; `--apply` removes targets and appends a `cleanup` ledger event referencing REQ-077..REQ-080. `--json` emits a parseable JSON report.
- **Requirement ID:** REQ-081
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-082. UTF-8 Safe Console Factory
- **ID:** TEST-082
- **Title:** UTF-8 Safe Console Factory
- **Description:** make_console returns a rich.console.Console instance with legacy_windows disabled and printing common glyphs (⚠, →, ✓, ✗) to a captured buffer must not raise UnicodeEncodeError.
- **Requirement ID:** REQ-082
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-083. Canonical Test Spec File Is TESTS.md
- **ID:** TEST-083
- **Title:** Canonical Test Spec File Is TESTS.md
- **Description:** The repository must contain `TESTS.md` and `docs/TESTS.md` (not `TESTS.md`/`TEST-SPECS.md`/`TEST-SPEC.md`); the source tree (excluding `.specsmith/runs/*.patch` historical evidence) must contain no remaining references to the legacy names; the scaffolder, auditor, importer, retrieval, exporter, requirements, phase, recovery, and stress-tester modules must reference `TESTS.md`.
- **Requirement ID:** REQ-083
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-084. Natural-Language Governance Broker
- **ID:** TEST-084
- **Title:** Natural-Language Governance Broker
- **Description:** `specsmith.agent.broker.classify_intent` correctly tags read-only/change/release/destructive utterances; `infer_scope` returns relevant existing REQ IDs from a tmp-path REQUIREMENTS.md; `run_preflight` invokes the Specsmith CLI and parses its JSON; `narrate_plan` renders a plain-language plan that does NOT contain REQ-/TEST-/WI- tokens by default; `execute_with_governance` honors the configured retry budget and escalates with a single clarifying question on stop-and-align.
- **Requirement ID:** REQ-084
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-085. specsmith preflight CLI Emits Required JSON
- **ID:** TEST-085
- **Title:** specsmith preflight CLI Emits Required JSON
- **Description:** Invoking `specsmith preflight <utterance> --json --project-dir <tmp_path>` via click's CliRunner returns exit code 0 and a JSON object with all required keys; read-only asks resolve to `accepted`, destructive utterances resolve to `needs_clarification`, and an utterance with no matching scope also resolves to `needs_clarification` with a non-empty `instruction`.
- **Requirement ID:** REQ-085
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-086. REPL Gates Execution on Preflight Acceptance
- **ID:** TEST-086
- **Title:** REPL Gates Execution on Preflight Acceptance
- **Description:** The Nexus REPL source must guard the orchestrator call so that `run_task` is only invoked when the preflight decision is `accepted`; any other decision must short-circuit and return to the prompt.
- **Requirement ID:** REQ-086
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-087. REPL Drives Orchestrator via Bounded-Retry Harness
- **ID:** TEST-087
- **Title:** REPL Drives Orchestrator via Bounded-Retry Harness
- **Description:** The REPL module must invoke `execute_with_governance` from the broker branch, passing the preflight decision and an executor closure built around `orchestrator.run_task`; `orchestrator.run_task` must not be called directly from the broker branch (only via the harness's executor argument).
- **Requirement ID:** REQ-087
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-088. specsmith preflight Resolves Test Case IDs From Machine State
- **ID:** TEST-088
- **Title:** specsmith preflight Resolves Test Case IDs From Machine State
- **Description:** Invoking `specsmith preflight` over a tmp project that contains a REQUIREMENTS.md (REQ-077) and a matching `.specsmith/testcases.json` (TEST-077 → REQ-077) must emit a JSON payload whose `test_case_ids` includes `TEST-077` when the change is accepted; the CLI must never emit ids absent from machine state.
- **Requirement ID:** REQ-088
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-089. Nexus Live l1-nexus Smoke Test Script
- **ID:** TEST-089
- **Title:** Nexus Live l1-nexus Smoke Test Script
- **Description:** `scripts/nexus_smoke.py` must expose a `smoke_test(base_url=...)` function that POSTs a chat-completions request and returns a dict with `ok`, `content`, and `latency_ms`. A pytest test must skip unless `NEXUS_LIVE=1` is set; when invoked offline, the script must surface a clear error rather than crash. Static checks must confirm the script exists and exposes the expected callable.
- **Requirement ID:** REQ-089
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-090. Nexus Documentation Surfaces Broker, Preflight, and Gated Execution
- **ID:** TEST-090
- **Title:** Nexus Documentation Surfaces Broker, Preflight, and Gated Execution
- **Description:** `ARCHITECTURE.md` and `README.md` must each contain a 'Nexus' section that mentions the broker, `specsmith preflight`, the REPL execution gate, and the `/why` toggle; the documentation must not contain literal REQ/TEST/WI tokens outside fenced governance examples.
- **Requirement ID:** REQ-090
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-091. Orchestrator.run_task Returns a Structured TaskResult
- **ID:** TEST-091
- **Title:** Orchestrator.run_task Returns a Structured TaskResult
- **Description:** `orchestrator.run_task` must return a `TaskResult` instance whose attributes include `equilibrium`, `confidence`, `summary`, `files_changed`, and `test_results`. The REPL source must consume that result inside the executor closure (`result.equilibrium`, `result.confidence`) rather than computing equilibrium from `bool(summary)`.
- **Requirement ID:** REQ-091
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-092. specsmith preflight CLI Returns Decision-Specific Exit Codes
- **ID:** TEST-092
- **Title:** specsmith preflight CLI Returns Decision-Specific Exit Codes
- **Description:** Invoking `specsmith preflight` over a tmp project must exit 0 for `accepted` decisions, 2 for `needs_clarification`, and 3 for `blocked`/`rejected`. The JSON payload must continue to be emitted on stdout regardless of exit code.
- **Requirement ID:** REQ-092
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-093. Accepted preflight Records a Ledger Event
- **ID:** TEST-093
- **Title:** Accepted preflight Records a Ledger Event
- **Description:** When the preflight decision is `accepted` and `LEDGER.md` exists in the tmp project root, invoking the CLI must append a new ledger entry tagged with `REQ-085` and the matched `requirement_ids`. When the decision is `needs_clarification`, the ledger must not gain an entry.
- **Requirement ID:** REQ-093
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-094. /why Surfaces Post-Run Governance Block in REPL
- **ID:** TEST-094
- **Title:** /why Surfaces Post-Run Governance Block in REPL
- **Description:** Inspecting the REPL source must show a `[/why]` post-run block guarded by `verbose_governance` after `execute_with_governance` returns; the block must reference `work_item_id`, `requirement_ids`, `test_case_ids`, `confidence`, and `equilibrium`.
- **Requirement ID:** REQ-094
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-095. Nexus Live Smoke Evidence Captured
- **ID:** TEST-095
- **Title:** Nexus Live Smoke Evidence Captured
- **Description:** `.specsmith/runs/WI-NEXUS-011/logs.txt` must exist and document either a successful live smoke (`ok: true`) or an honest reason the live container could not be reached.
- **Requirement ID:** REQ-095
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-096. execute_with_governance Maps Failures to Retry Strategies
- **ID:** TEST-096
- **Title:** execute_with_governance Maps Failures to Retry Strategies
- **Description:** When the executor never reaches equilibrium, `execute_with_governance` must populate `RunResult.strategy` with one of the canonical labels: `narrow_scope`, `expand_scope`, `fix_tests`, `rollback`, or `stop`. The clarifying question must mention the chosen label.
- **Requirement ID:** REQ-096
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-097. specsmith verify CLI Emits Required JSON
- **ID:** TEST-097
- **Title:** specsmith verify CLI Emits Required JSON
- **Description:** Invoking `specsmith verify --stdin --json` with a JSON verification payload via click's CliRunner must return a JSON object containing `equilibrium`, `confidence`, `summary`, `files_changed`, `test_results`, and `retry_strategy`. Exit code is 0 when equilibrium and confidence ≥ threshold, 2 when retry is recommended, and 3 on stop-and-align.
- **Requirement ID:** REQ-097
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-098. Confidence Threshold Read From .specsmith/config.yml
- **ID:** TEST-098
- **Title:** Confidence Threshold Read From .specsmith/config.yml
- **Description:** When `.specsmith/config.yml` sets `epistemic.confidence_threshold: 0.95` (well above the heuristic default), invoking `specsmith preflight` over a tmp project must return `confidence_target >= 0.95`. When the config file is absent, the heuristic default still applies.
- **Requirement ID:** REQ-098
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-099. Accepted Preflight Records work_proposal Event Once
- **ID:** TEST-099
- **Title:** Accepted Preflight Records work_proposal Event Once
- **Description:** When the preflight decision is `accepted` and the assigned `work_item_id` is not already in `LEDGER.md`, the CLI must emit BOTH a `preflight` ledger entry AND a `work_proposal` ledger entry tagged with `REQ-044` and `REQ-085`. A subsequent invocation that surfaces a different work_item_id must emit a second work_proposal entry.
- **Requirement ID:** REQ-099
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-100. Broker Scope Inference Surfaces Stress Warnings Under --stress
- **ID:** TEST-100
- **Title:** Broker Scope Inference Surfaces Stress Warnings Under --stress
- **Description:** Invoking `specsmith preflight "fix the cleanup bug" --stress` over a tmp project that has matched requirements with at least one synthetic critical failure must include a non-empty `stress_warnings` list in the JSON payload. Without `--stress`, the field is absent (or empty).
- **Requirement ID:** REQ-100
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-101. Lint Baseline Is Clean on develop
- **ID:** TEST-101
- **Title:** Lint Baseline Is Clean on develop
- **Description:** `ruff check src/ tests/` and `ruff format --check src/ tests/` both exit zero on `develop`. The CI workflow's `lint` job is the canonical gate; running both commands locally produces "All checks passed!" and "112 files already formatted" (or equivalent for the current file count).
- **Requirement ID:** REQ-101
- **Type:** integration
- **Verification Method:** ci
- **Confidence:** 1.0

## TEST-102. Type-Check Baseline Is Clean on develop
- **ID:** TEST-102
- **Title:** Type-Check Baseline Is Clean on develop
- **Description:** `mypy src/specsmith/` exits zero on `develop`. The CI workflow's `typecheck` job is the canonical gate. Modules added to the `ignore_errors=true` overrides in `pyproject.toml` (REQ-102) must remain enumerated; new modules must justify any addition with a comment.
- **Requirement ID:** REQ-102
- **Type:** integration
- **Verification Method:** ci
- **Confidence:** 1.0

## TEST-103. Security Job Passes With pip-audit ignore-vuln
- **ID:** TEST-103
- **Title:** Security Job Passes With pip-audit ignore-vuln
- **Description:** The CI security job upgrades pip to the latest release, installs `pip-audit`, installs specsmith with its runtime dependencies, then runs `pip-audit --ignore-vuln CVE-2026-3219`. The job exits zero on `develop`.
- **Requirement ID:** REQ-103
- **Type:** integration
- **Verification Method:** ci
- **Confidence:** 1.0

## TEST-104. workitems.json Mirrors Implemented REQs
- **ID:** TEST-104
- **Title:** workitems.json Mirrors Implemented REQs
- **Description:** Running `python scripts/sync_workitems.py` produces a `.specsmith/workitems.json` whose count matches the REQ count, every entry has `status=complete`, and every entry's `test_case_ids` lists the TEST ids that share the matching `requirement_id`.
- **Requirement ID:** REQ-104
- **Type:** integration
- **Verification Method:** script
- **Confidence:** 1.0

## TEST-105. Live Smoke Logs Document Skip Reason
- **ID:** TEST-105
- **Title:** Live Smoke Logs Document Skip Reason
- **Description:** `.specsmith/runs/WI-NEXUS-011/logs.txt` contains a fresh `nexus_smoke.py` probe output (with `"ok": false` or `"ok": true`), a UTC timestamp, the host's docker + GPU info, and a documented reason if the container could not be reached.
- **Requirement ID:** REQ-105
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-106. Kairos Governance Page Surfaces Preflight/Verify/Trace
- **ID:** TEST-106
- **Title:** Kairos Governance Page Surfaces Preflight/Verify/Trace
- **Description:** The Kairos Governance settings page shows the governance-serve health status, the BYOE endpoint URL, and the specsmith updater.
- **Requirement ID:** REQ-106
- **Type:** integration
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-107. ARCHITECTURE.md Has Current State Section
- **ID:** TEST-107
- **Title:** ARCHITECTURE.md Has Current State Section
- **Description:** `ARCHITECTURE.md` contains a heading whose text begins with 'Current State' and whose body references the broker, retry strategies, CI baseline, VS Kairos parity, live-smoke evidence, and documentation surface.
- **Requirement ID:** REQ-107
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-108. Verifier Scores Confidence From Tests/Lint/Type Outputs
- **ID:** TEST-108
- **Title:** Verifier Scores Confidence From Tests/Lint/Type Outputs
- **Description:** `verifier.score(report)` returns higher confidence when test_results report 0 failures, ruff_errors=0, mypy_errors=0; lower confidence when failures > 0; equilibrium=True only when all three gates are clean and confidence >= target.
- **Requirement ID:** REQ-108
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-109. Smoke Overlay File Pins 7B Q4 Model
- **ID:** TEST-109
- **Title:** Smoke Overlay File Pins 7B Q4 Model
- **Description:** `docker-compose.smoke.yml` exists and references a 7B GPTQ-Int4 model + `--served-model-name l1-nexus`. Evidence file `.specsmith/runs/WI-NEXUS-029/logs.txt` exists and references the overlay.
- **Requirement ID:** REQ-109
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-110. End-to-End Nexus Path Reaches Equilibrium
- **ID:** TEST-110
- **Title:** End-to-End Nexus Path Reaches Equilibrium
- **Description:** Driving a `FakeOrchestrator` through `execute_with_governance` with scripted attempt-1 failure and attempt-2 success yields `RunResult.success=True`, ledger gains a preflight + work_proposal entry, and retry strategy is empty.
- **Requirement ID:** REQ-110
- **Type:** integration
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-111. Mypy Strict Carveout Reduced
- **ID:** TEST-111
- **Title:** Mypy Strict Carveout Reduced
- **Description:** `pyproject.toml`'s `[[tool.mypy.overrides]] ignore_errors=true` block does NOT include `specsmith.agent.broker`, `specsmith.agent.safety`, `specsmith.console_utils`, or `specsmith.agent.indexer`. `mypy src/specsmith/` exits zero.
- **Requirement ID:** REQ-111
- **Type:** integration
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-112. Streaming Chat Emits Required JSONL Event Types
- **ID:** TEST-112
- **Title:** Streaming Chat Emits Required JSONL Event Types
- **Description:** Invoking `specsmith chat <utterance> --json-events --project-dir <tmp>` (against a stub orchestrator) emits at least one `block_start`, one `block_complete`, and one `task_complete` event on stdout.
- **Requirement ID:** REQ-112
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-113. Block Schema Has block_id, kind, agent, timestamp
- **ID:** TEST-113
- **Title:** Block Schema Has block_id, kind, agent, timestamp
- **Description:** Every emitted `block_start` event has all four required keys; the matching `block_complete` event reuses the same `block_id` value.
- **Requirement ID:** REQ-113
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-114. Plan Block Surfaces Steps with Status Transitions
- **ID:** TEST-114
- **Title:** Plan Block Surfaces Steps with Status Transitions
- **Description:** When the broker classifies a `change` and the orchestrator runs, a `plan` block is emitted with at least one step; subsequent `plan_step` events reference the step by id and end with `status=done` or `status=failed`.
- **Requirement ID:** REQ-114
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-115. --profile Flag Is Honored And Recorded
- **ID:** TEST-115
- **Title:** --profile Flag Is Honored And Recorded
- **Description:** Passing `--profile safe` to `specsmith chat` causes the chat-event stream to include a `profile` field on the `task_complete` event matching `safe`. Passing `--profile open` gives `profile: open`.
- **Requirement ID:** REQ-115
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-116. Inline Diff Round-Trip
- **ID:** TEST-116
- **Title:** Inline Diff Round-Trip
- **Description:** `specsmith verify --comment 'fix the off-by-one'` records the comment in `task_complete.comments` (or, in chat mode, the next harness retry surfaces it via memory).
- **Requirement ID:** REQ-116
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-117. Predict-Only Preflight Does Not Allocate Work Item
- **ID:** TEST-117
- **Title:** Predict-Only Preflight Does Not Allocate Work Item
- **Description:** `specsmith preflight 'fix the cleanup' --predict-only --json` returns `work_item_id == ''`, includes a `predicted_refinement` field, and does NOT modify `LEDGER.md`.
- **Requirement ID:** REQ-117
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-118. Kairos BYOE Proxy Consumes Chat Stream
- **ID:** TEST-118
- **Title:** Kairos BYOE Proxy Consumes Chat Stream
- **Description:** The Kairos governance proxy at `http://127.0.0.1:7700/v1/chat/completions` accepts agent requests and forwards them through specsmith preflight/verify. *The legacy openChat command test has been retired.*
- **Requirement ID:** REQ-118
- **Type:** integration
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-119. Rules Loader Returns Project Rules As System-Prompt Prefix
- **ID:** TEST-119
- **Title:** Rules Loader Returns Project Rules As System-Prompt Prefix
- **Description:** `rules.load_rules(tmp_path)` reads the seeded `docs/governance/RULES.md` plus AGENTS.md H-rules and returns a non-empty string that contains the rule body verbatim.
- **Requirement ID:** REQ-119
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-120. Memory Append/Read Round-Trip
- **ID:** TEST-120
- **Title:** Memory Append/Read Round-Trip
- **Description:** `memory.append_turn(session_id, turn)` followed by `memory.recent_turns(session_id, max_chars=10000)` returns the appended turn's content; capping by `max_chars` truncates oldest first.
- **Requirement ID:** REQ-120
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-121. MCP Loader Reads .specsmith/mcp.yml
- **ID:** TEST-121
- **Title:** MCP Loader Reads .specsmith/mcp.yml
- **Description:** `mcp.load_mcp_tools(tmp_path)` reads a seeded `.specsmith/mcp.yml` with one entry and returns one tool wrapper whose name matches the configured server.
- **Requirement ID:** REQ-121
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-122. Router Picks Tier From Intent
- **ID:** TEST-122
- **Title:** Router Picks Tier From Intent
- **Description:** `router.choose_tier('change', scope, retry_count=0)` returns `coder`; `choose_tier('release', ...)` returns `heavy`; `choose_tier('read_only_ask', ...)` returns `fast`. Override via `.specsmith/config.yml routing:` is honored.
- **Requirement ID:** REQ-122
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-123. Notebook Record Writes docs/notebooks/<slug>.md
- **ID:** TEST-123
- **Title:** Notebook Record Writes docs/notebooks/<slug>.md
- **Description:** `specsmith notebook record --session-id S --slug demo --project-dir <tmp>` reads `.specsmith/sessions/S/turns.jsonl` and writes a markdown notebook to `docs/notebooks/demo.md` containing each turn.
- **Requirement ID:** REQ-123
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-124. Perf Smoke Writes Baseline JSON
- **ID:** TEST-124
- **Title:** Perf Smoke Writes Baseline JSON
- **Description:** Running `scripts/perf_smoke.py --runs 3 --reqs 50 --output <tmp>/baseline.json` writes a JSON file with `p50`, `p95`, `p99` numeric keys.
- **Requirement ID:** REQ-124
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-125. Multi-Session Parent/Child Wiring
- **ID:** TEST-125
- **Title:** Multi-Session Parent/Child Wiring
- **Description:** `specsmith chat ... --session-id child --parent-session parent` causes the `task_complete` event to also write a `sub_session_complete` line into the parent session's turns.jsonl.
- **Requirement ID:** REQ-125
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-127. Onboarding Doctor Has Required Checks
- **ID:** TEST-127
- **Title:** Onboarding Doctor Has Required Checks
- **Description:** `specsmith doctor --onboarding --project-dir <tmp>` prints a checklist that includes lines for 'CLI installed', 'scaffold.yml', 'REQUIREMENTS.md', and 'LEDGER.md'.
- **Requirement ID:** REQ-127
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-128. Cross-Repo Security Sweep Runs in CI
- **ID:** TEST-128
- **Title:** Cross-Repo Security Sweep Runs in CI
- **Description:** Both `specsmith` and `kairos` CI workflows run security audits (`pip-audit` and `cargo audit` respectively).
- **Requirement ID:** REQ-128
- **Type:** integration
- **Verification Method:** static-check
- **Confidence:** 1.0

## TEST-129. API Stability Doc Enumerates Frozen Surface
- **ID:** TEST-129
- **Title:** API Stability Doc Enumerates Frozen Surface
- **Description:** `docs/site/api-stability.md` exists and enumerates: CLI subcommands, exit codes, JSON payload schemas, broker module API, ledger event schemas, VS Kairos CLI API surface. `pyproject.toml` version is `1.0.0` and classifier is `Production/Stable`.
- **Requirement ID:** REQ-129
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-130. Typed ProjectOperations Layer
- **ID:** TEST-130
- **Title:** Typed ProjectOperations Layer
- **Description:** All tool handlers MUST use a typed `ProjectOperations` class for file, git/VCS, and search operations. Direct raw shell string assembly in tool handlers is prohibited.
- **Requirement ID:** REQ-130
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-131. ProjectOperations File Operations via pathlib
- **ID:** TEST-131
- **Title:** ProjectOperations File Operations via pathlib
- **Description:** `ProjectOperations` MUST expose file operations (`read_file`, `write_file`, `list_dir`, `glob`, `search`) implemented via Python `pathlib`/`stdlib` — no subprocess calls.
- **Requirement ID:** REQ-131
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-132. ProjectOperations Git/VCS Operations
- **ID:** TEST-132
- **Title:** ProjectOperations Git/VCS Operations
- **Description:** `ProjectOperations` MUST expose git/VCS operations (`status`, `log`, `diff`, `add`, `commit`, `push`, `create_branch`, `create_pr`) returning structured result objects.
- **Requirement ID:** REQ-132
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-133. ProjectOperations Typed Result Objects
- **ID:** TEST-133
- **Title:** ProjectOperations Typed Result Objects
- **Description:** All `ProjectOperations` methods MUST return a typed result containing at minimum `exit_code`, `stdout`, `stderr`, and `elapsed_ms`.
- **Requirement ID:** REQ-133
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-134. executor.py run_tracked Preserved as Narrow Fallback
- **ID:** TEST-134
- **Title:** executor.py run_tracked Preserved as Narrow Fallback
- **Description:** The existing `executor.py` `run_tracked()` function MUST be preserved as a narrow fallback for commands that have no Python equivalent.
- **Requirement ID:** REQ-134
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-135. ProjectOperations Cross-Platform
- **ID:** TEST-135
- **Title:** ProjectOperations Cross-Platform
- **Description:** `ProjectOperations` MUST be cross-platform (Windows, Linux, macOS) without platform-specific code branches in call sites.
- **Requirement ID:** REQ-135
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-136. Harness Slash Commands Package
- **ID:** TEST-136
- **Title:** Harness Slash Commands Package
- **Description:** The `commands/` package MUST implement all priority harness slash commands available inside `specsmith run`.
- **Requirement ID:** REQ-136
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-137. Session Management Slash Commands
- **ID:** TEST-137
- **Title:** Session Management Slash Commands
- **Description:** Session management commands MUST include: `/model`, `/provider`, `/tier`, `/status`, `/save`, `/clear`, `/compact`, `/export`.
- **Requirement ID:** REQ-137
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-138. Multi-Agent Slash Commands
- **ID:** TEST-138
- **Title:** Multi-Agent Slash Commands
- **Description:** Multi-agent commands MUST include: `/spawn`, `/team`, `/team-status`, `/worktree`.
- **Requirement ID:** REQ-138
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-139. Continuous Learning Slash Commands
- **ID:** TEST-139
- **Title:** Continuous Learning Slash Commands
- **Description:** Continuous learning commands MUST include: `/learn`, `/learn-eval`, `/instinct-status`, `/instinct-import`, `/instinct-export`.
- **Requirement ID:** REQ-139
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-140. Evaluation Slash Commands
- **ID:** TEST-140
- **Title:** Evaluation Slash Commands
- **Description:** Evaluation commands MUST include: `/eval define`, `/eval run`, `/eval report`, `/eval compare`.
- **Requirement ID:** REQ-140
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-141. Orchestration Slash Commands
- **ID:** TEST-141
- **Title:** Orchestration Slash Commands
- **Description:** Orchestration commands MUST include: `/multi-plan`, `/multi-execute`, `/route`.
- **Requirement ID:** REQ-141
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-142. Hook Control Slash Commands
- **ID:** TEST-142
- **Title:** Hook Control Slash Commands
- **Description:** Hook control commands MUST include: `/hooks-enable`, `/hooks-disable`, `/hook-profile`.
- **Requirement ID:** REQ-142
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-143. MCP Slash Commands
- **ID:** TEST-143
- **Title:** MCP Slash Commands
- **Description:** MCP commands MUST include: `/mcp-list`, `/mcp-add`, `/mcp-configure`.
- **Requirement ID:** REQ-143
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-144. Security Slash Commands
- **ID:** TEST-144
- **Title:** Security Slash Commands
- **Description:** Security commands MUST include: `/security-scan`, `/audit-prompt`.
- **Requirement ID:** REQ-144
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-145. AgentTool for Subagent Spawning
- **ID:** TEST-145
- **Title:** AgentTool for Subagent Spawning
- **Description:** The runner MUST provide an `AgentTool` (TaskTool) as a native LLM-callable tool that spawns subagent instances.
- **Requirement ID:** REQ-145
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-146. Hub-and-Spoke and Agent-Teams Coordination
- **ID:** TEST-146
- **Title:** Hub-and-Spoke and Agent-Teams Coordination
- **Description:** Subagent spawning MUST support hub-and-spoke and agent-teams (peer-to-peer via filesystem mailbox) coordination modes.
- **Requirement ID:** REQ-146
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-147. Filesystem Mailbox for Agent Teams
- **ID:** TEST-147
- **Title:** Filesystem Mailbox for Agent Teams
- **Description:** The filesystem mailbox for agent teams MUST be stored at `.specsmith/teams/{team}/mailbox/{agent}.json`.
- **Requirement ID:** REQ-147
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-148. Git Worktree Isolation for Subagents
- **ID:** TEST-148
- **Title:** Git Worktree Isolation for Subagents
- **Description:** When `isolation=worktree`, the spawner MUST create a git worktree at `.specsmith/worktrees/{agent_id}/`.
- **Requirement ID:** REQ-148
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-149. No Recursive Subagent Nesting
- **ID:** TEST-149
- **Title:** No Recursive Subagent Nesting
- **Description:** Subagents MUST NOT be able to spawn further subagents (no recursive nesting).
- **Requirement ID:** REQ-149
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-150. Distilled Summary from Subagents
- **ID:** TEST-150
- **Title:** Distilled Summary from Subagents
- **Description:** The parent agent MUST receive a distilled summary from each subagent on completion, not the full transcript.
- **Requirement ID:** REQ-150
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-151. Agent Teams Feature Flag Gated
- **ID:** TEST-151
- **Title:** Agent Teams Feature Flag Gated
- **Description:** Agent team mode MUST be gated behind a feature flag (`SPECSMITH_AGENT_TEAMS=1`).
- **Requirement ID:** REQ-151
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-152. Orchestrator Meta-Agent for Routing
- **ID:** TEST-152
- **Title:** Orchestrator Meta-Agent for Routing
- **Description:** specsmith MUST provide an orchestrator meta-agent for task classification, routing, and optimization — not execution.
- **Requirement ID:** REQ-152
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-153. Orchestrator Defaults to Local Ollama
- **ID:** TEST-153
- **Title:** Orchestrator Defaults to Local Ollama
- **Description:** The orchestrator MUST default to a small local Ollama model so orchestration incurs zero cloud API cost.
- **Requirement ID:** REQ-153
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-154. Agent Registry with Capability Metadata
- **ID:** TEST-154
- **Title:** Agent Registry with Capability Metadata
- **Description:** The orchestrator MUST maintain an agent registry with type, model, provider, cost_tier, capabilities, avg_latency_ms, confidence.
- **Requirement ID:** REQ-154
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-155. Orchestrator Emits One Structured Next-Action
- **ID:** TEST-155
- **Title:** Orchestrator Emits One Structured Next-Action
- **Description:** The orchestrator MUST emit exactly one structured next-action per task.
- **Requirement ID:** REQ-155
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-156. Cost-Aware Routing
- **ID:** TEST-156
- **Title:** Cost-Aware Routing
- **Description:** The orchestrator MUST route cheap tasks to Ollama workers and complex tasks to cloud providers.
- **Requirement ID:** REQ-156
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-157. Post-Session Self-Evaluation for Routing Thresholds
- **ID:** TEST-157
- **Title:** Post-Session Self-Evaluation for Routing Thresholds
- **Description:** The orchestrator MUST run a post-session self-evaluation to update routing thresholds.
- **Requirement ID:** REQ-157
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-158. Feature Flag System for Tool Schema Visibility
- **ID:** TEST-158
- **Title:** Feature Flag System for Tool Schema Visibility
- **Description:** specsmith MUST implement a feature-flag system controlling which tool schemas are sent to the LLM.
- **Requirement ID:** REQ-158
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-159. Feature Flags via Environment and scaffold.yml
- **ID:** TEST-159
- **Title:** Feature Flags via Environment and scaffold.yml
- **Description:** Feature flags MUST be configurable via environment variables and `scaffold.yml` under `agent.flags`.
- **Requirement ID:** REQ-159
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-160. Agent Teams and Advanced Features Flag-Gated
- **ID:** TEST-160
- **Title:** Agent Teams and Advanced Features Flag-Gated
- **Description:** Agent teams, worktree isolation, KAIROS daemon mode, security scanner, and MCP tools MUST be flag-gated.
- **Requirement ID:** REQ-160
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-161. Instinct Persistence System
- **ID:** TEST-161
- **Title:** Instinct Persistence System
- **Description:** specsmith MUST implement an instinct persistence system in `src/specsmith/instinct.py`.
- **Requirement ID:** REQ-161
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-162. Instinct Record Schema
- **ID:** TEST-162
- **Title:** Instinct Record Schema
- **Description:** Each instinct record MUST contain: id, trigger_pattern, content, confidence, project_scope, created, last_used, use_count.
- **Requirement ID:** REQ-162
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-163. SESSION_END Hook Extracts Candidate Instincts
- **ID:** TEST-163
- **Title:** SESSION_END Hook Extracts Candidate Instincts
- **Description:** The `SESSION_END` hook MUST extract candidate instincts for user review.
- **Requirement ID:** REQ-163
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-164. /learn Command Promotes Pattern to Instinct
- **ID:** TEST-164
- **Title:** /learn Command Promotes Pattern to Instinct
- **Description:** The `/learn` command MUST promote a pattern to an instinct with an initial confidence score.
- **Requirement ID:** REQ-164
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-165. Instinct Confidence Updated on Application
- **ID:** TEST-165
- **Title:** Instinct Confidence Updated on Application
- **Description:** Instinct confidence MUST be updated based on application success/rejection.
- **Requirement ID:** REQ-165
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-166. Instincts Importable and Exportable as Markdown
- **ID:** TEST-166
- **Title:** Instincts Importable and Exportable as Markdown
- **Description:** Instincts MUST be importable and exportable as `.md` files.
- **Requirement ID:** REQ-166
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-167. /instinct-status Displays Active Instincts
- **ID:** TEST-167
- **Title:** /instinct-status Displays Active Instincts
- **Description:** `/instinct-status` MUST display all active instincts sorted by confidence.
- **Requirement ID:** REQ-167
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-168. Eval Harness Module
- **ID:** TEST-168
- **Title:** Eval Harness Module
- **Description:** specsmith MUST implement an eval harness in `src/specsmith/eval/`.
- **Requirement ID:** REQ-168
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-169. Eval Data Model
- **ID:** TEST-169
- **Title:** Eval Data Model
- **Description:** The eval model MUST define: Task, Trial, Grader, Transcript, Outcome.
- **Requirement ID:** REQ-169
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-170. Eval Tasks Stored as Markdown
- **ID:** TEST-170
- **Title:** Eval Tasks Stored as Markdown
- **Description:** Tasks MUST be stored as Markdown at `.specsmith/evals/{feature}.md` with YAML frontmatter.
- **Requirement ID:** REQ-170
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-171. Three Grader Types
- **ID:** TEST-171
- **Title:** Three Grader Types
- **Description:** The harness MUST support CodeGrader, ModelGrader, and HumanFlag grader types.
- **Requirement ID:** REQ-171
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-172. pass@k and pass^k Metrics
- **ID:** TEST-172
- **Title:** pass@k and pass^k Metrics
- **Description:** The harness MUST compute `pass@k` and `pass^k` metrics.
- **Requirement ID:** REQ-172
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-173. Git-Based Outcome Grading by Default
- **ID:** TEST-173
- **Title:** Git-Based Outcome Grading by Default
- **Description:** Default grading MUST be git-based outcome grading, not execution-path assertion.
- **Requirement ID:** REQ-173
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-174. /eval run --trials k
- **ID:** TEST-174
- **Title:** /eval run --trials k
- **Description:** `/eval run --trials k` MUST run k independent trials and report results.
- **Requirement ID:** REQ-174
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-175. Capability vs Regression Eval Distinction
- **ID:** TEST-175
- **Title:** Capability vs Regression Eval Distinction
- **Description:** The harness MUST distinguish capability evals from regression evals.
- **Requirement ID:** REQ-175
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-176. Cross-Session Agent Memory
- **ID:** TEST-176
- **Title:** Cross-Session Agent Memory
- **Description:** specsmith MUST implement cross-session agent memory in `src/specsmith/memory.py`.
- **Requirement ID:** REQ-176
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-177. Agent Memory Structured JSON
- **ID:** TEST-177
- **Title:** Agent Memory Structured JSON
- **Description:** Agent memory MUST be structured JSON with accumulated patterns, preferred approaches, known project facts, and failure history.
- **Requirement ID:** REQ-177
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-178. SESSION_START Hook Injects Memories into System Prompt
- **ID:** TEST-178
- **Title:** SESSION_START Hook Injects Memories into System Prompt
- **Description:** The `SESSION_START` hook MUST inject relevant memories into the system prompt (token-budget-aware).
- **Requirement ID:** REQ-178
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-179. Agent Memory Compatible with Theia AI Convention
- **ID:** TEST-179
- **Title:** Agent Memory Compatible with Theia AI Convention
- **Description:** Agent memory layout MUST be compatible with Theia AI's `~/.theia/agent-memory/` convention.
- **Requirement ID:** REQ-179
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-180. Runtime Hook Enable/Disable
- **ID:** TEST-180
- **Title:** Runtime Hook Enable/Disable
- **Description:** Hooks MUST be enable/disable-able at runtime without restarting the session.
- **Requirement ID:** REQ-180
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-181. Hook Profiles via /hook-profile
- **ID:** TEST-181
- **Title:** Hook Profiles via /hook-profile
- **Description:** Hook profiles MUST be loadable via `/hook-profile`.
- **Requirement ID:** REQ-181
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-182. New Hook Trigger Events
- **ID:** TEST-182
- **Title:** New Hook Trigger Events
- **Description:** New triggers: `SUBAGENT_START`, `SUBAGENT_STOP`, `CONTEXT_COMPACT`, `EVAL_PASS`, `EVAL_FAIL`.
- **Requirement ID:** REQ-182
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-183. SUBAGENT_START Hook Can Block Spawn
- **ID:** TEST-183
- **Title:** SUBAGENT_START Hook Can Block Spawn
- **Description:** `SUBAGENT_START` MUST fire before spawning; a hook MAY block the spawn.
- **Requirement ID:** REQ-183
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-184. SUBAGENT_STOP Hook on Completion
- **ID:** TEST-184
- **Title:** SUBAGENT_STOP Hook on Completion
- **Description:** `SUBAGENT_STOP` MUST fire when a subagent completes.
- **Requirement ID:** REQ-184
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-185. CONTEXT_COMPACT Hook Before Trimming
- **ID:** TEST-185
- **Title:** CONTEXT_COMPACT Hook Before Trimming
- **Description:** `CONTEXT_COMPACT` MUST fire before context trimming.
- **Requirement ID:** REQ-185
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-186. specsmith serve Command
- **ID:** TEST-186
- **Title:** specsmith serve Command
- **Description:** specsmith MUST provide a `specsmith serve` command (already shipped in v0.7.0).
- **Requirement ID:** REQ-186
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-187. REST Endpoints for Session and Agent Management
- **ID:** TEST-187
- **Title:** REST Endpoints for Session and Agent Management
- **Description:** REST endpoints: `GET/POST /sessions`, `GET /agents`, `GET /instincts`, `GET /evals`, `POST /index`, `GET /health`.
- **Requirement ID:** REQ-187
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-188. WebSocket Endpoint for Live Session I/O
- **ID:** TEST-188
- **Title:** WebSocket Endpoint for Live Session I/O
- **Description:** WebSocket endpoint at `/ws/session/{id}` for live session I/O using the existing JSONL event schema.
- **Requirement ID:** REQ-188
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-189. EventSink Protocol for Stdout and WebSocket
- **ID:** TEST-189
- **Title:** EventSink Protocol for Stdout and WebSocket
- **Description:** `AgentRunner._emit_event()` MUST use an `EventSink` protocol (`StdoutSink` / `WebSocketSink`).
- **Requirement ID:** REQ-189
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-190. Kairos Terminal Connects via HTTP/WebSocket
- **ID:** TEST-190
- **Title:** Kairos Terminal Connects via HTTP/WebSocket
- **Description:** The Kairos terminal MUST connect to `specsmith serve` over HTTP/WebSocket for all governance operations.
- **Requirement ID:** REQ-190
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-191. BM25 Retrieval Ranking
- **ID:** TEST-191
- **Title:** BM25 Retrieval Ranking
- **Description:** `retrieval.py` MUST be upgraded from term-frequency to BM25 ranking using `rank_bm25`.
- **Requirement ID:** REQ-191
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-192. File-Watcher Based Index Refresh
- **ID:** TEST-192
- **Title:** File-Watcher Based Index Refresh
- **Description:** The retrieval index MUST support file-watcher-based refresh.
- **Requirement ID:** REQ-192
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-193. Token-Counted Retrieval Results
- **ID:** TEST-193
- **Title:** Token-Counted Retrieval Results
- **Description:** Retrieval results MUST be token-counted before injection to prevent context budget overruns.
- **Requirement ID:** REQ-193
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-194. MCP Server Configuration Templates
- **ID:** TEST-194
- **Title:** MCP Server Configuration Templates
- **Description:** specsmith MUST provide MCP server configuration templates via `/mcp-add` or `specsmith mcp add`.
- **Requirement ID:** REQ-194
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-195. MCP Server Registry with Status
- **ID:** TEST-195
- **Title:** MCP Server Registry with Status
- **Description:** The MCP server registry MUST list configured servers with status and tool surfaces.
- **Requirement ID:** REQ-195
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-196. MCP Configuration in scaffold.yml
- **ID:** TEST-196
- **Title:** MCP Configuration in scaffold.yml
- **Description:** MCP configuration MUST be storable in `scaffold.yml` under `agent.mcp_servers`.
- **Requirement ID:** REQ-196
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-197. /security-scan Command
- **ID:** TEST-197
- **Title:** /security-scan Command
- **Description:** specsmith MUST provide a `/security-scan` command running a dedicated security analysis agent.
- **Requirement ID:** REQ-197
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-198. Security Scan Coverage
- **ID:** TEST-198
- **Title:** Security Scan Coverage
- **Description:** The security scan MUST check dependency vulnerabilities, OWASP-style code patterns, and exposed secrets.
- **Requirement ID:** REQ-198
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-199. /audit-prompt for Injection Analysis
- **ID:** TEST-199
- **Title:** /audit-prompt for Injection Analysis
- **Description:** `/audit-prompt` MUST analyze a prompt string for injection vectors.
- **Requirement ID:** REQ-199
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-200. Security Scan Results Stored Structurally
- **ID:** TEST-200
- **Title:** Security Scan Results Stored Structurally
- **Description:** Security scan results MUST be structured and stored at `.specsmith/security-reports/`.
- **Requirement ID:** REQ-200
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-201. specsmith-ide Theia Application
- **ID:** TEST-201
- **Title:** specsmith-ide Theia Application
- **Description:** A `specsmith-ide` application MUST be created on Eclipse Theia with `@theia/ai-core`, `@theia/ai-chat`, `@theia/ai-ide`.
- **Requirement ID:** REQ-201
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-202. specsmith-ide Extension Packages
- **ID:** TEST-202
- **Title:** specsmith-ide Extension Packages
- **Description:** specsmith-ide MUST ship: `@specsmith/ai-agents`, `@specsmith/epistemic-ui`, `@specsmith/eval-ui`, `@specsmith/service-client`.
- **Requirement ID:** REQ-202
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-203. specsmith-ide WebSocket Connection to specsmith serve
- **ID:** TEST-203
- **Title:** specsmith-ide WebSocket Connection to specsmith serve
- **Description:** specsmith-ide MUST connect to `specsmith serve` over WebSocket.
- **Requirement ID:** REQ-203
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-204. specsmith-ide Leverages Theia AI Native Tooling
- **ID:** TEST-204
- **Title:** specsmith-ide Leverages Theia AI Native Tooling
- **Description:** specsmith-ide MUST leverage Theia AI's existing MCP support, ShellExecutionTool, and agent skills system.
- **Requirement ID:** REQ-204
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-205. specsmith-ide Electron Desktop Packaging
- **ID:** TEST-205
- **Title:** specsmith-ide Electron Desktop Packaging
- **Description:** specsmith-ide MUST be packageable as an Electron desktop application.
- **Requirement ID:** REQ-205
- **Type:** unit
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-206. Tamper-Evident Agent Action Log
- **ID:** TEST-206
- **Title:** Tamper-Evident Agent Action Log
- **Description:** specsmith MUST maintain a tamper-evident, append-only agent action log capturing every governance decision, tool invocation, input, and output. The log chain MUST use SHA-256 chaining so any modification is detectable. Satisfies EU AI Act Art. 12 (logging obligations) and NIST AI RMF (GO-6).
- **Requirement ID:** REQ-206
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-207. Explanation Artifacts for Governance Decisions
- **ID:** TEST-207
- **Title:** Explanation Artifacts for Governance Decisions
- **Description:** Every governance decision (preflight, verify, classify) MUST produce an 'explanation artifact' recording: what data was used, which requirements were matched, why the decision was reached, and the confidence score. Satisfies EU AI Act Art. 13 (transparency), CFPB adverse-action requirements.
- **Requirement ID:** REQ-207
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-208. Action Log Replay and Export
- **ID:** TEST-208
- **Title:** Action Log Replay and Export
- **Description:** specsmith MUST support structured replay and export of agent action logs for external audit, regulatory submission, or incident investigation. Export format MUST be machine-readable (JSONL) and human-readable (Markdown). Satisfies OMB M-24-10 (AI use case inventories) and EU AI Act post-market monitoring.
- **Requirement ID:** REQ-208
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-209. Human Escalation Threshold
- **ID:** TEST-209
- **Title:** Human Escalation Threshold
- **Description:** specsmith MUST provide a configurable human-escalation threshold. When preflight confidence is below the threshold, or when a destructive/release intent is detected, execution MUST pause and route to human review. Satisfies NIST AI RMF (GO-4), OMB M-24-10 human-in-the-loop requirements.
- **Requirement ID:** REQ-209
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-210. Emergency Kill-Switch and Circuit-Breaker
- **ID:** TEST-210
- **Title:** Emergency Kill-Switch and Circuit-Breaker
- **Description:** specsmith MUST implement an emergency kill-switch that immediately halts agent activity when: (a) the user invokes a stop command, (b) an anomaly detector triggers, or (c) the retry budget is exhausted. The kill-switch MUST be reachable from both the CLI and the REST API. Satisfies EU AI Act Art. 14 (human oversight), NIST AI RMF.
- **Requirement ID:** REQ-210
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-211. Post-Market Behavioral Monitoring and Alerting
- **ID:** TEST-211
- **Title:** Post-Market Behavioral Monitoring and Alerting
- **Description:** specsmith MUST monitor agent behavior across sessions and alert when anomalous patterns are detected: unexpected confidence regression, unusual tool usage rates, or systematic requirement mismatches. Satisfies EU AI Act Art. 72 (post-market monitoring) and OMB M-24-10.
- **Requirement ID:** REQ-211
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-212. One-Click Rollback for File-Modifying Actions
- **ID:** TEST-212
- **Title:** One-Click Rollback for File-Modifying Actions
- **Description:** Every agent action that modifies governance files MUST create a timestamped backup before overwriting, and MUST expose a rollback command that restores the pre-action state. Satisfies NIST AI GenAI Profile (rollback and compensation), CFPB.
- **Requirement ID:** REQ-212
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-213. Safe Append-Only Write for New Governance Entries
- **ID:** TEST-213
- **Title:** Safe Append-Only Write for New Governance Entries
- **Description:** All new entries appended to governance files (LEDGER.md, REQUIREMENTS.md, TESTS.md) MUST use append-only mode — never truncating or overwriting existing content. Protects against data loss from agent errors. Satisfies EU AI Act technical controls and data integrity requirements.
- **Requirement ID:** REQ-213
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-214. AI Disclosure Metadata in Agent Outputs
- **ID:** TEST-214
- **Title:** AI Disclosure Metadata in Agent Outputs
- **Description:** Outputs generated by specsmith agents MUST include AI disclosure metadata when surfaced to end-users: which model was used, provider, confidence level, and whether the output was governance-gated. Satisfies FTC Operation AI Comply, Utah SB149 (2024) disclosure requirements.
- **Requirement ID:** REQ-214
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-215. Regulatory Compliance Export Report
- **ID:** TEST-215
- **Title:** Regulatory Compliance Export Report
- **Description:** specsmith MUST generate a structured compliance export report covering: AI system inventory, risk classification, human oversight controls, audit log summary, and incident history. Satisfies OMB M-24-10, Colorado SB24-205 impact assessments, EU AI Act technical docs.
- **Requirement ID:** REQ-215
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-216. Agent Risk Classification Before Deployment
- **ID:** TEST-216
- **Title:** Agent Risk Classification Before Deployment
- **Description:** Before activating a governance profile or agent session, specsmith MUST classify the intended use case against EU AI Act risk tiers (prohibited, high-risk Annex III, GPAI systemic-risk, or minimal-risk). High-risk use cases MUST require additional confirmation. Satisfies EU AI Act Art. 6 risk-based approach.
- **Requirement ID:** REQ-216
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-217. Least-Privilege Agent Permissions
- **ID:** TEST-217
- **Title:** Least-Privilege Agent Permissions
- **Description:** Every agent session MUST operate with the minimum permissions required. Agent capabilities MUST be explicitly declared, and sensitive operations (commit, push, create PR, external calls) MUST be individually gated. Satisfies EU AI Act agent registration, NIST AI RMF least-privilege principle.
- **Requirement ID:** REQ-217
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-218. Self-Optimization Bounded by Iteration Budget
- **ID:** TEST-218
- **Title:** Self-Optimization Bounded by Iteration Budget
- **Description:** All self-improvement loops (agent improve, eval harness, continuous learning) MUST be bounded by a configurable iteration budget. Unbounded recursion or runaway optimisation MUST be prevented. Satisfies EU AI Act systemic risk controls (GPAISR) and credit spend governance.
- **Requirement ID:** REQ-218
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-219. Local-First Model Routing for Governance Tasks
- **ID:** TEST-219
- **Title:** Local-First Model Routing for Governance Tasks
- **Description:** Governance classification tasks (preflight, verify, classify_intent) MUST default to a local Ollama model (zero cloud cost) and only escalate to cloud APIs when local confidence is below threshold. Reduces credit spend and avoids unnecessary data transfer to third parties.
- **Requirement ID:** REQ-219
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-220. Policy Guardrails at the Interface Layer
- **ID:** TEST-220
- **Title:** Policy Guardrails at the Interface Layer
- **Description:** specsmith MUST enforce allow/deny lists for tool categories and data access patterns at the agent interface layer — not just within prompts. Agents MUST NOT access live production databases or unmanaged data sources. Satisfies EU AI Act technical controls, California ADMT data governance requirements.
- **Requirement ID:** REQ-220
- **Type:** compliance
- **Verification Method:** evaluator
- **Confidence:** 1.0

## TEST-221. GPU-Aware Context Window — VRAM Tiers
- **ID:** TEST-221
- **Title:** GPU-Aware Context Window — VRAM Tiers
- **Description:** suggest_context_window(5.0) returns 4096; suggest_context_window(8.0) returns 8192; suggest_context_window(14.0) returns 16384; suggest_context_window(24.0) returns 32768.
- **Requirement ID:** REQ-244
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-222. GPU VRAM Detection Never Raises
- **ID:** TEST-222
- **Title:** GPU VRAM Detection Never Raises
- **Description:** detect_gpu_vram() returns a float >= 0 on any platform regardless of whether nvidia-smi or rocm-smi is present. Must not raise any exception.
- **Requirement ID:** REQ-244
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-223. ContextFillTracker Records Fill Events
- **ID:** TEST-223
- **Title:** ContextFillTracker Records Fill Events
- **Description:** ContextFillTracker(limit=4096).record(used=1000) returns a ContextFillEvent with type == "context_fill", used == 1000, limit == 4096, pct approximately 24.4.
- **Requirement ID:** REQ-245
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-224. ContextFillTracker Compression Threshold Warning
- **ID:** TEST-224
- **Title:** ContextFillTracker Compression Threshold Warning
- **Description:** ContextFillTracker(limit=4096).record(used=3400) returns a fill event at ~83% fill without raising (below default 85% hard ceiling). A fill event at pct >= compression threshold (80%) is returned for caller dispatch.
- **Requirement ID:** REQ-246
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-225. ContextFullError at Hard Ceiling
- **ID:** TEST-225
- **Title:** ContextFullError at Hard Ceiling
- **Description:** ContextFillTracker(limit=4096).record(used=3600) raises ContextFullError when fill >= 85% (hard ceiling). The error carries used, limit, and pct attributes. The caller MUST trigger emergency compression.
- **Requirement ID:** REQ-247
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-248. Dev/Stable Channel Persistence CLI Round-trip
- **ID:** TEST-248
- **Title:** Dev/Stable Channel Persistence CLI Round-trip
- **Description:** specsmith channel set dev persists the preference; channel get --json returns channel==dev source==user; channel clear reverts source to version.
- **Requirement ID:** REQ-248
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ248ChannelCLI, test_channel.py)
- **Confidence:** 1.0

## TEST-249. ESDB Export Creates Versioned JSON File
- **ID:** TEST-249
- **Title:** ESDB Export Creates Versioned JSON File
- **Description:** specsmith esdb export --json exits 0, returns ok==true + path; the written file contains esdb_version==1, backend, record_count, requirements, testcases.
- **Requirement ID:** REQ-249
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ249EsdbExport)
- **Confidence:** 1.0

## TEST-250. ESDB Import Validates and Stages JSON
- **ID:** TEST-250
- **Title:** ESDB Import Validates and Stages JSON
- **Description:** specsmith esdb import <file> --json exits 0 for valid JSON export, staging it at .specsmith/esdb_import.json. Exits non-zero for missing or invalid JSON files.
- **Requirement ID:** REQ-250
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ250EsdbImport)
- **Confidence:** 1.0

## TEST-251. ESDB Backup Creates Timestamped Snapshot
- **ID:** TEST-251
- **Title:** ESDB Backup Creates Timestamped Snapshot
- **Description:** specsmith esdb backup --json exits 0, creates a file matching esdb_backup_\d{8}T\d{6}Z.json with all required payload keys.
- **Requirement ID:** REQ-251
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ251EsdbBackup)
- **Confidence:** 1.0

## TEST-252. ESDB Rollback Reports Steps Without State Change
- **ID:** TEST-252
- **Title:** ESDB Rollback Reports Steps Without State Change
- **Description:** specsmith esdb rollback --steps N --json exits 0 and returns ok==true, steps_requested==N, records_before. State is unchanged (stub mode).
- **Requirement ID:** REQ-252
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ252EsdbRollback)
- **Confidence:** 1.0

## TEST-253. ESDB Compact Returns OK With Note
- **ID:** TEST-253
- **Title:** ESDB Compact Returns OK With Note
- **Description:** specsmith esdb compact --json exits 0 and returns ok==true, backend, records, note. Human-readable output contains "compact".
- **Requirement ID:** REQ-253
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ253EsdbCompact)
- **Confidence:** 1.0

## TEST-254. Skills Deactivate Sets active=false
- **ID:** TEST-254
- **Title:** Skills Deactivate Sets active=false
- **Description:** After skills activate <id>, skills deactivate <id> exits 0 and the skill's skill.json has active==false. Non-existent skill exits non-zero.
- **Requirement ID:** REQ-254
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ254SkillsDeactivate, TestSkillsBuilderDeactivateDelete)
- **Confidence:** 1.0

## TEST-255. Skills Delete Removes Directory
- **ID:** TEST-255
- **Title:** Skills Delete Removes Directory
- **Description:** skills delete <id> --yes exits 0 and permanently removes the skill directory. Non-existent skill exits non-zero. Sibling skills are preserved.
- **Requirement ID:** REQ-255
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ255SkillsDelete, TestSkillsBuilderDeactivateDelete)
- **Confidence:** 1.0

## TEST-256. MCP Generate Produces Stub With Required Fields
- **ID:** TEST-256
- **Title:** MCP Generate Produces Stub With Required Fields
- **Description:** mcp generate <desc> --json exits 0 and returns a dict containing id, name, command, args (in server sub-object or flat). Description field is stable; different descriptions produce different descriptions.
- **Requirement ID:** REQ-256
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ256McpGenerate)
- **Confidence:** 1.0

## TEST-257. Agent Ask Routes By Keyword And Returns Structured Output
- **ID:** TEST-257
- **Title:** Agent Ask Routes By Keyword And Returns Structured Output
- **Description:** gent ask <prompt> --json-output exits 0 and returns {reply, action, prompt}. Keywords esdb/mcp/skill/compliance route to appropriate actions. Unknown prompt routes to action=="unknown".
- **Requirement ID:** REQ-257
- **Type:** cli
- **Verification Method:** pytest (test_req_248_262.py::TestREQ257AgentAsk)
- **Confidence:** 1.0

## TEST-258. Kairos ESDB Settings Page Renders Without Overflow
- **ID:** TEST-258
- **Title:** Kairos ESDB Settings Page Renders Without Overflow
- **Description:** The Kairos Settings > Specsmith > ESDB page renders the status row, action buttons (Refresh, Export JSON, Import, Backup, Rollback, Compact) without layout errors.
- **Requirement ID:** REQ-258
- **Type:** integration
- **Verification Method:** manual (Rust UI build required)
- **Confidence:** 1.0

## TEST-259. Kairos Skills Settings Page Renders
- **ID:** TEST-259
- **Title:** Kairos Skills Settings Page Renders
- **Description:** The Kairos Settings > Specsmith > Skills page renders header, description, and CLI hint without errors.
- **Requirement ID:** REQ-259
- **Type:** integration
- **Verification Method:** manual (Rust UI build required)
- **Confidence:** 1.0

## TEST-260. Kairos Eval Settings Page Renders
- **ID:** TEST-260
- **Title:** Kairos Eval Settings Page Renders
- **Description:** The Kairos Settings > Specsmith > Eval page renders header, description, and CLI hint without errors.
- **Requirement ID:** REQ-260
- **Type:** integration
- **Verification Method:** manual (Rust UI build required)
- **Confidence:** 1.0

## TEST-261. Kairos AI Providers Table Does Not Overflow Long Model Names
- **ID:** TEST-261
- **Title:** Kairos AI Providers Table Does Not Overflow Long Model Names
- **Description:** In the Kairos Agents > Providers table, the model name "o4-mini-deep-research" is clipped to its column width (200px) and does not bleed into the Model ID column.
- **Requirement ID:** REQ-261
- **Type:** integration
- **Verification Method:** manual (Rust UI build + visual inspection)
- **Confidence:** 1.0

## TEST-262. Kairos MCP AI Builder Card Generates And Saves Stub
- **ID:** TEST-262
- **Title:** Kairos MCP AI Builder Card Generates And Saves Stub
- **Description:** In the Kairos Agents > MCP servers list, the AI Builder card accepts a description, generates a stub via specsmith, displays JSON, and appends to ~/.specsmith/mcp.json on 'Add to config' click.
- **Requirement ID:** REQ-262
- **Type:** integration
- **Verification Method:** manual (Rust UI build required)
- **Confidence:** 1.0

## TEST-263. HF Leaderboard Static Fallback Loads Without Network
- **ID:** TEST-263
- **Title:** HF Leaderboard Static Fallback Loads Without Network
- **Description:** Calling `sync_from_huggingface_blocking(force_static=True)` on an isolated tmp store (no HF network access) returns `{"synced": N, "errors": 0, "message": "...static..."}` with N >= 40 and the store contains scores for "gpt-4o" and "llama3.3:70b".
- **Requirement ID:** REQ-266
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-264. HF Rate-Limit Header Parsing
- **ID:** TEST-264
- **Title:** HF Rate-Limit Header Parsing
- **Description:** `_parse_ratelimit_reset({"RateLimit": '"api";r=5;t=42'})` returns 43.0 (+1 s safety margin). `_parse_ratelimit_reset({})` returns None.
- **Requirement ID:** REQ-264
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-265. Bucket Scoring Engine Correct Weights
- **ID:** TEST-265
- **Title:** Bucket Scoring Engine Correct Weights
- **Description:** `_compute_bucket_scores({"ifeval": 80, "bbh": 70, "math": 60, "gpqa": 50, "musr": 40, "mmlu_pro": 30})` returns reasoning == round(0.35*60 + 0.30*50 + 0.25*70 + 0.10*80, 2), conversational == round(0.40*80 + 0.35*30 + 0.25*70, 2), longform == round(0.35*40 + 0.35*80 + 0.30*30, 2).
- **Requirement ID:** REQ-267
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-266. Model Intelligence Recommendations Returns Top-10
- **ID:** TEST-266
- **Title:** Model Intelligence Recommendations Returns Top-10
- **Description:** `get_recommendations(bucket="reasoning")` on a store with 15 entries returns a list of <=10 items sorted by `reasoning_score` descending. The highest-scoring model is first.
- **Requirement ID:** REQ-268
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-267. Model Intel CLI Scores Subcommand
- **ID:** TEST-267
- **Title:** Model Intel CLI Scores Subcommand
- **Description:** `specsmith model-intel scores --json` exits 0 and returns a dict with key `"scores"` containing a list. `specsmith model-intel scores --model gpt-4o --json` returns `{"score": {...}}` with `"model_name": "gpt-4o"`.
- **Requirement ID:** REQ-269
- **Type:** cli
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-268. Model Intel CLI Sync Subcommand
- **ID:** TEST-268
- **Title:** Model Intel CLI Sync Subcommand
- **Description:** `specsmith model-intel sync --json` exits 0 and returns `{"synced": N, "errors": 0, "message": "..."}` with N >= 0. The command does NOT fail when HF is unreachable (falls back to static).
- **Requirement ID:** REQ-269
- **Type:** cli
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-269. Model Capability Profile Prefix Resolution
- **ID:** TEST-269
- **Title:** Model Capability Profile Prefix Resolution
- **Description:** `get_profile("qwen2.5:14b")` returns a profile with `max_tokens == 4096` and `prompt_style == "sections"`. `get_profile("gpt-4o")` returns `prompt_style == "sections"`. `get_profile("claude-3-5-sonnet-20241022")` returns `prompt_style == "xml"`. `get_profile("unknown-xyz")` returns the default profile.
- **Requirement ID:** REQ-270
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-270. Context History Trimmer Preserves System Messages
- **ID:** TEST-270
- **Title:** Context History Trimmer Preserves System Messages
- **Description:** `trim_history([{role:system, content:"S"*5000}, {role:user, content:"U"*4000}, {role:assistant, content:"A"*4000}], budget_chars=4000)` returns a list where system message is intact and older turns are summarised in an assistant summary message.
- **Requirement ID:** REQ-271
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-271. AI Pacer EMA Fields Present in Snapshot
- **ID:** TEST-271
- **Title:** AI Pacer EMA Fields Present in Snapshot
- **Description:** After two `acquire/release` cycles on a pacer with rpm_limit=10, tpm_limit=5000, `snapshot("test-model")` includes keys `"rpm_ema"` and `"tpm_ema"` both >= 0.0 and both < 1.0.
- **Requirement ID:** REQ-272
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-272. AI Pacer on_rate_limit Decreases Dynamic Concurrency
- **ID:** TEST-272
- **Title:** AI Pacer on_rate_limit Decreases Dynamic Concurrency
- **Description:** Given a pacer with `max_concurrency=4`, after `on_rate_limit("m", err, attempt=1)` the dynamic concurrency in `snapshot()` decreases by 1 (min 1) and the returned delay is > 0.
- **Requirement ID:** REQ-273
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-273. AI Pacer Image Token Estimation
- **ID:** TEST-273
- **Title:** AI Pacer Image Token Estimation
- **Description:** `estimate_request_tokens(model="m", prompt="hello", image_count=2)` returns a value >= 2 * 4096 (the default image_token_estimate). With `image_count=0` the result equals the text token estimate only.
- **Requirement ID:** REQ-274
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-274. LLM Client Fallback on 429
- **ID:** TEST-274
- **Title:** LLM Client Fallback on 429
- **Description:** `LLMClient([FailingProvider(429), MockProvider("ok")])`.chat([{role:user,content:"hi"}]) returns an LLMResult from MockProvider without raising. A `FailingProvider(401)` also triggers fallback.
- **Requirement ID:** REQ-275
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-275. LLM Client O-Series Parameter Translation
- **ID:** TEST-275
- **Title:** LLM Client O-Series Parameter Translation
- **Description:** When `model="o3-mini"` is used, the outgoing request body captured by a capturing mock must contain `"max_completion_tokens"` (not `"max_tokens"`), `"temperature": 1`, and any system message must have `"role": "developer"`.
- **Requirement ID:** REQ-276
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-276. LLM Client vLLM Guided-JSON Payload
- **ID:** TEST-276
- **Title:** LLM Client vLLM Guided-JSON Payload
- **Description:** When provider_type is `byoe` and a `json_schema` dict is passed, the outgoing request body must contain `"guided_json"` and `"chat_template_kwargs": {"enable_thinking": false}`.
- **Requirement ID:** REQ-277
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-277. Endpoint Preset Registry Contains Required Presets
- **ID:** TEST-277
- **Title:** Endpoint Preset Registry Contains Required Presets
- **Description:** `ENDPOINT_PRESETS` contains entries with ids including `vllm`, `lm_studio`, `llama_cpp`, `openrouter`, `together`, `groq`, `fireworks`, `deepinfra`, `perplexity`, `azure_openai`. Each entry has `id`, `label`, `base_url`, `endpoint_kind`, `needs_key`.
- **Requirement ID:** REQ-278
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-278. Endpoint Probe Returns models_detail With context_length
- **ID:** TEST-278
- **Title:** Endpoint Probe Returns models_detail With context_length
- **Description:** `probe_openai_compatible()` against a stub HTTP server returning `{"data": [{"id": "m", "max_model_len": 131072}]}` includes `models_detail[0]["context_length"] == 131072` in the result.
- **Requirement ID:** REQ-279
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-279. Suggested Profiles Inspects Cloud Env
- **ID:** TEST-279
- **Title:** Suggested Profiles Inspects Cloud Env
- **Description:** `suggest_profiles()` with `OPENAI_API_KEY` set in environment returns at least 3 suggestions of `provider_type=="cloud"` covering distinct roles. Suggestions MUST include `reasoning`, `conversational`, or `longform` in their notes or tags.
- **Requirement ID:** REQ-280
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-280. Kairos Model Intel Governance Endpoint
- **ID:** TEST-280
- **Title:** Kairos Model Intel Governance Endpoint
- **Description:** The specsmith governance HTTP server (GovernanceHTTPServer) exposes `GET /api/model-intel/scores` returning `{"scores": [...]}` and `GET /api/model-intel/recommendations` returning `{"recommendations": [...], "bucket": "reasoning"}`.
- **Requirement ID:** REQ-268
- **Type:** integration
- **Verification Method:** pytest (HTTP client against test server)
- **Confidence:** 1.0

## TEST-281. Kairos AI Providers Bucket Score Section Compiles
- **ID:** TEST-281
- **Title:** Kairos AI Providers Bucket Score Section Compiles
- **Description:** The updated `ai_providers_page.rs` in Kairos compiles without errors under `cargo check --package kairos`. The file must contain `model_intel` function call or `bucket_score` field rendering code.
- **Requirement ID:** REQ-281
- **Type:** build
- **Verification Method:** cargo check
- **Confidence:** 1.0

## TEST-282. HF Leaderboard Sync Persists Bucket Scores to JSON
- **ID:** TEST-282
- **Title:** HF Leaderboard Sync Persists Bucket Scores to JSON
- **Description:** `sync_from_huggingface_blocking(force_static=True, scores_path=tmp_path/"scores.json")` creates the file at the given path, whose JSON root contains a `"bucket_scores"` dict. Each entry has `reasoning_score`, `conversational_score`, `longform_score`, and `model_name` keys.
- **Requirement ID:** REQ-263
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-283. HF Token Included in Request Headers When Set
- **ID:** TEST-283
- **Title:** HF Token Included in Request Headers When Set
- **Description:** When `SPECSMITH_HF_TOKEN` is set to a non-empty string, `test_hf_connection()` returns `{"token_set": true}` and the rate_limit_tier includes "authenticated". The `_fetch_page` request (captured via mock) includes `Authorization: Bearer <token>` in its headers.
- **Requirement ID:** REQ-265
- **Type:** unit
- **Verification Method:** pytest
- **Confidence:** 1.0

## TEST-300. YAML-First Sync Reads YAML and Writes JSON + MD
- **ID:** TEST-300
- **Title:** YAML-First Sync Reads YAML and Writes JSON + MD
- **Description:** When `.specsmith/governance-mode` == `yaml` and docs/requirements/*.yml exist, `specsmith sync` reads from YAML files, writes .specsmith/ requirements.json + testcases.json, and regenerates docs/REQUIREMENTS.md + docs/TESTS.md. `specsmith sync --check` exits 0 after sync. In legacy mode (no governance-mode file), sync reads from REQUIREMENTS.md as before.
- **Requirement ID:** REQ-300
- **Type:** integration
- **Verification Method:** pytest
- **Input:** tmp_path with YAML files + governance-mode=yaml
- **Expected Behavior:** JSON updated; REQUIREMENTS.md regenerated; sync --check exits 0
- **Confidence:** 1.0

## TEST-301. validate --strict Enforces All 8 Schema Checks
- **ID:** TEST-301
- **Title:** validate --strict Enforces All 8 Schema Checks
- **Description:** `specsmith validate --strict --json` returns `{ok: true, strict_errors: 0}` on a clean project. When a duplicate REQ ID is injected, strict_errors > 0 and exit code is 1. When an untested REQ exists, strict_warnings > 0 but exit code is still 0. The `validate-strict` CI job runs this gate on every push.
- **Requirement ID:** REQ-301
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith validate --strict --json; inject duplicate REQ; inject untested REQ
- **Expected Behavior:** clean project exits 0 strict_errors=0; dup exits 1; untested exits 0 with warning
- **Confidence:** 1.0

## TEST-302. generate docs Renders YAML to REQUIREMENTS.md and TESTS.md
- **ID:** TEST-302
- **Title:** generate docs Renders YAML to REQUIREMENTS.md and TESTS.md
- **Description:** `specsmith generate docs --json` in YAML-first mode exits 0 and returns `{ok: true, reqs: N, tests: M}`. The regenerated docs/REQUIREMENTS.md contains a heading for each REQ in the YAML files. `--check` flag reports changes without writing.
- **Requirement ID:** REQ-302
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith generate docs --json; specsmith generate docs --check --json
- **Expected Behavior:** exits 0; ok=true; REQUIREMENTS.md updated; check exits 0 with dry_run=true
- **Confidence:** 1.0

## TEST-303. governance-mode Flag Controls YAML vs Markdown Authority
- **ID:** TEST-303
- **Title:** governance-mode Flag Controls YAML vs Markdown Authority
- **Description:** `is_yaml_mode(root)` returns True when `.specsmith/governance-mode` == `yaml` and False when the file is absent or contains `markdown`. `specsmith sync` uses YAML sources when yaml_mode=True and Markdown sources when False. The flag is preserved across specsmith upgrades.
- **Requirement ID:** REQ-303
- **Type:** unit
- **Verification Method:** pytest
- **Input:** governance-mode = yaml; governance-mode absent; governance-mode = markdown
- **Expected Behavior:** is_yaml_mode returns True/False/False respectively
- **Confidence:** 1.0

## TEST-304. Migration Script Is Idempotent
- **ID:** TEST-304
- **Title:** Migration Script Is Idempotent
- **Description:** Running `scripts/migrate_governance_to_yaml.py` twice produces the same result as running it once. After migration: docs/requirements/ and docs/tests/ contain YAML files, .specsmith/governance-mode == `yaml`, and `specsmith sync --check` exits 0.
- **Requirement ID:** REQ-304
- **Type:** integration
- **Verification Method:** script
- **Input:** scripts/migrate_governance_to_yaml.py run twice on same project
- **Expected Behavior:** second run produces no changes; governance-mode=yaml; sync --check exits 0
- **Confidence:** 1.0

## TEST-305. ChronoStore WAL-Based ESDB Write Layer
- **ID:** TEST-305
- **Title:** ChronoStore WAL-Based ESDB Write Layer
- **Description:** ChronoStore MUST append events as NDJSON with SHA-256 hash chaining to <project>/.chronomemory/events.wal. EsdbBridge.status() returns chain_valid=True after appending records.
- **Requirement ID:** REQ-305
- **Type:** integration
- **Verification Method:** pytest
- **Input:** ChronoStore(tmp_path) append 3 records; EsdbBridge(tmp_path).status()
- **Expected Behavior:** WAL file exists with chained hashes; chain_valid=True
- **Confidence:** 0.95

## TEST-306. ESDB Must Be Per-Project
- **ID:** TEST-306
- **Title:** ESDB Must Be Per-Project
- **Description:** Two EsdbBridge instances on separate 	mp_path directories MUST have independent .chronomemory/events.wal files; records from project A are not visible in project B.
- **Requirement ID:** REQ-306
- **Type:** integration
- **Verification Method:** pytest
- **Input:** Two EsdbBridge instances on different tmp_path directories
- **Expected Behavior:** Each project has independent WAL; no cross-contamination
- **Confidence:** 0.95

## TEST-307. Session State Must Survive Restart
- **ID:** TEST-307
- **Title:** Session State Must Survive Restart
- **Description:** SessionStore MUST persist session context to .specsmith/session-state.json. A new SessionStore instance on the same path MUST load the saved state.
- **Requirement ID:** REQ-307
- **Type:** integration
- **Verification Method:** pytest
- **Input:** SessionStore(tmp_path) save; new SessionStore(tmp_path) load
- **Expected Behavior:** Loaded state matches saved state; session-state.json exists
- **Confidence:** 0.95

## TEST-308. Context Orchestrator Tiered Auto-Optimization
- **ID:** TEST-308
- **Title:** Context Orchestrator Tiered Auto-Optimization
- **Description:** ContextOrchestrator.optimize(fill_pct=N) MUST apply the correct tier. Data on disk MUST NEVER be deleted at any tier.
- **Requirement ID:** REQ-308
- **Type:** integration
- **Verification Method:** pytest
- **Input:** optimize(65), optimize(82), optimize(88) on ContextOrchestrator(tmp_path)
- **Expected Behavior:** Correct tier actions returned; no files deleted from disk
- **Confidence:** 0.9

## TEST-309. CI Automation Togglable Per Project
- **ID:** TEST-309
- **Title:** CI Automation Togglable Per Project
- **Description:** CiManager.enable(platform=github, force=True) MUST generate CI workflow files and persist ci_automation_enabled=true to .specsmith/config.yml.
- **Requirement ID:** REQ-309
- **Type:** cli
- **Verification Method:** pytest
- **Input:** CiManager(tmp_path).enable(platform=github, force=True)
- **Expected Behavior:** CI files generated; config.yml has ci_automation_enabled=true
- **Confidence:** 0.9

## TEST-310. OEA Anti-Hallucination Fields on ESDB Records
- **ID:** TEST-310
- **Title:** OEA Anti-Hallucination Fields on ESDB Records
- **Description:** ChronoRecord(kind=test, payload={}) with no OEA arguments MUST default all 7 OEA fields to safe non-blocking values.
- **Requirement ID:** REQ-310
- **Type:** unit
- **Verification Method:** pytest
- **Input:** ChronoRecord(kind=test, payload={}) inspect all 7 OEA fields
- **Expected Behavior:** source_type=observed, confidence=1.0, evidence=[], is_hypothesis=False, recursion_depth=0
- **Confidence:** 0.95

## TEST-311. RAG Retrieval Must Filter by Confidence
- **ID:** TEST-311
- **Title:** RAG Retrieval Must Filter by Confidence
- **Description:** ESDB retrieval MUST exclude records with confidence < min_confidence. Records at exactly the threshold MUST be included.
- **Requirement ID:** REQ-311
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Append records with confidence 0.3, 0.7, 0.9; query(min_confidence=0.7)
- **Expected Behavior:** Only confidence >= 0.7 records returned; 0.3 excluded
- **Confidence:** 0.9

## TEST-312. Context Optimize Command
- **ID:** TEST-312
- **Title:** Context Optimize Command
- **Description:** specsmith context optimize --fill-pct N --json MUST exit 0 and return JSON with 	ier, ctions, and 	okens_freed.
- **Requirement ID:** REQ-312
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith context optimize --fill-pct 65 --json --project-dir tmp
- **Expected Behavior:** Exit 0; JSON contains tier, actions list, tokens_freed integer
- **Confidence:** 0.9

## TEST-313. Dispatch Run Appends Ledger Entry
- **ID:** TEST-313
- **Title:** Dispatch Run Appends Ledger Entry
- **Description:** After dispatching a single-node DAG to completion via AgentDispatcher, a governance ledger entry MUST exist in LEDGER.md containing dag_id, task, node counts, and equilibrium result.
- **Requirement ID:** REQ-313
- **Type:** integration
- **Verification Method:** pytest
- **Input:** AgentDispatcher.run() on single-node DAG; inspect LEDGER.md
- **Expected Behavior:** LEDGER.md contains dispatch ledger entry with dag_id and equilibrium=True
- **Confidence:** 0.9

## TEST-314. node_started Payload Contains Worker Role
- **ID:** TEST-314
- **Title:** node_started Payload Contains Worker Role
- **Description:** EventEmitter.node_started() MUST persist a role key in the payload of the node_started JSONL event. Replay must return the same role.
- **Requirement ID:** REQ-314
- **Type:** unit
- **Verification Method:** pytest
- **Input:** EventEmitter(tmp_path, 'dag'); node_started('n1', 'coder'); replay()
- **Expected Behavior:** Replayed node_started event has payload.role == 'coder'
- **Confidence:** 1.0

## TEST-315. DispatchSummary Contains dag_id for Traceability
- **ID:** TEST-315
- **Title:** DispatchSummary Contains dag_id for Traceability
- **Description:** DispatchSummary.dag_id MUST match the TaskDAG.dag_id used to create the dispatcher. CLI output MUST display the dag_id on completion.
- **Requirement ID:** REQ-315
- **Type:** unit
- **Verification Method:** pytest
- **Input:** TaskDAGBuilder.build('t', dag_id='trace-001'); run; summary.dag_id
- **Expected Behavior:** summary.dag_id == 'trace-001'
- **Confidence:** 1.0

## TEST-316. Governance Block Recorded in Node Error
- **ID:** TEST-316
- **Title:** Governance Block Recorded in Node Error
- **Description:** When _governance_preflight raises _GovernanceBlockedError, the DispatchResult.error MUST start with 'Governance preflight blocked'.
- **Requirement ID:** REQ-316
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Mock _governance_preflight to raise _GovernanceBlockedError('denied')
- **Expected Behavior:** summary.failed[0].error starts with 'Governance preflight blocked'
- **Confidence:** 1.0

## TEST-317. Context Injection via ESDB Record IDs Is Traceable
- **ID:** TEST-317
- **Title:** Context Injection via ESDB Record IDs Is Traceable
- **Description:** TaskNode.context_in MUST contain the esdb_record_id of a completed predecessor node after _propagate_context runs. The context_in list is part of TaskNode.to_dict() and available for replay inspection.
- **Requirement ID:** REQ-317
- **Type:** unit
- **Verification Method:** pytest
- **Input:** 2-node DAG; complete root with esdb_id='rec-xyz'; check child.context_in
- **Expected Behavior:** child.context_in contains 'rec-xyz'
- **Confidence:** 1.0

## TEST-318. Completed Nodes Not Re-Executed on Retry
- **ID:** TEST-318
- **Title:** Completed Nodes Not Re-Executed on Retry
- **Description:** dispatch retry must identify node_completed events from events.jsonl and refuse to retry nodes whose last event is node_completed. The retry CLI command returns an error when asked to retry a completed node.
- **Requirement ID:** REQ-318
- **Type:** cli
- **Verification Method:** pytest
- **Input:** EventEmitter with node_completed; CliRunner invoke dispatch retry --node n1
- **Expected Behavior:** CLI exits 0 but prints 'already completed'; does not start new run
- **Confidence:** 0.9

## TEST-319. ESDB dispatch_result Record Contains DAG Lineage
- **ID:** TEST-319
- **Title:** ESDB dispatch_result Record Contains DAG Lineage
- **Description:** ChronoRecords written by _write_esdb_record MUST have dag_id and node_id in both evidence list and data dict.
- **Requirement ID:** REQ-319
- **Type:** unit
- **Verification Method:** pytest
- **Input:** _write_esdb_record(node, run_result); inspect ChronoRecord
- **Expected Behavior:** record.evidence contains 'dag=...' and 'node=...'; record.data has dag_id and node_id keys
- **Confidence:** 1.0

## TEST-320. Abort Signal Recorded as Aborted in Error
- **ID:** TEST-320
- **Title:** Abort Signal Recorded as Aborted in Error
- **Description:** When abort_node() is called before or during node execution, the FAILED DispatchResult.error MUST contain the string 'Aborted'.
- **Requirement ID:** REQ-320
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Pre-arm abort_node('task-main'); run dispatcher; check summary.failed
- **Expected Behavior:** summary.failed[0].error contains 'Aborted'
- **Confidence:** 1.0

## TEST-321. Orchestrator Is Sole Dispatch Entry Point
- **ID:** TEST-321
- **Title:** Orchestrator Is Sole Dispatch Entry Point
- **Description:** The Orchestrator source MUST document REQ-321 and the sole-entry-point constraint. Worker agents MUST NOT expose a public method to initiate dispatches.
- **Requirement ID:** REQ-321
- **Type:** unit
- **Verification Method:** pytest
- **Input:** inspect.getsource(orchestrator); check for REQ-321 and 'sole entry point'
- **Expected Behavior:** Both strings present in source; no AgentDispatcher.run() call outside orchestrator
- **Confidence:** 0.95

## TEST-322. DAG Decomposition Before Worker Dispatch
- **ID:** TEST-322
- **Title:** DAG Decomposition Before Worker Dispatch
- **Description:** TaskDAGBuilder.build() decomposes task into a valid acyclic DAG. Cycles raise DAGValidationError before any worker starts. Single-node fallback used when no planner output is provided.
- **Requirement ID:** REQ-322
- **Type:** integration
- **Verification Method:** pytest
- **Input:** Build DAG from plan list; build DAG from JSON string; build with cycle; build with no planner output
- **Expected Behavior:** Valid plan builds DAG; JSON string extracted and built; cycle raises DAGValidationError; no planner builds single-node fallback
- **Confidence:** 1.0

## TEST-323. TaskNode Must Carry Required Fields
- **ID:** TEST-323
- **Title:** TaskNode Must Carry Required Fields
- **Description:** A TaskNode constructed with minimal args MUST default status=PENDING, context_in=[], context_out=None, result=None. to_dict() MUST include all required fields.
- **Requirement ID:** REQ-323
- **Type:** unit
- **Verification Method:** pytest
- **Input:** TaskNode(id=n, title=T, role=coder, depends_on=[dep])
- **Expected Behavior:** All 8 REQ-323 fields populated with correct types and defaults
- **Confidence:** 1.0

## TEST-324. Concurrent Dispatch Bounded by max_workers
- **ID:** TEST-324
- **Title:** Concurrent Dispatch Bounded by max_workers
- **Description:** AgentPool MUST return None when active_count >= max_workers, preventing over-dispatch. Pool with idle workers returns a reused agent without spawning.
- **Requirement ID:** REQ-324
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Pool at capacity; pool with idle worker
- **Expected Behavior:** acquire() returns None at cap; acquire() returns idle worker without spawning new agent
- **Confidence:** 1.0

## TEST-325. Fail-Forward BLOCKED Propagation
- **ID:** TEST-325
- **Title:** Fail-Forward BLOCKED Propagation
- **Description:** When a node transitions to FAILED, all transitive dependents are marked BLOCKED while non-dependent siblings remain PENDING. all_terminal() returns True after full propagation of a single-dependency chain.
- **Requirement ID:** REQ-325
- **Type:** integration
- **Verification Method:** pytest
- **Input:** 4-node DAG; fail impl; check review=BLOCKED and test=PENDING
- **Expected Behavior:** review BLOCKED; test unaffected; all_terminal() True after a+b fail+block
- **Confidence:** 1.0

## TEST-326. AgentPool Must Reuse Idle Workers
- **ID:** TEST-326
- **Title:** AgentPool Must Reuse Idle Workers
- **Description:** After release(), a subsequent acquire() for the same role returns the previously released agent object without spawning a new one.
- **Requirement ID:** REQ-326
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Insert sentinel into pool._idle['coder']; call acquire('coder')
- **Expected Behavior:** acquire() returns sentinel; active_count increments; release() decrements count and returns sentinel to idle
- **Confidence:** 1.0

## TEST-327. ESDB Context Written on Node Completion
- **ID:** TEST-327
- **Title:** ESDB Context Written on Node Completion
- **Description:** AgentDispatcher calls _write_esdb_record on node completion and sets context_out. Downstream nodes receive context_in populated with predecessor record ID.
- **Requirement ID:** REQ-327
- **Type:** integration
- **Verification Method:** pytest
- **Input:** Single-node DAG with mocked worker; mock _write_esdb_record returning 'rec-xyz'
- **Expected Behavior:** summary.completed[0].esdb_record_id == 'rec-xyz'; node.context_out set
- **Confidence:** 0.9

## TEST-328. DAG State Transitions Persisted as JSONL Events
- **ID:** TEST-328
- **Title:** DAG State Transitions Persisted as JSONL Events
- **Description:** EventEmitter writes node_started, node_completed, node_failed, and dag_done events as JSONL to .specsmith/dispatch/<dag_id>/events.jsonl. The file is created before the first emit.
- **Requirement ID:** REQ-328
- **Type:** integration
- **Verification Method:** pytest
- **Input:** EventEmitter(tmp_path, 'dag-id'); emit node_started, node_completed, node_failed
- **Expected Behavior:** events.jsonl exists immediately after construction; 3 JSONL lines with correct event_type values
- **Confidence:** 1.0

## TEST-329. Per-Node Governance Preflight Before Worker Start
- **ID:** TEST-329
- **Title:** Per-Node Governance Preflight Before Worker Start
- **Description:** AgentDispatcher._governance_preflight() is called for each node before worker acquisition. A mock that raises _GovernanceBlockedError causes the node to transition to FAILED without calling _invoke_worker.
- **Requirement ID:** REQ-329
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Single-node DAG; patch _governance_preflight to raise; mock _invoke_worker
- **Expected Behavior:** _invoke_worker not called; node.status = FAILED; summary.failed contains node
- **Confidence:** 0.9

## TEST-330. DAG Run Must Be Resumable from Checkpoint
- **ID:** TEST-330
- **Title:** DAG Run Must Be Resumable from Checkpoint
- **Description:** EventEmitter.replay() returns all persisted events for a dag_id. dispatch retry command identifies FAILED/BLOCKED nodes from past events and re-executes only those nodes.
- **Requirement ID:** REQ-330
- **Type:** integration
- **Verification Method:** pytest
- **Input:** EventEmitter(tmp_path, dag); emit node_started+completed+dag_done; call EventEmitter.replay()
- **Expected Behavior:** replay() returns 3 events in order; list_runs() includes dag_id
- **Confidence:** 1.0

## TEST-331. Dispatch CLI Group with run/status/list/retry
- **ID:** TEST-331
- **Title:** Dispatch CLI Group with run/status/list/retry
- **Description:** specsmith dispatch --help lists run, status, list, retry. Each subcommand shows expected options. dispatch list on empty project exits 0. dispatch status with unknown dag_id exits 0.
- **Requirement ID:** REQ-331
- **Type:** cli
- **Verification Method:** pytest
- **Input:** CliRunner invoke dispatch --help; dispatch run --help; dispatch list; dispatch status --dag-id nonexistent
- **Expected Behavior:** All exit 0; --help shows expected subcommands and options
- **Confidence:** 1.0

## TEST-332. Kairos Live DAG Graph Panel
- **ID:** TEST-332
- **Title:** Kairos Live DAG Graph Panel
- **Description:** DispatchApp renders a DAG graph panel subscribed to the SSE stream. Nodes are coloured by status. A node click opens a side panel with role, summary, ESDB record ID.
- **Requirement ID:** REQ-332
- **Type:** integration
- **Verification Method:** evaluator
- **Input:** Kairos DispatchApp with mock SSE events for each NodeStatus variant
- **Expected Behavior:** Each node rendered in correct colour; side panel opens on click showing node metadata
- **Confidence:** 0.85

## TEST-333. Kairos Gantt Timeline Strip
- **ID:** TEST-333
- **Title:** Kairos Gantt Timeline Strip
- **Description:** GanttStrip renders one row per node with a time-proportional bar. Nodes with overlapping started_at/finished_at ranges show visual concurrency.
- **Requirement ID:** REQ-333
- **Type:** integration
- **Verification Method:** evaluator
- **Input:** GanttStrip with 2 nodes having overlapping start/end times
- **Expected Behavior:** Both nodes show bars; bar widths proportional to duration; overlap visible
- **Confidence:** 0.85

## TEST-334. Kairos Per-Node Retry and Abort Controls
- **ID:** TEST-334
- **Title:** Kairos Per-Node Retry and Abort Controls
- **Description:** ControlsPanel Retry button is enabled for FAILED/BLOCKED nodes and disabled for others. Abort button is enabled only for RUNNING nodes. Clicking calls the correct POST endpoint.
- **Requirement ID:** REQ-334
- **Type:** unit
- **Verification Method:** evaluator
- **Input:** ControlsPanel for each NodeStatus (Pending/Running/Completed/Failed/Blocked)
- **Expected Behavior:** Retry enabled only for Failed/Blocked; Abort enabled only for Running; click invokes correct action callback
- **Confidence:** 0.9

## TEST-335. specsmith test-ran Records Test Result in testcases.json
- **ID:** TEST-335
- **Title:** specsmith test-ran Records Test Result in testcases.json
- **Description:** Running `specsmith test-ran TEST-001 --result passed` on a project with a valid testcases.json MUST: (1) update last_result to 'passed' and set last_run_at to an ISO-8601 UTC timestamp; (2) transition status from pending to implemented; (3) write a ledger entry of type test-ran; (4) exit 0. Running with --result failed MUST set status to failing. Running with an unknown TEST-ID MUST exit 1. Running with --json MUST emit a valid JSON payload with ok, test_id, result, old_status, new_status, and recorded_at fields.
- **Requirement ID:** REQ-335
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith test-ran TEST-001 --result passed / failed / unknown-id / --json
- **Expected Behavior:** testcases.json updated; status transitions correct; ledger entry written; exit codes correct; JSON output valid
- **Confidence:** 0.95

## TEST-336. specsmith save Performs Backup, Commit, and Push
- **ID:** TEST-336
- **Title:** specsmith save Performs Backup, Commit, and Push
- **Description:** `specsmith save` on a project with pending governance changes MUST create a timestamped backup under .chronomemory/backup/, git-commit all changed files, and git-push to origin. With --json it MUST emit {backup_path, commit_hash, push_ok}. With no pending changes it MUST exit 0 with a 'nothing to commit' message. On push failure it MUST exit 1 with an informative error.
- **Requirement ID:** REQ-336
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith save [--json] on project with dirty governance files; repeat with clean repo
- **Expected Behavior:** Backup created; git commit recorded; push attempted; exit 0 on success; --json payload valid; clean repo exits 0 with 'nothing to commit'
- **Confidence:** 0.95

## TEST-337. specsmith load Pulls Latest Governance State
- **ID:** TEST-337
- **Title:** specsmith load Pulls Latest Governance State
- **Description:** `specsmith load` MUST execute git-pull on the current branch and report files changed. With `--restore-backup` it MUST also restore the most recent backup from .chronomemory/backup/. With --json it MUST emit {pull_ok, files_changed, backup_restored}. On merge conflict git-pull it MUST exit 1 with the conflict details.
- **Requirement ID:** REQ-337
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith load [--restore-backup] [--json] on project with remote changes
- **Expected Behavior:** git-pull executed; files_changed count correct; backup optionally restored; --json payload valid; conflict exits 1
- **Confidence:** 0.9

## TEST-338. specsmith_run Tool Normalises Slash-Command and Verb Shortcut Forms
- **ID:** TEST-338
- **Title:** specsmith_run Tool Normalises Slash-Command and Verb Shortcut Forms
- **Description:** specsmith_run('/specsmith save') MUST execute `specsmith save`. specsmith_run('save') MUST execute `specsmith save`. specsmith_run('specsmith audit --strict') MUST execute `specsmith audit --strict`. specsmith_run('') MUST execute `specsmith --help`. specsmith_run MUST appear in AVAILABLE_TOOLS and build_tool_registry() and carry epistemic_claims listing side-effect categories.
- **Requirement ID:** REQ-338
- **Type:** unit
- **Verification Method:** pytest
- **Input:** specsmith_run('/specsmith save'); specsmith_run('save'); specsmith_run('specsmith audit --strict'); specsmith_run('')
- **Expected Behavior:** All three input forms resolve to the correct specsmith subprocess call; empty input triggers --help; tool registered with correct metadata
- **Confidence:** 0.95

## TEST-339. M005 Migration Writes agent-tools.json and Patches AGENTS.md
- **ID:** TEST-339
- **Title:** M005 Migration Writes agent-tools.json and Patches AGENTS.md
- **Description:** Running AgentRunToolMigration().run(project_root) MUST create .specsmith/agent-tools.json with primary_governance_command=specsmith_run and the full verb_shortcuts list. It MUST append a Governance commands section to AGENTS.md and write .specsmith/agents.md.m005.bak. dry_run=True MUST report expected changes without writing. rollback() MUST remove agent-tools.json and restore AGENTS.md from backup. M005 MUST appear in MigrationRegistry.all().
- **Requirement ID:** REQ-339
- **Type:** integration
- **Verification Method:** pytest
- **Input:** AgentRunToolMigration().run(tmp_path); dry_run=True; rollback()
- **Expected Behavior:** agent-tools.json written with correct schema; AGENTS.md patched; backup created; dry_run produces no files; rollback restores state; registry includes v5
- **Confidence:** 0.95

## TEST-340. /specsmith REPL Handler Streams CLI Output
- **ID:** TEST-340
- **Title:** /specsmith REPL Handler Streams CLI Output
- **Description:** In the Nexus REPL, entering `/specsmith status` MUST invoke `specsmith status` as a subprocess with shell=True, streaming output to the terminal (capture_output=False). `/specsmith` with no args MUST invoke `specsmith --help`. A subprocess timeout MUST print a timeout message without crashing the REPL loop. The REPL startup banner MUST contain the string '/specsmith'.
- **Requirement ID:** REQ-340
- **Type:** unit
- **Verification Method:** pytest
- **Input:** NEXUS_BANNER string; mock subprocess.run for /specsmith status; /specsmith with no args; timeout simulation
- **Expected Behavior:** Banner contains '/specsmith'; subprocess called with correct args; timeout handled gracefully; REPL loop continues after error
- **Confidence:** 0.9

## TEST-341. terminal-awareness Skill Exists in Skills Catalog
- **ID:** TEST-341
- **Title:** terminal-awareness Skill Exists in Skills Catalog
- **Description:** specsmith.skills.get('terminal-awareness') MUST return a non-None SkillEntry with domain=CROSS_PLATFORM. The skill body MUST contain sections for shell detection, PowerShell 5 vs 7 differences, cmd.exe rules, bash/zsh/fish, Python subprocess PID tracking, and a cleanup checklist. specsmith skill list MUST include terminal-awareness in its output.
- **Requirement ID:** REQ-341
- **Type:** unit
- **Verification Method:** pytest
- **Input:** from specsmith.skills import get; get('terminal-awareness')
- **Expected Behavior:** Non-None SkillEntry; domain=CROSS_PLATFORM; body contains expected sections
- **Confidence:** 0.95

## TEST-342. Shell Detection Returns Correct Shell for Active Environment
- **ID:** TEST-342
- **Title:** Shell Detection Returns Correct Shell for Active Environment
- **Description:** The detect_shell() example in terminal-awareness skill MUST return 'bash' when SHELL ends with 'bash', 'zsh' when SHELL ends with 'zsh', 'fish' when SHELL ends with 'fish', 'cmd' when ComSpec is set, and 'powershell' when PSModulePath is set but ComSpec is not.
- **Requirement ID:** REQ-342
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Patch os.environ for each shell type; call detect_shell()
- **Expected Behavior:** Returns correct shell string for each patched environment
- **Confidence:** 0.9

## TEST-343. run_tracked Uses DEVNULL stdin and communicate with Timeout
- **ID:** TEST-343
- **Title:** run_tracked Uses DEVNULL stdin and communicate with Timeout
- **Description:** specsmith.executor.run_tracked MUST call subprocess.Popen with stdin=subprocess.DEVNULL and must call proc.communicate(timeout=N) not proc.wait(). On timeout, it MUST call proc.kill() then proc.communicate() to drain. Spawned PIDs MUST be tracked in .specsmith/pids/.
- **Requirement ID:** REQ-343
- **Type:** unit
- **Verification Method:** pytest
- **Input:** run_tracked(tmp_path, 'echo ok', timeout=10); mock subprocess.Popen
- **Expected Behavior:** DEVNULL stdin; communicate called with timeout; PID file written
- **Confidence:** 0.9

## TEST-344. specsmith.esdb Namespace Exports Full chronomemory v0.1.1 Surface
- **ID:** TEST-344
- **Title:** specsmith.esdb Namespace Exports Full chronomemory v0.1.1 Surface
- **Description:** from specsmith.esdb import ChronoStore, ChronoRecord, EsdbBridge, DepGraph, ContextPackCompiler, RUST_BACKEND, query, metrics MUST all succeed without ImportError. RUST_BACKEND MUST be a bool. query MUST be a module with what_is_known. metrics MUST be a module with record_token_metric.
- **Requirement ID:** REQ-344
- **Type:** unit
- **Verification Method:** pytest
- **Input:** from specsmith.esdb import <all exports>
- **Expected Behavior:** All imports succeed; RUST_BACKEND is bool; query/metrics are modules
- **Confidence:** 0.95

## TEST-345. LLM Context Build Does Not Call store.query(rag_filter=True)
- **ID:** TEST-345
- **Title:** LLM Context Build Does Not Call store.query(rag_filter=True)
- **Description:** specsmith.retrieval.build_index and specsmith.agent.context_seed._load_esdb_snippet MUST NOT call store.query(rag_filter=True). Both MUST call query.what_is_known(store). A grep over the codebase for 'rag_filter=True' in retrieval.py and context_seed.py MUST return zero matches.
- **Requirement ID:** REQ-345
- **Type:** unit
- **Verification Method:** pytest
- **Input:** inspect source of retrieval.py and context_seed.py for rag_filter=True
- **Expected Behavior:** No occurrences of rag_filter=True in the LLM context code paths
- **Confidence:** 0.95

## TEST-346. specsmith save --force Bypasses Gitflow Guard
- **ID:** TEST-346
- **Title:** specsmith save --force Bypasses Gitflow Guard
- **Description:** specsmith save --force on a project with branching_strategy=gitflow on the main branch MUST NOT return the 'Refusing to push directly to main' error. run_push() called with force=True MUST issue git push --force-with-lease. Without --force on main, save MUST still refuse.
- **Requirement ID:** REQ-346
- **Type:** unit
- **Verification Method:** pytest
- **Input:** run_push(tmp_path, force=True) on gitflow main; run_push(tmp_path, force=False) on main
- **Expected Behavior:** force=True succeeds; force=False returns failure with guard message
- **Confidence:** 0.9

## TEST-347. specsmith pull --discard Hard-Resets Working Tree to Remote
- **ID:** TEST-347
- **Title:** specsmith pull --discard Hard-Resets Working Tree to Remote
- **Description:** specsmith.vcs_commands.run_discard MUST issue git fetch then git reset --hard origin/<branch>. The result.success MUST be True on success. The result.message MUST contain 'reset to origin/<branch>'. With clean=False, git clean MUST NOT be called.
- **Requirement ID:** REQ-347
- **Type:** unit
- **Verification Method:** pytest
- **Input:** run_discard(tmp_path, clean=False); mock _run_git
- **Expected Behavior:** fetch then reset called; success=True; message contains 'reset to origin/'
- **Confidence:** 0.9

## TEST-348. specsmith pull --clean Also Runs git clean -fd
- **ID:** TEST-348
- **Title:** specsmith pull --clean Also Runs git clean -fd
- **Description:** specsmith.vcs_commands.run_discard(clean=True) MUST call git clean -fd after the hard reset. The result.message MUST mention 'untracked files removed'. With clean=False, git clean MUST NOT be called.
- **Requirement ID:** REQ-348
- **Type:** unit
- **Verification Method:** pytest
- **Input:** run_discard(tmp_path, clean=True) vs run_discard(tmp_path, clean=False); mock _run_git
- **Expected Behavior:** clean=True calls git clean -fd and message notes untracked removal; clean=False does not
- **Confidence:** 0.9

## TEST-349. gh-ci-polling Skill Exists and Contains gh run watch Pattern
- **ID:** TEST-349
- **Title:** gh-ci-polling Skill Exists and Contains gh run watch Pattern
- **Description:** specsmith.skills.get('gh-ci-polling') MUST return a non-None SkillEntry with domain=GOVERNANCE. The skill body MUST contain 'gh run watch', 'NEVER', and explicit prohibition of 'Start-Sleep' and 'sleep'. It MUST contain a PowerShell example and a bash example.
- **Requirement ID:** REQ-349
- **Type:** unit
- **Verification Method:** pytest
- **Input:** from specsmith.skills import get; get('gh-ci-polling')
- **Expected Behavior:** Non-None; body contains 'gh run watch', 'NEVER', 'Start-Sleep', pwsh and bash examples
- **Confidence:** 0.95

## TEST-350. Sync Pipeline Passes Through platform/boundary/confidence Fields
- **ID:** TEST-350
- **Title:** Sync Pipeline Passes Through platform/boundary/confidence Fields
- **Description:** When a YAML requirement entry includes platform, boundary, or confidence fields, run_sync MUST include those fields in the corresponding .specsmith/requirements.json entry. When those fields are absent from the YAML entry, they MUST NOT appear in the JSON entry (not written as null or empty string).
- **Requirement ID:** REQ-350
- **Type:** unit
- **Verification Method:** pytest
- **Input:** YAML req with platform='linux', boundary='OS', confidence='0.9'; run_sync; inspect JSON
- **Expected Behavior:** JSON entry has platform, boundary, confidence keys; absent fields not present
- **Confidence:** 0.9

## TEST-351. specsmith checkpoint Emits GOVERNANCE ANCHOR with Required Fields
- **ID:** TEST-351
- **Title:** specsmith checkpoint Emits GOVERNANCE ANCHOR with Required Fields
- **Description:** specsmith checkpoint --json on a project with scaffold.yml MUST exit 0 and return JSON containing ts (ISO-8601), project (string), phase (string), phase_label, phase_pct (int), health (string), audit_failed (int), req_count (int), test_count (int), esdb_records (int), esdb_chain_valid (bool), recent_wis (list), last_preflight (string), and anchor ('SPECSMITH-ANCHOR-' prefix). Without --json it MUST print a line containing 'GOVERNANCE ANCHOR'. Both forms MUST exit 0 on a project with no ESDB or LEDGER (best-effort, never throws).
- **Requirement ID:** REQ-351
- **Type:** cli
- **Verification Method:** pytest
- **Input:** specsmith checkpoint --json --project-dir tmp; specsmith checkpoint --project-dir tmp
- **Expected Behavior:** JSON has all required fields; human output contains GOVERNANCE ANCHOR; exit 0 in both cases
- **Confidence:** 0.95

## TEST-352. M006 Injects Session Governance Protocol into AGENTS.md
- **ID:** TEST-352
- **Title:** M006 Injects Session Governance Protocol into AGENTS.md
- **Description:** SessionGovernanceMigration().run(tmp_path) on a project with AGENTS.md that lacks 'specsmith checkpoint' MUST inject the Session Governance Protocol section, create .specsmith/agents.md.m006.bak, and return success=True with 'AGENTS.md' in files_modified. Re-running MUST be a no-op (idempotent). Running with dry_run=True MUST report what would change without writing. rollback() MUST restore AGENTS.md from the backup. M006 MUST appear in MigrationRegistry.all().
- **Requirement ID:** REQ-352
- **Type:** integration
- **Verification Method:** pytest
- **Input:** SessionGovernanceMigration().run(tmp_path); dry_run=True; rollback(); re-run after injection
- **Expected Behavior:** Protocol injected; backup created; dry_run no writes; rollback restores; idempotent; registry includes v6
- **Confidence:** 0.95

## TEST-353. Modern Web Framework Types Have Tool Registry Entries
- **ID:** TEST-353
- **Title:** Modern Web Framework Types Have Tool Registry Entries
- **Description:** list_tools_for_type(ProjectType.NEXTJS_APP) MUST return a ToolSet with 'next build' in build and 'eslint' in lint. list_tools_for_type(ProjectType.NUXT_APP) MUST have 'nuxt build' in build. list_tools_for_type(ProjectType.SVELTEKIT_APP) MUST have 'vite build'. list_tools_for_type(ProjectType.REMIX_APP) MUST have 'remix vite:build'. list_tools_for_type(ProjectType.ASTRO_SITE) MUST have 'astro build'. All five types MUST appear in _TYPE_LABELS with non-empty human-readable labels.
- **Requirement ID:** REQ-353
- **Type:** unit
- **Verification Method:** pytest
- **Input:** list_tools_for_type for each new type; check _TYPE_LABELS
- **Expected Behavior:** Each type has correct build tool; all five types in _TYPE_LABELS
- **Confidence:** 0.95

## TEST-354. CodityAdapter Generates GitHub Workflow by Default
- **ID:** TEST-354
- **Title:** CodityAdapter Generates GitHub Workflow by Default
- **Description:** CodityAdapter().generate(config, tmp_path) on a directory with no VCS signals MUST create .github/workflows/codity-review.yml containing 'codity review --staged', 'curl -fsSL https://cli.codity.ai/install.sh | sh', 'CODITY_ACCESS_TOKEN', and 'actions/checkout@v4'. It MUST also create docs/codity-setup.md. When LEDGER.md exists, a TODO checklist entry MUST be appended containing 'codity login' and 'codity doctor'. CodityAdapter().name MUST equal 'codity'.
- **Requirement ID:** REQ-354
- **Type:** unit
- **Verification Method:** pytest
- **Input:** CodityAdapter().generate(mock_config, tmp_path); tmp_path has no scaffold.yml or VCS hint files
- **Expected Behavior:** .github/workflows/codity-review.yml created; docs/codity-setup.md created; LEDGER.md appended; name == 'codity'
- **Confidence:** 0.95

## TEST-355. CodityAdapter Detects GitLab and Azure VCS from Scaffold or Directory
- **ID:** TEST-355
- **Title:** CodityAdapter Detects GitLab and Azure VCS from Scaffold or Directory
- **Description:** When scaffold.yml contains 'gitlab' (case-insensitive), _detect_vcs() MUST return 'gitlab' and generate() MUST write .gitlab-ci-codity.yml (not a GitHub workflow). When scaffold.yml contains 'azure', _detect_vcs() MUST return 'azure' and generate() MUST write .azure-pipelines/codity-review.yml. When .gitlab-ci.yml exists in the project root (no scaffold.yml), _detect_vcs() MUST return 'gitlab'. When azure-pipelines.yml exists, _detect_vcs() MUST return 'azure'. The GitLab workflow MUST contain 'codity config set-pat --provider gitlab'. The Azure workflow MUST contain 'codity config set-pat --provider azure'.
- **Requirement ID:** REQ-354
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Scaffold.yml with gitlab/azure keyword; .gitlab-ci.yml present; azure-pipelines.yml present
- **Expected Behavior:** Correct VCS detected; correct workflow file written; PAT setup command present
- **Confidence:** 0.95

## TEST-356. codity-ai-review Skill Is in Governance Skills Catalog
- **ID:** TEST-356
- **Title:** codity-ai-review Skill Is in Governance Skills Catalog
- **Description:** specsmith.skills.governance.SKILLS MUST contain a SkillEntry with slug='codity-ai-review'. Its body MUST contain 'codity review --staged', 'codity login', 'codity init', 'codity scan --staged', 'codity test-gen --staged', 'codity doctor', 'specsmith integrate codity', 'HIGH severity', 'set-pat --provider gitlab', and 'set-pat --provider azure'. Its tags MUST include 'codity', 'ai-review', and 'pre-commit'. Its domain MUST be SkillDomain.GOVERNANCE.
- **Requirement ID:** REQ-356
- **Type:** unit
- **Verification Method:** pytest
- **Input:** from specsmith.skills.governance import SKILLS; find slug='codity-ai-review'
- **Expected Behavior:** SkillEntry found; body and tags correct; domain GOVERNANCE
- **Confidence:** 0.95

## TEST-357. AGENTS.md Template Contains Codity.ai Pre-commit Rule
- **ID:** TEST-357
- **Title:** AGENTS.md Template Contains Codity.ai Pre-commit Rule
- **Description:** The rendered agents.md.j2 template MUST contain a 'Codity.ai Code Review' section. The section MUST instruct agents to run 'codity review --staged' if codity doctor exits 0; MUST state that HIGH-severity findings block the commit; MUST mention MEDIUM-severity acknowledgement; MUST reference 'specsmith integrate codity'. The section MUST appear after the Session Governance Protocol section and before the project metadata footer.
- **Requirement ID:** REQ-355
- **Type:** unit
- **Verification Method:** pytest
- **Input:** Read src/specsmith/templates/agents.md.j2 directly; render via Jinja2 with minimal context
- **Expected Behavior:** Template contains Codity section with review --staged, HIGH severity, MEDIUM, integrate codity
- **Confidence:** 0.95

