Skip to main content
Welcome. This site supports keyboard navigation and screen readers. Press ? at any time for keyboard shortcuts. Press [ to focus the sidebar, ] to focus the content. High-contrast themes are available via the toolbar.
serard@dev00:~/cv

Five-Stage Generation Pipeline

The generator follows the CMF's existing multi-stage Roslyn pipeline:

Stage 0: Metamodel Registration

Register requirement base types (Epic, Feature<T>, Story<T>, Task<T>, Bug) as M3 MetaConcepts.

Stage 1: Requirement Collection

Walk compilation for types inheriting RequirementMetadata. Build the hierarchy graph. Validate constraints (no cycles, valid parent-child types).

Stage 2: Registry Generation

Generate RequirementRegistry.g.cs -- the type catalog with hierarchy, AC method names, and metadata.

Stage 3: Bridge Validators

Generate specification bridge classes (the UserRolesValidator that connects abstract Feature AC methods to ISpec methods).

Stage 4: Traceability Matrix

Cross-reference [ForRequirement], [TestsFor], [Verifies] attributes across all referenced assemblies. Generate TraceabilityMatrix.g.cs. Emit compiler diagnostics for coverage gaps.

Stage 5: Reports

Generate markdown hierarchy reports, JSON export for external tool integration (Jira, Linear, Azure DevOps), and CSV traceability matrices.


Requirement Lifecycle State Machine

All requirements support lifecycle tracking, automatically generated as a state machine:

Draft --> Proposed --> Approved --> InProgress --> Quality --> Translation --> Review --> Done
public enum RequirementLifecycleState : byte
{
    Draft = 0,
    Proposed = 1,
    Approved = 2,
    InProgress = 3,
    Quality = 4,
    Translation = 5,
    Review = 6,
    Done = 7
}

public class RequirementLifecycleStateMachine
{
    public static bool CanTransition(RequirementLifecycleState from, RequirementLifecycleState to)
    {
        if (to > from) return to == from + 1;   // Forward: one step at a time
        if (to < from) return to == from - 1;   // Backward: one step back allowed
        return false;
    }
}

The state machine is a by-product of the meta-metamodel -- the M3 layer understands "requirements have a lifecycle," and generation creates the SM automatically.


M3/M2/M1/M0 Mapping

Level In CMF In Requirements Chain
M3 MetaConcept, MetaProperty RequirementMetadata, Feature<T>, Story<T> base types
M2 [AggregateRoot], [Entity] UserRolesFeature, JwtRefreshStory -- concrete requirement types
M1 Generated entities, repos, CQRS RequirementRegistry.g.cs, TraceabilityMatrix.g.cs, diagnostics
M0 Runtime instances AuthorizationService processing actual User objects

With DDD DSL

[ForRequirement(typeof(UserRolesFeature))]
[AggregateRoot]
public partial class AuthAggregate : IUserRolesSpec
{
    [ForRequirement(typeof(UserRolesFeature), nameof(UserRolesFeature.AdminCanAssignRoles))]
    public Result AssignRole(User actingUser, User targetUser, Role role)
    {
        // DDD generator produces Entity + Repository + CQRS handlers
        // ALL tagged with [ForRequirement(typeof(UserRolesFeature))]
    }
}

With Workflow DSL

[ForRequirement(typeof(UserRolesFeature))]
[Workflow(Name = "FeatureApproval", Stages = new[] { "Design", "Impl", "Test", "Review" })]
public partial class FeatureWorkflow { }

// Workflow rules can reference requirement compliance:
[WorkflowRule(Stage = "Test", Condition = "All ACs have [Verifies] tests")]
[WorkflowRule(Stage = "Review", Condition = "Test coverage >= 80%")]

With Admin DSL

[ForRequirement(typeof(UserRolesFeature))]
[AdminModule(Name = "FeatureTracking", Path = "/admin/features")]
public partial class FeatureAdminPanel { }
// Generates: dashboard with compliance status, implementations per feature, test coverage
⬇ Download