docs(specs): complete speckit packages 036-039

This commit is contained in:
2026-07-13 15:10:07 +03:00
parent c2bd6cb441
commit 2eca5b514b
65 changed files with 3556 additions and 8 deletions

View File

@@ -0,0 +1,71 @@
# Implementation Plan: Dashboard Scenario Model
**Branch**: 038-dashboard-scenario-model | **Date**: 2026-07-13 | **Spec**: [spec.md](./spec.md)
## Summary
Implement a backend Pydantic ScenarioGraph domain and deterministic compiler that maps the 19 normalized PDF checklist cases plus dashboard/baseline capabilities into a reviewable DAG. Validate all refs, cycles, tools, selectors, parameters, and baseline rules before compiling a draft pack through versioned safe templates and registering it with 036.
## Technical Context
**Language/Version**: Python 3.13+
**Dependencies**: Pydantic 2, FastAPI, deterministic JSON/YAML serialization, existing 036/037 services
**Storage**: Immutable request/graph/draft hashes; draft bytes via 036; no new DB table required for MVP beyond AgentRun event/artifact links
**Testing**: pytest property/unit/contract, JSON Schema validation, golden snapshots
**Performance Goals**: validate 100-step graph under 100ms; resolve parameters under 200ms; byte-stable snapshots
**Constraints**: DAG only; no raw baseline numbers; no SQL; no executable LLM output; all checklist cases classified
**Scale**: 19 source cases, up to 100 steps, 50 parameters, 200 refs
## Constitution Check
| Principle | Result |
|---|---|
| Contracts/decision memory | PASS — compiler, validator, serializer and pack generator are contracted |
| Module discipline | PASS — models, catalog, mapping, compiler, validator, serializer, templates separated |
| RBAC/side effects | PASS — graph build is pure/read; draft registration and save use 036 |
| TDD | PASS — invalid fixture matrix and rejected direct-code/SQL paths first |
| Attention | PASS — ScenarioGraph.* IDs and shared scenario semantics |
## Project Structure
~~~text
backend/src/
├── api/routes/dashboard_scenarios.py
├── schemas/dashboard_scenario.py
└── services/dashboard_testing/scenario/
├── models.py
├── checklist_catalog.py
├── capability_mapper.py
├── compiler.py
├── validator.py
├── serializer.py
├── pack_compiler.py
└── templates/
backend/tests/services/dashboard_testing/scenario/
agent/src/ss_tools/agent/tools.py
~~~
## Delivery Phases
1. Machine schema, Pydantic models, normalized checklist catalog and fixtures.
2. Capability mapping and deterministic graph compiler.
3. Full validator and canonical serializer.
4. Parameter/selector/manual resolution with immutable revisions.
5. Safe template-based draft-pack compiler and 036 registration.
6. REST/agent tools and regression gates.
## API and Schema
- contracts/dashboard-test-scenario.schema.json is the canonical graph interchange contract.
- contracts/scenario-api.openapi.yaml defines compile, validate, resolve, and draft-pack endpoints.
## Cross-Spec Boundary
- Reads 037 query models/baseline summaries; never calls Superset directly.
- Writes drafts and progress through 036.
- Supplies scenario, validation, coverage, parameter, and artifact manifest DTOs to 039.
## Complexity Tracking
No exception planned. Checklist data remains declarative and versioned; do not turn the 19 cases into one large conditional compiler function.