Skip to content

Single Read Model Architecture (ADR-006): unify all consumers onto MasterDataset#28

Merged
darko-mijic merged 18 commits intomainfrom
feature/single-read-model
Feb 21, 2026
Merged

Single Read Model Architecture (ADR-006): unify all consumers onto MasterDataset#28
darko-mijic merged 18 commits intomainfrom
feature/single-read-model

Conversation

@darko-mijic
Copy link
Contributor

@darko-mijic darko-mijic commented Feb 20, 2026

Summary

Implements ADR-006 — Single Read Model Architecture: the MasterDataset becomes the single read model for all feature consumers. Three specs completed across 12 commits:

  1. ValidatorReadModelConsolidation — migrated validate-patterns.ts from a parallel pipeline with lossy local types to MasterDataset consumption
  2. ProcessAPILayeredExtraction — extracted shared pipeline factory (build-pipeline.ts) and domain logic (rules-query.ts) from the 1,700-line process-api.ts
  3. OrchestratorPipelineFactoryMigration — migrated orchestrator.ts (the original pipeline host) to the shared factory, eliminating the last parallel pipeline

Additionally: split 7 oversized test files into 18 focused files with shared state helpers, fixed DoD terminal status validation, and added Process Guard support for file splits.

Motivation

The MasterDataset is a single-pass O(n) transformer that pre-computes relationship indices, cross-source resolution, status groupings, and dependency graphs. Before this PR, the validator bypassed it entirely — wiring its own mini-pipeline from raw scanner/extractor output, creating a lossy local type (GherkinPatternInfo with 5 of 30+ fields), and producing 7 false-positive warnings because it couldn't resolve @libar-docs-implements links.

Three consumers independently wired the same 8-step scan-extract-merge-transform sequence. This is the Parallel Pipeline anti-pattern that ADR-006 names and targets.

Architecture: Before vs After

BEFORE: Three parallel pipelines
┌─────────────────┐  ┌──────────────────┐  ┌────────────────┐
│  process-api.ts  │  │validate-patterns │  │ orchestrator.ts│
│  buildPipeline() │  │ (inline pipeline)│  │ (inline pipeline)│
│  handleRules()   │  │ GherkinPatternInfo│  │ mergePatterns() │
│  (184 lines)     │  │ (lossy local type)│  │ (misplaced)    │
└───────┬──────────┘  └────────┬─────────┘  └───────┬────────┘
        │                      │                     │
   scan/extract           scan/extract          scan/extract
   merge/transform        ad-hoc matching       merge/transform

AFTER: Single pipeline factory, all consumers query the read model
┌─────────────────┐  ┌──────────────────┐  ┌────────────────┐
│  process-api.ts  │  │validate-patterns │  │ orchestrator.ts│
│  (thin CLI shell)│  │ (MasterDataset)  │  │ (generators)   │
└───────┬──────────┘  └────────┬─────────┘  └───────┬────────┘
        │                      │                     │
        └──────────────────────┼─────────────────────┘
                               │
                    ┌──────────▼──────────┐
                    │  buildMasterDataset()│
                    │  build-pipeline.ts   │
                    │  (single definition) │
                    └─────────────────────┘

What Changed (source code, verified)

New Files

File Purpose Lines
src/generators/pipeline/build-pipeline.ts Shared pipeline factory with buildMasterDataset() returning Result<PipelineResult, PipelineError> 342
src/generators/pipeline/merge-patterns.ts mergePatterns() moved from orchestrator — now a pipeline step alongside scan/extract/transform 60
src/api/rules-query.ts queryBusinessRules() extracted from handleRules — business rules grouping, annotation parsing, statistics 241

Modified Files

File Change
src/cli/validate-patterns.ts Rewired to consume MasterDataset via pipeline factory. Deleted GherkinPatternInfo type and extractGherkinPatternInfo(). Cross-source matching now uses dataset.relationshipIndex for implements resolution (DD-3 two-phase approach). Retains direct scans for DoD/anti-pattern checks (stage-1 consumers per ADR-006 exception).
src/cli/process-api.ts buildPipeline() replaced with buildMasterDataset() call. handleRules is now a 28-line thin wrapper calling queryBusinessRules(). No more imports from scanner/, extractor/, or renderable/codecs/.
src/generators/orchestrator.ts 8-step inline pipeline replaced with buildMasterDataset() call. mergePatterns() removed (moved to pipeline module). Uses includeValidation: false and failOnScanErrors: false for doc-generation semantics. No more imports from scanner/ or extractor/.
src/generators/index.ts mergePatterns re-export updated from ./orchestrator.js to ./pipeline/index.js
src/taxonomy/deliverable-status.ts New isDeliverableStatusTerminal() function — returns true for complete, n/a, superseded (not deferred)
src/validation/dod-validator.ts DoD validation relaxed from literal 'complete' to any terminal status via isDeliverableStatusTerminal()
src/lint/process-guard/decider.ts New bypass: files with unlock-reason tags skip FSM transition checks when isNewFile, supporting spec file splits
src/lint/process-guard/detect-changes.ts Detects unlock-reason tag presence in diff hunks, propagates to StatusTransition
src/lint/process-guard/types.ts Added hasUnlockReason?: boolean to StatusTransition interface
5 utility files Removed spurious @libar-docs-phase tags from content-deduplicator.ts, file-cache.ts, warning-collector.ts, source-mapping-validator.ts, source-mapper.ts — infrastructure patterns shouldn't carry roadmap phase metadata

Pipeline Factory Design

The PipelineOptions interface supports all three consumers through configuration:

Option process-api validate-patterns orchestrator
mergeConflictStrategy 'fatal' 'concatenate' 'fatal'
includeValidation true (default) true (default) false
failOnScanErrors true (default) true (default) false
exclude passed through passed through

Returns Result<PipelineResult, PipelineError> so each consumer maps errors to its own strategy (exit, throw, or Result.err).

PipelineResult includes structured warnings (PipelineWarning[] with type discriminator, counts, and file-level details including line/column) plus ScanMetadata for the orchestrator's diagnostic messages.

Test File Splits

7 oversized test files (largest: 921 lines) split into 18 focused files with shared state helpers:

Original Split Into State Helper
ast-parser.feature (921 lines) 3 files: exports, metadata, relationships-edges ast-parser-state.ts (412 lines)
reference-codec.feature (588 lines) 4 files: core, detail-rendering, diagram-types, diagrams reference-codec-state.ts (86 lines)
process-api.feature (493 lines) 3 files: core, modifiers-rules, subcommands process-api-state.ts (325 lines)
pr-changes-codec.feature 2 files: rendering, options pr-changes-codec-state.ts (612 lines)
render.feature 2 files: output, blocks render-state.ts (77 lines)
shape-extraction.feature 2 files: types, rendering shape-extraction-state.ts (46 lines)
lint-rules.feature 2 files: individual, advanced lint-rules-state.ts (98 lines)

Additionally, architecture-diagram-generation.feature was renamed to architecture-diagram-core.feature with architecture-diagram-advanced.feature extracted as a new file.

Spec file splits

Original (on main) New Files (on branch)
delivery-process/specs/architecture-diagram-generation.feature architecture-diagram-core.feature (renamed) + architecture-diagram-advanced.feature (new)

ADR-006 Anti-Patterns Eliminated

Anti-Pattern Where It Was Status
Parallel Pipeline (consumer imports scanner/extractor) validate-patterns.ts lines 32-35, process-api.ts buildPipeline(), orchestrator.ts lines 282-427 Eliminated — all three use buildMasterDataset()
Lossy Local Type (subset DTO discarding fields) validate-patterns.ts GherkinPatternInfo (5 of 30+ fields) Eliminated — type and extraction function deleted
Re-derived Relationship (building Map from raw implements/uses) validate-patterns.ts lines 373-384 (name-equality Map) Eliminated — uses dataset.relationshipIndex
Misplaced Pipeline Step (mergePatterns in consumer) orchestrator.ts line 701 Eliminated — moved to pipeline/merge-patterns.ts

Stats

  • 12 commits, 3 specs completed (all roadmap→active→completed)
  • 281 files changed (80 source/test files, rest are generated docs and dist)
  • Source: +14,233 / -12,428 lines (net +1,805 — bulk is test splits, not new code)
  • Net new production code: ~640 lines (build-pipeline.ts 342 + rules-query.ts 241 + merge-patterns.ts 60)
  • Net deleted production code: ~450 lines (orchestrator pipeline ~170, validate-patterns lossy types + pipeline ~200, process-api buildPipeline + handleRules ~80)

Test Plan

  • pnpm build — compiles with zero errors
  • pnpm test — all Gherkin specs pass (18 new split files + existing)
  • pnpm lint — zero warnings
  • pnpm validate:patterns — zero errors, zero warnings (was 7 warnings before)
  • pnpm validate:all — all validations pass including DoD and anti-patterns
  • pnpm docs:all — documentation generates identically
  • pnpm process:query -- overview — output unchanged
  • pnpm process:query -- rules — output unchanged (now via rules-query.ts)
  • All 3 CLI consumers (process-api, validate-patterns, orchestrator) call buildMasterDataset() from build-pipeline.ts — no inline pipeline wiring

Decision Spec

delivery-process/decisions/adr-006-single-read-model-architecture.feature — the architectural decision driving all three implementation specs.

Summary by CodeRabbit

  • Documentation

    • Added advanced architecture diagram specs: layered diagrams, generator-registry driven generation, and planned sequence-diagram support.
  • Refactor

    • Migrated orchestration into a pipeline-factory approach to centralize generation flow and improve validation/error handling parity.
  • Chores

    • Updated status/acceptance tracking across multiple process and taxonomy specifications to reflect completed items and tagging updates.

Eliminate the parallel pipeline anti-pattern in validate-patterns.ts:
the validator now consumes RuntimeMasterDataset instead of wiring its
own scan→extract→match pipeline with lossy GherkinPatternInfo types.

Key changes:
- Wire canonical 8-step pipeline (scan→extract→merge→transform)
- Two-phase cross-source matching via relationshipIndex (DD-3)
- Symmetric implements resolution in both TS→Gherkin and Gherkin→TS
- Naming collision guards in both match directions
- Remove spurious @libar-docs-phase from 5 utility patterns
- Delete GherkinPatternInfo and extractGherkinPatternInfo
- Use getPatternName() consistently to match relationshipIndex keying

Resolves: 7 false-positive warnings → 0 warnings, 0 errors
Matched: 0 → 64 cross-source pattern matches
All 6 deliverables verified: phase tag removal, pipeline wiring,
validatePatterns() rewrite, lossy type deletion, import cleanup,
and zero warnings on validate:patterns.
Update deliverable list to reflect design decisions: handleStubs,
handleDecisions, and handlePdr already delegate correctly (DD-5),
handleArch stays inline (DD-6). Replace 7 deliverables with 6 focused on
pipeline factory extraction, CLI migration, and rules-query extraction.
- Wire PipelineOptions.exclude through to scanPatterns() and
  scanGherkinFiles() — was silently dropped, breaking --exclude in
  validate-patterns when building the MasterDataset
- Update PipelineFactory and RulesQueryModule status to completed
  (matches parent spec ProcessAPILayeredExtraction)
- Remove unused includeValidation field from PipelineOptions (YAGNI)
… failures

PipelineResult now includes a warnings array so non-fatal issues
(e.g. Gherkin scan failure) reach CLI consumers via stderr rather
than being silently dropped.
Align documentation with the completed ValidatorReadModelConsolidation
and ProcessAPILayeredExtraction refactoring. Key changes:

- ARCHITECTURE.md: Add Single Read Model principle, Pipeline Factory
  section with types/consumer tables/anti-patterns, expand
  relationshipIndex schema from 4 to 10 fields, add factory flow diagram
- PROCESS-API.md: Document rules subcommand, update overview to mention
  buildMasterDataset()
- VALIDATION.md: Add architecture note on MasterDataset consumption via
  shared pipeline factory
- METHODOLOGY.md: Broaden Read Model definition to all consumers
- SESSION-GUIDES.md: Replace stale npx generate-docs with pnpm docs:all
- INDEX.md: Update line counts and detailed ToC ranges
…nd test file splits

DoD validator now accepts n/a and superseded as terminal deliverable statuses
via isDeliverableStatusTerminal(). Raised anti-pattern thresholds (scenario
bloat: 20→30, mega-feature: 500→750) and split 8 over-threshold test/spec
files into 20+ focused files with shared state helpers.

Process Guard now supports file splits: new files with @libar-docs-unlock-reason
bypass the FSM transition check, preventing false invalid-status-transition
errors when reorganizing completed patterns.

All 7801 tests pass, validate:all exits 0 with 0 errors and 0 warnings.
Eliminate the last Parallel Pipeline anti-pattern from ADR-006 by
making generateDocumentation() delegate to buildMasterDataset().

- Move mergePatterns to pipeline/merge-patterns.ts (fix inverted dep)
- Add PipelineWarning/ScanMetadata types with structured detail
- Add includeValidation and failOnScanErrors options to PipelineOptions
- Replace ~145 lines of inline pipeline with single factory call
- Update process-api.ts and validate-patterns.ts for PipelineWarning
…g warning

- Update @libar-docs-uses in process-api.ts to reflect PipelineFactory/RulesQueryModule
- Fix stale JSDoc in dod-validator.ts: "complete" → terminal statuses
- Add warning when merge conflicts are silently concatenated in pipeline factory
- Make RuleOutput fields readonly to match RulesQueryResult discipline
- Add explicit LoadedWorkflow type annotation in build-pipeline.ts
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (185)
  • docs-generated/ARCHITECTURE.md is excluded by !docs-generated/** and included by none
  • docs-generated/CHANGELOG-GENERATED.md is excluded by !docs-generated/** and included by none
  • docs-generated/COMPLETED-MILESTONES.md is excluded by !docs-generated/** and included by none
  • docs-generated/CURRENT-WORK.md is excluded by !docs-generated/** and included by none
  • docs-generated/PATTERNS.md is excluded by !docs-generated/** and included by none
  • docs-generated/REMAINING-WORK.md is excluded by !docs-generated/** and included by none
  • docs-generated/ROADMAP.md is excluded by !docs-generated/** and included by none
  • docs-generated/VALIDATION-RULES.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/annotation/annotation-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/architecture/reference-sample.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/configuration/configuration-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/core-types/core-types-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/data-api/data-api-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/generation/generation-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/process/process-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/_claude-md/validation/validation-overview.md is excluded by !docs-generated/** and included by none
  • docs-generated/current/phase-24-process-state-api-relationship-queries.md is excluded by !docs-generated/** and included by none
  • docs-generated/current/phase-25-data-api-stub-integration.md is excluded by !docs-generated/** and included by none
  • docs-generated/current/phase-27-file-cache.md is excluded by !docs-generated/** and included by none
  • docs-generated/current/phase-27-source-mapper.md is excluded by !docs-generated/** and included by none
  • docs-generated/current/phase-30-reference-doc-showcase.md is excluded by !docs-generated/** and included by none
  • docs-generated/current/phase-50-step-lint-vitest-cucumber.md is excluded by !docs-generated/** and included by none
  • docs-generated/docs/REFERENCE-SAMPLE.md is excluded by !docs-generated/** and included by none
  • docs-generated/milestones/Q1-2026.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/adr-document-codec.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/anti-pattern-detector-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/anti-pattern-detector.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/api-module.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/arch-generator-registration.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/arch-index-dataset.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/arch-queries-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/arch-queries-neighborhood-comparison-tags-sources-and-cli-context.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/arch-queries-test.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/arch-tag-extraction.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/architecture-codec.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/architecture-delta.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/architecture-diagram-generation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/ast-parser.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/built-in-generators.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/business-rules-codec.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/business-rules-document-codec.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/business-rules-generator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/category-definition.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/category-definitions.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/claude-module-generation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/cli-behavior-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/cli-error-handler.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/cli-version-helper.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-base-options.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-based-generator-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-based-generator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-behavior-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-driven-reference-generation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-generator-registration.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/codec-utils.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/collection-utilities.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/component-diagram-generation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/composite-codec-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/composite-codec.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/config-based-workflow-definition.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/config-loader-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/config-loader.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/config-resolution.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/config-resolver.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/config-schema-validation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/configuration-api.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/configuration-defaults.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/configuration-presets.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/configuration-types.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/content-deduplication.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/content-deduplicator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-assembler-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-assembler-session-oriented-context-bundle-builder.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-assembler-tests.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-formatter-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-formatter-plain-text-renderer-for-context-bundles.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-formatter-tests.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/context-inference.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/convention-extractor-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/coverage-analyzer-annotation-coverage-and-taxonomy-gap-detection.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/coverage-analyzer-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/cross-cutting-document-inclusion.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/cross-source-validation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-architecture-queries.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-context-assembly.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-design-session-support.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-output-shaping.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-platform-integration.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-relationship-graph.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-api-stub-integration.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/data-apicli-ergonomics.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/decision-doc-codec-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/decision-doc-codec.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/decision-doc-generator-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/decision-doc-generator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/declaration-level-shape-tagging-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/declaration-level-shape-tagging.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/dedent-helper.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/default-workflow-config-inline-default-workflow-constant.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/define-config-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/define-config.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/deliverable-status-taxonomy.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/delivery-process-factory.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/depends-on-tag-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/derive-process-state.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/description-header-normalization.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/description-quality-foundation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/detect-changes-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/detect-changes.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/directive-detection.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/do-d-validation-types.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/do-d-validation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/do-d-validator-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/do-d-validator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/doc-directive-schema.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/doc-string-media-type.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/document-codecs.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/document-extractor.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/document-generator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/documentation-generation-orchestrator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/documentation-generator-cli.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/documentation-orchestrator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/dual-source-extractor-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/dual-source-extractor.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/dual-source-schemas.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/effort-variance-tracking.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/error-factories.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/error-factory-types.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/error-handling-unification.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/extends-tag-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/extract-summary.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/extracted-pattern-schema.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/extracted-shape-schema.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/extraction-pipeline-enhancements-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/file-cache.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/file-discovery.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/format-types.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fsm-module.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fsm-states.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fsm-transitions.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fsm-validator-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fsm-validator.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fuzzy-match-tests.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fuzzy-matcher-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/fuzzy-matcher-pattern-name-fuzzy-search.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/generate-docs-cli.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/generate-tag-taxonomy-cli.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/generator-infrastructure-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/generator-registry-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/generator-registry.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/generator-types.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/gherkin-ast-parser.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/gherkin-extractor.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/gherkin-rules-support.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/gherkin-scanner.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/handoff-generator-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/handoff-generator-session-end-state-summary.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/handoff-generator-tests.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/hierarchy-levels.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/implementation-link-path-normalization.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/implements-tag-processing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/kebab-case-slugs.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/layer-inference-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/layer-inference.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/layer-types.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/layered-diagram-generation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-engine-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-engine.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-module.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-patterns-cli.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-process-cli.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-rules-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/lint-rules.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/linter-validation-testing.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/living-roadmap-cli.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/master-dataset.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/mermaid-relationship-rendering.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/mvp-workflow-implementation.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/normalized-status.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/output-pipeline-cli-output-shaping-and-formatting.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/output-pipeline-impl.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/output-pipeline-tests.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/output-schemas.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/pattern-helpers-tests.md is excluded by !docs-generated/** and included by none
  • docs-generated/patterns/pattern-helpers.md is excluded by !docs-generated/** and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an advanced architecture-diagram spec, migrates the orchestrator pipeline to a factory, extracts process-API rules query, and updates several deliverable/status metadata entries across delivery-process specs.

Changes

Cohort / File(s) Summary
Architecture Diagram Specs
delivery-process/specs/architecture-diagram-core.feature, delivery-process/specs/architecture-diagram-advanced.feature
Core spec metadata/tag updated and pared down; new advanced feature file added specifying layered diagram generation, generator registry CLI integration, and future sequence-diagram scenarios.
Pipeline Factory & Process API
delivery-process/specs/orchestrator-pipeline-factory-migration.feature, delivery-process/specs/process-api-layered-extraction.feature
New migration spec describing relocation of the 8-step pipeline into a pipeline factory (buildMasterDataset), structured PipelineWarning/ScanMetadata types, reworked orchestrator invocation, and extraction of rules-query API (src/api/rules-query.ts).
Status/Metadata Updates
delivery-process/specs/process-state-api-cli.feature, delivery-process/specs/typescript-taxonomy-implementation.feature, delivery-process/specs/validator-read-model-consolidation.feature
Minor metadata/status adjustments: text formatter status changed to n/a, additional @acceptance-criteria tagging, and several deliverables marked completed.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Orchestrator
  participant PipelineFactory
  participant MergePatterns
  participant Generators
  participant FS as FileSystem

  CLI->>Orchestrator: generateDocumentation(options)
  Orchestrator->>PipelineFactory: buildMasterDataset(options)
  PipelineFactory->>MergePatterns: mergePatterns(masterDataset)
  MergePatterns->>Generators: generateDiagrams(mergedDataset)
  Generators->>FS: write(diagramFiles -> outputDir)
  FS-->>CLI: return(output paths)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

specs - plan-level, specs - executable

Poem

🐰 Layers stacked from leaf to root,
Pipelines reshaped in careful suit,
Rules extracted, warnings told,
Specs sprout diagrams brave and bold,
I hop, I cheer—new plans take root.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: implementing ADR-006 to unify all consumers onto a single MasterDataset read model, which aligns with the core objective across all specification changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/single-read-model

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…output

The 130 INFO messages (Gherkin patterns with no TS match) are structurally
expected for ADRs, roadmap specs, and test features — never actionable.
They are now hidden by default and available via --verbose flag. JSON output
is unchanged.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
delivery-process/specs/validator-read-model-consolidation.feature (1)

62-66: ⚠️ Potential issue | 🟡 Minor

DD-1 and DD-4 are stale now that the shared pipeline factory is completed in this same PR.

  • DD-1 (line 62): States "not a shared factory yet" — but ProcessAPILayeredExtraction (which extracted build-pipeline.ts) is listed as completed in this PR's commit set.
  • DD-4 (lines 81–82): States "temporary parallel pipeline (acknowledged) that will be replaced when the pipeline factory exists" — the factory now exists. If the validator was not migrated to it, this is undocumented technical debt; if it was, the DD is factually incorrect.

Either update the DDs to reflect the final implementation decision (did the validator adopt buildMasterDataset() or not?), or note why the validator intentionally remained on the inline pipeline.

Also applies to: 79-82

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@delivery-process/specs/validator-read-model-consolidation.feature` around
lines 62 - 66, Update the DD notes in validator-read-model-consolidation.feature
to reflect the current state: replace the stale claims that the pipeline factory
doesn't exist with a statement that the shared pipeline factory (extracted by
ProcessAPILayeredExtraction / build-pipeline.ts) is now present, and explicitly
state whether the validator was migrated to use buildMasterDataset() from the
factory or intentionally left using the inline scan-extract-merge-transform
pipeline; if migrated, mention the adoption of buildMasterDataset(), otherwise
document the deliberate reason for retaining the inline pipeline and remove
references to a "temporary parallel pipeline."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@delivery-process/specs/architecture-diagram-advanced.feature`:
- Around line 10-26: The problem description block in
architecture-diagram-advanced.feature duplicates the core feature text (the tags
list and Problem/Solution paragraph referencing `@libar-docs-arch-role`,
`@libar-docs-arch-context`, `@libar-docs-arch-layer`), causing maintenance drift;
edit the advanced feature to remove the near‑verbatim copy and replace it with a
focused description tailored to advanced concerns (call out layered diagrams,
generator registry/CLI integration, and sequence/interaction diagrams) while
keeping a short reference to the three annotation tags for context, so the core
feature remains the canonical tag/extraction explanation and advanced highlights
layering, registry, and sequence use cases.

In `@delivery-process/specs/orchestrator-pipeline-factory-migration.feature`:
- Around line 313-318: The "Full verification passes" scenario in
orchestrator-pipeline-factory-migration.feature is declared at feature-level
rather than inside a Rule block; update the file by wrapping the existing
Scenario "Full verification passes" in a Rule: block and add the required
headers (**Invariant:**, **Rationale:**, **Verified by:**) above the Scenario to
match the pattern used in process-api-layered-extraction.feature and maintain
traceability; keep the Scenario text unchanged but indent it under the new Rule
block so docs generation and consistency are preserved.
- Around line 64-78: Remove the triple-backtick/""" code-fenced TypeScript
blocks from the feature description and instead place the PipelineWarning and
PipelineWarningDetail interface definitions as plain inline comments or
reference their source file; specifically, eliminate the """typescript ... """
blocks that contain the PipelineWarning and PipelineWarningDetail declarations
and either convert them to single-line or block comments within the feature text
or add a brief note pointing to the file where those interfaces are defined.

In `@delivery-process/specs/process-api-layered-extraction.feature`:
- Around line 306-312: The "Scenario: Full verification passes" is defined at
the Feature level rather than inside a Rule; to match the project's convention,
wrap that scenario inside a new Rule (e.g., Rule: End-to-end verification
confirms behavioral equivalence) and add the structured headers used elsewhere:
include an **Invariant:** describing the expected outcome, a **Rationale:**
explaining why this end-to-end check is needed, and a **Verified by:** noting
the commands (pnpm build, pnpm test, pnpm lint, pnpm validate:patterns and the
two pnpm process:query checks); move the existing "Full verification passes"
scenario into that Rule so all scenarios are consistently nested and
traceability generation will work.

In `@delivery-process/specs/typescript-taxonomy-implementation.feature`:
- Line 39: The `@acceptance-criteria` tag is only applied to the first scenario
(the line with "@happy-path `@acceptance-criteria`") but the Background table
lists three acceptance criteria; update the feature file so each criterion is
covered by a tagged scenario: add `@acceptance-criteria` to the scenario(s) that
demonstrate "Zod schemas use TypeScript constants" (the scenarios around lines
126–136) and either add a new scenario tagged `@acceptance-criteria` that verifies
"Existing consumers work unchanged" or remove that criterion from the Background
table if it is not applicable; ensure the tag is present on the scenario names
that exercise those behaviors so tracing matches the Background acceptance
criteria.

In `@delivery-process/specs/validator-read-model-consolidation.feature`:
- Line 3: This spec is missing the required unlock tag when set to completed;
update the header to include the `@libar-docs-unlock-reason`:<reason> tag
alongside `@libar-docs-status`:completed (e.g.,
`@libar-docs-unlock-reason`:finalized-spec-review) so future edits aren’t blocked
by the hard-lock; ensure you add the tag exactly as
`@libar-docs-unlock-reason`:<reason> in the
validator-read-model-consolidation.feature header and use a brief, descriptive
reason string.

---

Outside diff comments:
In `@delivery-process/specs/validator-read-model-consolidation.feature`:
- Around line 62-66: Update the DD notes in
validator-read-model-consolidation.feature to reflect the current state: replace
the stale claims that the pipeline factory doesn't exist with a statement that
the shared pipeline factory (extracted by ProcessAPILayeredExtraction /
build-pipeline.ts) is now present, and explicitly state whether the validator
was migrated to use buildMasterDataset() from the factory or intentionally left
using the inline scan-extract-merge-transform pipeline; if migrated, mention the
adoption of buildMasterDataset(), otherwise document the deliberate reason for
retaining the inline pipeline and remove references to a "temporary parallel
pipeline."

- Tailor architecture-diagram-advanced.feature description to advanced
  scope instead of duplicating core description verbatim
- Replace fragile """typescript blocks in orchestrator-pipeline-factory-migration
  feature description with references to actual implementation files
- Wrap standalone "Full verification passes" scenarios in Rule blocks with
  structured headers in both orchestrator and process-api specs
- Add @acceptance-criteria tags to 3 additional scenarios in
  typescript-taxonomy-implementation.feature for complete traceability
- Dismiss comment 006 (missing unlock-reason): Process Guard exempts
  transitions TO terminal states per decider.ts:186-189
…c shift

Reflect the pipeline factory architecture (buildMasterDataset, mergePatterns,
rules-query) across 7 modules. Fix stale references (deleted test files, DoD
terminal status). Add undocumented API commands (rules, files, decisions, pdr,
arch queries) and replace static handoff template with handoff --pattern.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@delivery-process/specs/architecture-diagram-advanced.feature`:
- Around line 139-170: Update the "**Verified by:**" header to include the
missing third scenario name so the list matches the three scenarios;
specifically, add "Participant ordering follows architectural layers" alongside
"Generate command flow sequence" and "Generate saga flow sequence" in the
Verified by line referenced in the Rule 7 block (look for the "**Verified by:**"
header and the three Scenario titles: "Generate command flow sequence",
"Generate saga flow sequence", and "Participant ordering follows architectural
layers").

In `@delivery-process/specs/orchestrator-pipeline-factory-migration.feature`:
- Around line 275-296: The feature rule covers both failOnScanErrors=true and
false but only tests the false path; add a new Scenario that verifies the
true/default behavior: reuse the existing Given (codebase with 1 of 10 TS files
having a syntax error), run the factory with failOnScanErrors set to true (or
omit it to rely on the default), and assert the outcome is Result.err (or that
the pipeline returns Result.err on the first scan failure) and that no patterns
are returned; reference the Rule text and the failOnScanErrors flag and mirror
the existing scenario structure (Given/When/Then) so the feature fully covers
both invariant branches.

In `@delivery-process/specs/typescript-taxonomy-implementation.feature`:
- Line 39: The acceptance-criteria tag mapping shows criterion 3 is only
implicitly covered by the scenario titled "buildRegistry returns expected
structure"; make this explicit by either renaming that scenario to mention
consumer backward-compatibility (e.g., include "consumer backward-compatibility"
or "existing generators compatibility" in the scenario title) or add a new
`@acceptance-criteria` scenario whose steps explicitly assert "And all existing
generators work without modification" (reuse that step text) so the traceability
to "Existing consumers work unchanged" is unambiguous; update the scenario title
or add the new scenario in the same feature file next to the existing
"buildRegistry returns expected structure" scenario to preserve context.

Comment on lines +139 to +170
Rule: Sequence diagrams render interaction flows

**Invariant:** Sequence diagrams must render interaction flows (command flow,
saga flow) showing step-by-step message passing between components.

**Rationale:** Component diagrams show structure but not behavior. Sequence
diagrams show runtime flow - essential for understanding command/saga execution.

**Verified by:** Generate command flow sequence, Generate saga flow sequence

@acceptance-criteria @happy-path @future
Scenario: Generate command flow sequence diagram
Given a command handler pattern with uses relationships
When the sequence diagram codec runs with command flow template
Then output contains mermaid sequenceDiagram
And participants are derived from uses relationships
And 7-step CommandOrchestrator flow is rendered

@acceptance-criteria @happy-path @future
Scenario: Generate saga flow sequence diagram
Given a saga pattern with uses relationships to multiple BCs
When the sequence diagram codec runs with saga flow template
Then output contains mermaid sequenceDiagram
And participants include each bounded context
And compensation steps are shown

@acceptance-criteria @happy-path @future
Scenario: Participant ordering follows architectural layers
Given patterns spanning multiple layers
When the sequence diagram codec runs
Then participants are ordered by layer
And infrastructure layer appears first
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Rule 7 (Sequence Diagram Generation) — appropriate use of @future tag.

The three future scenarios are clearly marked with @future and define expected behaviors for command flow, saga flow, and participant ordering. The **Verified by:** header lists only two scenario names but there are three scenarios — consider adding "Participant ordering follows architectural layers" for completeness.

Proposed fix
-    **Verified by:** Generate command flow sequence, Generate saga flow sequence
+    **Verified by:** Generate command flow sequence, Generate saga flow sequence,
+    Participant ordering follows architectural layers
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@delivery-process/specs/architecture-diagram-advanced.feature` around lines
139 - 170, Update the "**Verified by:**" header to include the missing third
scenario name so the list matches the three scenarios; specifically, add
"Participant ordering follows architectural layers" alongside "Generate command
flow sequence" and "Generate saga flow sequence" in the Verified by line
referenced in the Rule 7 block (look for the "**Verified by:**" header and the
three Scenario titles: "Generate command flow sequence", "Generate saga flow
sequence", and "Participant ordering follows architectural layers").

Comment on lines +275 to +296
Rule: Pipeline factory supports partial success mode

**Invariant:** When `failOnScanErrors` is false, the factory captures
scan errors and extraction errors as warnings and continues with
successfully processed files. When true (default), the factory returns
`Result.err` on the first scan failure.

**Rationale:** The orchestrator treats scan errors as non-fatal
warnings — documentation generation should succeed for all scannable
files even if some files have syntax errors. The process-api treats
scan errors as fatal because the query layer requires a complete
dataset. The factory must support both strategies via configuration.

**Verified by:** Partial success mode works

@acceptance-criteria
Scenario: Partial success mode works
Given a codebase where 1 of 10 TypeScript files has a syntax error
When the factory runs with failOnScanErrors false
Then the result is Result.ok with 9 patterns
And warnings include the scan error for the failing file
And the pipeline does not return Result.err
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Rule: Pipeline factory supports partial success mode — single scenario may lack edge-case coverage.

The rule's invariant describes two behaviors (failOnScanErrors: true returns Result.err; false captures warnings), but only the false path has a scenario. Consider adding a scenario for the true (default) path to fully verify the invariant.

Proposed additional scenario
     And the pipeline does not return Result.err
+
+    `@acceptance-criteria`
+    Scenario: Strict mode fails on scan errors
+      Given a codebase where 1 of 10 TypeScript files has a syntax error
+      When the factory runs with failOnScanErrors true
+      Then the result is Result.err with a PipelineError
+      And the error includes the failing file details
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@delivery-process/specs/orchestrator-pipeline-factory-migration.feature`
around lines 275 - 296, The feature rule covers both failOnScanErrors=true and
false but only tests the false path; add a new Scenario that verifies the
true/default behavior: reuse the existing Given (codebase with 1 of 10 TS files
having a syntax error), run the factory with failOnScanErrors set to true (or
omit it to rely on the default), and assert the outcome is Result.err (or that
the pipeline returns Result.err on the first scan failure) and that no patterns
are returned; reference the Rule text and the failOnScanErrors flag and mirror
the existing scenario structure (Given/When/Then) so the feature fully covers
both invariant branches.

# ─────────────────────────────────────────────────────────────────────────────

@happy-path
@happy-path @acceptance-criteria
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

@acceptance-criteria coverage now addresses the three Background criteria.

The new tags provide the following mapping, resolving the previously flagged gap:

Background Criterion Covering Scenario
Constants provide compile-time safety L40 "Define status values as TypeScript constant"
Zod schemas use TypeScript constants L127 "MetadataTagDefinitionSchema uses FORMAT_TYPES" + L134 "Status field validation uses constant"
Existing consumers work unchanged L160 "buildRegistry returns expected structure" (via step And all existing generators work without modification)

The third criterion is now satisfied, though its coverage is implicit — it rests on a single And step embedded in a scenario whose title ("buildRegistry returns expected structure") emphasises structure rather than consumer compatibility. Consider either renaming the scenario or adding a dedicated @acceptance-criteria scenario specifically titled around consumer backward-compatibility if this traceability link needs to be unambiguous for audit or tooling purposes.

✏️ Optional: make criterion-3 coverage explicit via scenario rename
-  `@acceptance-criteria`
-  Scenario: buildRegistry returns expected structure
-    Given the taxonomy module
-    When buildRegistry() is called
-    Then it returns the expected TagRegistry structure
-    And all existing generators work without modification
+  `@acceptance-criteria`
+  Scenario: Existing consumers work unchanged after taxonomy refactor
+    Given the taxonomy module
+    When buildRegistry() is called
+    Then it returns the expected TagRegistry structure
+    And all existing generators work without modification

Also applies to: 126-126, 133-133, 159-159

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@delivery-process/specs/typescript-taxonomy-implementation.feature` at line
39, The acceptance-criteria tag mapping shows criterion 3 is only implicitly
covered by the scenario titled "buildRegistry returns expected structure"; make
this explicit by either renaming that scenario to mention consumer
backward-compatibility (e.g., include "consumer backward-compatibility" or
"existing generators compatibility" in the scenario title) or add a new
`@acceptance-criteria` scenario whose steps explicitly assert "And all existing
generators work without modification" (reuse that step text) so the traceability
to "Existing consumers work unchanged" is unambiguous; update the scenario title
or add the new scenario in the same feature file next to the existing
"buildRegistry returns expected structure" scenario to preserve context.

@darko-mijic darko-mijic merged commit 07c0fee into main Feb 21, 2026
1 of 4 checks passed
@darko-mijic darko-mijic deleted the feature/single-read-model branch February 21, 2026 00:05
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.

1 participant