Skip to content

Bootstrap formal specification infrastructure, agent skills, and codebase reference docs#1142

Open
ahouseholder wants to merge 14 commits into
mainfrom
specs_bootstrap
Open

Bootstrap formal specification infrastructure, agent skills, and codebase reference docs#1142
ahouseholder wants to merge 14 commits into
mainfrom
specs_bootstrap

Conversation

@ahouseholder
Copy link
Copy Markdown
Contributor

@ahouseholder ahouseholder commented May 18, 2026

Summary

This branch bootstraps a formal specification infrastructure for the SSVC project — introducing structured YAML spec files, a spec registry and linter, agent skills for working with specs, and codebase reference documentation.

Why

The project lacked a machine-readable, AI-navigable specification layer. Decisions were captured ad hoc in notes, ADRs, and code. This PR establishes the scaffolding needed to track requirements, validate them programmatically, and export them for consumption by coding agents.


What Changed

Spec Infrastructure (specs/, src/ssvc/metadata/specs/)

  • Added YAML specification files covering API, CI, codegen, domain model, namespaces, registry, testing, and versioning
  • Added specs/spec-registry.yaml as the master registry of all spec files
  • Implemented src/ssvc/metadata/specs/ Python package with:
    • schema.py — Pydantic models for spec YAML structure
    • registry.py — loads and indexes spec files
    • lint.py — validates specs against schema rules
    • llm_export.py — flat JSON export for AI agent consumption
    • render.py — human-readable rendering
  • Added unit tests for lint and schema validation (src/test/metadata/specs/)

Agent Skills (.agents/skills/)

  • load-specs — exports all project specs as flat, inheritance-resolved JSON for coding agents
  • study-project-docs — loads specs and reads key project context files before implementation work
  • process-concerns — batch-processes CONCERNS.md into GitHub Issues (format-agnostic parser)
  • ingest-idea — processes GitHub Idea issues into formal specs and implementation notes

Codebase Reference Docs (docs/reference/codebase/)

  • Added ARCHITECTURE.md, CONCERNS.md, CONVENTIONS.md, INTEGRATIONS.md, STACK.md, STRUCTURE.md, TESTING.md
  • These provide stable, AI-readable context about the codebase

Notes and Versioning

  • Added notes/namespaces.md, notes/terminology.md, notes/versioning-rules.md
  • Added specs/namespaces.yaml and specs/versioning.yaml from ADR gap analysis

Packaging Fix

  • Fixed pyproject.toml: set setuptools packages.find where=["src"] so the ssvc package is importable when installed

Testing

  • New unit tests added under src/test/metadata/specs/
  • Existing tests unaffected

Closes #1153

ahouseholder and others added 9 commits May 18, 2026 11:54
Reorganize specs/ into seven topic-focused files, each with atomic,
verifiable requirements and no cross-file redundancy.

Changes to existing files:
- spec-registry.yaml (SR): split SR-01-002 (combined two requirements)
  into SR-01-002 (file must have ≥1 group) and SR-01-003 (group must
  have ≥1 spec); renumber SR-01-003–SR-01-005 → SR-01-004–SR-01-006

New spec files:
- domain-model.yaml (DM, kind=domain): object identity, DecisionPoint,
  DecisionTable, Outcome, and mixin composition requirements
- registry.yaml (RG, kind=implementation): SsvcObjectRegistry structure,
  registration behavior, and lookup behavior
- api.yaml (AP, kind=implementation): FastAPI structure, response format,
  and error handling requirements
- testing.yaml (TS, kind=language): test organisation, isolation, and
  quality standards
- ci.yaml (CI, kind=general): CI gates (pytest, spec-lint, markdownlint)
  and deployment (GitHub Pages, PyPI) requirements
- codegen.yaml (GN, kind=implementation): source authority and artifact
  generation requirements for data/json/, data/csv/, and
  namespace_patterns.py

New files:
- README.md: describes all spec files, ID prefix convention, SpecKind
  tiers, tooling usage, and a requirement authoring checklist

All files pass ssvc-spec-lint with exit code 0 (no errors, no warnings).
All 254 existing tests continue to pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The ssvc package lives under src/ssvc/ but pyproject.toml had where=["."],
causing setuptools editable-install to produce an empty MAPPING and making
the package unimportable ("No module named 'ssvc'").  Setting where=["src"]
fixes editable installs and unblocks uv run ssvc-spec-dump.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ports the load-specs skill from vultron_pub, adapted for SSVC:
- command is `uv run ssvc-spec-dump` (not spec-dump)
- example IDs reference SSVC spec topics (AP, SR, CI, TS)
- cross-cutting spec list updated for SSVC's spec files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add specs/versioning.yaml (VR): formalises ADR-0002/0005/0006/0013/0015
  into testable requirements covering decision point SemVer rules, decision
  point group SemVer rules, JSON schema SchemaVer rules, and project CalVer
- Add specs/namespaces.yaml (NS): formalises ADR-0012 into requirements for
  registered namespaces and extension namespace format (x_ prefix)
- Extend specs/domain-model.yaml (DM):
  - DM-02-005/006: description fields MUST NOT embed worked examples (ADR-0007)
  - DM-06: ordering constraints for decision point values and outcome sets
    (ADR-0008, ADR-0009)
  - DM-07: separation of concerns — DecisionTable must not embed OutcomeSet
    or policy mappings (ADR-0010)
- Extend specs/codegen.yaml (GN):
  - GN-02-004: JSON schema files MUST use SchemaVer in schemaVersion/
    (ADR-0015)
- Add notes/versioning-rules.md: prose companion with worked examples for
  the layered versioning strategy
- Add notes/namespaces.md: practical guide for namespace usage and adopter
  extension patterns
- Add notes/terminology.md: decision table vs. decision tree cheat sheet
  for documentation authors (ADR-0014)
- Update specs/README.md with rows for new VR and NS spec files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add .agents/skills/ingest-idea/ and study-project-docs/ skill definitions
  used during session workflows
- Add docs/reference/codebase/ architecture blueprint (ARCHITECTURE,
  CONCERNS, CONVENTIONS, INTEGRATIONS, STACK, STRUCTURE, TESTING) generated
  by the architecture-blueprint-generator skill
- Add plan/PRIORITIES.md and plan/BUILD_LEARNINGS.md project planning files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Adapted from vultron_pub/.agents/skills/process-concerns
- Updated repo constants: CERTCC/SSVC, node ID MDEwOlJlcG9zaXRvcnkyMzU4MDkzNTU=
- Concern type ID IT_kwDOAjf0s84B_2VT is the same as Vultron
- Replaced table-based parsing with prose/narrative parsing to match
  SSVC's CONCERNS.md format (numbered items under section headings,
  not markdown tables)
- Added section → severity/category mapping for SSVC's four sections
- Added explicit skip rule for 'Safe operating advice' section
- Replaced Vultron-specific label/repo references throughout
- Added GraphQL workaround note: gh issue list --json issueType is
  unsupported for this repo; use GraphQL API to list Concern issues
- Removed Phase 4 ASK USER handling (SSVC CONCERNS.md has no such section)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace section-name-based parsing with semantic extraction so the skill
works regardless of how the generated file is structured on any given run.

- Phase 2 now reads the whole file and identifies concern topics by content
  rather than by matching specific section headings
- Severity is inferred from any explicit language or section placement cues,
  defaulting to 'medium' when absent
- Category is mapped from keyword signals in the title/narrative rather than
  from fixed section names
- Constraints now explicitly forbid hard-coding section names from a prior run
- Checklist updated to reflect format-agnostic parsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 19:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bootstraps a formal specification infrastructure for SSVC: introduces a structured YAML spec registry under specs/, a Python package (ssvc.metadata.specs) with Pydantic schema, registry loader, linter, renderer, and LLM-optimized exporter, plus pre-commit/CLI integration. Also adds extensive agent skills under .agents/skills/, codebase reference docs under docs/reference/codebase/, notes on namespaces/terminology/versioning, and fixes the setuptools packages.find where setting so ssvc is importable from src/.

Changes:

  • Adds ssvc.metadata.specs Python package (schema, registry, lint, render, llm_export) with unit tests and two console scripts (ssvc-spec-lint, ssvc-spec-dump).
  • Adds 10 YAML spec files under specs/ plus a README, plus agent skill markdown files and codebase reference docs.
  • Fixes pyproject.toml to point setuptools at src/ and adds pyyaml dependency.

Reviewed changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Fix setuptools where=["src"], add pyyaml dep and two console_scripts
uv.lock Pick up new pyyaml dependency
src/ssvc/metadata/init.py, base.py New metadata tooling layer with NonEmptyStr alias
src/ssvc/metadata/specs/init.py Package surface and UnknownSpecIdWarning helper
src/ssvc/metadata/specs/schema.py Pydantic schema for spec YAML; possible validator-override issue between StatementSpec and BehavioralSpec
src/ssvc/metadata/specs/registry.py Spec loader, graph build, inheritance resolution, cross-ref validation
src/ssvc/metadata/specs/lint.py CLI linter with hard errors and advisory warnings
src/ssvc/metadata/specs/render.py Markdown/JSON/YAML/llm-json renderers and CLI entry points
src/ssvc/metadata/specs/llm_export.py Flat JSON projection for agents; minor enum .value inconsistency
src/test/metadata/specs/* Unit tests for schema, registry, lint and shared fixtures
specs/*.yaml + specs/README.md New normative YAML spec files and authoring guide
docs/reference/codebase/*.md Codebase-reference docs for agent context
notes/.md, plan/.md Project-level notes and queue files
.agents/skills/**/SKILL.md Agent skill definitions
.pre-commit-config.yaml Spec lint hook wired to ssvc-spec-lint

Comment thread src/ssvc/metadata/specs/schema.py
Comment thread src/ssvc/metadata/specs/llm_export.py
- Add VR-05 group to specs/versioning.yaml with VR-05-001 through
  VR-05-007 covering DecisionTable SemVer identity, major/minor/patch
  triggers, pre-stability (v0.x), and optional status field
- Downgrade VR-01-006 from SHOULD to MAY (status field)
- Tighten VR-02 to cover only DecisionPointGroup; remove stale
  'or DecisionTable' clause and incorrect 'successor' framing
- Update file-level description to mention decision tables
- Archive idea #1143 to plan/history/ideas.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ahouseholder and others added 2 commits May 18, 2026 15:56
…pec inherited-field tests

- Rename BehavioralSpec._nonempty_if_present to _behavioral_lists_nonempty so it
  no longer shadows the identically-named parent validator on StatementSpec; in
  Pydantic v2 a subclass method with the same name silently replaces the parent
  decorator entry, which caused scope/tags/relationships/lint_suppress to pass
  empty-list validation on BehavioralSpec instances
- Change _topic_record to emit file.kind.value instead of the bare StrEnum
  member, consistent with every other enum serialisation site in llm_export.py
  and render.py
- Add test_behavioral_spec_inherited_empty_list_rejected parametrized over
  scope/tags/relationships/lint_suppress to lock the inherited validator behaviour

Addresses copilot-pull-request-reviewer comments on PR #1142.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…LL.md

- Add specs/skills.yaml (SK-01 through SK-03, 10 requirements)
- Add notes/skills.md with decision table, directory layout, and CI guidance
- Restructure .agents/skills/: move 4 dev skills to dev/ subtier
- Add .agents/skills/ssvc/evaluate-decision-point/SKILL.md (WIP stub)
- Normalise load-specs frontmatter to canonical name+description format
- Add .agents/skills/README.md documenting two-tier split
- Add .github/workflows/validate_skills.yml for SKILL.md CI enforcement
- Update specs/README.md with SK entry
- Archive idea #1151 to plan/history/ideas.md

Addresses #1151 as part of #1142

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread .github/workflows/validate_skills.yml Fixed
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bootstrap formal specification infrastructure, agent skills, and codebase reference docs

3 participants