Skip to content

Spec Graduation: Absorb completed tier 1 specs into package executable specs #21

@darko-mijic

Description

@darko-mijic

Problem

Completed tier 1 roadmap specs are piling up in delivery-process/specs/ (23 of 38 specs are completed). These served their planning purpose but now require ongoing maintenance without providing proportional value. Meanwhile, package-level executable specs already contain the living behavior proof.

Current state:

  • 23 completed tier 1 specs sit alongside 15 active/roadmap specs
  • Executable specs in {package}/tests/features/behavior/ already carry @libar-docs-implements backlinks
  • Bidirectional traceability exists (@libar-docs-executable-specs@libar-docs-implements) but tier 1 specs are never "graduated"
  • Decision specs (PDRs) are correctly permanent — they document why, not what was planned

The stub analogy: Design stubs follow a clear lifecycle: delivery-process/stubs/ → implementation in src/ → stubs removed. Tier 1 specs should follow the same pattern: delivery-process/specs/ → behavior absorbed into executable specs → tier 1 spec graduated.

Proposal: Spec Graduation Lifecycle

Core Principle

Tier 1 specs are planning artifacts. Like stubs, they get absorbed into the real thing. Once a pattern's executable specs fully cover its behavior, the tier 1 spec has served its purpose.

Tier 1 Spec Lifecycle:
  roadmap → active → completed → graduated
                                     │
                              Behavior lives in executable specs
                              Planning metadata rolls up to epics
                              Tier 1 spec archived or removed

What Migrates Where

Tier 1 Content Destination Notes
Behavior scenarios Package executable specs Already done via two-tier architecture
Invariant/Rationale prose Executable spec Feature/Rule descriptions Enrich package specs with domain documentation
Phase/dependency metadata Epic specs One epic per phase cluster (see below)
Deliverable tracking Git history Purpose served — no migration needed

What Stays Permanently

Artifact Why
Decision specs (PDRs) Architectural events — permanent record of why
Epic specs Roadmap coordination — group-level planning
Active/roadmap tier 1 specs Still guiding implementation work

Epic Specs as Graduation Target

Introduce epic-level specs as the surviving roadmap artifacts. One precedent exists: epic-process-enhancements.feature uses @libar-docs-level:epic.

Proposed epic groupings (matching natural phase clusters):

Epic Phase Range Graduated Specs Package Home
Foundation 02-03 EventStoreFoundation, CommandBusFoundation platform-core, platform-bus
Decider & Type Safety 14-16 DeciderPattern, ProjectionCategories, DynamicConsistencyBoundaries platform-decider, platform-fsm, platform-core
Durability & Production 18a-18c DurableFunctionAdapters, WorkpoolPartitioning, EventStoreDurability, EventReplay platform-core
Service Independence 19-20 BddTestingInfra, EcstFatEvents, ReservationPattern platform-core
Integration 17, 21 ReactiveProjections, IntegrationPatterns platform-core
Agent Platform 22-22c AgentAsBC, AgentComponentIsolation, AgentLLM, AgentCommand platform-core
Example App 23 ExampleAppModernization order-management

Epic specs would carry:

  • @libar-docs-level:epic
  • Phase range and dependency graph (absorbed from child specs)
  • List of graduated patterns with links to their executable spec locations
  • High-level narrative (Problem/Solution from graduated specs, condensed)

Graduation Process (Per Completed Pattern)

Mirrors the stub resolution workflow:

  1. Verify executable spec coverage — all tier 1 scenarios have package-level equivalents
  2. Migrate domain documentation — move Invariant/Rationale prose from tier 1 Rules into executable spec Feature/Rule descriptions (enriching the living tests with context)
  3. Update epic spec — add pattern to epic's graduated patterns list
  4. Archive or remove tier 1 spec — either move to specs/archive/ or delete (git history preserves it)
  5. Update generators — codecs should prefer executable specs for content when tier 1 spec is graduated/absent

Generator Changes

The MasterDataset currently merges all sources without lifecycle awareness. Changes needed:

  • Content precedence rule: When a pattern has @libar-docs-implements backlinks AND the tier 1 spec is completed/graduated, codecs prefer executable spec content for behavior documentation
  • Epic-aware roadmap generation: ROADMAP.md and timeline generators use epic specs for graduated patterns instead of individual tier 1 specs
  • Traceability update: Traceability codec should show graduation status and link to executable spec location

Process Guard Updates

  • New validation rule: graduation-ready (info/warning) — completed spec with all scenarios covered by executable specs is a candidate for graduation
  • Optional: graduated FSM status as terminal state after completed (or use archive/removal as the signal)

Scope & Phasing

Phase 1: Documentation & Decision

  • Create PDR for spec graduation (PDR-014 or similar)
  • Define graduation criteria formally
  • Decide: graduated FSM status vs. archive/removal vs. generator-level preference

Phase 2: Epic Spec Structure

  • Define epic spec format (extend @libar-docs-level:epic pattern)
  • Create epic specs for the 7 natural phase clusters
  • Add epic-level tags: @libar-docs-graduated-patterns, @libar-docs-phase-range

Phase 3: Generator Adaptation

  • Implement content precedence in codecs (prefer executable specs for graduated patterns)
  • Update roadmap/timeline generators to use epic specs
  • Update traceability codec for graduation awareness

Phase 4: Graduation Execution

  • Graduate foundation specs (phases 02-03) as pilot
  • Migrate domain documentation to executable spec descriptions
  • Validate generated docs quality after graduation
  • Graduate remaining completed specs in phase-cluster batches

Phase 5: Process API & Tooling

  • Add pnpm process:query -- list --graduation-ready query
  • Add graduation-ready detection to Process Guard (info level)
  • Update planning plugin skills for graduation awareness

Prior Art in This Codebase

  • Stub lifecycle (PDR-009): delivery-process/stubs/src/ → cleanup
  • Epic spec pattern: epic-process-enhancements.feature with @libar-docs-level:epic
  • Two-tier spec architecture (PDR-007): already separates planning from implementation proof
  • @libar-docs-executable-specs: bidirectional traceability already in place

Questions to Resolve

  1. Archive vs. delete? Git preserves history either way. Archive directory adds noise; deletion is cleaner but less discoverable.
  2. graduated FSM status vs. implicit? An explicit status is queryable but adds FSM complexity. Removal/archive is simpler but less trackable.
  3. Enriching executable specs with documentation — should executable spec Feature descriptions carry the full Invariant/Rationale prose, or just link back to the PDR decisions?
  4. Epic spec granularity — one per phase cluster (7 epics) or one per product area (3 epics: Platform, DeliveryProcess, ExampleApp)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions