Artifact contracts (Milestone 2)
Minimum durable contracts implemented in a2c_core for loading and validation.
Repository: a2c-workflow
Python packages: models in a2c_core.schemas, services in a2c_core.services
Supported artifacts
| Artifact | File(s) | Model | Schema reference |
|---|---|---|---|
| Repository config | .a2c/config.yaml | A2CConfig | schemas/config.schema.json |
| Workflow manifest | docs/workflow-manifest.yaml | WorkflowManifest | schemas/workflow-manifest.schema.json |
| Epic | planning/epics/<id>.md | Epic | schemas/epic.schema.json (front matter fields) |
| Task | planning/tasks/<id>.md | Task | schemas/task.schema.json (front matter fields) |
| Sprint | planning/sprints/<id>.md | Sprint | schemas/sprint.schema.json (front matter fields) |
| ADR metadata | docs/adr/NNNN-*.md | AdrRecord | Filename + header parse (no JSON schema) |
Planning artifacts live under planning/ (Markdown + YAML front matter) — see
planning-artifact-format.md. They are optional; repositories
without planning/ still validate. Config remains YAML under .a2c/.
Validation behavior
- Parse — config/manifest as YAML; planning artifacts as front matter + Markdown body
- Shape — required
type,id,title; unknown front matter fields ignored (extra="ignore") - Naming — core ID invariants; optional
id_format.patternin.a2c/config.yaml(see naming-conventions.md) - Cross-reference — epic/task/sprint links must resolve within the repo
Failures return ServiceResult with structured ValidationIssue entries (code, message, optional path).
Service entrypoint
from pathlib import Path
from a2c_core.services import validate_repository
result = validate_repository(Path("/path/to/repo"))
if result.ok:
snapshot = result.value # RepositorySnapshot
else:
for issue in result.errors:
...
Result contracts (C4–C6)
| Contract | M2 status | Location |
|---|---|---|
| C4 CLI envelope | Types only | a2c_core.schemas.results.CliResultEnvelope |
| C5 Service result | Implemented | a2c_core.schemas.results.ServiceResult |
| C6 Workflow I/O | Stub types | a2c_core.schemas.workflows_io |
CLI serialization and AI orchestration arrive in Milestones 3 and 5.
Intentionally deferred
- Config merge across user/global/project layers (loader uses project file + defaults)
- Mutation/write APIs
- Full ADR index machine-readable file
- JSON Schema runtime validation (Pydantic is authoritative in M2)
- CLI
repo validatecommand (Milestone 3)