Skip to content

feat: consolidate documentation — 5 new codecs, 900+ manual lines replaced by auto-generation#32

Merged
darko-mijic merged 70 commits intomainfrom
feature/docs-consolidation
Mar 6, 2026
Merged

feat: consolidate documentation — 5 new codecs, 900+ manual lines replaced by auto-generation#32
darko-mijic merged 70 commits intomainfrom
feature/docs-consolidation

Conversation

@darko-mijic
Copy link
Copy Markdown
Contributor

@darko-mijic darko-mijic commented Mar 6, 2026

Summary

Replaces manually maintained documentation with auto-generated equivalents driven by annotated source code. Establishes a single output directory, builds 5 new generation codecs, and reduces manual doc maintenance by ~900 lines.

67 commits across 184 files (+22,184 / -5,442 lines):

Area Files Lines Added Lines Removed
Source code (src/) 42 +3,035 -434
Tests (tests/) 14 +2,524 -2
Specs (delivery-process/specs/) 17 +2,851 -25
Generated docs (docs-live/) 55 +17,445 -1,120
Design stubs 14 +2,923
Manual docs, config, CI 42

Before vs After

Before this PR, documentation lived in three disconnected locations (docs/, docs-generated/, docs-live/) with ~4,500 lines of manually maintained content that drifted from the codebase.

After this PR:

  • docs-generated/ is eliminated — all generated output goes to docs-live/
  • 900+ lines of manual docs replaced with codec-generated equivalents
  • 5 new codecs produce reference docs from annotated source code
  • CLAUDE.md reduced 38% (1,085 → 671 lines) by mandating Process Data API queries over manual prose
  • README.md reduced 72% (504 → 142 lines) by removing content already covered by the website

What Changed and Why

Unified Output Directory

Problem: Generated docs were scattered across docs-generated/ and docs-live/ with no clear ownership — consumers and the website sync script had to know which directory held what.

Solution: All generated output now goes to docs-live/. The docs-generated/ directory is removed from git tracking and added to .gitignore as a transient build cache only.

Before After
docs-generated/ (14 files, 8,117 lines tracked) Deleted from tracking, .gitignored
Output split across 2 directories Single docs-live/ output directory

Generated Doc Quality Improvements

Problem: Generated docs had duplicate tables (ADR-006 violation), missing TOCs, inconsistent type ordering, and a wall-of-text introduction in the Generation product area doc.

Solution:

  • Fixed REFERENCE-SAMPLE.md duplication
  • Added TOC to long generated documents
  • Reordered type documentation for logical reading flow
  • Replaced Generation product area intro with structured pipeline stage + codec inventory tables

Session Workflow as Queryable Business Rules

Problem: Session workflow guidance was hand-authored in CLAUDE.md and duplicated across multiple locations with no synchronization mechanism.

Solution: Created a comprehensive spec (session-guides-module-source.feature) with 7 Rule blocks encoding session workflow invariants. These now serve as source for both:

  • Compact AI context modules (_claude-md/workflow/session-workflow-guide.md)
  • Public reference docs (docs-live/reference/SESSION-WORKFLOW-GUIDE.md, 384 lines)
  • Queryable rules via pnpm process:query -- rules --pattern SessionGuidesModuleSource

Publishing Docs Relocated

Problem: docs/PUBLISHING.md was published to the website but contained maintainer-only npm publishing workflows irrelevant to end users.

Solution: Moved to MAINTAINERS.md at repo root — the audience-appropriate location for contributor-facing operational docs, excluded from website publishing.

Gherkin Patterns Restructured

Problem: docs/GHERKIN-PATTERNS.md (515 lines) contained a Step Linting Reference section that belongs with validation documentation, not authoring guidance.

Solution:

  • Relocated Step Linting Reference to docs/VALIDATION.md (correct domain)
  • Trimmed GHERKIN-PATTERNS.md to 366 lines (29% reduction)
  • Focused remaining content on essential authoring patterns, tag constraints, and parser quirks

README Rationalized

Problem: README.md (504 lines) duplicated 10 sections already covered by website components and generated docs.

Solution: Trimmed to 142 lines (72% reduction) with outcome-focused messaging: Quick Start, How It Works, What Gets Generated, CLI Commands table, and documentation links.

Process API Docs Generated from Declarative Schema

Problem: docs/PROCESS-API.md (508 lines) was a manually maintained CLI reference that drifted from actual implementation whenever commands changed.

Solution:

  • Created src/cli/cli-schema.ts (616 lines) — a declarative CLI schema that serves as single source of truth for both runtime help text and generated docs
  • Built ProcessApiReferenceGenerator → generates reference tables from the schema
  • Built CliRecipeGenerator → generates workflow recipes with editorial preamble
  • Trimmed PROCESS-API.md to a 63-line pointer file (87% reduction)

New generated output:

  • docs-live/reference/PROCESS-API-REFERENCE.md (63 lines) — command reference tables
  • docs-live/reference/PROCESS-API-RECIPES.md (476 lines) — workflow recipes and examples

Claude Module Generation

Problem: _claude-md/ modules were hand-authored, creating maintenance burden for compact AI context that had to be manually kept in sync with spec changes.

Solution: Created ClaudeModuleCodec that extracts Rule blocks from patterns tagged with @libar-docs-claude-module and generates compact context modules with invariants, rationale, and decision tables derived from Scenario Outline examples.

New Index, Architecture, and Changelog Generators

Five generators were added or promoted to the standard build:

Generator Output Lines What It Produces
IndexCodec docs-live/INDEX.md 226 Navigation hub composing editorial preamble with MasterDataset statistics
CliRecipeGenerator PROCESS-API-RECIPES.md 476 Workflow recipes generated from CLI schema
ProcessApiReferenceGenerator PROCESS-API-REFERENCE.md 63 CLI command reference tables
Architecture generator docs-live/ARCHITECTURE.md 564 Mermaid architecture diagrams
Changelog generator docs-live/CHANGELOG-GENERATED.md 328 Release history from commit metadata

Plus 4 new reference documents via ReferenceDocConfig:

  • PROCESS-GUARD-REFERENCE.md (179 lines) — error diagnosis, FSM states, pre-commit setup
  • SESSION-WORKFLOW-GUIDE.md (384 lines) — session checklists with Mermaid decision tree
  • ANNOTATION-REFERENCE.md (146 lines) — getting-started guide for @libar-docs annotations
  • Enhanced ARCHITECTURE-CODECS.md (656 lines) and ARCHITECTURE-TYPES.md (429 lines)

New Source Code

Core infrastructure (src/)

File Purpose
cli/cli-schema.ts Declarative CLI schema — single source of truth for help text + doc generation
generators/built-in/cli-recipe-generator.ts Generates recipe docs from CLI schema + markdown preambles
generators/built-in/process-api-reference-generator.ts Generates CLI reference tables from schema
generators/built-in/codec-generators.ts Wires all 23 generators into the registry
renderable/codecs/index-codec.ts Composes editorial preamble with MasterDataset statistics for INDEX.md
renderable/codecs/claude-module.ts Extracts Rule blocks → compact AI context modules
renderable/load-preamble.ts 5-state markdown parser: docs-sources/*.mdSectionBlock[]
taxonomy/claude-section-values.ts Enum for _claude-md/ subdirectory organization

Key design pattern: loadPreambleFromMarkdown()

The src/renderable/load-preamble.ts utility (349 lines) eliminates the need to hand-author SectionBlock[] arrays in TypeScript config. Instead, editorial preamble content is authored as natural Markdown in docs-sources/ and parsed into structured blocks at config load time. This reduced per-codec config boilerplate by ~540 lines.

4 preamble source files in docs-sources/:

File Content
annotation-guide.md Getting started with @libar-docs annotations
index-navigation.md Quick navigation table for generated docs
session-workflow-guide.md Session decision tree (Mermaid flowchart)
process-api-recipes.md CLI recipes with comparison tables

Specification Work

15 new spec files define the consolidation deliverables as executable specifications:

Spec Pattern Status
docs-consolidation-strategy.feature DocsConsolidationStrategy roadmap
docs-live-consolidation.feature DocsLiveConsolidation completed
publishing-relocation.feature PublishingRelocation completed
generated-doc-quality.feature GeneratedDocQuality completed
session-guides-module-source.feature SessionGuidesModuleSource completed
gherkin-patterns-restructure.feature GherkinPatternsRestructure completed
readme-rationalization.feature ReadmeRationalization completed
process-api-hybrid-generation.feature ProcessApiHybridGeneration completed
claude-module-generation.feature ClaudeModuleGeneration completed
architecture-doc-refactoring.feature ArchitectureDocRefactoring completed
enhanced-index-generation.feature EnhancedIndexGeneration completed
error-guide-codec.feature ErrorGuideCodec completed
cli-recipe-codec.feature CliRecipeCodec completed
procedural-guide-codec.feature ProceduralGuideCodec completed

14 design stub files in delivery-process/stubs/ provide interfaces and schemas for future implementation work.


Test Coverage

14 new test files (+2,524 lines), all in Gherkin .feature + step definition format:

Test File What It Covers
process-api-reference.steps.ts Reference table generation from declarative CLI schema
convention-extractor.steps.ts Heading match for structured JSDoc convention annotations
generated-doc-quality.steps.ts Duplicate table detection, TOC generation, type ordering
reference-codec-diagrams.steps.ts Mermaid C4Context + graph LR diagram generation per product area
reference-generators.steps.ts Config-driven reference doc generation pipeline
architecture-doc-refactoring.steps.ts Convention tag decomposition of ARCHITECTURE.md
load-preamble.steps.ts Markdown → SectionBlock[] 5-state parser

Manual Docs Impact

Trimmed (replaced by generated equivalents)

Document Before After Reduction Generated Replacement
PROCESS-API.md 508 63 87% PROCESS-API-REFERENCE.md + PROCESS-API-RECIPES.md
README.md 504 142 72% Website components
CLAUDE.md 1,085 671 38% Process Data API queries
GHERKIN-PATTERNS.md 515 366 29% Step Linting → VALIDATION.md

Relocated

Document From To Reason
PUBLISHING.md docs/ MAINTAINERS.md (root) Audience alignment — maintainer content, not user content
Step Linting section GHERKIN-PATTERNS.md VALIDATION.md Correct domain — validation rules belong with validation docs

Preserved as reference

Manual docs/ files are preserved until generated equivalents reach quality parity. Each file has a note pointing to its generated counterpart.


Documentation Architecture

After this PR, documentation follows a clear three-tier hierarchy:

┌─────────────────────────────────────────────────────┐
│ Tier 1: Annotated Source Code (single source)       │
│   TypeScript JSDoc + Gherkin Rule: blocks            │
│   → Queryable via: pnpm process:query               │
├─────────────────────────────────────────────────────┤
│ Tier 2: Generated Docs (auto-maintained)            │
│   docs-live/        → 55+ files, website-ready      │
│   _claude-md/       → 10 AI context modules         │
├─────────────────────────────────────────────────────┤
│ Tier 3: Editorial Docs (hand-maintained)            │
│   docs/             → Philosophy, gotchas, guides   │
│   docs-sources/     → Preambles injected into Tier 2│
│   CLAUDE.md         → Compact AI session context    │
└─────────────────────────────────────────────────────┘

The key insight: Tier 1 annotations feed Tier 2 generation automatically. Tier 3 exists only for irreducibly editorial content (philosophy, troubleshooting gotchas, authoring style guides) that cannot be extracted from code.


Remaining Work

Tracked in docs/DOCS-GAP-ANALYSIS.md:

Priority Item Description
P0 Website sync script fix Update sync-content.mjs to read from docs-live/ instead of the now-empty docs-generated/
P1 Quality polish Mobile-friendly tables, Mermaid rendering verification, cross-references, split oversized files
P3 Methodology disposition Confirm METHODOLOGY.md stays manual (philosophy is irreducibly editorial)

How to Verify

# Regenerate all docs (should be idempotent — no diff after run)
pnpm docs:all

# Run full test suite
pnpm test

# Validate process integrity (FSM, anti-patterns, DoD)
pnpm validate:all

# Query project health
pnpm process:query -- overview

Test Plan

  • pnpm test — all tests pass including 14 new test files (+2,524 lines)
  • pnpm docs:all — regeneration is idempotent (no diff after run)
  • pnpm validate:all — no anti-pattern or DoD violations
  • pnpm typecheck — no type errors
  • pnpm lint — no lint violations
  • Website build reads from docs-live/ correctly (separate follow-up PR)

…e doc decomposition

Design session output: added Rules 5-8 covering product area absorption (DD-4),
MasterDataset shapes reference (DD-6), pipeline diagram generation (DD-7/DD-8),
and usefulness-driven editorial trimming (DD-5/DD-9). Updated Section Disposition
table to reflect ~320 line target with Programmatic Usage and Extending the System
sections dropped. Added editorial trim deliverable. Updated umbrella spec with
Phase 4 cross-reference.
… deliverable

All 12 deliverables were complete and tests passing (20/20) from prior
commits. This commit records the FSM transition roadmap→active and marks
the Phase 4 Architecture decomposition deliverable as complete in
DocsConsolidationStrategy.
…ted)

All 12 deliverables confirmed complete, 20/20 tests passing, ARCHITECTURE.md
at 358 lines (target ~320). Pattern transitions to terminal completed state.
Improve heading extraction to handle structured JSDoc with ## headings
inside @libar-docs-convention blocks. Fix restrict-plus-operands lint
error on table row parser.
Establish docs-live/ as the single output directory for all
website-published and Claude-readable content. Spec defines
4 deliverables for consolidating reference docs and compacts.
Move reference docs output from docs-generated/docs/ to
docs-live/reference/ and architecture compacts to
docs-live/_claude-md/architecture/.

- Add outputDirectory: docs-live override for reference-docs
- Change generator output prefix docs/ → reference/
- Add docs-generated/ to .gitignore
- Remove docs-generated from package.json files array
- Add docs-live/ to process guard isGeneratedDocsPath()
- Update 4 cross-references in docs/ARCHITECTURE.md
- Update 7 test file path references
- Fix session-guides lint error (When → Once)
All 4 deliverables verified:
- Reference docs at docs-live/reference/
- Architecture compacts at docs-live/_claude-md/architecture/
- docs-generated/ contains only intermediates
- .gitignore updated
Reference docs now output to docs-live/reference/. Architecture
compacts now at docs-live/_claude-md/architecture/. Remove
docs-generated/ from git tracking (now gitignored, contains only
intermediate build artifacts).

Includes regenerated product areas, ADRs, compacts, and business
rules reflecting current annotation state.
Add Phase 38-43 roadmap specs (GeneratedDocQuality,
GherkinPatternsRestructure, ProcessApiHybridGeneration,
PublishingRelocation, ReadmeRationalization) and session
planning tracker.
Four quality improvements to generated docs:
- D1: Remove duplicate convention tables from behavior-specs renderer
- D2: Enrich Generation product area compact (1.4 KB → 4.3 KB)
- D3: Add shapesFirst config to reorder ARCHITECTURE-TYPES.md
- D4: Add generated TOC to product area doc headers
Design session revealed original plan to tag ADR-001/ADR-003/PDR-001
with claude-module was flawed — file-level tag pulls all Rules, most
irrelevant to session workflows. Revised spec: this spec itself is the
annotated source with 9 Rule blocks capturing session workflow invariants.

Changes:
- Rewrote session-guides-module-source.feature with 9 Rule blocks
  (session types, planning, design, implementation, FSM errors, handoff)
- Restructured deliverables: 3 pending, 1 complete, 3 deferred on Phase 25
- Added 'workflow' to Phase 25 claude-section enum values
- Updated tracker with design session report

123 test files, 7972 tests passing.
Revised line target from ~250 to ~370 after section audit showed only
Step Linting (148 lines) is misplaced content. Added section disposition
table, exact line ranges, VALIDATION.md integration point, INDEX.md
deliverable, and 3 Rule blocks. No CLAUDE.md trim this phase.
Copy link
Copy Markdown

@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.

Review continued from previous batch...

Copy link
Copy Markdown

@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: 4

Caution

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

⚠️ Outside diff range comments (1)
src/renderable/codecs/reference.ts (1)

664-701: ⚠️ Potential issue | 🟠 Major

Don’t deduplicate shapes by bare name.

Lines 670 and 876 use only shape.name as the identity key. Two distinct declarations like Config from different files/modules will collide, and one disappears from the rendered reference. Please switch both paths to a source-qualified key instead of a name-only key.

Also applies to: 877-907

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

In `@src/renderable/codecs/reference.ts` around lines 664 - 701, The code
currently deduplicates shapes using only shape.name (seenNames), which collapses
distinct shapes with the same name from different files/modules; change
deduplication to use a source-qualified key (e.g.,
`${shape.name}::${shape.source || shape.filePath || shape.moduleId}`) everywhere
name-only deduplication is used (the seenNames set and any other place that
checks shape.name, such as the selector merge and the include-tag merge and the
similar block around buildShapeSections and the later 876–907 region). Replace
the Set<string> seenNames with a Set of these composite keys (rename to
seenKeys), compute the key via a small helper (e.g., makeShapeKey(shape)) and
use that helper whenever adding/checking so distinct declarations with the same
name do not collide while preserving current merge logic around
extractShapesFromDataset, filterShapesBySelectors, dataset.patterns and
buildShapeSections.
♻️ Duplicate comments (1)
src/renderable/codecs/business-rules.ts (1)

434-434: ⚠️ Potential issue | 🟡 Minor

The NEXT_HEADER_PATTERN regex bug remains unfixed.

The ^\| branch cannot match indented table rows because \n\s* consumes whitespace before the anchor check. This causes tables with leading whitespace (e.g., \n | table |) to fail matching.

🐛 Proposed fix
-const NEXT_HEADER_PATTERN = /\n\s*(\*\*[A-Z]|^\|)/m;
+const NEXT_HEADER_PATTERN = /\n\s*(?:\*\*[A-Z]|\|)/m;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderable/codecs/business-rules.ts` at line 434, The NEXT_HEADER_PATTERN
regex incorrectly uses the ^ anchor inside the alternation causing indented
table rows to miss matches; update NEXT_HEADER_PATTERN so the pipe branch
matches after optional whitespace (e.g., replace /\n\s*(\*\*[A-Z]|^\|)/m with a
pattern that either removes the ^ or uses a lookahead such as
/\n\s*(\*\*[A-Z]|\|)/m or /\n(?=\s*(\*\*[A-Z]|\|))/m so that '\n  | table |' is
correctly recognized; change the constant NEXT_HEADER_PATTERN accordingly and
run tests that cover indented table rows and header detection.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/generators/built-in/process-api-reference-generator.ts`:
- Around line 93-109: Update the generate method signature on class
ProcessApiReferenceGeneratorImpl to match the DocumentGenerator interface by
replacing the parameter type readonly unknown[] with readonly ExtractedPattern[]
and import ExtractedPattern from the types module; specifically change
generate(_patterns: readonly unknown[], _context: GeneratorContext) to
generate(_patterns: readonly ExtractedPattern[], _context: GeneratorContext) and
add the corresponding import so the class (ProcessApiReferenceGeneratorImpl)
explicitly conforms to the interface.

In `@src/renderable/codecs/reference.ts`:
- Around line 943-949: The TOC is being inserted after the first separator
(firstSepIdx) which can be the separator added right after config.preamble,
causing the TOC to appear before the generated intro; change the insertion logic
to locate the separator that follows the intro block instead of the very first
separator. Specifically, when tocBlocks produced by
buildTableOfContents(sections) is non-empty, find the index of the intro block
(e.g., const introIdx = sections.findIndex(s => s.type === 'intro') or otherwise
compute the intro boundary) and then find the separator after that (e.g., const
sepAfterIntro = sections.findIndex((s, i) => i > introIdx && s.type ===
'separator')), and splice tocBlocks at sepAfterIntro + 1 (falling back to
firstSepIdx or end if no intro/separator found); update the code paths that
reference firstSepIdx, tocBlocks, buildTableOfContents and config.preamble
accordingly.
- Around line 1797-1809: The hardcoded byStatus label in
buildMasterDatasetViewsDiagram uses an incorrect vocabulary; update the byStatus
node string (the entry with byStatus["byStatus<br/>(... )"]) to list the
canonical lifecycle names in the correct/process-guard order (roadmap, active,
completed, deferred) so the diagram matches the dataset and the FSM rules
(roadmap → active → completed, deferred → roadmap).
- Around line 614-618: The preamble field from ReferenceDocConfig is only
honored inside decodeProductArea, so createReferenceCodec({ preamble, ... })
drops preamble for the normal decode path; to fix, apply the same
preamble-handling logic used by decodeProductArea in the standard decode branch
as well: extract/merge the preamble from the config and prepend or merge it into
the dataset/content before continuing with the regular decode flow. Update
createReferenceCodec (or the decoder entrypoint) so both branches (productArea
and non-productArea) invoke the preamble application step, keeping
decodeProductArea unchanged and reusing its preamble behavior.

---

Outside diff comments:
In `@src/renderable/codecs/reference.ts`:
- Around line 664-701: The code currently deduplicates shapes using only
shape.name (seenNames), which collapses distinct shapes with the same name from
different files/modules; change deduplication to use a source-qualified key
(e.g., `${shape.name}::${shape.source || shape.filePath || shape.moduleId}`)
everywhere name-only deduplication is used (the seenNames set and any other
place that checks shape.name, such as the selector merge and the include-tag
merge and the similar block around buildShapeSections and the later 876–907
region). Replace the Set<string> seenNames with a Set of these composite keys
(rename to seenKeys), compute the key via a small helper (e.g.,
makeShapeKey(shape)) and use that helper whenever adding/checking so distinct
declarations with the same name do not collide while preserving current merge
logic around extractShapesFromDataset, filterShapesBySelectors, dataset.patterns
and buildShapeSections.

---

Duplicate comments:
In `@src/renderable/codecs/business-rules.ts`:
- Line 434: The NEXT_HEADER_PATTERN regex incorrectly uses the ^ anchor inside
the alternation causing indented table rows to miss matches; update
NEXT_HEADER_PATTERN so the pipe branch matches after optional whitespace (e.g.,
replace /\n\s*(\*\*[A-Z]|^\|)/m with a pattern that either removes the ^ or uses
a lookahead such as /\n\s*(\*\*[A-Z]|\|)/m or /\n(?=\s*(\*\*[A-Z]|\|))/m so that
'\n  | table |' is correctly recognized; change the constant NEXT_HEADER_PATTERN
accordingly and run tests that cover indented table rows and header detection.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8958621e-e1aa-437c-bf71-ba2ad87d0d7d

📥 Commits

Reviewing files that changed from the base of the PR and between 1ac4421 and 8a96d44.

📒 Files selected for processing (3)
  • src/generators/built-in/process-api-reference-generator.ts
  • src/renderable/codecs/business-rules.ts
  • src/renderable/codecs/reference.ts

@darko-mijic
Copy link
Copy Markdown
Contributor Author

@coderabbitai Thank you for the thorough review. Here's our response to each comment group:

Addressed (10 comments)

The following comments identified valid issues and have been fixed:

Comment File Fix
003 generated-doc-quality.feature Reconciled threshold: 5+ KB → 4+ KB to match Rule invariant
008 session-guides-module-source.feature Fixed deliverable location: session-workflows.md → fsm-handoff.md
013 VALIDATION.md Fixed severity count: (8 error, 4 warning) → (9 error, 3 warning)
014 VALIDATION.md Added text language label to unlabeled code block
021 business-rules.ts Fixed regex alternation: ^| anchor disconnected from \n\s* prefix
034 claude-section-values.ts Added missing @libar-docs opt-in marker
035 convention-extractor.feature Fixed Then → And for consecutive assertions
040 convention-extractor.steps.ts Removed duplicate And step definition
046 INDEX.md Fixed CHANGELOG.md line count: 1-26 → 1-31
053 architecture-doc-refactoring.feature Removed duplicate "Data Flow Diagrams" scenario

Acknowledged — Deferred (13 comments)

These identify pre-existing documentation/implementation gaps not introduced by this PR. Tracked for future work:

  • 005, 022, 023, 025, 027, 028, 029, 031, 033: Codec header JSDoc documents options or output structures that differ from actual implementation. These are aspirational docs from initial codec design — aligning them is a separate cleanup task.
  • 049, 050, 054: Process API reference tests verify generator output and CLI schema sync, not parser execution. Enhanced integration tests that exercise parseArgs() and showHelp() directly are a separate scope.
  • 042: Section Disposition line spans are internally consistent and non-overlapping. Verifying against the original pre-refactoring document requires that document as input.

Not Applicable (31 comments)

Tags are optional (comments 001, 004, 006, 007, 041, 043, 044, 045, 047, 051)

@libar-docs-team and @libar-docs-quarter are optional per the tag registry (src/taxonomy/registry-builder.ts — neither has required: true). Only 1 of 61 spec files in this project uses them. No validator enforces their presence. These are planning metadata tags used by the consumer monorepo, not required for this package's specs.

JSDoc colon format is intentional (comments 015, 019, 024, 030, 032)

@libar-docs-product-area:Generation uses colon syntax consistently across all codec JSDoc annotations. The space-separated format in the registry example applies to Gherkin feature file tags. JSDoc tags and Gherkin tags are parsed by different extractors. Changing JSDoc annotations without verifying TypeScript scanner compatibility would risk silent breakage.

Verified-by sections are aspirational (comments 036, 037, 038, 039, 048, 052)

**Verified by:** in Rule blocks is a documentation guideline but is not machine-enforced — no validator, extractor, or DoD check requires it. Many existing specs across the project omit it. Adding it uniformly is a documentation quality initiative, not a PR blocker.

Factually incorrect assessments (10 comments)

  • 002: The file does have Rule blocks and scenarios covering all deliverables (lines 42–106 contain 2 Rules with 4 scenarios).
  • 009: # banner lines at lines 76–78 are valid Gherkin comments between blocks (after Background, before Rule), not inside descriptions. The #-in-description parser trap only applies inside Feature/Rule description text.
  • 010: "Planning + Design" is an intentional fourth session type, explicitly documented in CLAUDE.md's "Session type determines artifacts and FSM changes" section.
  • 011: The quick reference table in GHERKIN-PATTERNS.md is accurately scoped for its purpose.
  • 012: The relative path ../docs-live/reference/PROCESS-API-REFERENCE.md is correct — this is a cross-directory reference from docs/ to docs-live/.
  • 016: The config note correctly states .ts only — delivery-process.config.ts is the sole supported config format.
  • 017: All four option groups (global, modifiers, filters, sessions) are intentionally included in help output.
  • 018: The async Gherkin extractor does assign claudeModule, claudeSection, and claudeTags at lines 268–270. Both sync and async paths have full parity.
  • 020: ADR output file naming in header docs is correct.
  • 026: The preamble field exists in the TypeScript interface and is used in the implementation (reference.ts line 796).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 6, 2026

@darko-mijic: Thank you for the detailed and well-structured response — this is exactly the kind of context that helps calibrate future reviews. Here's my summary:

Addressed (10 fixes): All confirmed and noted. The fixes for comment 021 (regex anchor), 035 (Then → And), 040 (duplicate step), and 053 (duplicate scenario) in particular were the most impactful corrections.

Deferred (13 items): Understood. Aspirational codec header docs vs. actual implementation is a valid separation of concerns, and the enhanced parser integration tests (049, 050, 054) are appropriately scoped to a future task.

Not Applicable (31 items): The explanations are clear and I'll record the key clarifications as learnings:

  • JSDoc colon format: The @libar-docs-product-area:Generation colon syntax is correct for TypeScript scanner extraction — different from the space-separated Gherkin tag format. These are parsed by separate extractors.
  • Optional tags: @libar-docs-team and @libar-docs-quarter have no required: true in the registry and are consumer-monorepo planning metadata, not enforced in this package.
  • Verified-by sections: Aspirational documentation guideline, not machine-enforced or a PR blocker.
  • Factual corrections: Accepted across all 10 points — particularly the async extractor parity (018), preamble field existence (026), and # banner comments being valid between blocks not inside descriptions (009).

(ノ◕ヮ◕)ノ*:・゚✧


✏️ Learnings added
Learnt from: darko-mijic
URL: https://github.com/libar-dev/delivery-process/pull/32

Timestamp: 2026-03-06T02:26:14.460Z
Learning: In the delivery-process repository, `libar-docs-product-area:Generation` uses colon syntax (no space) in TypeScript JSDoc codec annotations. This is intentional and differs from the space-separated format used in Gherkin feature file tags. JSDoc tags and Gherkin tags are parsed by separate extractors (TypeScript scanner vs. Gherkin extractor). Do not flag colon-syntax JSDoc product-area annotations as errors.

Learnt from: darko-mijic
URL: https://github.com/libar-dev/delivery-process/pull/32

Timestamp: 2026-03-06T02:26:14.460Z
Learning: In the delivery-process repository, `libar-docs-team` and `libar-docs-quarter` are optional planning metadata tags per the tag registry (src/taxonomy/registry-builder.ts — neither has `required: true`). They are used by the consumer monorepo, not enforced in this package. Only 1 of 61 spec files uses them. Do not flag their absence as a missing required field.

Learnt from: darko-mijic
URL: https://github.com/libar-dev/delivery-process/pull/32

Timestamp: 2026-03-06T02:26:14.460Z
Learning: In the delivery-process repository, `**Verified by:**` sections in Gherkin Rule blocks are an aspirational documentation guideline. They are not machine-enforced by any validator, extractor, or DoD check. Many existing specs omit them. Do not treat their absence as a PR blocker.

Learnt from: darko-mijic
URL: https://github.com/libar-dev/delivery-process/pull/32

Timestamp: 2026-03-06T02:26:14.460Z
Learning: In the delivery-process repository, `#` banner comment lines in Gherkin feature files are valid between top-level blocks (e.g., after Background, before Rule). The concern about `#` characters in description text only applies when they appear inside Feature/Rule description body text (which confuses some parsers). Comments between blocks are valid Gherkin syntax.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Actions performed

Comments resolved. Auto-approval is disabled; enable reviews.request_changes_workflow to approve automatically.

- Reconcile conflicting size thresholds (5+ KB → 4+ KB) in generated-doc-quality spec
- Fix deliverable location column (session-workflows.md → fsm-handoff.md)
- Correct severity count (8 error, 4 warning → 9 error, 3 warning) in VALIDATION.md
- Add language label to unlabeled code block in VALIDATION.md
- Fix CHANGELOG.md line count (1-26 → 1-31) in INDEX.md
- Fix regex alternation in NEXT_HEADER_PATTERN (disconnected ^ anchor)
- Add @libar-docs opt-in marker to claude-section-values.ts
- Remove duplicate "Data Flow Diagrams" scenario and step definition
Copy link
Copy Markdown

@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: 1

♻️ Duplicate comments (5)
delivery-process/specs/generated-doc-quality.feature (1)

34-40: ⚠️ Potential issue | 🟠 Major

Add the missing Rule for the TOC deliverable.

The Background marks four deliverables complete, but this file only defines three Rule blocks. The TOC behavior already exists in tests/features/behavior/codecs/generated-doc-quality.feature, Lines 51-63, so the executable spec and this planning spec have drifted. Add a matching Rule/Scenario here or stop listing that item as complete in the deliverables table.

As per coding guidelines, delivery-process/**/*.feature: Ensure scenarios define clear acceptance criteria.

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

In `@delivery-process/specs/generated-doc-quality.feature` around lines 34 - 40,
The Background table lists the "Add generated TOC block to product area doc
headers" deliverable as complete but there is no matching Rule/Scenario in this
file; either add a Rule/Scenario that mirrors the executable spec in
tests/features/behavior/codecs/generated-doc-quality.feature (see the TOC
scenario at lines ~51-63) or remove that deliverable row from the table; when
adding the Rule, place it alongside the other Rules in this feature, give it the
same title "Add generated TOC block to product area doc headers", include the
same acceptance steps and expectations from the referenced executable spec so
the planning spec stays in sync and meets the delivery-process/**/*.feature
guideline for clear acceptance criteria.
docs/VALIDATION.md (2)

219-224: ⚠️ Potential issue | 🟡 Minor

Add a language to the scan-scope fence.

This block is still unlabeled, so markdownlint MD040 will keep firing. text is enough here.

Suggested edit
-```
+```text
 Feature files:  tests/features/**/*.feature
                 delivery-process/specs/**/*.feature
                 delivery-process/decisions/**/*.feature
 Step files:     tests/steps/**/*.steps.ts
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/VALIDATION.md around lines 219 - 224, The unlabeled fenced code block
containing the scan-scope list should be marked with a language to satisfy
markdownlint MD040; edit the block in VALIDATION.md that starts with the triple
backticks before "Feature files:" (the scan-scope fence) and change it to a
labeled fence (e.g., add "text" after the opening ```), leaving the block
contents unchanged.


</details>

---

`94-168`: _⚠️ Potential issue_ | _🟡 Minor_

**`lint-steps` is still documenting the wrong rule set.**

`src/lint/steps/types.ts:32-117` currently defines 13 `STEP_LINT_RULES` (9 `error`, 4 `warning`), including the `pair-resolver` warning, but this section only documents 12. Please sync the totals and rule tables with the actual registry so the docs match the implementation.

 
As per coding guidelines "`docs/**/*.md`: Ensure documentation is clear, accurate, and up-to-date."

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against the current code and only fix it if needed.

In `@docs/VALIDATION.md` around lines 94 - 168, The docs' Feature/Step/Cross-File
rules summary is out of sync with the implementation: STEP_LINT_RULES in
src/lint/steps/types.ts currently registers 13 rules (9 error, 4 warning)
including the pair-resolver warning while VALIDATION.md lists 12 rules (9 error,
3 warning); update VALIDATION.md to reflect the actual registry (adjust the
totals line and the rule tables to include the missing rule entry and correct
severities/counts) or alternatively update STEP_LINT_RULES to match the
documented 12-rule set—locate the STEP_LINT_RULES constant and the
"pair-resolver" rule identifier to decide which side to change and make the
totals and tables consistent.
```

</details>

</blockquote></details>
<details>
<summary>delivery-process/specs/session-guides-module-source.feature (1)</summary><blockquote>

`135-149`: _⚠️ Potential issue_ | _🟠 Major_

**Don't model `Planning + Design` as a fourth session type.**

This turns a valid sequence of sessions into a new canonical type. Because this spec feeds generated workflow docs, the table should keep the session taxonomy to the actual per-session contracts and describe combined flows as sequencing, not as a separate row.

<details>
<summary>Suggested edit</summary>

```diff
-    **Invariant:** Four session types exist, each with defined input, output, and
+    **Invariant:** Three session types exist, each with defined input, output, and
     FSM impact. Mixing outputs across session types (e.g., writing code in a planning
     session) violates session discipline.
@@
-    | Planning + Design | Pattern brief | Spec + stubs | Creates roadmap |
+    A combined planning→design workflow is a sequence of the Planning and Design
+    sessions above, not a separate session type.
```
</details>

 
Based on learnings Session planning must follow Decision Tree: planning → optional design → implementation, with output and FSM changes per session type.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against the current code and only fix it if needed.

In `@delivery-process/specs/session-guides-module-source.feature` around lines 135
- 149, The table introduces an invalid fourth canonical session type "Planning +
Design" which conflates sequencing with a distinct contract; remove the
"Planning + Design" row from the table and instead document the allowed sequence
(planning → optional design → implementation) as a sequencing note in the
surrounding text (e.g., under the Invariant or Rationale); ensure the table only
lists the three atomic session types "Planning", "Design", and "Implementation"
with their Input, Output, and FSM Change, and add a short sentence describing
that combined flows are modeled as ordered sessions rather than a new session
type.
```

</details>

</blockquote></details>
<details>
<summary>docs/INDEX.md (1)</summary><blockquote>

`25-30`: _⚠️ Potential issue_ | _🟡 Minor_

**Quick nav and detailed TOC still disagree on line ranges.**

These entries now say `ARCHITECTURE.md` is `1-358` and `PROCESS-API.md` is `1-464`, but the detailed sections below still use the old `1-1638` and `1-507` spans. Please update the detailed TOC too so the index stays internally consistent.

 
As per coding guidelines "`docs/**/*.md`: Ensure documentation is clear, accurate, and up-to-date."

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against the current code and only fix it if needed.

In `@docs/INDEX.md` around lines 25 - 30, The quick nav TOC lists updated line
ranges for ARCHITECTURE.md (1-358) and PROCESS-API.md (1-464) but the detailed
TOC still shows the old spans (e.g., ARCHITECTURE.md 1-1638 and PROCESS-API.md
1-507); update the detailed TOC entries to match the quick nav ranges (adjust
the spans for ARCHITECTURE.md and PROCESS-API.md to 1-358 and 1-464
respectively) so the INDEX.md line-range references are internally consistent
with the quick nav; verify other file entries (SESSION-GUIDES.md,
GHERKIN-PATTERNS.md, PROCESS-GUARD.md, VALIDATION.md) match between quick nav
and detailed TOC and correct any discrepancies.
```

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Inline comments:
In @delivery-process/specs/generated-doc-quality.feature:

  • Around line 77-99: The feature currently asserts an invariant for "Each
    product area compact" and "All area compacts" but only provides a scenario
    exercising the Generation compact; update the spec so it matches the intent:
    either (A) narrow the invariant/“Verified by:” text to only reference Generation
    (replace "Each product area compact" / "All area compacts" with "Generation
    compact") and keep the existing Scenario: "Generation compact contains codec
    inventory and pipeline summary", or (B) add parallel acceptance scenarios for
    each other product area (create scenarios mirroring "Scenario: Generation
    compact contains codec inventory and pipeline summary" for each area compact) so
    the Invariant/Verified by statements remain accurate; make the change in the
    same feature around the "Invariant", "Verified by" text and the existing
    "Scenario: Generation compact contains codec inventory and pipeline summary".

Duplicate comments:
In @delivery-process/specs/generated-doc-quality.feature:

  • Around line 34-40: The Background table lists the "Add generated TOC block to
    product area doc headers" deliverable as complete but there is no matching
    Rule/Scenario in this file; either add a Rule/Scenario that mirrors the
    executable spec in tests/features/behavior/codecs/generated-doc-quality.feature
    (see the TOC scenario at lines ~51-63) or remove that deliverable row from the
    table; when adding the Rule, place it alongside the other Rules in this feature,
    give it the same title "Add generated TOC block to product area doc headers",
    include the same acceptance steps and expectations from the referenced
    executable spec so the planning spec stays in sync and meets the
    delivery-process/**/*.feature guideline for clear acceptance criteria.

In @delivery-process/specs/session-guides-module-source.feature:

  • Around line 135-149: The table introduces an invalid fourth canonical session
    type "Planning + Design" which conflates sequencing with a distinct contract;
    remove the "Planning + Design" row from the table and instead document the
    allowed sequence (planning → optional design → implementation) as a sequencing
    note in the surrounding text (e.g., under the Invariant or Rationale); ensure
    the table only lists the three atomic session types "Planning", "Design", and
    "Implementation" with their Input, Output, and FSM Change, and add a short
    sentence describing that combined flows are modeled as ordered sessions rather
    than a new session type.

In @docs/INDEX.md:

  • Around line 25-30: The quick nav TOC lists updated line ranges for
    ARCHITECTURE.md (1-358) and PROCESS-API.md (1-464) but the detailed TOC still
    shows the old spans (e.g., ARCHITECTURE.md 1-1638 and PROCESS-API.md 1-507);
    update the detailed TOC entries to match the quick nav ranges (adjust the spans
    for ARCHITECTURE.md and PROCESS-API.md to 1-358 and 1-464 respectively) so the
    INDEX.md line-range references are internally consistent with the quick nav;
    verify other file entries (SESSION-GUIDES.md, GHERKIN-PATTERNS.md,
    PROCESS-GUARD.md, VALIDATION.md) match between quick nav and detailed TOC and
    correct any discrepancies.

In @docs/VALIDATION.md:

  • Around line 219-224: The unlabeled fenced code block containing the scan-scope
    list should be marked with a language to satisfy markdownlint MD040; edit the
    block in VALIDATION.md that starts with the triple backticks before "Feature
    files:" (the scan-scope fence) and change it to a labeled fence (e.g., add
    "text" after the opening ```), leaving the block contents unchanged.
  • Around line 94-168: The docs' Feature/Step/Cross-File rules summary is out of
    sync with the implementation: STEP_LINT_RULES in src/lint/steps/types.ts
    currently registers 13 rules (9 error, 4 warning) including the pair-resolver
    warning while VALIDATION.md lists 12 rules (9 error, 3 warning); update
    VALIDATION.md to reflect the actual registry (adjust the totals line and the
    rule tables to include the missing rule entry and correct severities/counts) or
    alternatively update STEP_LINT_RULES to match the documented 12-rule set—locate
    the STEP_LINT_RULES constant and the "pair-resolver" rule identifier to decide
    which side to change and make the totals and tables consistent.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Path: .coderabbit.yaml

**Review profile**: ASSERTIVE

**Plan**: Pro

**Run ID**: `acfefe04-6b90-49c2-86a4-2a8b376e677a`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 8a96d44f15ceeb2d384684c97d2e288e6392503f and fde769829be13bdc6eb55e34c37966ceba11b5d4.

</details>

<details>
<summary>📒 Files selected for processing (8)</summary>

* `delivery-process/specs/generated-doc-quality.feature`
* `delivery-process/specs/session-guides-module-source.feature`
* `docs/INDEX.md`
* `docs/VALIDATION.md`
* `src/renderable/codecs/business-rules.ts`
* `src/taxonomy/claude-section-values.ts`
* `tests/features/doc-generation/architecture-doc-refactoring.feature`
* `tests/steps/doc-generation/architecture-doc-refactoring.steps.ts`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

CI was failing because format:check runs in CI but the pre-push hook
only ran tests. Unformatted files outside the staged set would pass
lint-staged (pre-commit) but fail CI's full-project format:check.
The hook was missing the executable bit, so git silently skipped it.
This meant lint-staged (eslint --fix + prettier --write) never ran on
staged files, letting formatting issues reach CI.
…andates

Replace static reference tables with Process Data API query pointers
and add a mandatory Context Gathering Protocol section.

Key changes:
- NEW: Context Gathering Protocol section (hard API-first mandate)
- FIX: ClaudeModuleCodec skips Feature descriptions, only emits Rule blocks
- MOVE: Guides section to api-reference additive layer
- ADD: Decision specs (ADR/PDR) reference table in Architecture section
- TRIM: 11 module files replacing tables with API query commands

Static tables replaced by API queries:
- Protection levels -> `query getProtectionInfo <status>`
- Validation rules -> `rules --pattern ProcessGuard`
- Module structure -> `arch context` / `arch layer`
- Tag conventions -> `tags`
- FSM transitions -> `query getValidTransitionsFrom <status>`

CLAUDE.md reduction: 1,085 -> 670 lines (38%), ~13,100 -> ~8,700 tokens
Restore docs/ARCHITECTURE.md, docs/PROCESS-API.md, and docs/INDEX.md from
main — manual reference docs are preserved in full, not replaced by
redirect pointers to generated content.

Move business-rules, taxonomy, and validation-rules generators from
gitignored docs-generated/ to committed docs-live/ via outputDirectory
overrides. Add docs:validation to docs:all chain. Create docs-live/INDEX.md
as navigation hub for all 47 generated files.

Update DocsLiveConsolidation spec invariant: docs-generated/ is now empty
after docs:all (business-rules and taxonomy are no longer classified as
intermediate artifacts). Add cross-references from manual docs to their
generated counterparts. Update architecture-doc-refactoring tests to
reflect coexistence of full manual docs with generated equivalents.

124 test files, 7,999 tests passing.
…ed tables

The Generation intro was ~1,600 chars crammed into a single paragraph.
Trimmed to 3 sentences and moved pipeline stages + codec inventory into
structured tables via new optional `introSections` field on ProductAreaMeta.
Tables render only at 'detailed' level — compact _claude-md/ output gets
just the concise intro. Regenerated all docs.
…0+ lines of manual docs replaced

Implements five work packages from the docs consolidation strategy:

WP-3+4: Promote architecture and changelog generators from preview to docs:all
WP-5 (ErrorGuideCodec): Extend ValidationRulesCodec with convention-tagged
  error rationale from decider.ts, generating PROCESS-GUARD-REFERENCE.md
WP-7 (ProceduralGuideCodec): Two ReferenceDocConfig entries producing
  SESSION-WORKFLOW-GUIDE.md and ANNOTATION-REFERENCE.md from preamble +
  SessionGuidesModuleSource Rule: block extraction
WP-6 (CliRecipeCodec): Standalone generator producing PROCESS-API-RECIPES.md
  from structured CLI_SCHEMA recipe/narrative fields, replacing 446 lines
  of manual PROCESS-API.md prose

Cross-cutting: loadPreambleFromMarkdown() utility (DD-7/DD-8) parses markdown
files into SectionBlock[] at config import time, reducing delivery-process.config.ts
from 853 to 302 lines. Three markdown source files in docs-sources/.

Planning/design specs created for all WPs plus EnhancedIndexGeneration (WP-2).
18 design stubs across 4 directories document architectural decisions.

Key metrics:
- 4 new generated reference files + 4 compact claude-md variants
- PROCESS-API.md: 509 → 63 lines (pointers to 2 generated files)
- delivery-process.config.ts: 853 → 302 lines (loadPreambleFromMarkdown)
- 11 generators producing 56+ files via docs:all
- 8,055 tests passing, 38 phases DoD-clean
…ming

WP-2 — EnhancedIndexGeneration:
- New IndexCodec (src/renderable/codecs/index-codec.ts) composing
  MasterDataset statistics with editorial preamble navigation
- Editorial preamble in docs-sources/index-navigation.md loaded via
  loadPreambleFromMarkdown() (DD-7/DD-8 from WP-7)
- 18 document entries across 6 topics in delivery-process.config.ts
- Registered in CodecRegistry, DOCUMENT_TYPES, and docs:all chain
- docs-live/INDEX.md now generated (112→232 lines) with live stats

Phase 1 — Taxonomy consolidation:
- docs/TAXONOMY.md reduced from 107→31 lines, points to generated output

Phase 5 — Guide trimming:
- docs/CONFIGURATION.md trimmed ~60 lines of duplicated preset tables

Spec stays at roadmap — FSM transitions follow in separate commits.
Master spec: 14/15 deliverables complete (Phase 38 quality polish remaining)
All 6 deliverables at terminal status (5 complete, 1 superseded).
… parity

Reverts premature replacement of manual docs with pointer files.
docs/ files are preserved as reference until generated docs-live/
equivalents reach desired quality for archival.

Restored:
- docs/INDEX.md (353 lines — full manual navigation content)
- docs/TAXONOMY.md (107 lines — full manual taxonomy reference)
- docs/CONFIGURATION.md (357 lines — full preset detail tables)

Reverted Phase 1, Phase 5, Phase 6 to pending in master spec.
Master spec: 11/15 deliverables complete.
Source code fixes:
- Remove dead allocation in flushCodeFence (load-preamble.ts)
- Simplify DEFAULT_INDEX_OPTIONS type to Required<IndexCodecOptions>
- Extract resolveCodec helper to deduplicate generate.ts

Test fixes:
- Add **Invariant:**/**Rationale:**/**Verified by:** to all 7 Rule
  blocks in architecture-doc-refactoring.feature
- Add @acceptance-criteria tags to one scenario per Rule block

Regenerated all docs-live/ from annotated sources.
…al docs/

Remove all docs/ references from the two data sources feeding IndexCodec:
- docs-sources/index-navigation.md: rewrite preamble with docs-live/-relative links
- delivery-process.config.ts: replace INDEX_DOCUMENT_ENTRIES with 21 docs-live/ entries

Also fixes path prefix bug where links like docs-live/PRODUCT-AREAS.md would
resolve to docs-live/docs-live/PRODUCT-AREAS.md since INDEX.md lives inside
docs-live/. All paths now relative to the file's location.

Regenerated all docs via pnpm docs:all.
@darko-mijic darko-mijic changed the title refactor: consolidate documentation — 9 phases, 4K line reduction feat: consolidate documentation — 9 phases, 5 new codecs, 900+ manual lines replaced Mar 6, 2026
@darko-mijic darko-mijic changed the title feat: consolidate documentation — 9 phases, 5 new codecs, 900+ manual lines replaced feat: consolidate documentation — 5 new codecs, 900+ manual lines replaced by auto-generation Mar 6, 2026
Copy link
Copy Markdown

@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: 25

🤖 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/cli-recipe-codec.feature`:
- Around line 116-126: The invariant describes RecipeExample.commands as an
array of strings but the spec and stubs use per-step metadata via RecipeStep,
creating an inconsistency; update the invariant so CLI_SCHEMA's recipes field
defines RecipeGroup[] where each RecipeExample.commands is RecipeStep[] (not
string[]), and ensure the text mentions RecipeStep fields (e.g., command string,
optional comment, optional expectedOutput) while clarifying that this extension
is additive and does not change existing CLIOptionGroup types; adjust any
references to RecipeExample.commands accordingly to align the contract with the
RecipeStep model.

In `@delivery-process/specs/docs-consolidation-strategy.feature`:
- Around line 86-91: Update the feature scenarios so they expect generated
public reference output under docs-live/ instead of docs/; specifically change
the scenario "Convention tag produces a generated reference document" (and the
other similar scenarios referencing generated reference docs) to assert a
detailed docs-live/ file and a compact _claude-md/ file are produced, while
leaving the rest of the checks (that both contain the convention content
extracted from source JSDoc and that a ReferenceDocConfig entry matches the
convention tag) unchanged.
- Around line 139-159: The retention rule conflicts with the scope table: the
invariant names SESSION-GUIDES.md, GHERKIN-PATTERNS.md, PROCESS-API.md, and
PUBLISHING.md as fully manual while Phases 39–43 mark them as
trimmed/hybrid/relocated; update the spec so the invariant and the acceptance
Scenario align with the scope table. Either remove those filenames from the
"fully manual" list (leaving only true-manual docs like METHODOLOGY.md) or amend
the scope table/Phases 39–43 entries to mark them as retained; ensure the
Scenario "Retained documents have no generated equivalent" and the check for
ReferenceDocConfig reflect whichever choice.
- Around line 18-30: The document inconsistently references the number and
numbering of phases (mentions "6-phase consolidation" and "10 phases", and the
scope table lists "phases 1-6 plus 37-43"); pick the intended phase count
(either 6 or 10) and make all references consistent: update the summary header
phrase ("6-phase consolidation"), the later sentence that says "10 phases", and
the scope table entries (remove or renumber "37-43" and ensure it lists the
correct phase range such as "phases 1–6" or "phases 1–10"), and scan the nearby
section (the content around the current lines 33–47) to fix any remaining
mismatched mentions so the roadmap reads with a single, consistent phase count
and numbering.

In `@delivery-process/specs/docs-live-consolidation.feature`:
- Around line 91-95: Scenario title "docs-generated/ is empty after standard
generation" overstates the verification because the step "Then docs-generated/
contains no .md files" only checks for .md files; update either the title or the
assertion: either rename the scenario to "docs-generated/ contains no .md files
after standard generation" or replace the step with an explicit check that the
directory is absent or empty (e.g., assert "docs-generated/ does not exist" or
"docs-generated/ is empty") so the scenario's title and step(s) match the
intended post-consolidation state.
- Around line 59-64: The assertion at the end of the "Reference docs are
generated into docs-live/reference/" scenario is guarding the wrong legacy path;
change the negative check that currently verifies "docs-generated/docs/ does not
exist" to instead assert that "docs-generated/reference/ does not exist" so the
scenario fails if stale reference output is still emitted to the legacy
reference directory.
- Around line 66-72: The spec rule in docs-live-consolidation.feature conflicts
with the implementation: delivery-process.config.ts still routes the
claude-modules generator to the repo-root _claude-md, while the rule insists all
compact files live under docs-live/_claude-md/. Either narrow the feature rule
to only apply to architecture reference summaries (architecture-codecs,
architecture-types) or update delivery-process.config.ts to route the
claude-modules generator into docs-live/_claude-md/ (and adjust any references
to “_claude-md/” in the PR summary/spec accordingly); locate the rule text in
docs-live-consolidation.feature and the claude-modules generator config in
delivery-process.config.ts to apply the chosen change.

In `@delivery-process/specs/enhanced-index-generation.feature`:
- Around line 39-42: The acceptance criteria are contradictory: the Scope table
lists sources as “File system scan plus MasterDataset” while DD-2 and the
`documentEntries` behavior describe a static, no-I/O codec; pick a single source
model and make both places consistent. Decide whether the inventory is generated
from a FileSystem scan + MasterDataset or from static `documentEntries` (no
I/O), then update the Scope table entry and the DD-2 wording (and any scenario
text referencing `documentEntries`) to match that choice; also apply the same
change to the other affected scenario lines (the related entries around lines
61-62) so all scenarios and acceptance criteria are aligned.

In `@delivery-process/specs/procedural-guide-codec.feature`:
- Around line 214-220: The scenario asserts the wrong generated filename: the
ProceduralGuideCodec with ReferenceDocConfig produces
docs-live/reference/ANNOTATION-REFERENCE.md, not ANNOTATION-GUIDE.md; update the
feature scenario (the "Two separate guide files are generated" scenario) to
expect docs-live/reference/ANNOTATION-REFERENCE.md (keep the
SESSION-WORKFLOW-GUIDE.md expectation) so the test matches the configured
annotation output filename generated by ProceduralGuideCodec/ReferenceDocConfig.
- Around line 38-43: The feature text mixes two incompatible pipelines for
checklists and decision trees (SessionGuidesModuleSource vs docs-sources/*.md
loaded via loadPreambleFromMarkdown()), so pick one pipeline and update the spec
to reference only that source and its acceptance rules; e.g., if you choose
SessionGuidesModuleSource, change Solution/Scope and Rule 1/4 to state
checklists and decision trees are extracted from SessionGuidesModuleSource and
preserve the SESSION-GUIDES.md invariant, or if you choose docs-sources/*.md,
update Rule 2 and any references to extraction to use loadPreambleFromMarkdown()
and its acceptance criteria, and ensure all other affected blocks (lines noted:
54-67, 112-123, 152-190, 233-239) are made consistent with the single chosen
pipeline.

In `@delivery-process/stubs/cli-recipe-codec/cli-recipe-generator.ts`:
- Around line 297-313: The comment incorrectly points readers to
delivery-process.config.ts as the registration site; update the preamble to
state that although generatorOverrides in delivery-process.config.ts can
override outputDirectory, the actual registration for the "cli-recipe" generator
is done programmatically following the createProcessApiReferenceGenerator()
pattern in the built-in codec-generators registration module (i.e., where
built-in codec generators are registered), so change the example and wording to
reference that programmatic registration hook and remove the misleading
generatorOverrides-only claim.
- Around line 103-177: The functions buildRecipeSections and
buildNarrativeSections (and the generator exports
generate/createCliRecipeGenerator) are currently untyped (unknown) and must be
updated to the actual generator interfaces; change their signatures to use
SectionBlock[] for section arrays, implement generate(_patterns: readonly
unknown[], _context: GeneratorContext): Promise<GeneratorOutput>, and ensure
createCliRecipeGenerator(preamble: readonly SectionBlock[]): DocumentGenerator
returns an instance of CliRecipeGeneratorImpl which implements
DocumentGenerator; import and use the canonical types SectionBlock,
GeneratorOutput, DocumentGenerator, and GeneratorContext from the project's
types so the stub matches the real implementation at
src/generators/built-in/cli-recipe-generator.ts.

In `@delivery-process/stubs/cli-recipe-codec/recipe-data.ts`:
- Around line 109-113: COMMON_RECIPES, SESSION_WORKFLOW_NARRATIVES, and
EXAMPLE_PREAMBLE currently export concrete example payloads; remove those real
data objects from the module and replace each exported symbol with a stub that
throws new Error('PatternName not yet implemented - roadmap pattern') (e.g.,
export const COMMON_RECIPES = () => { throw new Error('COMMON_RECIPES not yet
implemented - roadmap pattern') }, or export const COMMON_RECIPES = (() => {
throw new Error('COMMON_RECIPES not yet implemented - roadmap pattern') })() )
so downstream code cannot import real examples; move the concrete examples
(startingASessionRecipe, findingWorkRecipe, narrative arrays, preamble text)
into JSDoc or a separate Markdown example section in the file rather than the
export surface and apply the same throw-only pattern to
SESSION_WORKFLOW_NARRATIVES and EXAMPLE_PREAMBLE.

In `@delivery-process/stubs/cli-recipe-codec/recipe-schema.ts`:
- Around line 211-244: Remove the duplicate, weakened CLISchemaExtended
interface and instead alias the canonical CLISchema: import the original
CLISchema (from src/cli/cli-schema.ts) and replace the interface declaration
`export interface CLISchemaExtended { ... }` with `export type CLISchemaExtended
= CLISchema;`, ensuring you no longer re-declare `globalOptions`,
`outputModifiers`, `listFilters`, `sessionOptions`, `recipes`, or
`commandNarratives` here so the concrete types from the source-of-truth are
preserved.

In `@delivery-process/stubs/enhanced-index-generation/index-codec-options.ts`:
- Around line 108-113: Update the JSDoc for documentEntries to remove any claim
that the codec merges entries with auto-discovered/generated documents from
MasterDataset; instead state that documentEntries is a static, explicit contract
(no filesystem or MasterDataset discovery), and clarify that MasterDataset
exposes pattern views rather than a document inventory so it is not used as a
source of documentEntries. Ensure the comment references the symbol
documentEntries and MasterDataset so readers know the intended static-only
contract and correct source-of-truth.

In `@delivery-process/stubs/enhanced-index-generation/index-codec.ts`:
- Line 101: The module currently invokes createIndexCodec during top-level
initialization by exporting IndexCodec = createIndexCodec(), which throws on
import; stop calling the throwing stub at module load by removing the immediate
invocation and instead export the factory or a thunk (e.g., export
createIndexCodec and/or export getIndexCodec/getIndexCodecInstance that calls
createIndexCodec at call time) so callers can opt-in to construction; update any
references to IndexCodec to call the factory/getter rather than rely on a
preconstructed instance.
- Around line 86-88: The createIndexCodec stub currently returns unknown and is
eagerly instantiated by export const IndexCodec = createIndexCodec(), which
causes import-time failure; change the signature of createIndexCodec to return
z.ZodCodec<MasterDatasetSchema, RenderableDocumentOutputSchema> (matching the
real contract and supporting .decode calls in generate.ts) and replace the eager
export with either no eager instantiation (remove export const IndexCodec) or
export a safe non-throwing placeholder codec from createIndexCodec that
implements decode (a minimal pass-through or runtime-safe stub) so the module
can be imported without throwing; update references to IndexCodec to call
createIndexCodec() lazily if needed.

In `@delivery-process/stubs/enhanced-index-generation/index-preamble-config.ts`:
- Line 211: Update the stale filename entry in the index preamble array: replace
occurrences of 'PUBLISHING.md' with the new 'MAINTAINERS.md' in the list items
(e.g., the array entry currently showing ['PUBLISHING.md', 'Maintainers',
'Release -- npm publishing']), and also scan and update the other matching
entries referenced (around the second occurrence at lines ~393-395) so the
generated index points to MAINTAINERS.md instead of the removed PUBLISHING.md.
- Around line 104-106: The SectionBlock 'table' variant is using a non-existent
headers property; update each table block (e.g., the object with type: 'table'
as const) to provide a columns property instead of headers so it matches the
SectionBlock table schema in src/renderable/schema.ts—replace headers: [...]
with columns: [...] for the blocks around the current change and the similar
block at the other occurrence (lines referenced in the review).

In `@delivery-process/stubs/error-guide-codec/enhanced-validation-options.ts`:
- Around line 118-126: The constant ENHANCED_DEFAULT_OPTIONS is typed with
Required<EnhancedValidationRulesCodecOptions>, which promotes the inherited
optional limits (from BaseCodecOptions/CodecLimits) to required but the literal
omits limits; fix by either adding a proper limits: CodecLimits value to
ENHANCED_DEFAULT_OPTIONS or change the typing to use "satisfies
EnhancedValidationRulesCodecOptions" so limits remains optional; update the
declaration for ENHANCED_DEFAULT_OPTIONS and ensure references to
EnhancedValidationRulesCodecOptions, BaseCodecOptions and CodecLimits are used
to construct or validate the limits value if you choose to add it.
- Line 40: Update the import for BaseCodecOptions in
enhanced-validation-options.ts to point to the repo root (use
../../../src/renderable/codecs/types/base.ts or
../../../src/renderable/codecs/types/base.js) so the type resolves correctly,
and fix the ENHANCED_DEFAULT_OPTIONS constant (typed as
Required<EnhancedValidationRulesCodecOptions>) by either adding a concrete
limits property of type CodecLimits to the object literal or loosening the type
wrapper (remove Required<> or make limits optional) so the missing limits field
no longer causes a TypeScript error; reference BaseCodecOptions,
EnhancedValidationRulesCodecOptions, ENHANCED_DEFAULT_OPTIONS, limits, and
CodecLimits when making the change.

In `@delivery-process/stubs/error-guide-codec/error-guide-config.ts`:
- Around line 215-237: Remove or reword the outdated registration snippet in the
comment block: the CONVENTION_VALUES example that lists 'process-guard-errors'
is obsolete because that value already exists; update the comment in
error-guide-config.ts to reflect the current state (either delete the entire
example block or replace it with a short note stating that
'process-guard-errors' is already included in CONVENTION_VALUES) and ensure
references to CONVENTION_VALUES and 'process-guard-errors' remain accurate.
- Around line 200-206: The mermaid node name "detectChanges" is ambiguous
compared to the exported functions used elsewhere; update the diagram to match
the real API names (e.g., replace the node with detectStagedChanges and/or
detectBranchChanges) or explicitly relabel it as a generic step like "change
detection" so readers won't assume a callable API; ensure the connected nodes
(deriveProcessState, validateChanges, ValidationResult) remain unchanged and the
label you choose aligns with the preamble/table terminology.

In `@delivery-process/stubs/procedural-guide-codec/load-preamble.ts`:
- Line 111: The import for SectionBlock in the procedural-guide-codec stubs is
using the wrong relative path; update the import statement that currently reads
"import type { SectionBlock } from '../../src/renderable/schema.js';" to use the
correct relative path "../../../src/renderable/schema.js" in all three
procedural-guide-codec stub files (the load-preamble, procedural-codec-options
and procedural-codec stubs) so the SectionBlock type resolves to the actual
schema module.

In `@delivery-process/stubs/procedural-guide-codec/procedural-codec-options.ts`:
- Around line 63-73: The Annotation Guide column in the
procedural-codec-options.ts stub is out of sync with the actual
ReferenceDocConfig used in delivery-process.config.ts; update the Annotation
Guide fields to match the real config by setting title to "Annotation Reference
Guide", setting conventionTags to ['annotation-system'], removing or leaving
includeTags empty (no includeTags), and changing claudeMdSection to 'annotation'
(verify docsFilename/claudeMdFilename remain correct) so the codec routes this
document through the annotation extraction path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3da80ecf-9a0a-4858-b856-d7954a18f39b

📥 Commits

Reviewing files that changed from the base of the PR and between fc60b6b and 5069717.

⛔ Files ignored due to path filters (43)
  • delivery-process.config.ts is excluded by none and included by none
  • docs-live/ARCHITECTURE.md is excluded by none and included by none
  • docs-live/BUSINESS-RULES.md is excluded by none and included by none
  • docs-live/CHANGELOG-GENERATED.md is excluded by none and included by none
  • docs-live/INDEX.md is excluded by none and included by none
  • docs-live/PRODUCT-AREAS.md is excluded by none and included by none
  • docs-live/TAXONOMY.md is excluded by none and included by none
  • docs-live/VALIDATION-RULES.md is excluded by none and included by none
  • docs-live/_claude-md/annotation/annotation-reference.md is excluded by none and included by none
  • docs-live/_claude-md/architecture/architecture-codecs.md is excluded by none and included by none
  • docs-live/_claude-md/architecture/reference-sample.md is excluded by none and included by none
  • docs-live/_claude-md/generation/generation-overview.md is excluded by none and included by none
  • docs-live/_claude-md/process/process-overview.md is excluded by none and included by none
  • docs-live/_claude-md/validation/process-guard.md is excluded by none and included by none
  • docs-live/_claude-md/workflow/session-workflow-guide.md is excluded by none and included by none
  • docs-live/business-rules/annotation.md is excluded by none and included by none
  • docs-live/business-rules/configuration.md is excluded by none and included by none
  • docs-live/business-rules/core-types.md is excluded by none and included by none
  • docs-live/business-rules/data-api.md is excluded by none and included by none
  • docs-live/business-rules/generation.md is excluded by none and included by none
  • docs-live/business-rules/process.md is excluded by none and included by none
  • docs-live/business-rules/validation.md is excluded by none and included by none
  • docs-live/product-areas/CORE-TYPES.md is excluded by none and included by none
  • docs-live/product-areas/GENERATION.md is excluded by none and included by none
  • docs-live/product-areas/PROCESS.md is excluded by none and included by none
  • docs-live/product-areas/VALIDATION.md is excluded by none and included by none
  • docs-live/reference/ANNOTATION-REFERENCE.md is excluded by none and included by none
  • docs-live/reference/ARCHITECTURE-CODECS.md is excluded by none and included by none
  • docs-live/reference/PROCESS-API-RECIPES.md is excluded by none and included by none
  • docs-live/reference/PROCESS-GUARD-REFERENCE.md is excluded by none and included by none
  • docs-live/reference/REFERENCE-SAMPLE.md is excluded by none and included by none
  • docs-live/reference/SESSION-WORKFLOW-GUIDE.md is excluded by none and included by none
  • docs-live/taxonomy/categories.md is excluded by none and included by none
  • docs-live/taxonomy/format-types.md is excluded by none and included by none
  • docs-live/taxonomy/metadata-tags.md is excluded by none and included by none
  • docs-live/validation/error-catalog.md is excluded by none and included by none
  • docs-live/validation/fsm-transitions.md is excluded by none and included by none
  • docs-live/validation/protection-levels.md is excluded by none and included by none
  • docs-sources/annotation-guide.md is excluded by none and included by none
  • docs-sources/index-navigation.md is excluded by none and included by none
  • docs-sources/process-api-recipes.md is excluded by none and included by none
  • docs-sources/session-workflow-guide.md is excluded by none and included by none
  • package.json is excluded by none and included by none
📒 Files selected for processing (44)
  • delivery-process/specs/cli-recipe-codec.feature
  • delivery-process/specs/docs-consolidation-strategy.feature
  • delivery-process/specs/docs-live-consolidation.feature
  • delivery-process/specs/enhanced-index-generation.feature
  • delivery-process/specs/error-guide-codec.feature
  • delivery-process/specs/procedural-guide-codec.feature
  • delivery-process/specs/session-guides-module-source.feature
  • delivery-process/stubs/cli-recipe-codec/cli-recipe-generator.ts
  • delivery-process/stubs/cli-recipe-codec/recipe-data.ts
  • delivery-process/stubs/cli-recipe-codec/recipe-schema.ts
  • delivery-process/stubs/enhanced-index-generation/index-codec-options.ts
  • delivery-process/stubs/enhanced-index-generation/index-codec.ts
  • delivery-process/stubs/enhanced-index-generation/index-preamble-config.ts
  • delivery-process/stubs/error-guide-codec/convention-annotation-example.ts
  • delivery-process/stubs/error-guide-codec/enhanced-validation-options.ts
  • delivery-process/stubs/error-guide-codec/error-guide-config.ts
  • delivery-process/stubs/procedural-guide-codec/annotation-guide-preamble.ts
  • delivery-process/stubs/procedural-guide-codec/load-preamble.ts
  • delivery-process/stubs/procedural-guide-codec/procedural-codec-options.ts
  • delivery-process/stubs/procedural-guide-codec/procedural-codec.ts
  • delivery-process/stubs/procedural-guide-codec/session-guide-preamble.ts
  • docs/ANNOTATION-GUIDE.md
  • docs/DOCS-GAP-ANALYSIS.md
  • docs/PROCESS-API.md
  • docs/PROCESS-GUARD.md
  • docs/TAXONOMY.md
  • docs/VALIDATION.md
  • src/cli/cli-schema.ts
  • src/config/project-config-schema.ts
  • src/generators/built-in/cli-recipe-generator.ts
  • src/generators/built-in/codec-generators.ts
  • src/lint/process-guard/decider.ts
  • src/renderable/codecs/index-codec.ts
  • src/renderable/codecs/index.ts
  • src/renderable/codecs/reference.ts
  • src/renderable/codecs/validation-rules.ts
  • src/renderable/generate.ts
  • src/renderable/index.ts
  • src/renderable/load-preamble.ts
  • src/taxonomy/conventions.ts
  • tests/features/doc-generation/architecture-doc-refactoring.feature
  • tests/features/generation/load-preamble.feature
  • tests/steps/doc-generation/architecture-doc-refactoring.steps.ts
  • tests/steps/generation/load-preamble.steps.ts

Fixes 22 valid review comments from coderabbitai:

Specs:
- cli-recipe-codec: "command strings" → "RecipeStep entries" in invariant
- docs-consolidation-strategy: fix phase count (13 not 6/10), docs/ → docs-live/
  output path, update retention rule to reflect Phase 39-43 completions
- docs-live-consolidation: fix legacy path assertion, narrow _claude-md rule to
  architecture compacts only, fix scenario title precision
- enhanced-index-generation: scope table source matches DD-2 (static entries)
- procedural-guide-codec: ANNOTATION-GUIDE.md → ANNOTATION-REFERENCE.md

Stubs:
- cli-recipe-codec: remove unused import, clarify type comments, fix
  registration JSDoc, un-export example data, remove stale CLISchemaExtended
- enhanced-index-generation: fix auto-discovery JSDoc, remove eager throwing
  instantiation, headers → columns in table blocks, PUBLISHING → MAINTAINERS
- error-guide-codec: fix import path (../../ → ../../../), remove Required<>
  wrapper, fix mermaid diagram API names, remove obsolete convention snippet
- procedural-guide-codec: fix import paths (../../ → ../../../) in 3 files,
  update Annotation Guide config table to match delivery-process.config.ts
- What Gets Generated: expanded from 6 to 10 content types with file counts
- CLI Commands: doc links now point to docs-live/ generated equivalents
- Documentation: split into Generated (docs-live/INDEX.md) and Editorial (docs/) tiers
- All links verified against existing files
@darko-mijic darko-mijic merged commit 1bd9dc4 into main Mar 6, 2026
4 of 5 checks passed
@darko-mijic darko-mijic deleted the feature/docs-consolidation branch March 6, 2026 09:56
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