@libar-dev/architect 1.0.0-pre.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/LICENSE +25 -0
- package/LICENSE-MCP +62 -0
- package/README.md +147 -0
- package/dist/api/arch-queries.d.ts +95 -0
- package/dist/api/arch-queries.d.ts.map +1 -0
- package/dist/api/arch-queries.js +310 -0
- package/dist/api/arch-queries.js.map +1 -0
- package/dist/api/context-assembler.d.ts +124 -0
- package/dist/api/context-assembler.d.ts.map +1 -0
- package/dist/api/context-assembler.js +472 -0
- package/dist/api/context-assembler.js.map +1 -0
- package/dist/api/context-formatter.d.ts +26 -0
- package/dist/api/context-formatter.d.ts.map +1 -0
- package/dist/api/context-formatter.js +183 -0
- package/dist/api/context-formatter.js.map +1 -0
- package/dist/api/coverage-analyzer.d.ts +38 -0
- package/dist/api/coverage-analyzer.d.ts.map +1 -0
- package/dist/api/coverage-analyzer.js +117 -0
- package/dist/api/coverage-analyzer.js.map +1 -0
- package/dist/api/fuzzy-match.d.ts +75 -0
- package/dist/api/fuzzy-match.d.ts.map +1 -0
- package/dist/api/fuzzy-match.js +150 -0
- package/dist/api/fuzzy-match.js.map +1 -0
- package/dist/api/handoff-generator.d.ts +45 -0
- package/dist/api/handoff-generator.d.ts.map +1 -0
- package/dist/api/handoff-generator.js +139 -0
- package/dist/api/handoff-generator.js.map +1 -0
- package/dist/api/index.d.ts +61 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +54 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/pattern-helpers.d.ts +51 -0
- package/dist/api/pattern-helpers.d.ts.map +1 -0
- package/dist/api/pattern-helpers.js +84 -0
- package/dist/api/pattern-helpers.js.map +1 -0
- package/dist/api/process-state.d.ts +224 -0
- package/dist/api/process-state.d.ts.map +1 -0
- package/dist/api/process-state.js +308 -0
- package/dist/api/process-state.js.map +1 -0
- package/dist/api/rules-query.d.ts +60 -0
- package/dist/api/rules-query.d.ts.map +1 -0
- package/dist/api/rules-query.js +154 -0
- package/dist/api/rules-query.js.map +1 -0
- package/dist/api/scope-validator.d.ts +56 -0
- package/dist/api/scope-validator.d.ts.map +1 -0
- package/dist/api/scope-validator.js +293 -0
- package/dist/api/scope-validator.js.map +1 -0
- package/dist/api/stub-resolver.d.ts +117 -0
- package/dist/api/stub-resolver.d.ts.map +1 -0
- package/dist/api/stub-resolver.js +154 -0
- package/dist/api/stub-resolver.js.map +1 -0
- package/dist/api/summarize.d.ts +75 -0
- package/dist/api/summarize.d.ts.map +1 -0
- package/dist/api/summarize.js +97 -0
- package/dist/api/summarize.js.map +1 -0
- package/dist/api/types.d.ts +221 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +57 -0
- package/dist/api/types.js.map +1 -0
- package/dist/cache/file-cache.d.ts +72 -0
- package/dist/cache/file-cache.d.ts.map +1 -0
- package/dist/cache/file-cache.js +80 -0
- package/dist/cache/file-cache.js.map +1 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +5 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cli/cli-schema.d.ts +83 -0
- package/dist/cli/cli-schema.d.ts.map +1 -0
- package/dist/cli/cli-schema.js +505 -0
- package/dist/cli/cli-schema.js.map +1 -0
- package/dist/cli/dataset-cache.d.ts +66 -0
- package/dist/cli/dataset-cache.d.ts.map +1 -0
- package/dist/cli/dataset-cache.js +179 -0
- package/dist/cli/dataset-cache.js.map +1 -0
- package/dist/cli/error-handler.d.ts +84 -0
- package/dist/cli/error-handler.d.ts.map +1 -0
- package/dist/cli/error-handler.js +197 -0
- package/dist/cli/error-handler.js.map +1 -0
- package/dist/cli/generate-docs.d.ts +30 -0
- package/dist/cli/generate-docs.d.ts.map +1 -0
- package/dist/cli/generate-docs.js +370 -0
- package/dist/cli/generate-docs.js.map +1 -0
- package/dist/cli/lint-patterns.d.ts +57 -0
- package/dist/cli/lint-patterns.d.ts.map +1 -0
- package/dist/cli/lint-patterns.js +257 -0
- package/dist/cli/lint-patterns.js.map +1 -0
- package/dist/cli/lint-process.d.ts +54 -0
- package/dist/cli/lint-process.d.ts.map +1 -0
- package/dist/cli/lint-process.js +319 -0
- package/dist/cli/lint-process.js.map +1 -0
- package/dist/cli/lint-steps.d.ts +32 -0
- package/dist/cli/lint-steps.d.ts.map +1 -0
- package/dist/cli/lint-steps.js +172 -0
- package/dist/cli/lint-steps.js.map +1 -0
- package/dist/cli/mcp-server.d.ts +22 -0
- package/dist/cli/mcp-server.d.ts.map +1 -0
- package/dist/cli/mcp-server.js +57 -0
- package/dist/cli/mcp-server.js.map +1 -0
- package/dist/cli/output-pipeline.d.ts +130 -0
- package/dist/cli/output-pipeline.d.ts.map +1 -0
- package/dist/cli/output-pipeline.js +234 -0
- package/dist/cli/output-pipeline.js.map +1 -0
- package/dist/cli/process-api.d.ts +37 -0
- package/dist/cli/process-api.d.ts.map +1 -0
- package/dist/cli/process-api.js +1550 -0
- package/dist/cli/process-api.js.map +1 -0
- package/dist/cli/repl.d.ts +38 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +239 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/validate-patterns.d.ts +115 -0
- package/dist/cli/validate-patterns.d.ts.map +1 -0
- package/dist/cli/validate-patterns.js +707 -0
- package/dist/cli/validate-patterns.js.map +1 -0
- package/dist/cli/version.d.ts +35 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +64 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/config/config-loader.d.ts +167 -0
- package/dist/config/config-loader.d.ts.map +1 -0
- package/dist/config/config-loader.js +294 -0
- package/dist/config/config-loader.js.map +1 -0
- package/dist/config/defaults.d.ts +92 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +103 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/define-config.d.ts +37 -0
- package/dist/config/define-config.d.ts.map +1 -0
- package/dist/config/define-config.js +38 -0
- package/dist/config/define-config.js.map +1 -0
- package/dist/config/factory.d.ts +79 -0
- package/dist/config/factory.d.ts.map +1 -0
- package/dist/config/factory.js +116 -0
- package/dist/config/factory.js.map +1 -0
- package/dist/config/index.d.ts +45 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +48 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/merge-sources.d.ts +47 -0
- package/dist/config/merge-sources.d.ts.map +1 -0
- package/dist/config/merge-sources.js +61 -0
- package/dist/config/merge-sources.js.map +1 -0
- package/dist/config/presets.d.ts +115 -0
- package/dist/config/presets.d.ts.map +1 -0
- package/dist/config/presets.js +119 -0
- package/dist/config/presets.js.map +1 -0
- package/dist/config/project-config-schema.d.ts +192 -0
- package/dist/config/project-config-schema.d.ts.map +1 -0
- package/dist/config/project-config-schema.js +231 -0
- package/dist/config/project-config-schema.js.map +1 -0
- package/dist/config/project-config.d.ts +229 -0
- package/dist/config/project-config.d.ts.map +1 -0
- package/dist/config/project-config.js +37 -0
- package/dist/config/project-config.js.map +1 -0
- package/dist/config/regex-builders.d.ts +49 -0
- package/dist/config/regex-builders.d.ts.map +1 -0
- package/dist/config/regex-builders.js +85 -0
- package/dist/config/regex-builders.js.map +1 -0
- package/dist/config/resolve-config.d.ts +65 -0
- package/dist/config/resolve-config.d.ts.map +1 -0
- package/dist/config/resolve-config.js +150 -0
- package/dist/config/resolve-config.js.map +1 -0
- package/dist/config/types.d.ts +81 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +22 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/workflow-loader.d.ts +90 -0
- package/dist/config/workflow-loader.d.ts.map +1 -0
- package/dist/config/workflow-loader.js +167 -0
- package/dist/config/workflow-loader.js.map +1 -0
- package/dist/extractor/doc-extractor.d.ts +233 -0
- package/dist/extractor/doc-extractor.d.ts.map +1 -0
- package/dist/extractor/doc-extractor.js +481 -0
- package/dist/extractor/doc-extractor.js.map +1 -0
- package/dist/extractor/dual-source-extractor.d.ts +161 -0
- package/dist/extractor/dual-source-extractor.d.ts.map +1 -0
- package/dist/extractor/dual-source-extractor.js +407 -0
- package/dist/extractor/dual-source-extractor.js.map +1 -0
- package/dist/extractor/gherkin-extractor.d.ts +170 -0
- package/dist/extractor/gherkin-extractor.d.ts.map +1 -0
- package/dist/extractor/gherkin-extractor.js +543 -0
- package/dist/extractor/gherkin-extractor.js.map +1 -0
- package/dist/extractor/index.d.ts +7 -0
- package/dist/extractor/index.d.ts.map +1 -0
- package/dist/extractor/index.js +11 -0
- package/dist/extractor/index.js.map +1 -0
- package/dist/extractor/layer-inference.d.ts +66 -0
- package/dist/extractor/layer-inference.d.ts.map +1 -0
- package/dist/extractor/layer-inference.js +93 -0
- package/dist/extractor/layer-inference.js.map +1 -0
- package/dist/extractor/shape-extractor.d.ts +79 -0
- package/dist/extractor/shape-extractor.d.ts.map +1 -0
- package/dist/extractor/shape-extractor.js +966 -0
- package/dist/extractor/shape-extractor.js.map +1 -0
- package/dist/generators/built-in/cli-recipe-generator.d.ts +30 -0
- package/dist/generators/built-in/cli-recipe-generator.d.ts.map +1 -0
- package/dist/generators/built-in/cli-recipe-generator.js +155 -0
- package/dist/generators/built-in/cli-recipe-generator.js.map +1 -0
- package/dist/generators/built-in/codec-generators.d.ts +29 -0
- package/dist/generators/built-in/codec-generators.d.ts.map +1 -0
- package/dist/generators/built-in/codec-generators.js +195 -0
- package/dist/generators/built-in/codec-generators.js.map +1 -0
- package/dist/generators/built-in/decision-doc-generator.d.ts +204 -0
- package/dist/generators/built-in/decision-doc-generator.d.ts.map +1 -0
- package/dist/generators/built-in/decision-doc-generator.js +654 -0
- package/dist/generators/built-in/decision-doc-generator.js.map +1 -0
- package/dist/generators/built-in/design-review-generator.d.ts +26 -0
- package/dist/generators/built-in/design-review-generator.d.ts.map +1 -0
- package/dist/generators/built-in/design-review-generator.js +94 -0
- package/dist/generators/built-in/design-review-generator.js.map +1 -0
- package/dist/generators/built-in/index.d.ts +22 -0
- package/dist/generators/built-in/index.d.ts.map +1 -0
- package/dist/generators/built-in/index.js +23 -0
- package/dist/generators/built-in/index.js.map +1 -0
- package/dist/generators/built-in/process-api-reference-generator.d.ts +18 -0
- package/dist/generators/built-in/process-api-reference-generator.d.ts.map +1 -0
- package/dist/generators/built-in/process-api-reference-generator.js +85 -0
- package/dist/generators/built-in/process-api-reference-generator.js.map +1 -0
- package/dist/generators/built-in/reference-generators.d.ts +51 -0
- package/dist/generators/built-in/reference-generators.d.ts.map +1 -0
- package/dist/generators/built-in/reference-generators.js +320 -0
- package/dist/generators/built-in/reference-generators.js.map +1 -0
- package/dist/generators/codec-based.d.ts +63 -0
- package/dist/generators/codec-based.d.ts.map +1 -0
- package/dist/generators/codec-based.js +88 -0
- package/dist/generators/codec-based.js.map +1 -0
- package/dist/generators/content-deduplicator.d.ts +114 -0
- package/dist/generators/content-deduplicator.d.ts.map +1 -0
- package/dist/generators/content-deduplicator.js +356 -0
- package/dist/generators/content-deduplicator.js.map +1 -0
- package/dist/generators/index.d.ts +50 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +54 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/orchestrator.d.ts +265 -0
- package/dist/generators/orchestrator.d.ts.map +1 -0
- package/dist/generators/orchestrator.js +570 -0
- package/dist/generators/orchestrator.js.map +1 -0
- package/dist/generators/pipeline/build-pipeline.d.ts +131 -0
- package/dist/generators/pipeline/build-pipeline.d.ts.map +1 -0
- package/dist/generators/pipeline/build-pipeline.js +248 -0
- package/dist/generators/pipeline/build-pipeline.js.map +1 -0
- package/dist/generators/pipeline/context-inference.d.ts +55 -0
- package/dist/generators/pipeline/context-inference.d.ts.map +1 -0
- package/dist/generators/pipeline/context-inference.js +76 -0
- package/dist/generators/pipeline/context-inference.js.map +1 -0
- package/dist/generators/pipeline/index.d.ts +27 -0
- package/dist/generators/pipeline/index.d.ts.map +1 -0
- package/dist/generators/pipeline/index.js +34 -0
- package/dist/generators/pipeline/index.js.map +1 -0
- package/dist/generators/pipeline/merge-patterns.d.ts +33 -0
- package/dist/generators/pipeline/merge-patterns.d.ts.map +1 -0
- package/dist/generators/pipeline/merge-patterns.js +50 -0
- package/dist/generators/pipeline/merge-patterns.js.map +1 -0
- package/dist/generators/pipeline/relationship-resolver.d.ts +47 -0
- package/dist/generators/pipeline/relationship-resolver.d.ts.map +1 -0
- package/dist/generators/pipeline/relationship-resolver.js +132 -0
- package/dist/generators/pipeline/relationship-resolver.js.map +1 -0
- package/dist/generators/pipeline/sequence-utils.d.ts +49 -0
- package/dist/generators/pipeline/sequence-utils.d.ts.map +1 -0
- package/dist/generators/pipeline/sequence-utils.js +235 -0
- package/dist/generators/pipeline/sequence-utils.js.map +1 -0
- package/dist/generators/pipeline/transform-dataset.d.ts +82 -0
- package/dist/generators/pipeline/transform-dataset.d.ts.map +1 -0
- package/dist/generators/pipeline/transform-dataset.js +355 -0
- package/dist/generators/pipeline/transform-dataset.js.map +1 -0
- package/dist/generators/pipeline/transform-types.d.ts +96 -0
- package/dist/generators/pipeline/transform-types.d.ts.map +1 -0
- package/dist/generators/pipeline/transform-types.js +18 -0
- package/dist/generators/pipeline/transform-types.js.map +1 -0
- package/dist/generators/registry.d.ts +64 -0
- package/dist/generators/registry.d.ts.map +1 -0
- package/dist/generators/registry.js +77 -0
- package/dist/generators/registry.js.map +1 -0
- package/dist/generators/source-mapper.d.ts +143 -0
- package/dist/generators/source-mapper.d.ts.map +1 -0
- package/dist/generators/source-mapper.js +602 -0
- package/dist/generators/source-mapper.js.map +1 -0
- package/dist/generators/source-mapping-validator.d.ts +118 -0
- package/dist/generators/source-mapping-validator.d.ts.map +1 -0
- package/dist/generators/source-mapping-validator.js +334 -0
- package/dist/generators/source-mapping-validator.js.map +1 -0
- package/dist/generators/types.d.ts +104 -0
- package/dist/generators/types.d.ts.map +1 -0
- package/dist/generators/types.js +5 -0
- package/dist/generators/types.js.map +1 -0
- package/dist/generators/warning-collector.d.ts +144 -0
- package/dist/generators/warning-collector.d.ts.map +1 -0
- package/dist/generators/warning-collector.js +166 -0
- package/dist/generators/warning-collector.js.map +1 -0
- package/dist/git/branch-diff.d.ts +44 -0
- package/dist/git/branch-diff.d.ts.map +1 -0
- package/dist/git/branch-diff.js +57 -0
- package/dist/git/branch-diff.js.map +1 -0
- package/dist/git/helpers.d.ts +46 -0
- package/dist/git/helpers.d.ts.map +1 -0
- package/dist/git/helpers.js +67 -0
- package/dist/git/helpers.js.map +1 -0
- package/dist/git/index.d.ts +18 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +18 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/name-status.d.ts +32 -0
- package/dist/git/name-status.d.ts.map +1 -0
- package/dist/git/name-status.js +66 -0
- package/dist/git/name-status.js.map +1 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/engine.d.ts +113 -0
- package/dist/lint/engine.d.ts.map +1 -0
- package/dist/lint/engine.js +228 -0
- package/dist/lint/engine.js.map +1 -0
- package/dist/lint/index.d.ts +26 -0
- package/dist/lint/index.d.ts.map +1 -0
- package/dist/lint/index.js +24 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/process-guard/decider.d.ts +166 -0
- package/dist/lint/process-guard/decider.d.ts.map +1 -0
- package/dist/lint/process-guard/decider.js +412 -0
- package/dist/lint/process-guard/decider.js.map +1 -0
- package/dist/lint/process-guard/derive-state.d.ts +96 -0
- package/dist/lint/process-guard/derive-state.d.ts.map +1 -0
- package/dist/lint/process-guard/derive-state.js +368 -0
- package/dist/lint/process-guard/derive-state.js.map +1 -0
- package/dist/lint/process-guard/detect-changes.d.ts +109 -0
- package/dist/lint/process-guard/detect-changes.d.ts.map +1 -0
- package/dist/lint/process-guard/detect-changes.js +487 -0
- package/dist/lint/process-guard/detect-changes.js.map +1 -0
- package/dist/lint/process-guard/index.d.ts +35 -0
- package/dist/lint/process-guard/index.d.ts.map +1 -0
- package/dist/lint/process-guard/index.js +39 -0
- package/dist/lint/process-guard/index.js.map +1 -0
- package/dist/lint/process-guard/types.d.ts +255 -0
- package/dist/lint/process-guard/types.d.ts.map +1 -0
- package/dist/lint/process-guard/types.js +31 -0
- package/dist/lint/process-guard/types.js.map +1 -0
- package/dist/lint/rules.d.ts +147 -0
- package/dist/lint/rules.d.ts.map +1 -0
- package/dist/lint/rules.js +289 -0
- package/dist/lint/rules.js.map +1 -0
- package/dist/lint/steps/cross-checks.d.ts +66 -0
- package/dist/lint/steps/cross-checks.d.ts.map +1 -0
- package/dist/lint/steps/cross-checks.js +290 -0
- package/dist/lint/steps/cross-checks.js.map +1 -0
- package/dist/lint/steps/feature-checks.d.ts +78 -0
- package/dist/lint/steps/feature-checks.d.ts.map +1 -0
- package/dist/lint/steps/feature-checks.js +279 -0
- package/dist/lint/steps/feature-checks.js.map +1 -0
- package/dist/lint/steps/index.d.ts +22 -0
- package/dist/lint/steps/index.d.ts.map +1 -0
- package/dist/lint/steps/index.js +26 -0
- package/dist/lint/steps/index.js.map +1 -0
- package/dist/lint/steps/pair-resolver.d.ts +29 -0
- package/dist/lint/steps/pair-resolver.d.ts.map +1 -0
- package/dist/lint/steps/pair-resolver.js +76 -0
- package/dist/lint/steps/pair-resolver.js.map +1 -0
- package/dist/lint/steps/runner.d.ts +28 -0
- package/dist/lint/steps/runner.d.ts.map +1 -0
- package/dist/lint/steps/runner.js +143 -0
- package/dist/lint/steps/runner.js.map +1 -0
- package/dist/lint/steps/step-checks.d.ts +41 -0
- package/dist/lint/steps/step-checks.d.ts.map +1 -0
- package/dist/lint/steps/step-checks.js +164 -0
- package/dist/lint/steps/step-checks.js.map +1 -0
- package/dist/lint/steps/types.d.ts +95 -0
- package/dist/lint/steps/types.d.ts.map +1 -0
- package/dist/lint/steps/types.js +79 -0
- package/dist/lint/steps/types.js.map +1 -0
- package/dist/lint/steps/utils.d.ts +22 -0
- package/dist/lint/steps/utils.d.ts.map +1 -0
- package/dist/lint/steps/utils.js +57 -0
- package/dist/lint/steps/utils.js.map +1 -0
- package/dist/mcp/file-watcher.d.ts +24 -0
- package/dist/mcp/file-watcher.d.ts.map +1 -0
- package/dist/mcp/file-watcher.js +75 -0
- package/dist/mcp/file-watcher.js.map +1 -0
- package/dist/mcp/index.d.ts +19 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +21 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/pipeline-session.d.ts +33 -0
- package/dist/mcp/pipeline-session.d.ts.map +1 -0
- package/dist/mcp/pipeline-session.js +149 -0
- package/dist/mcp/pipeline-session.js.map +1 -0
- package/dist/mcp/server.d.ts +28 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +197 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +4 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +525 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/renderable/codecs/adr.d.ts +4730 -0
- package/dist/renderable/codecs/adr.d.ts.map +1 -0
- package/dist/renderable/codecs/adr.js +590 -0
- package/dist/renderable/codecs/adr.js.map +1 -0
- package/dist/renderable/codecs/architecture.d.ts +4760 -0
- package/dist/renderable/codecs/architecture.d.ts.map +1 -0
- package/dist/renderable/codecs/architecture.js +524 -0
- package/dist/renderable/codecs/architecture.js.map +1 -0
- package/dist/renderable/codecs/business-rules.d.ts +4777 -0
- package/dist/renderable/codecs/business-rules.d.ts.map +1 -0
- package/dist/renderable/codecs/business-rules.js +648 -0
- package/dist/renderable/codecs/business-rules.js.map +1 -0
- package/dist/renderable/codecs/claude-module.d.ts +4710 -0
- package/dist/renderable/codecs/claude-module.d.ts.map +1 -0
- package/dist/renderable/codecs/claude-module.js +214 -0
- package/dist/renderable/codecs/claude-module.js.map +1 -0
- package/dist/renderable/codecs/composite.d.ts +84 -0
- package/dist/renderable/codecs/composite.d.ts.map +1 -0
- package/dist/renderable/codecs/composite.js +124 -0
- package/dist/renderable/codecs/composite.js.map +1 -0
- package/dist/renderable/codecs/convention-extractor.d.ts +105 -0
- package/dist/renderable/codecs/convention-extractor.d.ts.map +1 -0
- package/dist/renderable/codecs/convention-extractor.js +353 -0
- package/dist/renderable/codecs/convention-extractor.js.map +1 -0
- package/dist/renderable/codecs/decision-doc.d.ts +308 -0
- package/dist/renderable/codecs/decision-doc.d.ts.map +1 -0
- package/dist/renderable/codecs/decision-doc.js +485 -0
- package/dist/renderable/codecs/decision-doc.js.map +1 -0
- package/dist/renderable/codecs/design-review.d.ts +55 -0
- package/dist/renderable/codecs/design-review.d.ts.map +1 -0
- package/dist/renderable/codecs/design-review.js +532 -0
- package/dist/renderable/codecs/design-review.js.map +1 -0
- package/dist/renderable/codecs/diagram-utils.d.ts +62 -0
- package/dist/renderable/codecs/diagram-utils.d.ts.map +1 -0
- package/dist/renderable/codecs/diagram-utils.js +70 -0
- package/dist/renderable/codecs/diagram-utils.js.map +1 -0
- package/dist/renderable/codecs/helpers.d.ts +553 -0
- package/dist/renderable/codecs/helpers.d.ts.map +1 -0
- package/dist/renderable/codecs/helpers.js +913 -0
- package/dist/renderable/codecs/helpers.js.map +1 -0
- package/dist/renderable/codecs/index-codec.d.ts +4714 -0
- package/dist/renderable/codecs/index-codec.d.ts.map +1 -0
- package/dist/renderable/codecs/index-codec.js +250 -0
- package/dist/renderable/codecs/index-codec.js.map +1 -0
- package/dist/renderable/codecs/index.d.ts +46 -0
- package/dist/renderable/codecs/index.d.ts.map +1 -0
- package/dist/renderable/codecs/index.js +70 -0
- package/dist/renderable/codecs/index.js.map +1 -0
- package/dist/renderable/codecs/patterns.d.ts +4757 -0
- package/dist/renderable/codecs/patterns.d.ts.map +1 -0
- package/dist/renderable/codecs/patterns.js +462 -0
- package/dist/renderable/codecs/patterns.js.map +1 -0
- package/dist/renderable/codecs/planning.d.ts +14055 -0
- package/dist/renderable/codecs/planning.d.ts.map +1 -0
- package/dist/renderable/codecs/planning.js +449 -0
- package/dist/renderable/codecs/planning.js.map +1 -0
- package/dist/renderable/codecs/pr-changes.d.ts +4742 -0
- package/dist/renderable/codecs/pr-changes.d.ts.map +1 -0
- package/dist/renderable/codecs/pr-changes.js +425 -0
- package/dist/renderable/codecs/pr-changes.js.map +1 -0
- package/dist/renderable/codecs/reference.d.ts +215 -0
- package/dist/renderable/codecs/reference.d.ts.map +1 -0
- package/dist/renderable/codecs/reference.js +1578 -0
- package/dist/renderable/codecs/reference.js.map +1 -0
- package/dist/renderable/codecs/reporting.d.ts +14026 -0
- package/dist/renderable/codecs/reporting.d.ts.map +1 -0
- package/dist/renderable/codecs/reporting.js +365 -0
- package/dist/renderable/codecs/reporting.js.map +1 -0
- package/dist/renderable/codecs/requirements.d.ts +4743 -0
- package/dist/renderable/codecs/requirements.d.ts.map +1 -0
- package/dist/renderable/codecs/requirements.js +428 -0
- package/dist/renderable/codecs/requirements.js.map +1 -0
- package/dist/renderable/codecs/session.d.ts +9410 -0
- package/dist/renderable/codecs/session.d.ts.map +1 -0
- package/dist/renderable/codecs/session.js +848 -0
- package/dist/renderable/codecs/session.js.map +1 -0
- package/dist/renderable/codecs/shape-matcher.d.ts +54 -0
- package/dist/renderable/codecs/shape-matcher.d.ts.map +1 -0
- package/dist/renderable/codecs/shape-matcher.js +106 -0
- package/dist/renderable/codecs/shape-matcher.js.map +1 -0
- package/dist/renderable/codecs/shared-schema.d.ts +44 -0
- package/dist/renderable/codecs/shared-schema.d.ts.map +1 -0
- package/dist/renderable/codecs/shared-schema.js +43 -0
- package/dist/renderable/codecs/shared-schema.js.map +1 -0
- package/dist/renderable/codecs/taxonomy.d.ts +4733 -0
- package/dist/renderable/codecs/taxonomy.d.ts.map +1 -0
- package/dist/renderable/codecs/taxonomy.js +570 -0
- package/dist/renderable/codecs/taxonomy.js.map +1 -0
- package/dist/renderable/codecs/timeline.d.ts +14094 -0
- package/dist/renderable/codecs/timeline.d.ts.map +1 -0
- package/dist/renderable/codecs/timeline.js +906 -0
- package/dist/renderable/codecs/timeline.js.map +1 -0
- package/dist/renderable/codecs/types/base.d.ts +81 -0
- package/dist/renderable/codecs/types/base.d.ts.map +1 -0
- package/dist/renderable/codecs/types/base.js +56 -0
- package/dist/renderable/codecs/types/base.js.map +1 -0
- package/dist/renderable/codecs/types/index.d.ts +5 -0
- package/dist/renderable/codecs/types/index.d.ts.map +1 -0
- package/dist/renderable/codecs/types/index.js +5 -0
- package/dist/renderable/codecs/types/index.js.map +1 -0
- package/dist/renderable/codecs/validation-rules.d.ts +4773 -0
- package/dist/renderable/codecs/validation-rules.d.ts.map +1 -0
- package/dist/renderable/codecs/validation-rules.js +537 -0
- package/dist/renderable/codecs/validation-rules.js.map +1 -0
- package/dist/renderable/generate.d.ts +338 -0
- package/dist/renderable/generate.d.ts.map +1 -0
- package/dist/renderable/generate.js +437 -0
- package/dist/renderable/generate.js.map +1 -0
- package/dist/renderable/index.d.ts +36 -0
- package/dist/renderable/index.d.ts.map +1 -0
- package/dist/renderable/index.js +58 -0
- package/dist/renderable/index.js.map +1 -0
- package/dist/renderable/load-preamble.d.ts +56 -0
- package/dist/renderable/load-preamble.d.ts.map +1 -0
- package/dist/renderable/load-preamble.js +298 -0
- package/dist/renderable/load-preamble.js.map +1 -0
- package/dist/renderable/render.d.ts +61 -0
- package/dist/renderable/render.d.ts.map +1 -0
- package/dist/renderable/render.js +346 -0
- package/dist/renderable/render.js.map +1 -0
- package/dist/renderable/schema.d.ts +194 -0
- package/dist/renderable/schema.d.ts.map +1 -0
- package/dist/renderable/schema.js +197 -0
- package/dist/renderable/schema.js.map +1 -0
- package/dist/renderable/utils.d.ts +146 -0
- package/dist/renderable/utils.d.ts.map +1 -0
- package/dist/renderable/utils.js +362 -0
- package/dist/renderable/utils.js.map +1 -0
- package/dist/scanner/ast-parser.d.ts +75 -0
- package/dist/scanner/ast-parser.d.ts.map +1 -0
- package/dist/scanner/ast-parser.js +835 -0
- package/dist/scanner/ast-parser.js.map +1 -0
- package/dist/scanner/gherkin-ast-parser.d.ts +166 -0
- package/dist/scanner/gherkin-ast-parser.d.ts.map +1 -0
- package/dist/scanner/gherkin-ast-parser.js +507 -0
- package/dist/scanner/gherkin-ast-parser.js.map +1 -0
- package/dist/scanner/gherkin-scanner.d.ts +106 -0
- package/dist/scanner/gherkin-scanner.d.ts.map +1 -0
- package/dist/scanner/gherkin-scanner.js +149 -0
- package/dist/scanner/gherkin-scanner.js.map +1 -0
- package/dist/scanner/index.d.ts +85 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +102 -0
- package/dist/scanner/index.js.map +1 -0
- package/dist/scanner/pattern-scanner.d.ts +83 -0
- package/dist/scanner/pattern-scanner.d.ts.map +1 -0
- package/dist/scanner/pattern-scanner.js +110 -0
- package/dist/scanner/pattern-scanner.js.map +1 -0
- package/dist/taxonomy/categories.d.ts +47 -0
- package/dist/taxonomy/categories.d.ts.map +1 -0
- package/dist/taxonomy/categories.js +175 -0
- package/dist/taxonomy/categories.js.map +1 -0
- package/dist/taxonomy/claude-section-values.d.ts +12 -0
- package/dist/taxonomy/claude-section-values.d.ts.map +1 -0
- package/dist/taxonomy/claude-section-values.js +17 -0
- package/dist/taxonomy/claude-section-values.js.map +1 -0
- package/dist/taxonomy/conventions.d.ts +13 -0
- package/dist/taxonomy/conventions.d.ts.map +1 -0
- package/dist/taxonomy/conventions.js +27 -0
- package/dist/taxonomy/conventions.js.map +1 -0
- package/dist/taxonomy/deliverable-status.d.ts +99 -0
- package/dist/taxonomy/deliverable-status.d.ts.map +1 -0
- package/dist/taxonomy/deliverable-status.js +131 -0
- package/dist/taxonomy/deliverable-status.js.map +1 -0
- package/dist/taxonomy/format-types.d.ts +17 -0
- package/dist/taxonomy/format-types.d.ts.map +1 -0
- package/dist/taxonomy/format-types.js +23 -0
- package/dist/taxonomy/format-types.js.map +1 -0
- package/dist/taxonomy/generator-options.d.ts +67 -0
- package/dist/taxonomy/generator-options.d.ts.map +1 -0
- package/dist/taxonomy/generator-options.js +75 -0
- package/dist/taxonomy/generator-options.js.map +1 -0
- package/dist/taxonomy/hierarchy-levels.d.ts +23 -0
- package/dist/taxonomy/hierarchy-levels.d.ts.map +1 -0
- package/dist/taxonomy/hierarchy-levels.js +22 -0
- package/dist/taxonomy/hierarchy-levels.js.map +1 -0
- package/dist/taxonomy/index.d.ts +35 -0
- package/dist/taxonomy/index.d.ts.map +1 -0
- package/dist/taxonomy/index.js +56 -0
- package/dist/taxonomy/index.js.map +1 -0
- package/dist/taxonomy/layer-types.d.ts +22 -0
- package/dist/taxonomy/layer-types.d.ts.map +1 -0
- package/dist/taxonomy/layer-types.js +28 -0
- package/dist/taxonomy/layer-types.js.map +1 -0
- package/dist/taxonomy/normalized-status.d.ts +99 -0
- package/dist/taxonomy/normalized-status.d.ts.map +1 -0
- package/dist/taxonomy/normalized-status.js +113 -0
- package/dist/taxonomy/normalized-status.js.map +1 -0
- package/dist/taxonomy/registry-builder.d.ts +104 -0
- package/dist/taxonomy/registry-builder.d.ts.map +1 -0
- package/dist/taxonomy/registry-builder.js +561 -0
- package/dist/taxonomy/registry-builder.js.map +1 -0
- package/dist/taxonomy/risk-levels.d.ts +16 -0
- package/dist/taxonomy/risk-levels.d.ts.map +1 -0
- package/dist/taxonomy/risk-levels.js +15 -0
- package/dist/taxonomy/risk-levels.js.map +1 -0
- package/dist/taxonomy/severity-types.d.ts +6 -0
- package/dist/taxonomy/severity-types.d.ts.map +1 -0
- package/dist/taxonomy/severity-types.js +5 -0
- package/dist/taxonomy/severity-types.js.map +1 -0
- package/dist/taxonomy/status-values.d.ts +39 -0
- package/dist/taxonomy/status-values.d.ts.map +1 -0
- package/dist/taxonomy/status-values.js +42 -0
- package/dist/taxonomy/status-values.js.map +1 -0
- package/dist/types/branded.d.ts +89 -0
- package/dist/types/branded.d.ts.map +1 -0
- package/dist/types/branded.js +57 -0
- package/dist/types/branded.js.map +1 -0
- package/dist/types/errors.d.ts +342 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +251 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +41 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/result.d.ts +78 -0
- package/dist/types/result.d.ts.map +1 -0
- package/dist/types/result.js +78 -0
- package/dist/types/result.js.map +1 -0
- package/dist/utils/collection-utils.d.ts +49 -0
- package/dist/utils/collection-utils.d.ts.map +1 -0
- package/dist/utils/collection-utils.js +58 -0
- package/dist/utils/collection-utils.js.map +1 -0
- package/dist/utils/id-utils.d.ts +46 -0
- package/dist/utils/id-utils.d.ts.map +1 -0
- package/dist/utils/id-utils.js +51 -0
- package/dist/utils/id-utils.js.map +1 -0
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/string-utils.d.ts +150 -0
- package/dist/utils/string-utils.d.ts.map +1 -0
- package/dist/utils/string-utils.js +281 -0
- package/dist/utils/string-utils.js.map +1 -0
- package/dist/validation/anti-patterns.d.ts +134 -0
- package/dist/validation/anti-patterns.d.ts.map +1 -0
- package/dist/validation/anti-patterns.js +307 -0
- package/dist/validation/anti-patterns.js.map +1 -0
- package/dist/validation/dod-validator.d.ts +94 -0
- package/dist/validation/dod-validator.d.ts.map +1 -0
- package/dist/validation/dod-validator.js +198 -0
- package/dist/validation/dod-validator.js.map +1 -0
- package/dist/validation/fsm/index.d.ts +59 -0
- package/dist/validation/fsm/index.d.ts.map +1 -0
- package/dist/validation/fsm/index.js +64 -0
- package/dist/validation/fsm/index.js.map +1 -0
- package/dist/validation/fsm/states.d.ts +93 -0
- package/dist/validation/fsm/states.d.ts.map +1 -0
- package/dist/validation/fsm/states.js +98 -0
- package/dist/validation/fsm/states.js.map +1 -0
- package/dist/validation/fsm/transitions.d.ts +100 -0
- package/dist/validation/fsm/transitions.d.ts.map +1 -0
- package/dist/validation/fsm/transitions.js +122 -0
- package/dist/validation/fsm/transitions.js.map +1 -0
- package/dist/validation/fsm/validator.d.ts +163 -0
- package/dist/validation/fsm/validator.d.ts.map +1 -0
- package/dist/validation/fsm/validator.js +205 -0
- package/dist/validation/fsm/validator.js.map +1 -0
- package/dist/validation/index.d.ts +23 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +25 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/types.d.ts +136 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +56 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/validation-schemas/codec-utils.d.ts +188 -0
- package/dist/validation-schemas/codec-utils.d.ts.map +1 -0
- package/dist/validation-schemas/codec-utils.js +258 -0
- package/dist/validation-schemas/codec-utils.js.map +1 -0
- package/dist/validation-schemas/config.d.ts +99 -0
- package/dist/validation-schemas/config.d.ts.map +1 -0
- package/dist/validation-schemas/config.js +178 -0
- package/dist/validation-schemas/config.js.map +1 -0
- package/dist/validation-schemas/doc-directive.d.ts +195 -0
- package/dist/validation-schemas/doc-directive.d.ts.map +1 -0
- package/dist/validation-schemas/doc-directive.js +239 -0
- package/dist/validation-schemas/doc-directive.js.map +1 -0
- package/dist/validation-schemas/dual-source.d.ts +167 -0
- package/dist/validation-schemas/dual-source.d.ts.map +1 -0
- package/dist/validation-schemas/dual-source.js +168 -0
- package/dist/validation-schemas/dual-source.js.map +1 -0
- package/dist/validation-schemas/export-info.d.ts +53 -0
- package/dist/validation-schemas/export-info.d.ts.map +1 -0
- package/dist/validation-schemas/export-info.js +101 -0
- package/dist/validation-schemas/export-info.js.map +1 -0
- package/dist/validation-schemas/extracted-pattern.d.ts +351 -0
- package/dist/validation-schemas/extracted-pattern.d.ts.map +1 -0
- package/dist/validation-schemas/extracted-pattern.js +459 -0
- package/dist/validation-schemas/extracted-pattern.js.map +1 -0
- package/dist/validation-schemas/extracted-shape.d.ts +200 -0
- package/dist/validation-schemas/extracted-shape.d.ts.map +1 -0
- package/dist/validation-schemas/extracted-shape.js +182 -0
- package/dist/validation-schemas/extracted-shape.js.map +1 -0
- package/dist/validation-schemas/feature.d.ts +554 -0
- package/dist/validation-schemas/feature.d.ts.map +1 -0
- package/dist/validation-schemas/feature.js +262 -0
- package/dist/validation-schemas/feature.js.map +1 -0
- package/dist/validation-schemas/index.d.ts +15 -0
- package/dist/validation-schemas/index.d.ts.map +1 -0
- package/dist/validation-schemas/index.js +32 -0
- package/dist/validation-schemas/index.js.map +1 -0
- package/dist/validation-schemas/lint.d.ts +46 -0
- package/dist/validation-schemas/lint.d.ts.map +1 -0
- package/dist/validation-schemas/lint.js +45 -0
- package/dist/validation-schemas/lint.js.map +1 -0
- package/dist/validation-schemas/master-dataset.d.ts +8299 -0
- package/dist/validation-schemas/master-dataset.d.ts.map +1 -0
- package/dist/validation-schemas/master-dataset.js +275 -0
- package/dist/validation-schemas/master-dataset.js.map +1 -0
- package/dist/validation-schemas/output-schemas.d.ts +183 -0
- package/dist/validation-schemas/output-schemas.d.ts.map +1 -0
- package/dist/validation-schemas/output-schemas.js +149 -0
- package/dist/validation-schemas/output-schemas.js.map +1 -0
- package/dist/validation-schemas/scenario-ref.d.ts +80 -0
- package/dist/validation-schemas/scenario-ref.d.ts.map +1 -0
- package/dist/validation-schemas/scenario-ref.js +73 -0
- package/dist/validation-schemas/scenario-ref.js.map +1 -0
- package/dist/validation-schemas/tag-registry.d.ts +210 -0
- package/dist/validation-schemas/tag-registry.d.ts.map +1 -0
- package/dist/validation-schemas/tag-registry.js +248 -0
- package/dist/validation-schemas/tag-registry.js.map +1 -0
- package/dist/validation-schemas/workflow-config.d.ts +125 -0
- package/dist/validation-schemas/workflow-config.d.ts.map +1 -0
- package/dist/validation-schemas/workflow-config.js +138 -0
- package/dist/validation-schemas/workflow-config.js.map +1 -0
- package/docs/ANNOTATION-GUIDE.md +271 -0
- package/docs/ARCHITECTURE.md +1636 -0
- package/docs/CONFIGURATION.md +337 -0
- package/docs/DOCS-GAP-ANALYSIS.md +811 -0
- package/docs/GHERKIN-PATTERNS.md +366 -0
- package/docs/INDEX.md +345 -0
- package/docs/MCP-SETUP.md +140 -0
- package/docs/METHODOLOGY.md +240 -0
- package/docs/PROCESS-API.md +65 -0
- package/docs/PROCESS-GUARD.md +341 -0
- package/docs/SESSION-GUIDES.md +391 -0
- package/docs/TAXONOMY.md +106 -0
- package/docs/VALIDATION.md +418 -0
- package/docs-live/ARCHITECTURE.md +362 -0
- package/docs-live/BUSINESS-RULES.md +24 -0
- package/docs-live/CHANGELOG-GENERATED.md +375 -0
- package/docs-live/DECISIONS.md +78 -0
- package/docs-live/INDEX.md +231 -0
- package/docs-live/PRODUCT-AREAS.md +255 -0
- package/docs-live/TAXONOMY.md +202 -0
- package/docs-live/VALIDATION-RULES.md +119 -0
- package/docs-live/_claude-md/annotation/annotation-overview.md +26 -0
- package/docs-live/_claude-md/annotation/annotation-reference.md +213 -0
- package/docs-live/_claude-md/architecture/architecture-codecs.md +160 -0
- package/docs-live/_claude-md/architecture/architecture-types.md +32 -0
- package/docs-live/_claude-md/architecture/reference-sample.md +162 -0
- package/docs-live/_claude-md/authoring/gherkin-authoring-guide.md +245 -0
- package/docs-live/_claude-md/configuration/configuration-guide.md +216 -0
- package/docs-live/_claude-md/configuration/configuration-overview.md +37 -0
- package/docs-live/_claude-md/core-types/core-types-overview.md +20 -0
- package/docs-live/_claude-md/data-api/data-api-overview.md +39 -0
- package/docs-live/_claude-md/generation/generation-overview.md +30 -0
- package/docs-live/_claude-md/process/process-overview.md +127 -0
- package/docs-live/_claude-md/validation/process-guard.md +185 -0
- package/docs-live/_claude-md/validation/validation-overview.md +37 -0
- package/docs-live/_claude-md/validation/validation-tools-guide.md +242 -0
- package/docs-live/_claude-md/workflow/session-workflow-guide.md +141 -0
- package/docs-live/business-rules/annotation.md +1462 -0
- package/docs-live/business-rules/configuration.md +465 -0
- package/docs-live/business-rules/core-types.md +531 -0
- package/docs-live/business-rules/data-api.md +1403 -0
- package/docs-live/business-rules/generation.md +4726 -0
- package/docs-live/business-rules/process.md +122 -0
- package/docs-live/business-rules/validation.md +998 -0
- package/docs-live/decisions/adr-001-taxonomy-canonical-values.md +197 -0
- package/docs-live/decisions/adr-002-gherkin-only-testing.md +57 -0
- package/docs-live/decisions/adr-003-source-first-pattern-architecture.md +147 -0
- package/docs-live/decisions/adr-004-session-workflow-commands.md +137 -0
- package/docs-live/decisions/adr-005-codec-based-markdown-rendering.md +150 -0
- package/docs-live/decisions/adr-006-single-read-model-architecture.md +136 -0
- package/docs-live/decisions/adr-021-doc-generation-proof-of-concept.md +489 -0
- package/docs-live/product-areas/ANNOTATION.md +591 -0
- package/docs-live/product-areas/CONFIGURATION.md +1048 -0
- package/docs-live/product-areas/CORE-TYPES.md +221 -0
- package/docs-live/product-areas/DATA-API.md +850 -0
- package/docs-live/product-areas/GENERATION.md +1200 -0
- package/docs-live/product-areas/PROCESS.md +351 -0
- package/docs-live/product-areas/VALIDATION.md +1135 -0
- package/docs-live/reference/ANNOTATION-REFERENCE.md +232 -0
- package/docs-live/reference/ARCHITECTURE-CODECS.md +675 -0
- package/docs-live/reference/ARCHITECTURE-TYPES.md +436 -0
- package/docs-live/reference/CONFIGURATION-GUIDE.md +235 -0
- package/docs-live/reference/GHERKIN-AUTHORING-GUIDE.md +270 -0
- package/docs-live/reference/PROCESS-API-RECIPES.md +476 -0
- package/docs-live/reference/PROCESS-API-REFERENCE.md +63 -0
- package/docs-live/reference/PROCESS-GUARD-REFERENCE.md +258 -0
- package/docs-live/reference/REFERENCE-SAMPLE.md +1135 -0
- package/docs-live/reference/SESSION-WORKFLOW-GUIDE.md +384 -0
- package/docs-live/reference/VALIDATION-TOOLS-GUIDE.md +263 -0
- package/docs-live/taxonomy/categories.md +33 -0
- package/docs-live/taxonomy/format-types.md +67 -0
- package/docs-live/taxonomy/metadata-tags.md +693 -0
- package/docs-live/validation/error-catalog.md +78 -0
- package/docs-live/validation/fsm-transitions.md +50 -0
- package/docs-live/validation/protection-levels.md +51 -0
- package/package.json +233 -0
|
@@ -0,0 +1,1200 @@
|
|
|
1
|
+
# Generation Overview
|
|
2
|
+
|
|
3
|
+
**Purpose:** Generation product area overview
|
|
4
|
+
**Detail Level:** Full reference
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**How does code become docs?** The generation pipeline transforms annotated source code into markdown documents through a four-stage architecture: Scanner discovers files, Extractor produces `ExtractedPattern` objects, Transformer builds MasterDataset with pre-computed views, and Codecs render to markdown via RenderableDocument IR. Nine specialized codecs handle reference docs, planning, session, reporting, timeline, ADRs, business rules, taxonomy, and composite output — each supporting three detail levels (detailed, standard, summary). The Orchestrator runs generators in registration order, producing both detailed `docs-live/` references and compact `_claude-md/` summaries.
|
|
9
|
+
|
|
10
|
+
### Pipeline Stages
|
|
11
|
+
|
|
12
|
+
| Stage | Module | Responsibility |
|
|
13
|
+
| ----------- | -------------------------- | --------------------------------------------------------------- |
|
|
14
|
+
| Scanner | `src/scanner/` | File discovery, AST parsing, opt-in via `@architect` |
|
|
15
|
+
| Extractor | `src/extractor/` | Pattern extraction from TypeScript JSDoc and Gherkin tags |
|
|
16
|
+
| Transformer | `src/generators/pipeline/` | MasterDataset with pre-computed views for O(1) access (ADR-006) |
|
|
17
|
+
| Codec | `src/renderable/` | Pure functions: MasterDataset → RenderableDocument → Markdown |
|
|
18
|
+
|
|
19
|
+
### Codec Inventory
|
|
20
|
+
|
|
21
|
+
| Codec | Purpose |
|
|
22
|
+
| ---------------------- | -------------------------------------------------------------- |
|
|
23
|
+
| ReferenceDocumentCodec | Conventions, diagrams, shapes, behaviors (4-layer composition) |
|
|
24
|
+
| PlanningCodec | Roadmap and remaining work |
|
|
25
|
+
| SessionCodec | Current work and session findings |
|
|
26
|
+
| ReportingCodec | Changelog |
|
|
27
|
+
| TimelineCodec | Timeline and traceability |
|
|
28
|
+
| RequirementsAdrCodec | ADR generation |
|
|
29
|
+
| BusinessRulesCodec | Gherkin rule extraction |
|
|
30
|
+
| TaxonomyCodec | Tag registry docs |
|
|
31
|
+
| CompositeCodec | Composes multiple codecs into a single document |
|
|
32
|
+
|
|
33
|
+
## Key Invariants
|
|
34
|
+
|
|
35
|
+
- Codec purity: Every codec is a pure function (dataset in, document out). No side effects, no filesystem access. Same input always produces same output
|
|
36
|
+
- Single read model (ADR-006): All codecs consume MasterDataset. No codec reads raw scanner/extractor output. Anti-patterns: Parallel Pipeline, Lossy Local Type, Re-derived Relationship
|
|
37
|
+
- Progressive disclosure: Every document renders at three detail levels (detailed, standard, summary) from the same codec. Summary feeds `_claude-md/` modules; detailed feeds `docs-live/reference/`
|
|
38
|
+
- Config-driven generation: A single `ReferenceDocConfig` produces a complete document. Content sources compose in fixed order: conventions, diagrams, shapes, behaviors
|
|
39
|
+
- RenderableDocument IR: Codecs express intent ("this is a table"), the renderer handles syntax ("pipe-delimited markdown"). Switching output format requires only a new renderer
|
|
40
|
+
- Composition order: Reference docs compose four content layers in fixed order. Product area docs compose five layers: intro, conventions, diagrams, shapes, business rules
|
|
41
|
+
- Shape extraction: TypeScript shapes (`interface`, `type`, `enum`, `function`, `const`) are extracted by declaration-level `@architect-shape` tags. Shapes include source text, JSDoc, type parameters, and property documentation
|
|
42
|
+
- Generator registration: Generators self-register via `registerGenerator()`. The orchestrator runs them in registration order. Each generator owns its output files and codec configuration
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Contents
|
|
47
|
+
|
|
48
|
+
- [Key Invariants](#key-invariants)
|
|
49
|
+
- [Generation Components](#generation-components)
|
|
50
|
+
- [API Types](#api-types)
|
|
51
|
+
- [Business Rules](#business-rules)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Generation Components
|
|
56
|
+
|
|
57
|
+
Scoped architecture diagram showing component relationships:
|
|
58
|
+
|
|
59
|
+
```mermaid
|
|
60
|
+
graph TB
|
|
61
|
+
subgraph generator["Generator"]
|
|
62
|
+
SourceMapper[/"SourceMapper"/]
|
|
63
|
+
Documentation_Generation_Orchestrator("Documentation Generation Orchestrator")
|
|
64
|
+
GitModule["GitModule"]
|
|
65
|
+
GitHelpers["GitHelpers"]
|
|
66
|
+
GitBranchDiff["GitBranchDiff"]
|
|
67
|
+
TransformTypes["TransformTypes"]
|
|
68
|
+
TransformDataset("TransformDataset")
|
|
69
|
+
SequenceTransformUtils("SequenceTransformUtils")
|
|
70
|
+
RelationshipResolver("RelationshipResolver")
|
|
71
|
+
ContextInferenceImpl["ContextInferenceImpl"]
|
|
72
|
+
ProcessApiReferenceGenerator["ProcessApiReferenceGenerator"]
|
|
73
|
+
DesignReviewGenerator("DesignReviewGenerator")
|
|
74
|
+
DecisionDocGenerator("DecisionDocGenerator")
|
|
75
|
+
CliRecipeGenerator["CliRecipeGenerator"]
|
|
76
|
+
end
|
|
77
|
+
subgraph renderer["Renderer"]
|
|
78
|
+
loadPreambleFromMarkdown___Shared_Markdown_to_SectionBlock_Parser["loadPreambleFromMarkdown — Shared Markdown-to-SectionBlock Parser"]
|
|
79
|
+
PatternsCodec[("PatternsCodec")]
|
|
80
|
+
MermaidDiagramUtils["MermaidDiagramUtils"]
|
|
81
|
+
DesignReviewCodec[("DesignReviewCodec")]
|
|
82
|
+
DecisionDocCodec[("DecisionDocCodec")]
|
|
83
|
+
CompositeCodec[("CompositeCodec")]
|
|
84
|
+
ArchitectureCodec[("ArchitectureCodec")]
|
|
85
|
+
end
|
|
86
|
+
subgraph related["Related"]
|
|
87
|
+
MasterDataset["MasterDataset"]:::neighbor
|
|
88
|
+
Pattern_Scanner["Pattern Scanner"]:::neighbor
|
|
89
|
+
GherkinASTParser["GherkinASTParser"]:::neighbor
|
|
90
|
+
ShapeExtractor["ShapeExtractor"]:::neighbor
|
|
91
|
+
PatternHelpers["PatternHelpers"]:::neighbor
|
|
92
|
+
ReferenceDocShowcase["ReferenceDocShowcase"]:::neighbor
|
|
93
|
+
ProcessApiHybridGeneration["ProcessApiHybridGeneration"]:::neighbor
|
|
94
|
+
ProceduralGuideCodec["ProceduralGuideCodec"]:::neighbor
|
|
95
|
+
PatternRelationshipModel["PatternRelationshipModel"]:::neighbor
|
|
96
|
+
DesignReviewGeneration["DesignReviewGeneration"]:::neighbor
|
|
97
|
+
CliRecipeCodec["CliRecipeCodec"]:::neighbor
|
|
98
|
+
ContextInference["ContextInference"]:::neighbor
|
|
99
|
+
end
|
|
100
|
+
loadPreambleFromMarkdown___Shared_Markdown_to_SectionBlock_Parser ..->|implements| ProceduralGuideCodec
|
|
101
|
+
SourceMapper -.->|depends on| DecisionDocCodec
|
|
102
|
+
SourceMapper -.->|depends on| ShapeExtractor
|
|
103
|
+
SourceMapper -.->|depends on| GherkinASTParser
|
|
104
|
+
Documentation_Generation_Orchestrator -->|uses| Pattern_Scanner
|
|
105
|
+
GitModule -->|uses| GitBranchDiff
|
|
106
|
+
GitModule -->|uses| GitHelpers
|
|
107
|
+
PatternsCodec ..->|implements| PatternRelationshipModel
|
|
108
|
+
DesignReviewCodec -->|uses| MasterDataset
|
|
109
|
+
DesignReviewCodec -->|uses| MermaidDiagramUtils
|
|
110
|
+
DesignReviewCodec ..->|implements| DesignReviewGeneration
|
|
111
|
+
CompositeCodec ..->|implements| ReferenceDocShowcase
|
|
112
|
+
ArchitectureCodec -->|uses| MasterDataset
|
|
113
|
+
TransformTypes -->|uses| MasterDataset
|
|
114
|
+
TransformDataset -->|uses| MasterDataset
|
|
115
|
+
TransformDataset ..->|implements| PatternRelationshipModel
|
|
116
|
+
SequenceTransformUtils -->|uses| MasterDataset
|
|
117
|
+
SequenceTransformUtils ..->|implements| DesignReviewGeneration
|
|
118
|
+
RelationshipResolver -->|uses| PatternHelpers
|
|
119
|
+
ContextInferenceImpl ..->|implements| ContextInference
|
|
120
|
+
ProcessApiReferenceGenerator ..->|implements| ProcessApiHybridGeneration
|
|
121
|
+
DesignReviewGenerator -->|uses| DesignReviewCodec
|
|
122
|
+
DesignReviewGenerator -->|uses| MasterDataset
|
|
123
|
+
DesignReviewGenerator ..->|implements| DesignReviewGeneration
|
|
124
|
+
DecisionDocGenerator -.->|depends on| DecisionDocCodec
|
|
125
|
+
DecisionDocGenerator -.->|depends on| SourceMapper
|
|
126
|
+
CliRecipeGenerator ..->|implements| CliRecipeCodec
|
|
127
|
+
DesignReviewGeneration -.->|depends on| MermaidDiagramUtils
|
|
128
|
+
CliRecipeCodec -.->|depends on| ProcessApiHybridGeneration
|
|
129
|
+
classDef neighbor stroke-dasharray: 5 5
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## API Types
|
|
135
|
+
|
|
136
|
+
### RuntimeMasterDataset (interface)
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
/**
|
|
140
|
+
* Runtime MasterDataset with optional workflow
|
|
141
|
+
*
|
|
142
|
+
* Extends the Zod-compatible MasterDataset with workflow reference.
|
|
143
|
+
* LoadedWorkflow contains Maps which aren't JSON-serializable,
|
|
144
|
+
* so it's kept separate from the Zod schema.
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
interface RuntimeMasterDataset extends MasterDataset {
|
|
151
|
+
/** Optional workflow configuration (not serializable) */
|
|
152
|
+
readonly workflow?: LoadedWorkflow;
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
| Property | Description |
|
|
157
|
+
| -------- | -------------------------------------------------- |
|
|
158
|
+
| workflow | Optional workflow configuration (not serializable) |
|
|
159
|
+
|
|
160
|
+
### RawDataset (interface)
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
/**
|
|
164
|
+
* Raw input data for transformation
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
interface RawDataset {
|
|
171
|
+
/** Extracted patterns from TypeScript and/or Gherkin sources */
|
|
172
|
+
readonly patterns: readonly ExtractedPattern[];
|
|
173
|
+
|
|
174
|
+
/** Tag registry for category lookups */
|
|
175
|
+
readonly tagRegistry: TagRegistry;
|
|
176
|
+
|
|
177
|
+
/** Optional workflow configuration for phase names (can be undefined) */
|
|
178
|
+
readonly workflow?: LoadedWorkflow | undefined;
|
|
179
|
+
|
|
180
|
+
/** Optional rules for inferring bounded context from file paths */
|
|
181
|
+
readonly contextInferenceRules?: readonly ContextInferenceRule[] | undefined;
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
| Property | Description |
|
|
186
|
+
| --------------------- | ------------------------------------------------------------------ |
|
|
187
|
+
| patterns | Extracted patterns from TypeScript and/or Gherkin sources |
|
|
188
|
+
| tagRegistry | Tag registry for category lookups |
|
|
189
|
+
| workflow | Optional workflow configuration for phase names (can be undefined) |
|
|
190
|
+
| contextInferenceRules | Optional rules for inferring bounded context from file paths |
|
|
191
|
+
|
|
192
|
+
### RenderableDocument (type)
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
type RenderableDocument = {
|
|
196
|
+
title: string;
|
|
197
|
+
purpose?: string;
|
|
198
|
+
detailLevel?: string;
|
|
199
|
+
sections: SectionBlock[];
|
|
200
|
+
additionalFiles?: Record<string, RenderableDocument>;
|
|
201
|
+
};
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### SectionBlock (type)
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
type SectionBlock =
|
|
208
|
+
| HeadingBlock
|
|
209
|
+
| ParagraphBlock
|
|
210
|
+
| SeparatorBlock
|
|
211
|
+
| TableBlock
|
|
212
|
+
| ListBlock
|
|
213
|
+
| CodeBlock
|
|
214
|
+
| MermaidBlock
|
|
215
|
+
| CollapsibleBlock
|
|
216
|
+
| LinkOutBlock;
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### HeadingBlock (type)
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
type HeadingBlock = z.infer<typeof HeadingBlockSchema>;
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### TableBlock (type)
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
type TableBlock = z.infer<typeof TableBlockSchema>;
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### ListBlock (type)
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
type ListBlock = z.infer<typeof ListBlockSchema>;
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### CodeBlock (type)
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
type CodeBlock = z.infer<typeof CodeBlockSchema>;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### MermaidBlock (type)
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
type MermaidBlock = z.infer<typeof MermaidBlockSchema>;
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### CollapsibleBlock (type)
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
type CollapsibleBlock = {
|
|
253
|
+
type: 'collapsible';
|
|
254
|
+
summary: string;
|
|
255
|
+
content: SectionBlock[];
|
|
256
|
+
};
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### transformToMasterDataset (function)
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
/**
|
|
263
|
+
* Transform raw extracted data into a MasterDataset with all pre-computed views.
|
|
264
|
+
*
|
|
265
|
+
* This is a ONE-PASS transformation that computes:
|
|
266
|
+
* - Status-based groupings (completed/active/planned)
|
|
267
|
+
* - Phase-based groupings with counts
|
|
268
|
+
* - Quarter-based groupings for timeline views
|
|
269
|
+
* - Category-based groupings for taxonomy
|
|
270
|
+
* - Source-based views (TypeScript vs Gherkin, roadmap, PRD)
|
|
271
|
+
* - Aggregate statistics (counts, phase count, category count)
|
|
272
|
+
* - Optional relationship index
|
|
273
|
+
*
|
|
274
|
+
* Convenience wrapper that returns just the dataset.
|
|
275
|
+
* Use `transformToMasterDatasetWithValidation` to get validation summary.
|
|
276
|
+
*
|
|
277
|
+
* @param raw - Raw dataset with patterns, registry, and optional workflow
|
|
278
|
+
* @returns MasterDataset with all pre-computed views
|
|
279
|
+
*/
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
function transformToMasterDataset(raw: RawDataset): RuntimeMasterDataset;
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
| Parameter | Type | Description |
|
|
287
|
+
| --------- | ---- | ---------------------------------------------------------- |
|
|
288
|
+
| raw | | Raw dataset with patterns, registry, and optional workflow |
|
|
289
|
+
|
|
290
|
+
**Returns:** MasterDataset with all pre-computed views
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Business Rules
|
|
295
|
+
|
|
296
|
+
92 patterns, 441 rules with invariants (442 total)
|
|
297
|
+
|
|
298
|
+
### ADR 005 Codec Based Markdown Rendering
|
|
299
|
+
|
|
300
|
+
| Rule | Invariant | Rationale |
|
|
301
|
+
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
302
|
+
| Codecs implement a decode-only contract | Every codec is a pure function that accepts a MasterDataset and returns a RenderableDocument. Codecs do not perform side effects, do not write files, and do not access the filesystem. The codec contract is decode-only because the transformation is one-directional: structured data becomes a document, never the reverse. | Pure functions are deterministic and trivially testable. For the same MasterDataset, a codec always produces the same RenderableDocument. This makes snapshot testing reliable and enables codec output comparison across versions. |
|
|
303
|
+
| RenderableDocument is a typed intermediate representation | RenderableDocument contains a title, an ordered array of SectionBlock elements, and an optional record of additional files. Each SectionBlock is a discriminated union: heading, paragraph, table, code, list, separator, or metaRow. The renderer consumes this IR without needing to know which codec produced it. | A typed IR decouples codecs from rendering. Codecs express intent ("this is a table with these rows") and the renderer handles syntax ("pipe-delimited markdown with separator row"). This means switching output format (e.g., HTML instead of markdown) requires only a new renderer, not changes to every codec. |
|
|
304
|
+
| CompositeCodec assembles documents from child codecs | CompositeCodec accepts an array of child codecs and produces a single RenderableDocument by concatenating their sections. Child codec order determines section order in the output. Separators are inserted between children by default. | Reference documents combine content from multiple domains (patterns, conventions, shapes, diagrams). Rather than building a monolithic codec that knows about all content types, CompositeCodec lets each domain own its codec and composes them declaratively. |
|
|
305
|
+
| ADR content comes from both Feature description and Rule prefixes | ADR structured content (Context, Decision, Consequences) can appear in two locations within a feature file. Both sources must be rendered. Silently dropping either source causes content loss. | Early ADRs used name prefixes like "Context - ..." and "Decision - ..." on Rule blocks to structure content. Later ADRs placed Context, Decision, and Consequences as bold-annotated prose in the Feature description, reserving Rule: blocks for invariants and design rules. Both conventions are valid. The ADR codec must handle both because the codebase contains ADRs authored in each style. The Feature description lives in pattern.directive.description. If the codec only renders Rules (via partitionRulesByPrefix), then Feature description content is silently dropped -- no error, no warning. This caused confusion across two repos where ADR content appeared in the feature file but was missing from generated docs. The fix renders pattern.directive.description in buildSingleAdrDocument between the Overview metadata table and the partitioned Rules section, using renderFeatureDescription() which walks content linearly and handles prose, tables, and DocStrings with correct interleaving. |
|
|
306
|
+
| The markdown renderer is codec-agnostic | The renderer accepts any RenderableDocument regardless of which codec produced it. Rendering depends only on block types, not on document origin. This enables testing codecs and renderers independently. | If the renderer knew about specific codecs, adding a new codec would require renderer changes. By operating purely on the SectionBlock discriminated union, the renderer is closed for modification but open for extension via new block types. |
|
|
307
|
+
|
|
308
|
+
### ADR 006 Single Read Model Architecture
|
|
309
|
+
|
|
310
|
+
| Rule | Invariant | Rationale |
|
|
311
|
+
| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
312
|
+
| All feature consumers query the read model, not raw state | Code that needs pattern relationships, status groupings, cross-source resolution, or dependency information consumes the MasterDataset. Direct scanner/extractor imports are permitted only in pipeline orchestration code that builds the MasterDataset. | Bypassing the read model forces consumers to re-derive data that the MasterDataset already computes, creating duplicate logic and divergent behavior when the pipeline evolves. |
|
|
313
|
+
| No lossy local types | Consumers do not define local DTOs that duplicate and discard fields from ExtractedPattern. If a consumer needs a subset, the type system provides the projection — not a hand-written extraction function that becomes a barrier between the consumer and canonical data. | Lossy local types silently drop fields that later become needed, causing bugs that only surface when new MasterDataset capabilities are added and the local type lacks them. |
|
|
314
|
+
| Relationship resolution is computed once | Forward relationships (uses, dependsOn, implementsPatterns) and reverse lookups (usedBy, implementedBy, extendedBy) are computed in `transformToMasterDataset()`. No consumer re-derives these from raw pattern arrays or scanned file tags. | Re-deriving relationships in consumers duplicates the resolution logic and risks inconsistency when different consumers implement subtly different traversal or filtering rules. |
|
|
315
|
+
| Three named anti-patterns | These are recognized violations, serving as review criteria for new code and refactoring targets for existing code. | Without named anti-patterns, violations appear as one-off style issues rather than systematic architectural drift, making them harder to detect and communicate in code review. |
|
|
316
|
+
|
|
317
|
+
### Arch Generator Registration
|
|
318
|
+
|
|
319
|
+
| Rule | Invariant | Rationale |
|
|
320
|
+
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
321
|
+
| Architecture generator is registered in the registry | The generator registry must contain an "architecture" generator entry available for CLI invocation. | Without a registered entry, the CLI cannot discover or invoke architecture diagram generation. |
|
|
322
|
+
| Architecture generator produces component diagram by default | Running the architecture generator without diagram type options must produce a component diagram with bounded context subgraphs. | A sensible default prevents users from needing to specify options for the most common use case. |
|
|
323
|
+
| Architecture generator supports diagram type options | The architecture generator must accept a diagram type option that selects between component and layered diagram output. | Different architectural perspectives (bounded context vs. layer hierarchy) require different diagram types, and the user must be able to select which to generate. |
|
|
324
|
+
| Architecture generator supports context filtering | When context filtering is applied, the generated diagram must include only patterns from the specified bounded contexts and exclude all others. | Without filtering, large monorepos would produce unreadable diagrams with dozens of bounded contexts; filtering enables focused per-context views. |
|
|
325
|
+
|
|
326
|
+
### Arch Index Dataset
|
|
327
|
+
|
|
328
|
+
| Rule | Invariant | Rationale |
|
|
329
|
+
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
330
|
+
| archIndex groups patterns by arch-role | Every pattern with an arch-role tag must appear in the archIndex.byRole map under its role key. | Diagram generators need O(1) lookup of patterns by role to render role-based groupings efficiently. |
|
|
331
|
+
| archIndex groups patterns by arch-context | Every pattern with an arch-context tag must appear in the archIndex.byContext map under its context key. | Component diagrams render bounded context subgraphs and need patterns grouped by context. |
|
|
332
|
+
| archIndex groups patterns by arch-layer | Every pattern with an arch-layer tag must appear in the archIndex.byLayer map under its layer key. | Layered diagrams render layer subgraphs and need patterns grouped by architectural layer. |
|
|
333
|
+
| archIndex.all contains all patterns with any arch tag | archIndex.all must contain exactly the set of patterns that have at least one arch tag (role, context, or layer). | Consumers iterating over all architectural patterns need a single canonical list; omitting partially-tagged patterns would silently drop them from diagrams. |
|
|
334
|
+
| Patterns without arch tags are excluded from archIndex | Patterns lacking all three arch tags (role, context, layer) must not appear in any archIndex view. | Including non-architectural patterns would pollute diagrams with irrelevant components. |
|
|
335
|
+
|
|
336
|
+
### Architecture Diagram Advanced
|
|
337
|
+
|
|
338
|
+
| Rule | Invariant | Rationale |
|
|
339
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
340
|
+
| Layered diagrams group patterns by architectural layer | Layered diagrams must render patterns grouped by architectural layer (domain, application, infrastructure) with top-to-bottom flow. | Layered architecture visualization shows dependency direction - domain at top, infrastructure at bottom - following conventional layer ordering. |
|
|
341
|
+
| Architecture generator is registered with generator registry | An "architecture" generator must be registered with the generator registry to enable `pnpm docs:architecture` via the existing `generate-docs.js` CLI. | The Architect uses a generator registry pattern. New generators register with the orchestrator rather than creating separate CLI commands. |
|
|
342
|
+
| Sequence diagrams render interaction flows | Sequence diagrams must render interaction flows (command flow, saga flow) showing step-by-step message passing between components. | Component diagrams show structure but not behavior. Sequence diagrams show runtime flow - essential for understanding command/saga execution. |
|
|
343
|
+
|
|
344
|
+
### Architecture Diagram Core
|
|
345
|
+
|
|
346
|
+
| Rule | Invariant | Rationale |
|
|
347
|
+
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
348
|
+
| Architecture tags exist in the tag registry | Three architecture-specific tags (`arch-role`, `arch-context`, `arch-layer`) must exist in the tag registry with correct format and enum values. | Architecture diagram generation requires metadata to classify source files into diagram components. Standard tag infrastructure enables consistent extraction via the existing AST parser. |
|
|
349
|
+
| AST parser extracts architecture tags from TypeScript | The AST parser must extract `arch-role`, `arch-context`, and `arch-layer` tags from TypeScript JSDoc comments into DocDirective objects. | Source code annotations are the single source of truth for architectural metadata. Parser must extract them alongside existing pattern metadata. |
|
|
350
|
+
| MasterDataset builds archIndex during transformation | The `transformToMasterDataset` function must build an `archIndex` that groups patterns by role, context, and layer for efficient diagram generation. | Single-pass extraction during dataset transformation avoids expensive re-traversal. Index structure enables O(1) lookup by each dimension. |
|
|
351
|
+
| Component diagrams group patterns by bounded context | Component diagrams must render patterns as nodes grouped into bounded context subgraphs, with relationship arrows using UML-inspired styles. | Component diagrams visualize system architecture showing how bounded contexts isolate components. Subgraphs enforce visual separation. |
|
|
352
|
+
|
|
353
|
+
### Architecture Doc Refactoring
|
|
354
|
+
|
|
355
|
+
| Rule | Invariant | Rationale |
|
|
356
|
+
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
357
|
+
| Convention-tagged JSDoc produces machine-extractable codec documentation | Every codec source file annotated with `@architect-convention<br> codec-registry` must have structured JSDoc following the machine-extractable format. The convention extractor splits multi-codec files by `## Heading` into separate convention rules, each rendered as its own section in the generated reference document. | DD-1: Convention tag approach over dedicated codec. Rather than creating a new "codec inventory" codec that enumerates codecs from source, the existing convention-tag mechanism is reused. Each codec file's JSDoc is treated as convention rules tagged with `codec-registry`. This avoids new codec infrastructure and leverages the proven convention extractor path. The reference codec already handles 4-layer composition, so convention tags slot into the existing Layer 1 (conventions) position. |
|
|
358
|
+
| Machine-extractable JSDoc format follows structured heading convention | DD-2: Multi-codec JSDoc splitting uses one `## Heading` per codec per file. Each heading block contains structured fields in a fixed order: `**Purpose:**` one-liner, `**Output Files:**` file paths, options table with Type/Default/Description columns, `**When to Use:**` bullet list, and `**Factory Pattern:**` code example. Fields are optional -- codecs without options omit the table, codecs without factory patterns omit the code block. | The convention extractor uses `## ` heading regex to split descriptions into rules. Without this structure, a file like `session.ts` (3 codecs) would produce a single undifferentiated blob. The heading text becomes the convention rule title in the generated reference. The fixed field order ensures consistent rendering across all 20+ codec entries. |
|
|
359
|
+
| Heading match in convention extractor handles whitespace correctly | The convention extractor's heading parser uses `matchEnd` (the character position after the full regex match) rather than `indexOf('\n',<br> heading.index)` to calculate where content starts after a heading. This prevents the `\s*` prefix in the heading regex from consuming leading newlines, which would cause `heading.index` to point to those newlines instead of the heading text. | Discovered during Phase 2 implementation. The heading regex `/^\s*##\s+(.+)$/gm` matches headings with optional leading whitespace. When a heading has leading newlines, `heading.index` points to the first newline (part of the `\s*` match), not the `##` character. Using `indexOf('\n', heading.index)` then finds the newline BEFORE the heading, producing content that includes the heading text itself. The fix uses the regex match's end position directly. |
|
|
360
|
+
| Section disposition follows content-type routing | DD-3: Each ARCHITECTURE.md section is routed based on content type. Three routing strategies apply: (1) product area absorption -- sections describing a specific pipeline stage move to the corresponding product area document where they get live diagrams and relationship graphs; (2) generated shapes -- sections documenting TypeScript interfaces move to generated shape reference docs; (3) generated diagrams -- ASCII/text data flow diagrams are replaced by live Mermaid diagrams generated from architecture annotations. | The routing heuristic is: if a generated equivalent already exists, replace with pointer; if content is convention-taggable in source files, tag and generate; if editorial content that cannot be expressed as annotations, retain. This ensures each section lands in the location with the best maintenance model for its content type. |
|
|
361
|
+
| Product area absorption validates content coverage before pointer replacement | DD-4: Product area absorption replaces ARCHITECTURE.md sections with pointers only when the target product area document already covers the equivalent content. Three sections route to product areas: Configuration Architecture (L70-139) to CONFIGURATION.md, Source Systems (L585-692) to ANNOTATION.md, and Workflow Integration (L959-1068) to PROCESS.md. Annotation format examples from Source Systems merge into the Four-Stage Pipeline retained section rather than being lost. Workflow API code examples are dropped -- Claude reads source files directly. | Product area documents are generated from annotated source code and already contain live diagrams, relationship graphs, and API types. Absorbing manual Architecture sections into these generated docs eliminates drift while preserving the content in a maintained location. The key test is: does the product area doc cover the same technical facts? If yes, the manual section becomes a 4-line pointer. |
|
|
362
|
+
| MasterDataset shapes generate a dedicated ARCHITECTURE-TYPES reference document | DD-6: A new ReferenceDocConfig produces ARCHITECTURE-TYPES.md using shapeSelectors with group master-dataset to extract MasterDataset schema types, RuntimeMasterDataset, RawDataset, PipelineOptions, and PipelineResult. Source files tagged with @architect-shape master-dataset and @architect-include master-dataset contribute shapes to the reference doc. The Unified Transformation section (L345-478) is replaced with a condensed narrative (~15 lines) and pointer to ARCHITECTURE-TYPES.md. | The MasterDataset is the central data structure -- the sole read model per ADR-006. It deserves dedicated reference doc treatment alongside ARCHITECTURE-CODECS.md. Shape extraction from TypeScript declarations provides exact type signatures that stay in sync with code, unlike the manual schema table in ARCHITECTURE.md. |
|
|
363
|
+
| Pipeline architecture convention content replaces ASCII data flow diagrams | DD-7: The Data Flow Diagrams section (L774-957) contains 4 ASCII diagrams totaling ~183 lines. These are replaced using a hybrid approach: convention tag pipeline-architecture (already registered, currently unused) on orchestrator.ts and build-pipeline.ts produces prose descriptions of pipeline steps and consumer architecture. A new master-dataset-views hardcoded diagram source generates a Mermaid fan-out diagram showing dataset view relationships. DD-8: Both convention content and diagram source are configured on the ARCHITECTURE-TYPES.md ReferenceDocConfig, keeping all architecture reference content in one generated document. | ASCII diagrams cannot be generated from code annotations. The hybrid approach maximizes generated coverage: convention-tagged JSDoc captures the narrative (pipeline steps, ADR-006 consumer pattern) while the hardcoded diagram source produces visual Mermaid output. Using the already-registered pipeline-architecture convention tag avoids new taxonomy entries. |
|
|
364
|
+
| Usefulness-driven editorial trimming targets Claude as primary consumer | DD-9: ARCHITECTURE.md serves Claude (primary audience) and human developers (secondary). Content retained must answer architectural "why" and "how things connect" questions. Content available via source file reads or generated reference documents is removed. Post-decomposition target: ~320 lines (~75% reduction from 1,287 lines). Sections dropped entirely: Programmatic Usage (L1070-1125) and Extending the System (L1127-1194) -- Claude reads source files directly and infers extension patterns from existing codec implementations. DD-5: Key Design Patterns section (L693-772) trimmed from ~80 to ~15 lines: Result Monad becomes a pointer to CORE-TYPES.md, Schema-First Validation becomes a 3-line summary with source pointer, Tag Registry becomes a 4-line summary with source pointer. | Claude has direct access to source files and generated reference docs. Duplicating this content in ARCHITECTURE.md wastes context window tokens. The remaining editorial sections (Executive Summary, Four-Stage Pipeline, Codec Architecture, Progressive Disclosure) provide the mental model and architectural "why" that cannot be inferred from code alone. |
|
|
365
|
+
|
|
366
|
+
### Architecture Doc Refactoring Testing
|
|
367
|
+
|
|
368
|
+
| Rule | Invariant | Rationale |
|
|
369
|
+
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
370
|
+
| Product area sections coexist with generated documents | Each architecture section in docs/ARCHITECTURE.md has a corresponding generated document in docs-live/product-areas/ covering equivalent content from annotated sources. | Manual and generated docs must coexist during the transition period. Generated docs prove that annotated sources produce equivalent coverage before manual sections are deprecated. |
|
|
371
|
+
| Four-Stage Pipeline section retains annotation format examples | The Four-Stage Pipeline section contains annotation format examples (e.g., @architect-shape, extract-shapes) and appears before the Source Systems section in document order. | Annotation format examples in the pipeline section demonstrate the source-first architecture. Their ordering establishes the conceptual flow: pipeline stages first, then the source systems that feed them. |
|
|
372
|
+
| Convention extraction produces ARCHITECTURE-CODECS reference document | The ARCHITECTURE-CODECS.md reference document is generated from convention-tagged JSDoc in codec source files and contains structured sections for each codec with output file references. | Codec documentation must stay synchronized with source code. Convention extraction from JSDoc ensures the reference document reflects actual codec implementations rather than manually maintained descriptions that drift. |
|
|
373
|
+
| Full sections coexist with generated equivalents in docs-live | Major sections of ARCHITECTURE.md (Unified Transformation, Data Flow Diagrams, Quick Reference) are retained alongside their generated equivalents in docs-live/reference/. | Generated reference documents (ARCHITECTURE-TYPES.md, ARCHITECTURE-CODECS.md) provide exhaustive type and codec listings, but the manual sections offer architectural narrative and design rationale that generated docs cannot yet replicate. |
|
|
374
|
+
| MasterDataset shapes appear in ARCHITECTURE-TYPES reference | The ARCHITECTURE-TYPES.md reference document contains core MasterDataset types (MasterDataset, RuntimeMasterDataset, RawDataset) and pipeline types (PipelineOptions, PipelineResult) extracted from shape annotations. | Type shapes are the structural backbone of the pipeline. Generating their documentation from annotations ensures the reference always matches the actual TypeScript interfaces, eliminating manual drift. |
|
|
375
|
+
| Pipeline architecture convention appears in generated reference | Source files in the pipeline layer (orchestrator.ts, build-pipeline.ts) carry the pipeline-architecture convention tag, enabling convention extraction into the ARCHITECTURE-TYPES reference document. | Convention tags on pipeline source files are the mechanism that feeds content into generated reference docs. Without these tags, the architecture reference would have no source material to extract. |
|
|
376
|
+
| Full ARCHITECTURE.md retains all sections with substantial content | ARCHITECTURE.md retains all major sections (Programmatic Usage, Extending the System, Key Design Patterns) with substantial content and remains under 1700 lines as a comprehensive reference. | These sections contain editorial content (usage examples, extension guides, design pattern explanations) that cannot be generated from annotations. They remain manual until procedural guide codecs can replicate their depth. |
|
|
377
|
+
|
|
378
|
+
### Arch Tag Extraction
|
|
379
|
+
|
|
380
|
+
| Rule | Invariant | Rationale |
|
|
381
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
382
|
+
| arch-role tag is defined in the registry | The tag registry must contain an arch-role tag with enum format and all valid architectural role values. | Without a registry-defined arch-role tag, the extractor cannot validate role values and diagrams may render invalid roles. |
|
|
383
|
+
| arch-context tag is defined in the registry | The tag registry must contain an arch-context tag with value format for free-form bounded context names. | Without a registry-defined arch-context tag, bounded context groupings cannot be validated and diagrams may contain arbitrary context names. |
|
|
384
|
+
| arch-layer tag is defined in the registry | The tag registry must contain an arch-layer tag with enum format and exactly three values: domain, application, infrastructure. | Allowing arbitrary layer values would break the fixed Clean Architecture ordering that layered diagrams depend on. |
|
|
385
|
+
| AST parser extracts arch-role from TypeScript annotations | The AST parser must extract the arch-role value from JSDoc annotations and populate the directive's archRole field. | If arch-role is not extracted, patterns cannot be classified by architectural role and diagram node styling is lost. |
|
|
386
|
+
| AST parser extracts arch-context from TypeScript annotations | The AST parser must extract the arch-context value from JSDoc annotations and populate the directive's archContext field. | If arch-context is not extracted, component diagrams cannot group patterns into bounded context subgraphs. |
|
|
387
|
+
| AST parser extracts arch-layer from TypeScript annotations | The AST parser must extract the arch-layer value from JSDoc annotations and populate the directive's archLayer field. | If arch-layer is not extracted, layered diagrams cannot group patterns into domain/application/infrastructure subgraphs. |
|
|
388
|
+
| AST parser handles multiple arch tags together | When a JSDoc block contains arch-role, arch-context, and arch-layer tags, all three must be extracted into the directive. | Partial extraction would cause components to be missing from role, context, or layer groupings depending on which tag was dropped. |
|
|
389
|
+
| Missing arch tags yield undefined values | Arch tag fields absent from a JSDoc block must be undefined in the extracted directive, not null or empty string. | Downstream consumers distinguish between "not annotated" (undefined) and "annotated with empty value" to avoid rendering ghost nodes. |
|
|
390
|
+
|
|
391
|
+
### Business Rules Document Codec
|
|
392
|
+
|
|
393
|
+
| Rule | Invariant | Rationale |
|
|
394
|
+
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
395
|
+
| Extracts Rule blocks with Invariant and Rationale | Annotated Rule blocks must have their Invariant, Rationale, and Verified-by fields faithfully extracted and rendered. | These structured annotations are the primary content of business rules documentation; losing them silently produces incomplete output. |
|
|
396
|
+
| Organizes rules by product area and phase | Rules must be grouped by product area and ordered by phase number within each group. | Ungrouped or misordered rules make it impossible to find domain-specific constraints or understand their delivery sequence. |
|
|
397
|
+
| Summary mode generates compact output | Summary mode must produce only a statistics line and omit all detailed rule headings and content. | AI context windows have strict token limits; including full detail in summary mode wastes context budget and degrades session quality. |
|
|
398
|
+
| Preserves code examples and tables in detailed mode | Code examples must appear only in detailed mode and must be excluded from standard mode output. | Code blocks in standard mode clutter the overview and push important rule summaries out of view; detailed mode is the opt-in path for full content. |
|
|
399
|
+
| Generates scenario traceability links | Verification links must include the source file path so readers can locate the verifying scenario. | Links without file paths are unresolvable, breaking the traceability chain between business rules and their executable specifications. |
|
|
400
|
+
| Progressive disclosure generates detail files per product area | Each product area with rules must produce a separate detail file, and the main document must link to all detail files via an index table. | A single monolithic document becomes unnavigable at scale; progressive disclosure lets readers drill into only the product area they need. |
|
|
401
|
+
| Empty rules show placeholder instead of blank content | Rules with no invariant, description, or scenarios must render a placeholder message; rules with scenarios but no invariant must show the verified-by list instead. | Blank rule sections are indistinguishable from rendering bugs; explicit placeholders signal intentional incompleteness versus broken extraction. |
|
|
402
|
+
| Rules always render flat for full visibility | Rule output must never use collapsible blocks regardless of rule count; all rule headings must be directly visible. | Business rules are compliance-critical content; hiding them behind collapsible sections risks rules being overlooked during review. |
|
|
403
|
+
| Source file shown as filename text | Source file references must render as plain filename text, not as markdown links. | Markdown links to local file paths break in every viewer except the local filesystem, producing dead links that erode trust in the documentation. |
|
|
404
|
+
| Verified-by renders as checkbox list at standard level | Verified-by must render as a checkbox list of scenario names, with duplicate names deduplicated. | Duplicate entries inflate the checklist and mislead reviewers into thinking more verification exists than actually does. |
|
|
405
|
+
| Feature names are humanized from camelCase pattern names | CamelCase pattern names must be converted to space-separated headings with trailing "Testing" suffixes stripped. | Raw camelCase names are unreadable in documentation headings, and "Testing" suffixes leak implementation concerns into user-facing output. |
|
|
406
|
+
|
|
407
|
+
### Business Rules Generator
|
|
408
|
+
|
|
409
|
+
| Rule | Invariant | Rationale |
|
|
410
|
+
| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
411
|
+
| Extracts Rule blocks with Invariant and Rationale | Every `Rule:` block with `**Invariant:**` annotation must be extracted. Rules without annotations are included with rule name only. | Business rules are the core domain constraints. Extracting them separately from acceptance criteria creates a focused reference document for domain understanding. |
|
|
412
|
+
| Organizes rules by domain category and phase | Rules are grouped first by domain category (from `@architect-*` flags), then by phase number for temporal ordering. | Domain-organized documentation helps stakeholders find rules relevant to their area of concern without scanning all rules. |
|
|
413
|
+
| Preserves code examples and comparison tables | DocStrings (`"""typescript`) and tables in Rule descriptions are rendered in the business rules document. | Code examples and tables provide concrete understanding of abstract rules. Removing them loses critical context. |
|
|
414
|
+
| Generates scenario traceability links | Each rule's `**Verified by:**` section generates links to the scenarios that verify the rule. | Traceability enables audit compliance and helps developers find relevant tests when modifying rules. |
|
|
415
|
+
|
|
416
|
+
### Claude Module Generation
|
|
417
|
+
|
|
418
|
+
| Rule | Invariant | Rationale |
|
|
419
|
+
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
420
|
+
| Claude module tags exist in the tag registry | Three claude-specific tags (`claude-module`, `claude-section`, `claude-tags`) must exist in the tag registry with correct format and values. | Module generation requires metadata to determine output path, section placement, and variation filtering. Standard tag infrastructure enables consistent extraction via the existing Gherkin parser. |
|
|
421
|
+
| Gherkin parser extracts claude module tags from feature files | The Gherkin extractor must extract `claude-module`, `claude-section`, and `claude-tags` from feature file tags into ExtractedPattern objects. | Behavior specs are the source of truth for CLAUDE.md module content. Parser must extract module metadata alongside existing pattern metadata. |
|
|
422
|
+
| Module content is extracted from feature file structure | The codec extracts content from Rule blocks and Scenario Outline Examples only. Feature descriptions (Problem/Solution preamble) are skipped because they contain meta-documentation about why the spec exists, not operational content for AI sessions. | Behavior specs contain well-structured, prescriptive content in Rule blocks. Feature descriptions waste context in compact AI modules — the invariants and rationale in Rule blocks are the actionable content. |
|
|
423
|
+
| ClaudeModuleCodec produces compact markdown modules | The codec transforms patterns with claude tags into markdown files suitable for the `_claude-md/` directory structure. | CLAUDE.md modules must be compact and actionable. The codec produces ready-to-use markdown without truncation (let modular-claude-md handle token budget warnings). |
|
|
424
|
+
| Claude module generator writes files to correct locations | The generator must write module files to `{outputDir}/{section}/{module}.md` based on the `claude-section` and `claude-module` tags. | Output path structure must match modular-claude-md expectations. The `claude-section` determines the subdirectory, `claude-module` determines filename. |
|
|
425
|
+
| Claude module generator is registered with generator registry | A "claude-modules" generator must be registered with the generator registry to enable `pnpm docs:claude-modules` via the existing CLI. | Consistent with architecture-diagram-generation pattern. New generators register with the orchestrator rather than creating separate commands. |
|
|
426
|
+
| Same source generates detailed docs with progressive disclosure | When running with `detailLevel: "detailed"`, the codec produces expanded documentation including all Rule content, code examples, and scenario details. | Single source generates both compact modules (AI context) and detailed docs (human reference). Progressive disclosure is already a codec capability. |
|
|
427
|
+
|
|
428
|
+
### Cli Recipe Codec
|
|
429
|
+
|
|
430
|
+
| Rule | Invariant | Rationale |
|
|
431
|
+
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
432
|
+
| CLI recipes are a separate generator from reference tables | The `CliRecipeGenerator` is a standalone sibling to `ProcessApiReferenceGenerator`, not an extension of it. Both implement `DocumentGenerator`, both consume `CLI_SCHEMA` directly, and both produce independent `OutputFile[]` via the standard orchestrator write path. The recipe generator produces `docs-live/reference/PROCESS-API-RECIPES.md` while the reference generator produces `docs-live/reference/PROCESS-API-REFERENCE.md`. | Reference tables and recipe guides serve different audiences and change at different cadences. Reference tables change when CLI flags are added or removed. Recipes change when workflow recommendations evolve. Coupling them in one generator would force both to change together and make the generator responsible for two distinct content types. ProcessApiReferenceGenerator is already completed and tested (Phase 43) -- extending it risks regressions. Two small standalone generators are easier to test and maintain than one large one. |
|
|
433
|
+
| Recipe content uses a structured schema extension | `CLI_SCHEMA` is extended with a `recipes` field containing `RecipeGroup[]`. Each `RecipeGroup` has a title, optional description, and an array of `RecipeExample` objects. Each `RecipeExample` has a title, a purpose description, an array of RecipeStep entries (each with a command string and optional comment), and an optional expected output block. The schema extension is additive -- existing `CLIOptionGroup` types are unchanged. | Recipes are multi-command sequences ("run these 3 commands in order") with explanatory context. They do not fit into `CLIOptionGroup` which models individual flags. A separate `RecipeGroup[]` keeps the schema type-safe and makes recipes independently testable. Static expected output strings in the schema are deterministic -- no build-time CLI execution needed. |
|
|
434
|
+
| Narrative prose uses preamble mechanism | Editorial content that cannot be derived from the CLI schema -- specifically "Why Use This" motivational prose, the Quick Start example with output, and the session type decision tree -- uses a preamble mechanism in the generator configuration. Preamble content is manually authored in `architect.config.ts` as structured section data and appears before all generated recipe content in the output file. | The "Why Use This" section explains the value proposition of the Data API CLI with a comparison table (CLI vs reading markdown). This is editorial judgment, not derivable from command metadata. The Quick Start shows a specific 3-command workflow with example terminal output. The session decision tree maps cognitive states ("Starting to code?") to session types. None of these have a source annotation -- they are instructional content authored for human understanding. The preamble mechanism exists precisely for this (proven by DocsConsolidationStrategy Phase 2 preamble implementation). |
|
|
435
|
+
| Generated recipe file complements manual PROCESS-API.md | After this pattern completes, `docs/PROCESS-API.md` is trimmed to a slim editorial introduction (~30 lines) containing the document title, a one-paragraph purpose statement, and links to both generated files: `docs-live/reference/PROCESS-API-REFERENCE.md` (option tables from Phase 43) and `docs-live/reference/PROCESS-API-RECIPES.md` (recipes and narratives from this pattern). The manual file retains the JSON Envelope, Exit Codes, and JSON Piping sections (~40 lines) which are operational reference unlikely to drift. All other prose sections are replaced by the generated recipe file. | Phase 43 established the hybrid pattern: keep editorial prose in the manual file, extract derivable content to generated files. This pattern extends the hybrid by recognizing that recipe content IS derivable from a structured schema. The ~460 lines of command descriptions, example output, and recipe blocks can be maintained as schema data rather than freeform markdown. What remains in the manual file (~70 lines total) is true operational reference (JSON envelope format, exit codes, piping tips) that changes rarely and has no schema source. |
|
|
436
|
+
| Command narrative descriptions are sourced from schema metadata | Each command group in the generated recipe file includes a narrative description sourced from the CLI schema, not hardcoded in the generator. The existing `CLIOptionGroup.description` and `CLIOptionGroup.postNote` fields carry per-group narrative text. For command groups not currently in CLI_SCHEMA (Session Workflow Commands, Pattern Discovery, Architecture Queries, Metadata and Inventory), new `CommandGroup` entries are added to the schema with title, description, and per-command narrative metadata. | The manual PROCESS-API.md contains narrative descriptions for each command ("Highest-impact command. Pre-flight readiness check that prevents wasted sessions.") that are valuable developer context. Hardcoding these in the generator would create a second maintenance location. Placing them in CLI_SCHEMA co-locates command metadata (what the command does) with command definition (what flags it accepts), following the same single-source-of-truth principle that drove Phase 43. |
|
|
437
|
+
|
|
438
|
+
### Codec Based Generator Testing
|
|
439
|
+
|
|
440
|
+
| Rule | Invariant | Rationale |
|
|
441
|
+
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
442
|
+
| CodecBasedGenerator adapts codecs to generator interface | CodecBasedGenerator delegates document generation to the underlying codec and surfaces codec errors through the generator interface. | The adapter pattern enables codec-based rendering to integrate with the existing orchestrator without modifying either side. |
|
|
443
|
+
|
|
444
|
+
### Codec Behavior Testing
|
|
445
|
+
|
|
446
|
+
| Rule | Invariant | Rationale |
|
|
447
|
+
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
448
|
+
| Timeline codecs group patterns by phase and status | Roadmap shows planned work, Milestones shows completed work, CurrentWork shows active patterns only. | Mixing statuses across timeline views would bury actionable information and make it impossible to distinguish planned from delivered work. |
|
|
449
|
+
| Session codecs provide working context for AI sessions | SessionContext shows active patterns with deliverables. RemainingWork aggregates incomplete work by phase. | AI sessions without curated context waste tokens on irrelevant patterns, and unaggregated remaining work obscures project health. |
|
|
450
|
+
| Requirements codec produces PRD-style documentation | Features include problem, solution, business value. Acceptance criteria are formatted with bold keywords. | Omitting problem/solution context produces specs that lack justification, and unformatted acceptance criteria are difficult to scan. |
|
|
451
|
+
| Reporting codecs support release management and auditing | Changelog follows Keep a Changelog format. Traceability maps rules to scenarios. | Non-standard changelog formats break tooling that parses release notes, and unmapped rules represent unverified business constraints. |
|
|
452
|
+
| Planning codecs support implementation sessions | Planning checklist includes DoD items. Session plan shows implementation steps. | Missing DoD items in checklists allow incomplete patterns to pass validation, and sessions without implementation steps lose focus. |
|
|
453
|
+
|
|
454
|
+
### Codec Driven Reference Generation
|
|
455
|
+
|
|
456
|
+
| Rule | Invariant | Rationale |
|
|
457
|
+
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
458
|
+
| Config-driven codec replaces per-document recipe features | A single `ReferenceDocConfig` object is sufficient to produce a complete reference document. No per-document codec subclass or recipe feature is required. | The codec composition logic is identical across all reference documents. Only the content sources differ. Extracting this into a config-driven factory eliminates N duplicated recipe features and makes adding new documents a one-line config addition. |
|
|
459
|
+
| Four content sources compose in AD-5 order | Reference documents always compose content in this order: conventions, then scoped diagrams, then shapes, then behaviors. Empty sources are omitted without placeholder sections. | AD-5 established that conceptual context (conventions and architectural diagrams) should precede implementation details (shapes and behaviors). This reading order helps developers understand the "why" before the "what". |
|
|
460
|
+
| Detail level controls output density | Three detail levels produce progressively more content from the same config. Summary: type tables only, no diagrams, no narrative. Standard: narrative and code examples, no rationale. Detailed: full rationale, property documentation, and scoped diagrams. | AI context windows need compact summaries. Human readers need full documentation. The same config serves both audiences by parameterizing the detail level at generation time. |
|
|
461
|
+
| Generator registration produces paired detailed and summary outputs | Each ReferenceDocConfig produces exactly two generators (detailed for `docs/`, summary for `_claude-md/`) plus a meta-generator that invokes all pairs. Total: N configs x 2 + 1 = 2N + 1 generators. | Every reference document needs both a human-readable detailed version and an AI-optimized compact version. The meta-generator enables `pnpm docs:all` to produce every reference document in one pass. |
|
|
462
|
+
|
|
463
|
+
### Component Diagram Generation
|
|
464
|
+
|
|
465
|
+
| Rule | Invariant | Rationale |
|
|
466
|
+
| ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
467
|
+
| Component diagrams group patterns by bounded context | Each distinct arch-context value must produce exactly one Mermaid subgraph containing all patterns with that context. | Without subgraph grouping, the visual relationship between components and their bounded context is lost, making the diagram structurally meaningless. |
|
|
468
|
+
| Context-less patterns go to Shared Infrastructure | Patterns without an arch-context value must be placed in a "Shared Infrastructure" subgraph, never omitted from the diagram. | Cross-cutting infrastructure components (event bus, logger) belong to no bounded context but must still appear in the diagram. |
|
|
469
|
+
| Relationship types render with distinct arrow styles | Each relationship type must render with its designated Mermaid arrow style: uses (-->), depends-on (-.->), implements (..->), extends (-->>). | Distinct arrow styles convey dependency semantics visually; conflating them loses architectural information. |
|
|
470
|
+
| Arrows only connect annotated components | Relationship arrows must only be rendered when both source and target patterns exist in the architecture index. | Rendering an arrow to a non-existent node would produce invalid Mermaid syntax or dangling references. |
|
|
471
|
+
| Component diagram includes summary section | The generated component diagram document must include an Overview section with component count and bounded context count. | Without summary counts, readers cannot quickly assess diagram scope or detect missing components. |
|
|
472
|
+
| Component diagram includes legend when enabled | When the legend is enabled, the document must include a Legend section explaining relationship arrow styles. | Without a legend, readers cannot distinguish uses, depends-on, implements, and extends arrows, making relationship semantics ambiguous. |
|
|
473
|
+
| Component diagram includes inventory table when enabled | When the inventory is enabled, the document must include a Component Inventory table with Component, Context, Role, and Layer columns. | The inventory provides a searchable, text-based alternative to the visual diagram for tooling and accessibility. |
|
|
474
|
+
| Empty architecture data shows guidance message | When no patterns have architecture annotations, the document must display a guidance message explaining how to add arch tags. | An empty diagram with no explanation would be confusing; guidance helps users onboard to the annotation system. |
|
|
475
|
+
|
|
476
|
+
### Composite Codec Testing
|
|
477
|
+
|
|
478
|
+
| Rule | Invariant | Rationale |
|
|
479
|
+
| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
480
|
+
| CompositeCodec concatenates sections in codec array order | Sections from child codecs appear in the composite output in the same order as the codecs array. | Non-deterministic section ordering would make generated documents unstable across runs, breaking diff-based review workflows. |
|
|
481
|
+
| Separators between codec outputs are configurable | By default, a separator block is inserted between each child codec's sections. When separateSections is false, no separators are added. | Without configurable separators, consumers cannot control visual grouping — some documents need clear boundaries between codec outputs while others need seamless flow. |
|
|
482
|
+
| additionalFiles merge with last-wins semantics | additionalFiles from all children are merged into a single record. When keys collide, the later codec's value wins. | Silently dropping colliding keys would lose content without warning, while throwing on collision would prevent composing codecs that intentionally override shared file paths. |
|
|
483
|
+
| composeDocuments works at document level without codecs | composeDocuments accepts RenderableDocument array and produces a composed RenderableDocument without requiring codecs. | Requiring a full codec instance for simple document merging would force unnecessary schema definitions when callers already hold pre-rendered documents. |
|
|
484
|
+
| Empty codec outputs are handled gracefully | Codecs producing empty sections arrays contribute nothing to the output. No separator is emitted for empty outputs. | Emitting separators around empty sections would produce orphaned dividers in the generated markdown, creating visual noise with no content between them. |
|
|
485
|
+
|
|
486
|
+
### Content Deduplication
|
|
487
|
+
|
|
488
|
+
| Rule | Invariant | Rationale |
|
|
489
|
+
| --------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
490
|
+
| Duplicate detection uses content fingerprinting | Content with identical normalized text must produce identical fingerprints. | Fingerprinting enables efficient duplicate detection without full text comparison. |
|
|
491
|
+
| Duplicates are merged based on source priority | Higher-priority sources take precedence when merging duplicate content. | TypeScript sources have richer JSDoc; feature files provide behavioral context. |
|
|
492
|
+
| Section order is preserved after deduplication | Section order matches the source mapping table order after deduplication. | Predictable ordering ensures consistent documentation structure. |
|
|
493
|
+
| Deduplicator integrates with source mapper pipeline | Deduplication runs after extraction and before document assembly. | All content must be extracted before duplicates can be identified. |
|
|
494
|
+
|
|
495
|
+
### Convention Extractor Testing
|
|
496
|
+
|
|
497
|
+
| Rule | Invariant | Rationale |
|
|
498
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
499
|
+
| Empty and missing inputs produce empty results | Extraction with no tags or no matching patterns always produces an empty result. | Callers must be able to distinguish "no conventions found" from errors without special-casing nulls or exceptions. |
|
|
500
|
+
| Convention bundles are extracted from matching patterns | Each unique convention tag produces exactly one bundle, and patterns sharing a tag are merged into that bundle. | Without tag-based grouping and merging, convention content would be fragmented across duplicates, making downstream rendering unreliable. |
|
|
501
|
+
| Structured content is extracted from rule descriptions | Invariant, rationale, and table content embedded in rule descriptions must be extracted as structured metadata, not raw text. | Downstream renderers depend on structured fields to produce consistent documentation; unstructured text would require re-parsing at every consumption point. |
|
|
502
|
+
| Code examples in rule descriptions are preserved | Fenced code blocks (including Mermaid diagrams) in rule descriptions must be extracted as typed code examples and never discarded. | Losing code examples during extraction would silently degrade generated documentation, removing diagrams and samples authors intended to publish. |
|
|
503
|
+
| TypeScript JSDoc conventions are extracted alongside Gherkin | TypeScript JSDoc and Gherkin convention sources sharing the same tag must merge into a single bundle with all rules preserved from both sources. | Conventions are defined across both TypeScript and Gherkin; failing to merge them would split a single logical convention into incomplete fragments. |
|
|
504
|
+
|
|
505
|
+
### Cross Cutting Document Inclusion
|
|
506
|
+
|
|
507
|
+
| Rule | Invariant | Rationale |
|
|
508
|
+
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
509
|
+
| Include tag routes content to named documents | A pattern or shape with `architect-include:X` appears in any reference document whose includeTags contains X. The tag is CSV, so `architect-include:X,Y` routes the item to both document X and document Y. This is additive -- the item also appears in any document whose existing selectors (conventionTags, behaviorCategories, shapeSelectors) would already select it. | Content-to-document is a many-to-many relationship. A type definition may be relevant to an architecture overview, a configuration guide, and an AI context section. The include tag expresses this routing at the source, next to the code, without requiring the document configs to enumerate every item by name. |
|
|
510
|
+
| Include tag scopes diagrams (replaces arch-view) | DiagramScope.include matches patterns whose `@architect-include` values contain the specified scope value. This is the same field that existed as archView -- renamed for consistency with the general-purpose include tag. Patterns with `@architect-include:pipeline-stages` appear in any DiagramScope with include: pipeline-stages. | The experimental arch-view tag was diagram-specific routing under a misleading name. Renaming to include unifies the vocabulary: one tag, two consumption points (diagram scoping via DiagramScope.include, content routing via ReferenceDocConfig.includeTags). |
|
|
511
|
+
| Shapes use include tag for document routing | A declaration tagged with both `architect-shape` and `architect-include` has its include values stored on the ExtractedShape. The reference codec uses these values alongside shapeSelectors for shape filtering. A shape with `architect-include:X` appears in any document whose includeTags contains X, regardless of whether the shape matches any shapeSelector. | Shape extraction (via `architect-shape`) and document routing (via `architect-include`) are orthogonal concerns. A shape must be extracted before it can be routed. The shape tag triggers extraction; the include tag controls which documents render it. This separation allows one shape to appear in multiple documents without needing multiple group values. |
|
|
512
|
+
| Conventions use include tag for selective inclusion | A decision record or convention pattern with `architect-include:X` appears in a reference document whose includeTags contains X. This allows selecting a single convention rule for a focused document without pulling all conventions matching a broad conventionTag. | Convention content is currently selected by conventionTags, which pulls all decision records tagged with a given convention value. For showcase documents or focused guides, this is too coarse. The include tag enables cherry-picking individual conventions alongside broad tag-based selection. |
|
|
513
|
+
|
|
514
|
+
### Decision Doc Codec Testing
|
|
515
|
+
|
|
516
|
+
| Rule | Invariant | Rationale |
|
|
517
|
+
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
518
|
+
| Rule blocks are partitioned by semantic prefix | Decision document rules must be partitioned into ADR sections based on their semantic prefix (e.g., "Decision:", "Context:", "Consequence:"), with non-standard rules placed in an "other" category. | Semantic partitioning produces structured ADR output that follows the standard ADR format — unpartitioned rules would generate a flat, unnavigable document. |
|
|
519
|
+
| DocStrings are extracted with language tags | DocStrings within rule descriptions must be extracted preserving their language tag (e.g., typescript, bash), defaulting to "text" when no language is specified. | Language tags enable syntax highlighting in generated markdown code blocks — losing the tag produces unformatted code that is harder to read. |
|
|
520
|
+
| Source mapping tables are parsed from rule descriptions | Markdown tables in rule descriptions with source mapping columns must be parsed into structured data, returning empty arrays when no table is present. | Source mapping tables drive the extraction pipeline — they define which files to read and what content to extract for each decision section. |
|
|
521
|
+
| Self-reference markers are correctly detected | The "THIS DECISION" marker must be recognized as a self-reference to the current decision document, with optional rule name qualifiers parsed correctly. | Self-references enable decisions to extract content from their own rules — misdetecting them would trigger file-system lookups for a non-existent "THIS DECISION" file. |
|
|
522
|
+
| Extraction methods are normalized to known types | Extraction method strings from source mapping tables must be normalized to canonical method names for dispatcher routing. | Users may write extraction methods in various formats (e.g., "Decision rule description", "extract-shapes") — normalization ensures consistent dispatch regardless of formatting. |
|
|
523
|
+
| Complete decision documents are parsed with all content | A complete decision document must be parseable into its constituent parts including rules, DocStrings, source mappings, and self-references in a single parse operation. | Complete parsing validates that all codec features compose correctly — partial parsing could miss interactions between features. |
|
|
524
|
+
| Rules can be found by name with partial matching | Rules must be findable by exact name match or partial (substring) name match, returning undefined when no match exists. | Partial matching supports flexible cross-references between decisions — requiring exact matches would make references brittle to minor naming changes. |
|
|
525
|
+
|
|
526
|
+
### Decision Doc Generator Testing
|
|
527
|
+
|
|
528
|
+
| Rule | Invariant | Rationale |
|
|
529
|
+
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
530
|
+
| Output paths are determined from pattern metadata | Output file paths must be derived from pattern metadata using kebab-case conversion of the pattern name, with configurable section prefixes. | Consistent path derivation ensures generated files are predictable and linkable — ad-hoc paths would break cross-document references. |
|
|
531
|
+
| Compact output includes only essential content | Compact output mode must include only essential decision content (type shapes, key constraints) while excluding full descriptions and verbose sections. | Compact output is designed for AI context windows where token budget is limited — including full descriptions would negate the space savings. |
|
|
532
|
+
| Detailed output includes full content | Detailed output mode must include all decision content including full descriptions, consequences, and DocStrings rendered as code blocks. | Detailed output serves as the complete human reference — omitting any section would force readers to consult source files for the full picture. |
|
|
533
|
+
| Multi-level generation produces both outputs | The generator must produce both compact and detailed output files from a single generation run, using the pattern name or patternName tag as the identifier. | Both output levels serve different audiences (AI vs human) — generating them together ensures consistency and eliminates the risk of one becoming stale. |
|
|
534
|
+
| Generator is registered with the registry | The decision document generator must be registered with the generator registry under a canonical name and must filter input patterns to only those with source mappings. | Registry registration enables discovery via --list-generators — filtering to source-mapped patterns prevents empty output for patterns without decision metadata. |
|
|
535
|
+
| Source mappings are executed during generation | Source mapping tables must be executed during generation to extract content from referenced files, with missing files reported as validation errors. | Source mappings are the bridge between decision specs and implementation — unexecuted mappings produce empty sections, while silent missing-file errors hide broken references. |
|
|
536
|
+
|
|
537
|
+
### Dedent Helper
|
|
538
|
+
|
|
539
|
+
| Rule | Invariant | Rationale |
|
|
540
|
+
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
541
|
+
| Tabs are normalized to spaces before dedent | Tab characters must be converted to spaces before calculating the minimum indentation level. | Mixing tabs and spaces produces incorrect indentation calculations — normalizing first ensures consistent dedent depth. |
|
|
542
|
+
| Empty lines are handled correctly | Empty lines (including lines with only whitespace) must not affect the minimum indentation calculation and must be preserved in output. | Counting whitespace-only lines as indented content would inflate the minimum indentation, causing non-empty lines to retain unwanted leading spaces. |
|
|
543
|
+
| Single line input is handled | Single-line input must have its leading whitespace removed without errors or unexpected transformations. | Failing or returning empty output on single-line input would break callers that extract individual lines from multi-line DocStrings. |
|
|
544
|
+
| Unicode whitespace is handled | Non-breaking spaces and other Unicode whitespace characters must be treated as content, not as indentation to be removed. | Stripping Unicode whitespace as indentation would corrupt intentional formatting in source code and documentation content. |
|
|
545
|
+
| Relative indentation is preserved | After removing the common leading whitespace, the relative indentation between lines must remain unchanged. | Altering relative indentation would break the syntactic structure of extracted code blocks, making them unparseable or semantically incorrect. |
|
|
546
|
+
|
|
547
|
+
### Description Header Normalization
|
|
548
|
+
|
|
549
|
+
| Rule | Invariant | Rationale |
|
|
550
|
+
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
551
|
+
| Leading headers are stripped from pattern descriptions | Markdown headers at the start of a pattern description are removed before rendering to prevent duplicate headings under the Description section. | The codec already emits a "## Description" header; preserving the source header would create a redundant or conflicting heading hierarchy. |
|
|
552
|
+
| Edge cases are handled correctly | Header stripping handles degenerate inputs (header-only, whitespace-only, mid-description headers) without data loss or rendering errors. | Patterns with unusual descriptions (header-only stubs, whitespace padding) are common in early roadmap stages; crashing on these would block documentation generation for the entire dataset. |
|
|
553
|
+
| stripLeadingHeaders removes only leading headers | The helper function strips only headers that appear before any non-header content; headers occurring after body text are preserved. | Mid-description headers are intentional structural elements authored by the user; stripping them would silently destroy document structure. |
|
|
554
|
+
|
|
555
|
+
### Description Quality Foundation
|
|
556
|
+
|
|
557
|
+
| Rule | Invariant | Rationale |
|
|
558
|
+
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
559
|
+
| Behavior files are verified during pattern extraction | Every timeline pattern must report whether its corresponding behavior file exists. | Without verification at extraction time, traceability reports would silently include broken references to non-existent behavior files. |
|
|
560
|
+
| Traceability coverage reports verified and unverified behavior files | Coverage reports must distinguish between patterns with verified behavior files and those without. | Conflating verified and unverified coverage would overstate test confidence, hiding gaps that should be addressed before release. |
|
|
561
|
+
| Pattern names are transformed to human-readable display names | Display names must convert CamelCase to title case, handle consecutive capitals, and respect explicit title overrides. | CamelCase identifiers are unreadable in generated documentation; human-readable names are essential for non-developer consumers of pattern registries. |
|
|
562
|
+
| PRD acceptance criteria are formatted with numbering and bold keywords | PRD output must number acceptance criteria and bold Given/When/Then keywords when steps are enabled. | Unnumbered criteria are difficult to reference in reviews; unformatted step keywords blend into prose, making scenarios harder to parse visually. |
|
|
563
|
+
| Business values are formatted for human readability | Hyphenated business value tags must be converted to space-separated readable text in all output contexts. | Raw hyphenated tags like "enable-rich-prd" are annotation artifacts; displaying them verbatim in generated docs confuses readers expecting natural language. |
|
|
564
|
+
|
|
565
|
+
### Design Review Generation
|
|
566
|
+
|
|
567
|
+
| Rule | Invariant | Rationale |
|
|
568
|
+
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
569
|
+
| SequenceIndex pre-computes ordered steps from rule-level tags | The MasterDataset sequenceIndex contains one entry per pattern that has the `architect-sequence-orchestrator` tag and at least one rule with the `architect-sequence-step` tag. Steps are sorted by stepNumber. Participants are deduplicated and ordered with orchestrator first. | Pre-computing in the transform pass avoids repeated parsing in the codec. ADR-006 mandates the MasterDataset as the sole read model. Downstream consumers (codec, process API) read structured data, not raw tags. |
|
|
570
|
+
| DesignReviewCodec generates sequence diagrams from ordered steps | The sequence diagram contains participants derived from `@architect-sequence-module` tags, Note blocks from Rule names, call arrows from Input/Output markers, and alt blocks from `@architect-sequence-error` scenarios. Participant order follows step order with User and orchestrator first. | Sequence diagrams verify interaction ordering and error handling completeness. Auto-generation ensures diagrams stay synchronized with spec annotations. Manual diagrams drift within days of a spec edit. |
|
|
571
|
+
| DesignReviewCodec generates component diagrams from data flow types | The component diagram groups modules into subgraphs by shared Input type, renders distinct Output types as hexagon nodes with field lists, and draws directed edges showing data flow through the orchestrator. No circular edges exist in the generated diagram. | Component diagrams verify unidirectional data flow and interface completeness. Type hexagon nodes make the central contracts visible, informing stub creation with exact field lists. |
|
|
572
|
+
| Process API exposes sequence data via subcommand | The sequence subcommand with no args lists all patterns with sequence annotations. With a pattern name, it returns the full SequenceIndexEntry including steps, participants, and data flow types. | The Process API is the primary query interface for AI sessions. Exposing sequence data enables design review analysis without regenerating the full document or reading generated markdown. |
|
|
573
|
+
|
|
574
|
+
### Design Review Generation Tests
|
|
575
|
+
|
|
576
|
+
| Rule | Invariant | Rationale |
|
|
577
|
+
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
578
|
+
| SequenceIndex pre-computes ordered steps from annotated rules | buildSequenceIndexEntry produces a SequenceIndexEntry with steps sorted by stepNumber, participants deduplicated with orchestrator first, and data flow types collected from Input/Output annotations. | Pre-computing in the transform pass avoids repeated parsing in the codec. ADR-006 mandates the MasterDataset as the sole read model. |
|
|
579
|
+
| Participants are deduplicated with orchestrator first | The participants array starts with the orchestrator, followed by module names in first-appearance step order, with no duplicates. | Sequence diagram participant declarations must be ordered and unique. The orchestrator is always the first participant as the entry point. |
|
|
580
|
+
| Data flow types are extracted from Input and Output annotations | The dataFlowTypes array contains distinct type names parsed from Input and Output annotation strings using the "TypeName -- fields" format. | Data flow types are used by the component diagram to render hexagon nodes and by the type definitions table to show producers and consumers. |
|
|
581
|
+
| DesignReviewCodec produces sequence diagram with correct participant count | The rendered sequence diagram participant list includes User plus all participants from the SequenceIndexEntry. The count equals 1 (User) plus the number of unique participants. | Correct participant count proves the codec reads SequenceIndex data correctly and maps it to Mermaid syntax. |
|
|
582
|
+
| Error scenarios produce alt blocks in sequence diagrams | Each error scenario name from a step's errorScenarios array produces an alt block in the Mermaid sequence diagram with the scenario name as the condition text. | Alt blocks make error handling visible in the sequence diagram, enabling design review verification of error path completeness. |
|
|
583
|
+
| Component diagram groups modules by shared input type | Contiguous steps sharing the same Input type annotation are grouped into a single subgraph in the component diagram. Non-contiguous steps with the same input become separate subgraphs. | Grouping by input type reveals natural phase boundaries in the orchestration flow, making data flow architecture visible. |
|
|
584
|
+
| Component diagram module nodes are scoped per phase | Repeated modules in non-contiguous phases render with distinct Mermaid node IDs, while repeated use of the same module inside one phase reuses a single declaration. | Mermaid node IDs are global across the diagram. Reusing raw module IDs causes later phases to collapse into earlier declarations and misrepresent the orchestration flow. |
|
|
585
|
+
| Type hexagons show field definitions from Output annotations | Output annotations with the "TypeName -- field1, field2" format produce hexagon nodes in the component diagram containing the type name and field names separated by newlines. | Type hexagons make central data contracts visible, enabling design reviewers to verify interface completeness. |
|
|
586
|
+
| Mermaid-sensitive text is escaped across rendered labels | Participant aliases, subgraph labels, type hexagon text, and edge labels escape Mermaid-sensitive characters such as quotes, pipes, and comment markers before rendering. | Design review diagrams are generated directly from annotations. Valid annotation text must not break Mermaid parsing when rendered into different label positions. |
|
|
587
|
+
| Design questions table includes auto-computed metrics | The Design Questions section contains a table with auto-computed step count, type count, and error path count drawn from the SequenceIndexEntry data. | Auto-computed metrics reduce manual counting during design reviews and highlight coverage gaps (e.g., 0 error paths). |
|
|
588
|
+
| Invalid sequence annotations are skipped with validation warnings | Patterns with ambiguous sequence-step numbering or empty sequence-module tags are excluded from sequenceIndex and reported through malformedPatterns. | Design reviews should never render misleading diagrams from malformed annotations. The transform pass is the correct place to validate and suppress bad sequence entries. |
|
|
589
|
+
| Process API sequence lookup resolves pattern names case-insensitively | The sequence subcommand resolves pattern names with the same case-insensitive matching behavior as other pattern-oriented process-api queries. | Design review consumers should not need exact display-name casing when querying sequence data from the CLI. |
|
|
590
|
+
|
|
591
|
+
### Design Review Generator Lifecycle Tests
|
|
592
|
+
|
|
593
|
+
| Rule | Invariant | Rationale |
|
|
594
|
+
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
595
|
+
| Orphaned design review files are scheduled for deletion | Existing markdown files in design-reviews/ that no longer map to the current sequenceIndex must be returned in filesToDelete, while current patterns remain preserved. | Renaming or removing sequence-annotated patterns otherwise leaves stale design review documents behind, which misleads readers and downstream tooling. |
|
|
596
|
+
|
|
597
|
+
### Doc Generation Proof Of Concept
|
|
598
|
+
|
|
599
|
+
| Rule | Invariant | Rationale |
|
|
600
|
+
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
601
|
+
| Context - Manual documentation maintenance does not scale | Documentation must be generated from annotated source code, never manually maintained as a separate artifact. | Manual documentation drifts from source as the codebase evolves, creating stale references that mislead both humans and AI coding sessions. |
|
|
602
|
+
| Decision - Decisions own convention content and durable context, code owns details | Each content type (intro/rationale, rules/examples, API types) is owned by exactly one source type (decision, behavior spec, or code). | Shared ownership leads to conflicting updates and ambiguous authority over what the "correct" version is. |
|
|
603
|
+
| Proof of Concept - Self-documentation validates the pattern | The documentation generation pattern must be validated by generating documentation about itself from its own annotated sources. | A self-referential proof of concept exposes extraction gaps and source mapping issues that synthetic test data would miss. |
|
|
604
|
+
| Expected Output - Compact claude module structure | Compact output must contain only essential tables and type names, with no JSDoc comments or implementation details. | AI context windows are finite; including non-essential content displaces actionable information and degrades session effectiveness. |
|
|
605
|
+
| Consequences - Durable sources with clear ownership boundaries | Decision documents remain the authoritative source for intro, rationale, and convention content until explicitly superseded. | Without durable ownership, documentation sections lose their authoritative source and degrade into unattributed prose that no one updates. |
|
|
606
|
+
| Consequences - Design stubs live in stubs, not src | Pre-implementation design stubs must reside in `architect/stubs/`, never in `src/`. | Stubs in `src/` require ESLint exceptions, create confusion between production and design code, and risk accidental imports of unimplemented functions. |
|
|
607
|
+
| Decision - Source mapping table parsing and extraction method dispatch | The source mapping table in a decision document defines how documentation sections are assembled from multiple source files. | Without a declarative mapping, generators must hard-code source-to-section relationships, making the system brittle to new document types. |
|
|
608
|
+
|
|
609
|
+
### Docs Consolidation Strategy
|
|
610
|
+
|
|
611
|
+
| Rule | Invariant | Rationale |
|
|
612
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
613
|
+
| Convention tags are the primary consolidation mechanism | Each consolidation phase follows the same pattern: register a convention tag value in `src/taxonomy/conventions.ts`, annotate source files with `@architect-convention` tags using structured JSDoc, add a `ReferenceDocConfig` entry in `architect.config.ts`, and replace the manual doc section with a pointer to the generated reference document. | Convention-tagged annotations are the only sustainable way to keep docs in sync with implementation. The reference codec (`createReferenceCodec`) already handles the 4-layer composition so each phase only needs annotation work and config — no new codec infrastructure required. |
|
|
614
|
+
| Preamble preserves editorial context in generated docs | `ReferenceDocConfig.preamble` accepts `readonly SectionBlock[]` that are prepended before all generated content. Preamble sections appear in both detailed and summary (claude-md) outputs, followed by a separator. A config without preamble produces no extra separator or empty sections. | Not all documentation content can be extracted from code annotations. Introductory prose, cross-cutting context, and reading guides require human authorship. The preamble provides a designated place for this content within the generated document structure, avoiding a separate hand-maintained file. |
|
|
615
|
+
| Each consolidation phase is independently deliverable | Each phase can be implemented and validated independently. A phase is complete when: the manual doc section has been replaced with a pointer to the generated equivalent, `pnpm docs:all` produces the generated output without errors, and the generated content covers the replaced manual content. No phase requires another uncompleted phase to function. | Independent phases allow incremental consolidation without blocking on the full initiative. Each merged PR reduces manual maintenance immediately. Phase ordering in the plan is a suggested sequence (simplest first), not a dependency chain. |
|
|
616
|
+
| Manual docs retain editorial and tutorial content | Documents containing philosophy (METHODOLOGY.md) remain fully manual with no generated equivalent (~238 lines). Documents that were originally manual but now have generated equivalents or have been restructured (SESSION-GUIDES.md, GHERKIN-PATTERNS.md, PROCESS-API.md) retain their editorial content as preamble within generated outputs. PUBLISHING.md was relocated to MAINTAINERS.md at the repository root. | The consolidation targets sections most likely to drift when code changes: reference tables, codec listings, validation rules, API types. Editorial content changes at a different cadence and requires human judgment to update. Forcing this into annotations would produce worse documentation. Documents that transitioned to hybrid generation preserve their editorial voice via preamble while keeping reference content in sync with source annotations. |
|
|
617
|
+
| Audience alignment determines document location | Each document lives in the location matching its primary audience: `docs/` (deployed to libar.dev) for content that serves package users and developers; repo root for GitHub-visible metadata (CONTRIBUTING.md, SECURITY.md, MAINTAINERS.md); CLAUDE.md for AI session context. A document appearing in docs/ must be useful to a developer or user visiting the website — maintainer-only operational procedures (npm publishing workflow, GitHub Actions setup) belong at the repo root. | The audit found PUBLISHING.md (maintainer-only) in docs/ alongside user-facing guides. SESSION-GUIDES.md (AI session procedures) duplicates CLAUDE.md with 95% overlap. Audience mismatches increase website noise for users and create drift risk when the same content lives in two locations. |
|
|
618
|
+
|
|
619
|
+
### Docs Live Consolidation
|
|
620
|
+
|
|
621
|
+
| Rule | Invariant | Rationale |
|
|
622
|
+
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
623
|
+
| docs-live/ is the single directory for website-published content | Every file appearing on `libar.dev` or referenced by CLAUDE.md comes from `docs-live/`. No production reference document is published from `docs-generated/`. The `docs-generated/` directory contains no production reference content after `docs:all` runs. Business-rules, taxonomy, and validation-rules output to `docs-live/` alongside other reference docs. | DD-1: Splitting production output across two directories creates ambiguity about where authoritative content lives. Website configuration, CLAUDE.md path references, and team navigation all benefit from a single source directory. `docs-generated/` name signals "build cache", not "publishable output". |
|
|
624
|
+
| Architecture reference compacts generate under docs-live/\_claude-md/ | Architecture reference summary files live under `docs-live/_claude-md/architecture/`. Architecture-scoped compacts (architecture-codecs, architecture-types) move from `docs-generated/_claude-md/architecture/` to `docs-live/_claude-md/architecture/`. This consolidation does not affect the separate claude-modules output at the repository root `_claude-md/`. | DD-2: `_claude-md/` compact versions are the Claude consumption contract — agents read compacts, not full product area docs. Having compacts split across two directories (docs-generated/ and docs-live/) means Claude sessions following "read from docs-live/" miss the architecture compacts entirely. |
|
|
625
|
+
|
|
626
|
+
### Documentation Orchestrator
|
|
627
|
+
|
|
628
|
+
| Rule | Invariant | Rationale |
|
|
629
|
+
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
630
|
+
| Orchestrator coordinates full documentation generation pipeline | Non-overlapping patterns from TypeScript and Gherkin sources must merge into a unified dataset; overlapping pattern names must fail with conflict error. | Silent merging of conflicting patterns would produce incorrect documentation — fail-fast ensures data integrity across the pipeline. |
|
|
631
|
+
|
|
632
|
+
### Enhanced Index Generation
|
|
633
|
+
|
|
634
|
+
| Rule | Invariant | Rationale |
|
|
635
|
+
| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
636
|
+
| IndexCodec composes generated statistics with editorial navigation | The IndexCodec generates document listings and pattern statistics from MasterDataset pre-computed views (`byCategory`, `byPhase`, `byProductArea`, `byStatus`), while audience reading paths, the document roles matrix, and the quick finder table use the `ReferenceDocConfig.preamble` mechanism as manually authored `SectionBlock[]`. The codec does not hardcode document metadata -- all statistics are derived from the dataset at generation time. Editorial content changes at authorial cadence via config edits, not code changes. | Approximately 40% of INDEX.md content (product area lists, file inventories, pattern statistics, phase progress) is directly derivable from MasterDataset views and drifts when patterns change status or new patterns are added. The remaining 60% (audience paths, document roles, quick finder) requires human editorial judgment about which documents serve which readers. The preamble mechanism cleanly separates these two content types within a single generated output, as proven by CodecDrivenReferenceGeneration and DocsConsolidationStrategy Phase 2. |
|
|
637
|
+
| Audience reading paths are first-class sections | Three audience profiles exist in the generated index: New User, Developer/AI, and Team Lead/CI. Each profile has a curated reading order that lists documents in recommended sequence with a one-line description of what each document provides for that audience. Reading paths appear prominently after the quick navigation table and before the auto-generated statistics sections. The reading paths are sourced from preamble, not derived from pattern metadata. | The manual INDEX.md reading orders are consistently cited as the most useful navigation aid by developers onboarding to the project. A flat alphabetical file listing (as in the current docs-live/INDEX.md) forces readers to guess which documents are relevant to their role. Audience-specific paths reduce time-to-relevance from minutes of scanning to seconds of following a curated sequence. This content is inherently editorial -- no annotation can express "read this third because it builds on concepts from document two." |
|
|
638
|
+
| Index unifies manual and generated doc listings | The generated index covers both `docs/` (manual reference documents) and `docs-live/` (generated reference documents) in a single unified navigation structure. Documents are organized by topic or audience, not by source directory. The reader does not need to know whether a document is manually authored or auto-generated. Each document entry includes its title, a brief description, and its primary audience. The directory source (docs/ or docs-live/) appears only in the link path, not as a section heading or organizational axis. | The current documentation set splits across two directories for implementation reasons (manual vs generated), but this split is meaningless to readers. A developer looking for architecture documentation should find one entry, not separate entries under "Manual Docs" and "Generated Docs" sections. The unified listing follows the same principle as a library catalog -- books are organized by subject, not by whether they were hand-typeset or digitally printed. |
|
|
639
|
+
| Document metadata drives auto-generated sections | Pattern counts per product area, phase progress summaries, and product area coverage percentages are derived from MasterDataset pre-computed views at generation time. The IndexCodec accesses `dataset.byProductArea` for area statistics, `dataset.byStatus` for status distribution, and `dataset.byPhase` for phase ordering. No statistics are hardcoded in the codec or config. When a pattern changes status or a new pattern is added, regenerating the index reflects the change without any manual update. | The manual INDEX.md has no statistics section because maintaining accurate counts manually is unsustainable across 196+ patterns. The MasterDataset pre-computed views provide O(1) access to grouped pattern data. Surfacing these statistics in the index gives readers an at-a-glance project health overview (how many patterns per area, what percentage are completed, which phases are active) that was previously only available via the Process Data API CLI. |
|
|
640
|
+
|
|
641
|
+
### Error Guide Codec
|
|
642
|
+
|
|
643
|
+
| Rule | Invariant | Rationale |
|
|
644
|
+
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
645
|
+
| Error guide extends the existing ValidationRulesCodec | Error diagnosis guide content is produced by enhancing the existing `ValidationRulesCodec` and its `RULE_DEFINITIONS` constant, not by creating a parallel codec. The enhanced codec adds fix rationale, alternative approaches, and integration context to the existing error catalog, FSM transitions, and protection level detail files. A separate `ErrorGuideCodec` class is not created. | `ValidationRulesCodec` already owns `RULE_DEFINITIONS` with error codes, causes, and fixes. It generates `error-catalog.md`, `fsm-transitions.md`, and `protection-levels.md`. Creating a parallel codec would duplicate RULE_DEFINITIONS access and fragment validation documentation across two codecs. Extending the existing codec keeps all validation reference content in one place. |
|
|
646
|
+
| Each error code has fix rationale explaining why the rule exists | Every error code in the generated output includes not just a fix command but a "why this rule exists" rationale. The rationale is sourced from `@architect-convention:process-guard-errors` JSDoc annotations on the error-handling code in `src/lint/process-guard/`. The `RuleDefinition` interface is extended with a `rationale` field, or rationale is composed from convention-extracted content. | The existing `error-catalog.md` tells developers what to do (fix command) but not why the rule exists. Without rationale, developers reach for escape hatches instead of understanding the workflow constraint. PROCESS-GUARD.md includes rationale like "Prevents scope creep during implementation. Plan fully before starting; implement what was planned." -- this must survive in the generated output. |
|
|
647
|
+
| Preamble carries integration content that cannot come from annotations | Pre-commit setup instructions (Husky configuration, package.json scripts), CI pipeline patterns, programmatic API examples, and the Decider pattern architecture diagram use the `ReferenceDocConfig.preamble` mechanism. These are `SectionBlock[]` defined in the config entry, prepended before all generated content. Preamble content is manually authored and changes at editorial cadence, not code cadence. | Integration recipes (Husky hook setup, CI YAML patterns, API usage examples) are not extractable from source annotations because they describe how external systems consume Process Guard, not how Process Guard is implemented. The preamble mechanism exists precisely for this: editorial prose that lives in the config, not in a separate manual file, and appears in the generated output. |
|
|
648
|
+
| Convention tags source error context from annotated lint code | Error-handling code in `src/lint/process-guard/` is annotated with `@architect-convention:process-guard-errors` using structured JSDoc that includes rationale, alternative approaches, and common mistake patterns. The convention tag value `process-guard-errors` is registered in `src/taxonomy/conventions.ts` in the `CONVENTION_VALUES` array. The `createReferenceCodec` factory extracts this content via the existing convention extractor pipeline. | Convention-tagged annotations on the error-handling code co-locate rationale with implementation. When a developer changes an error rule in the decider, the convention JSDoc is right there -- they update both in the same commit. This is the same pattern used by `codec-registry`, `pipeline-architecture`, and `taxonomy-rules` convention tags, all proven by CodecDrivenReferenceGeneration. |
|
|
649
|
+
|
|
650
|
+
### Extract Summary
|
|
651
|
+
|
|
652
|
+
| Rule | Invariant | Rationale |
|
|
653
|
+
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
654
|
+
| Single-line descriptions are returned as-is when complete | A single-line description that ends with sentence-ending punctuation is returned verbatim; one without gets an appended ellipsis. | Summaries appear in pattern tables where readers expect grammatically complete text; an ellipsis signals intentional truncation rather than a rendering bug. |
|
|
655
|
+
| Multi-line descriptions are combined until sentence ending | Lines are concatenated until a sentence-ending punctuation mark is found or the character limit is reached, whichever comes first. | Splitting at arbitrary line breaks produces sentence fragments that lose meaning; combining until a natural boundary preserves semantic completeness. |
|
|
656
|
+
| Long descriptions are truncated at sentence or word boundaries | Summaries exceeding the character limit are truncated at the nearest sentence boundary if possible, otherwise at a word boundary with an appended ellipsis. | Sentence-boundary truncation preserves semantic completeness; word-boundary fallback avoids mid-word breaks. |
|
|
657
|
+
| Tautological and header lines are skipped | Lines that merely repeat the pattern name or consist only of a section header label (e.g., "Problem:", "Solution:") are skipped; the summary begins with the first substantive line. | Tautological opening lines waste the limited summary space without adding information. |
|
|
658
|
+
| Edge cases are handled gracefully | Degenerate inputs (empty strings, markdown-only content, bold markers) produce valid output without errors: empty input yields empty string, formatting is stripped, and multiple sentence endings use the first. | Summary extraction runs on every pattern in the dataset; an unhandled edge case would crash the entire documentation generation pipeline. |
|
|
659
|
+
|
|
660
|
+
### Generated Doc Quality
|
|
661
|
+
|
|
662
|
+
| Rule | Invariant | Rationale |
|
|
663
|
+
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
664
|
+
| Behavior-specs renderer does not duplicate convention table content | When the reference codec renders a convention rule that contains a table, the table appears exactly once in the output: in the main convention section. The behavior-specs (expanded rule detail) section shows only the Invariant, Rationale, and Verified-by metadata — not the table body. A convention section with N tables produces exactly N table instances in the generated document, regardless of detail level. | DD-4: The current renderer re-includes the full convention table when rendering the expanded rule detail section. For REFERENCE-SAMPLE.md with 5 canonical value tables, this produces 500+ lines of exact duplication. Agents consuming this file waste context on content they already parsed. Human readers see the same table twice in the same scroll view. |
|
|
665
|
+
| Compact \_claude-md/ files are self-sufficient for their product area | Each product area compact (`_claude-md/<area>/<area>-overview.md`) is self-sufficient as a standalone context file — an agent reading only the compact can answer: what does this area do, what are its key patterns, what are its invariants, and what files to read for details. Minimum target: 4 KB. The Generation compact is a specific gap: 1.4 KB for an area with 20+ codecs and the entire rendering pipeline. | DD-2: `_claude-md/` compacts are the Claude consumption contract. A 1.4 KB compact for the largest product area (233 KB) means agents have no usable summary context for Generation. They fall back to reading the full file or hallucinating based on names alone. The contract requires each compact to be a genuine summary, not a stub. |
|
|
666
|
+
| ARCHITECTURE-TYPES.md leads with type definitions, not convention content | ARCHITECTURE-TYPES.md opens with the MasterDataset type definitions section before any pipeline-architecture convention content. An agent querying "what is MasterDataset" finds the type definition within the first 30 lines. The pipeline-architecture convention prose (orchestrator responsibilities, pipeline steps) follows the type definitions section. | The file is named ARCHITECTURE-TYPES — type definitions are the primary content. The pipeline-architecture convention content was added as a secondary layer. Current output opens with orchestrator prose, burying the type definitions that both Claude and human developers are most likely seeking. Section ordering in ReferenceDocConfig determines render order. |
|
|
667
|
+
|
|
668
|
+
### Generated Doc Quality Tests
|
|
669
|
+
|
|
670
|
+
| Rule | Invariant | Rationale |
|
|
671
|
+
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
672
|
+
| Behavior-specs renderer does not duplicate convention table content | Convention tables appear exactly once in the output — in the convention section. The behavior-specs section shows only metadata. | DD-4: Duplicate tables waste 500+ lines and agent context tokens. |
|
|
673
|
+
| ARCHITECTURE-TYPES leads with type definitions | When shapesFirst is true, shapes render before conventions. | ARCHITECTURE-TYPES.md should open with type definitions, not orchestrator prose. |
|
|
674
|
+
| Product area docs have a generated table of contents | Product area docs with 3+ H2 headings include a Contents section with anchor links. | Large product area docs need browser-navigable TOC for human developers. |
|
|
675
|
+
| Generation compact is self-sufficient | The Generation compact contains codec inventory and pipeline summary at 4+ KB. | DD-2: A 1.4 KB compact for the largest area means agents have no usable summary. |
|
|
676
|
+
|
|
677
|
+
### Generator Infrastructure Testing
|
|
678
|
+
|
|
679
|
+
| Rule | Invariant | Rationale |
|
|
680
|
+
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
681
|
+
| Orchestrator coordinates full documentation generation pipeline | Orchestrator merges TypeScript and Gherkin patterns, handles conflicts, and produces requested document types. | Without centralized orchestration, consumers would wire pipelines independently, leading to inconsistent merging and silent data loss. |
|
|
682
|
+
| Registry manages generator registration and retrieval | Registry prevents duplicate names, returns undefined for unknown generators, and lists available generators alphabetically. | Duplicate registrations would silently overwrite generators, causing unpredictable output depending on registration order. |
|
|
683
|
+
| CodecBasedGenerator adapts codecs to generator interface | Generator delegates to underlying codec for transformation. Missing MasterDataset produces descriptive error. | If the adapter silently proceeds without a MasterDataset, codecs receive undefined input and produce corrupt or empty documents. |
|
|
684
|
+
| Orchestrator supports PR changes generation options | PR changes can filter by git diff, changed files, or release version. | Without filtering, PR documentation would include all patterns in the dataset, making change review noisy and hiding actual modifications. |
|
|
685
|
+
|
|
686
|
+
### Generator Registry Testing
|
|
687
|
+
|
|
688
|
+
| Rule | Invariant | Rationale |
|
|
689
|
+
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
690
|
+
| Registry manages generator registration and retrieval | Each generator name is unique within the registry; duplicate registration is rejected and lookup of unknown names returns undefined. | Allowing duplicate names would silently overwrite an existing generator, causing previously registered behavior to disappear without warning. |
|
|
691
|
+
|
|
692
|
+
### Gherkin Patterns Restructure
|
|
693
|
+
|
|
694
|
+
| Rule | Invariant | Rationale |
|
|
695
|
+
| ----------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
696
|
+
| Step Linting content belongs in VALIDATION.md | All validation tooling reference content lives in VALIDATION.md. | VALIDATION.md already documents lint-patterns, lint-process, and validate-patterns. Step Linting is a fourth quality tool in the same family — it must follow the same pattern. Redirecting from VALIDATION.md to GHERKIN-PATTERNS.md for lint rules breaks the principle that VALIDATION.md is the single place to find quality tooling documentation. |
|
|
697
|
+
| GHERKIN-PATTERNS.md remains the authoring guide | GHERKIN-PATTERNS.md covers only Gherkin writing patterns, not tooling reference. | The writing guide is useful during spec authoring. Quality tool reference is useful during CI setup and debugging. Mixing them forces authors to scroll past 148 lines of tooling reference they do not need during writing, and forces CI engineers to look in the wrong file for lint rule documentation. |
|
|
698
|
+
| INDEX.md reflects current document structure | INDEX.md section tables and line counts must be updated when content moves between docs. | INDEX.md serves as the navigation hub for all documentation. Stale line counts and missing section entries cause developers to land in the wrong part of a document or miss content entirely. Both GHERKIN-PATTERNS.md and VALIDATION.md entries must reflect the restructure. |
|
|
699
|
+
|
|
700
|
+
### Git Branch Diff Testing
|
|
701
|
+
|
|
702
|
+
| Rule | Invariant | Rationale |
|
|
703
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
704
|
+
| getChangedFilesList returns only existing changed files | Modified and added files are returned, while deleted tracked files are excluded from the final list. | PR-scoped generation only needs files that still exist on the current branch; including deleted paths would force consumers to chase files that cannot be read. |
|
|
705
|
+
| Paths with spaces are preserved | A filename containing spaces is returned as the exact original path, not split into multiple tokens. | Whitespace splitting corrupts file paths and breaks PR-scoped generation in repositories with descriptive filenames. |
|
|
706
|
+
| NUL-delimited rename and copy statuses use the new path | Rename and copy statuses with similarity scores must record the current path, not the old/source path. | Git emits statuses like R100 and C087 in real diffs; parsing the wrong side of the pair causes generators to scope output to stale paths. |
|
|
707
|
+
|
|
708
|
+
### Implementation Link Path Normalization
|
|
709
|
+
|
|
710
|
+
| Rule | Invariant | Rationale |
|
|
711
|
+
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
712
|
+
| Repository prefixes are stripped from implementation paths | Implementation file paths must not contain repository-level prefixes like "libar-platform/" or "monorepo/". | Generated links are relative to the output directory; repository prefixes produce broken paths. |
|
|
713
|
+
| All implementation links in a pattern are normalized | Every implementation link in a pattern document must have its path normalized, regardless of how many implementations exist. | A single un-normalized link in a multi-implementation pattern produces a broken reference that undermines trust in the entire generated document. |
|
|
714
|
+
| normalizeImplPath strips known prefixes | normalizeImplPath removes only recognized repository prefixes from the start of a path and leaves all other path segments unchanged. | Over-stripping would corrupt legitimate path segments that happen to match a prefix name, producing silent broken links. |
|
|
715
|
+
|
|
716
|
+
### Layered Diagram Generation
|
|
717
|
+
|
|
718
|
+
| Rule | Invariant | Rationale |
|
|
719
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
720
|
+
| Layered diagrams group patterns by arch-layer | Each distinct arch-layer value must produce exactly one Mermaid subgraph containing all patterns with that layer. | Without layer subgraphs, the Clean Architecture boundary between domain, application, and infrastructure is not visually enforced. |
|
|
721
|
+
| Layer order is domain to infrastructure (top to bottom) | Layer subgraphs must be rendered in Clean Architecture order: domain first, then application, then infrastructure. | The visual order reflects the dependency rule where outer layers depend on inner layers; reversing it would misrepresent the architecture. |
|
|
722
|
+
| Context labels included in layered diagram nodes | Each node in a layered diagram must include its bounded context name as a label, since context is not conveyed by subgraph grouping. | Layered diagrams group by layer, not context, so the context label is the only way to identify which bounded context a node belongs to. |
|
|
723
|
+
| Patterns without layer go to Other subgraph | Patterns that have arch-role or arch-context but no arch-layer must be placed in an "Other" subgraph, never omitted from the diagram. | Omitting unlayered patterns would silently hide architectural components; the "Other" group makes their missing classification visible. |
|
|
724
|
+
| Layered diagram includes summary section | The generated layered diagram document must include an Overview section with annotated source file count. | Without summary counts, readers cannot assess diagram completeness or detect missing annotated sources. |
|
|
725
|
+
|
|
726
|
+
### Load Preamble Parser
|
|
727
|
+
|
|
728
|
+
| Rule | Invariant | Rationale |
|
|
729
|
+
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
730
|
+
| Headings are parsed into HeadingBlock | Lines starting with 1-6 hash characters followed by a space produce HeadingBlock with the correct level and text. | Headings are the primary structural element in preamble markdown and must map exactly to HeadingBlock level values. |
|
|
731
|
+
| Paragraphs are parsed into ParagraphBlock | Consecutive non-empty, non-construct lines produce a single ParagraphBlock with lines joined by spaces. | Multi-line paragraphs in markdown are a single logical block separated by blank lines. |
|
|
732
|
+
| Separators are parsed into SeparatorBlock | Lines matching exactly three or more dashes, asterisks, or underscores produce SeparatorBlock. | Horizontal rules serve as visual separators in preamble content and must be faithfully represented. |
|
|
733
|
+
| Tables are parsed into TableBlock | A line starting with pipe followed by a separator row produces TableBlock with columns from the header and rows from subsequent pipe-delimited lines. | Tables are heavily used in preamble content for structured reference data and must preserve column names and cell values exactly. |
|
|
734
|
+
| Unordered lists are parsed into ListBlock | Lines starting with dash-space or asterisk-space produce ListBlock with ordered=false and string items. | Unordered lists are common in preamble content for enumerating capabilities or constraints. |
|
|
735
|
+
| Ordered lists are parsed into ListBlock | Lines starting with a digit followed by period-space produce ListBlock with ordered=true. | Ordered lists represent sequential steps in procedural guides and must preserve ordering semantics. |
|
|
736
|
+
| Code blocks are parsed into CodeBlock | Fenced code blocks with a language info string produce CodeBlock with the language and content fields. | Code examples in preamble content must preserve the language annotation for syntax highlighting in generated docs. |
|
|
737
|
+
| Mermaid blocks are parsed into MermaidBlock | Code fences with the info string "mermaid" produce MermaidBlock instead of CodeBlock. | Mermaid diagrams have a dedicated SectionBlock type for specialized rendering in generated docs. |
|
|
738
|
+
| Mixed content produces correct block sequence | A markdown document with multiple construct types produces blocks in document order with correct types. | Preamble files combine headings, paragraphs, code blocks, and tables in sequence. The parser must handle transitions between all state machine states correctly. |
|
|
739
|
+
| Bold and inline formatting is preserved in paragraphs | Inline markdown formatting such as bold, italic, and code spans are preserved as-is in ParagraphBlock text. | The parser produces structural blocks. Inline formatting is the responsibility of the markdown renderer, not the block parser. |
|
|
740
|
+
|
|
741
|
+
### Mermaid Relationship Rendering
|
|
742
|
+
|
|
743
|
+
| Rule | Invariant | Rationale |
|
|
744
|
+
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
745
|
+
| Each relationship type has a distinct arrow style | Each relationship type (uses, depends-on, implements, extends) must render with a unique, visually distinguishable arrow style. | Identical arrow styles would make relationship semantics indistinguishable in generated diagrams. |
|
|
746
|
+
| Pattern names are sanitized for Mermaid node IDs | Pattern names must be transformed into valid Mermaid node IDs by replacing special characters (dots, hyphens, spaces) with underscores. | Unsanitized names containing dots, hyphens, or spaces produce invalid Mermaid syntax that fails to render. |
|
|
747
|
+
| All relationship types appear in single graph | The generated Mermaid graph must combine all relationship types (uses, depends-on, implements, extends) into a single top-down graph. | Splitting relationship types into separate graphs would fragment the dependency picture and hide cross-type interactions. |
|
|
748
|
+
|
|
749
|
+
### Orchestrator Pipeline Factory Migration
|
|
750
|
+
|
|
751
|
+
| Rule | Invariant | Rationale |
|
|
752
|
+
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
753
|
+
| Orchestrator delegates pipeline to factory | `generateDocumentation()` calls `buildMasterDataset()` for the scan-extract-merge-transform sequence. It does not import from `scanner/` or `extractor/` for pipeline orchestration. Direct imports are permitted only for types used in GenerateResult (e.g., `ExtractedPattern`). | The orchestrator is the original host of the inline pipeline. After this migration, the pipeline factory is the sole definition of the 8-step sequence. Any future changes to pipeline steps (adding caching, parallel scanning, incremental extraction) happen in one place and all consumers benefit. |
|
|
754
|
+
| mergePatterns lives in pipeline module | The `mergePatterns()` function lives in `src/generators/pipeline/merge-patterns.ts` as a pipeline step. It is not defined in consumer code (orchestrator or CLI files). | `mergePatterns` is step 5 of the 8-step pipeline. It was defined in orchestrator.ts for historical reasons (the orchestrator was the first pipeline host). Now that the pipeline factory exists, the function belongs alongside other pipeline steps (scan, extract, transform). The public API re-export in `generators/index.ts` preserves backward compatibility. |
|
|
755
|
+
| Factory provides structured warnings for all consumers | `PipelineResult.warnings` contains typed warning objects with `type`, `message`, optional `count`, and optional `details` (file, line, column, message). Consumers that need granular diagnostics (orchestrator) use the full structure. Consumers that need simple messages (process-api) read `.message` only. | The orchestrator collects scan errors, skipped directives, extraction errors, and Gherkin parse errors as structured `GenerationWarning` objects. The factory must provide equivalent structure to eliminate the orchestrator's need to run the pipeline directly. The `PipelineWarning` type is structurally similar to `GenerationWarning` to minimize mapping complexity. |
|
|
756
|
+
| Pipeline factory supports partial success mode | 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. | 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. |
|
|
757
|
+
| End-to-end verification confirms behavioral equivalence | After migration, all CLI commands and doc generation produce identical output to pre-refactor behavior. | The migration must not change observable behavior for any consumer. Full verification confirms the factory migration is a pure refactor. |
|
|
758
|
+
|
|
759
|
+
### Patterns Codec Testing
|
|
760
|
+
|
|
761
|
+
| Rule | Invariant | Rationale |
|
|
762
|
+
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
763
|
+
| Document structure includes progress tracking and category navigation | Every decoded document must contain a title, purpose, Progress section with status counts, and category navigation regardless of dataset size. | The PATTERNS.md is the primary entry point for understanding project scope; incomplete structure would leave consumers without context. |
|
|
764
|
+
| Pattern table presents all patterns sorted by status then name | The pattern table must include every pattern in the dataset with columns for Pattern, Category, Status, and Description, sorted by status priority (completed first) then alphabetically by name. | Consistent ordering allows quick scanning of project progress; completed patterns at top confirm done work, while roadmap items at bottom show remaining scope. |
|
|
765
|
+
| Category sections group patterns by domain | Each category in the dataset must produce an H3 section listing its patterns, and the filterCategories option must restrict output to only the specified categories. | Without category grouping, consumers must scan the entire flat pattern list to find domain-relevant patterns; filtering avoids noise in focused documentation. |
|
|
766
|
+
| Dependency graph visualizes pattern relationships | A Mermaid dependency graph must be included when pattern relationships exist and the includeDependencyGraph option is not disabled; it must be omitted when no relationships exist or when explicitly disabled. | Dependency relationships are invisible in flat pattern lists; the graph reveals implementation ordering and coupling that affects planning decisions. |
|
|
767
|
+
| Detail file generation creates per-pattern pages | When generateDetailFiles is enabled, each pattern must produce an individual markdown file at patterns/{slug}.md containing an Overview section; when disabled, no additional files must be generated. | Detail files enable deep-linking into specific patterns from the main registry while keeping the index document scannable. |
|
|
768
|
+
|
|
769
|
+
### Planning Codec Testing
|
|
770
|
+
|
|
771
|
+
| Rule | Invariant | Rationale |
|
|
772
|
+
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
773
|
+
| PlanningChecklistCodec prepares for implementation sessions | The checklist must include pre-planning questions, definition of done with deliverables, and dependency status for all actionable phases. | Implementation sessions fail without upfront preparation — the checklist surfaces blockers before work begins. |
|
|
774
|
+
| SessionPlanCodec generates implementation plans | The plan must include status summary, implementation approach from use cases, deliverables with status, and acceptance criteria from scenarios. | A structured implementation plan ensures all deliverables and acceptance criteria are visible before coding starts. |
|
|
775
|
+
| SessionFindingsCodec captures retrospective discoveries | Findings must be categorized into gaps, improvements, risks, and learnings with per-type counts in the summary. | Retrospective findings drive continuous improvement — categorization enables prioritized follow-up across sessions. |
|
|
776
|
+
|
|
777
|
+
### Poc Integration
|
|
778
|
+
|
|
779
|
+
| Rule | Invariant | Rationale |
|
|
780
|
+
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
781
|
+
| POC decision document is parsed correctly | The real POC decision document (Process Guard) must be parseable by the codec, extracting all source mappings with their extraction types. | Integration testing against the actual POC document validates that the codec works with real-world content, not just synthetic test data. |
|
|
782
|
+
| Self-references extract content from POC decision | THIS DECISION self-references in the POC document must successfully extract Context rules, Decision rules, and DocStrings from the document itself. | Self-references are the most common extraction type in decision docs — they must work correctly for the POC to demonstrate the end-to-end pipeline. |
|
|
783
|
+
| TypeScript shapes are extracted from real files | The source mapper must successfully extract type shapes and patterns from real TypeScript source files referenced in the POC document. | TypeScript extraction is the primary mechanism for pulling implementation details into decision docs — it must work with actual project files. |
|
|
784
|
+
| Behavior spec content is extracted correctly | The source mapper must successfully extract Rule blocks and ScenarioOutline Examples from real Gherkin feature files referenced in the POC document. | Behavior spec extraction bridges decision documents to executable specifications — incorrect extraction would misrepresent the verified behavior. |
|
|
785
|
+
| JSDoc sections are extracted from CLI files | The source mapper must successfully extract JSDoc comment sections from real TypeScript CLI files referenced in the POC document. | CLI documentation often lives in JSDoc comments — extracting them into decision docs avoids duplicating CLI usage information manually. |
|
|
786
|
+
| All source mappings execute successfully | All source mappings defined in the POC decision document must execute without errors, producing non-empty extraction results. | End-to-end execution validates that all extraction types work with real files — a single failing mapping would produce incomplete decision documentation. |
|
|
787
|
+
| Compact output generates correctly | The compact output for the POC document must generate successfully and contain all essential sections defined by the compact format. | Compact output is the AI-facing artifact — verifying it against the real POC ensures the format serves its purpose of providing concise decision context. |
|
|
788
|
+
| Detailed output generates correctly | The detailed output for the POC document must generate successfully and contain all sections including full content from source mappings. | Detailed output is the human-facing artifact — verifying it against the real POC ensures no content is lost in the generation pipeline. |
|
|
789
|
+
| Generated output matches quality expectations | The generated output structure must match the expected target format, with complete validation rules and properly structured sections. | Quality assertions catch regressions in output formatting — structural drift in generated documents would degrade their usefulness as references. |
|
|
790
|
+
|
|
791
|
+
### Pr Changes Codec Options Testing
|
|
792
|
+
|
|
793
|
+
| Rule | Invariant | Rationale |
|
|
794
|
+
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
795
|
+
| PrChangesCodec generates review checklist when includeReviewChecklist is enabled | When includeReviewChecklist is enabled, the codec must generate a "Review Checklist" section with standard items and context-sensitive items based on pattern state (completed, active, dependencies, deliverables). When disabled, no checklist appears. | A context-sensitive checklist prevents reviewers from missing state-specific concerns (e.g., verifying completed patterns still work, or that dependencies are satisfied) that a static checklist would not cover. |
|
|
796
|
+
| PrChangesCodec generates dependencies section when includeDependencies is enabled | When includeDependencies is enabled and patterns have dependency relationships, the codec must render a "Dependencies" section with "Depends On" and "Enables" subsections. When no dependencies exist or the option is disabled, the section is omitted. | Dependency visibility in PR reviews prevents merging changes that break upstream or downstream patterns, which would otherwise only surface during integration. |
|
|
797
|
+
| PrChangesCodec filters patterns by changedFiles | When changedFiles filter is set, only patterns whose source files match (including partial directory path matches) are included in the output. | Filtering by changed files scopes the PR document to only the patterns actually touched, preventing reviewers from wading through unrelated patterns. |
|
|
798
|
+
| PrChangesCodec filters patterns by releaseFilter | When releaseFilter is set, only patterns with deliverables matching the specified release version are included. | Release filtering isolates the patterns scheduled for a specific version, enabling targeted release reviews without noise from other versions' deliverables. |
|
|
799
|
+
| PrChangesCodec uses OR logic for combined filters | When both changedFiles and releaseFilter are set, patterns matching either criterion are included (OR logic), and patterns matching both criteria appear only once (no duplicates). | OR logic maximizes PR coverage — a change may affect files not yet assigned to a release, or a release may include patterns from unchanged files. |
|
|
800
|
+
| PrChangesCodec only includes active and completed patterns | The codec must exclude roadmap and deferred patterns, including only active and completed patterns in the PR changes output. | PR changes reflect work that is in progress or done — roadmap and deferred patterns have no code changes to review. |
|
|
801
|
+
|
|
802
|
+
### Pr Changes Codec Rendering Testing
|
|
803
|
+
|
|
804
|
+
| Rule | Invariant | Rationale |
|
|
805
|
+
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
806
|
+
| PrChangesCodec handles empty results gracefully | When no patterns match the applied filters, the codec must produce a valid document with a "No Changes" section describing which filters were active. | Reviewers need to distinguish "nothing matched" from "codec error" and understand why no patterns appear. |
|
|
807
|
+
| PrChangesCodec generates summary with filter information | Every PR changes document must contain a Summary section with pattern counts and active filter information. | Without a summary, reviewers must scan the entire document to understand the scope and filtering context of the PR changes. |
|
|
808
|
+
| PrChangesCodec groups changes by phase when sortBy is "phase" | When sortBy is "phase" (the default), patterns must be grouped under phase headings in ascending phase order. | Phase grouping aligns PR changes with the delivery roadmap, letting reviewers verify that changes belong to the expected implementation phase. |
|
|
809
|
+
| PrChangesCodec groups changes by priority when sortBy is "priority" | When sortBy is "priority", patterns must be grouped under High/Medium/Low priority headings with correct pattern assignment. | Priority grouping lets reviewers focus on high-impact changes first, ensuring critical patterns receive the most review attention. |
|
|
810
|
+
| PrChangesCodec shows flat list when sortBy is "workflow" | When sortBy is "workflow", patterns must be rendered as a flat list without phase or priority grouping. | Workflow sorting presents patterns in review order without structural grouping, suited for quick PR reviews. |
|
|
811
|
+
| PrChangesCodec renders pattern details with metadata and description | Each pattern entry must include a metadata table (status, phase, business value when available) and description text. | Metadata and description provide the context reviewers need to evaluate whether a pattern's implementation aligns with its stated purpose and delivery status. |
|
|
812
|
+
| PrChangesCodec renders deliverables when includeDeliverables is enabled | Deliverables are only rendered when includeDeliverables is enabled, and when releaseFilter is set, only deliverables matching that release are shown. | Deliverables add bulk to the PR document; gating them behind a flag keeps default output concise, while release filtering prevents reviewers from seeing unrelated work items. |
|
|
813
|
+
| PrChangesCodec renders acceptance criteria from scenarios | When patterns have associated scenarios, the codec must render an "Acceptance Criteria" section containing scenario names and step lists. | Acceptance criteria give reviewers a concrete checklist to verify that the PR's implementation satisfies the behavioral requirements defined in the spec. |
|
|
814
|
+
| PrChangesCodec renders business rules from Gherkin Rule keyword | When patterns have Gherkin Rule blocks, the codec must render a "Business Rules" section containing rule names and verification information. | Business rules surface domain invariants directly in the PR review, ensuring reviewers can verify that implementation changes respect the documented constraints. |
|
|
815
|
+
|
|
816
|
+
### Pr Changes Generation
|
|
817
|
+
|
|
818
|
+
| Rule | Invariant | Rationale |
|
|
819
|
+
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
820
|
+
| Release version filtering controls which phases appear in output | Only phases with deliverables matching the releaseFilter are included; roadmap phases are always excluded. | Including unrelated releases or unstarted roadmap items in a PR description misleads reviewers about the scope of actual changes. |
|
|
821
|
+
| Patterns are grouped by phase number in the output | Each phase number produces a separate heading section in the generated output. | Without phase grouping, reviewers cannot distinguish which changes belong to which delivery phase, making incremental review impossible. |
|
|
822
|
+
| Summary statistics provide a high-level overview of the PR | Summary section always shows pattern counts and release tag when a releaseFilter is active. | Without a summary, reviewers must read the entire document to understand the PR's scope; the release tag anchors the summary to a specific version. |
|
|
823
|
+
| Deliverables are displayed inline with their parent patterns | When includeDeliverables is enabled, each pattern lists its deliverables with name, status, and release tag. | Hiding deliverables forces reviewers to cross-reference feature files to verify completion; inline display makes review self-contained. |
|
|
824
|
+
| Review checklist includes standard code quality verification items | Review checklist always includes code conventions, tests, documentation, and completed pattern verification items. | Omitting the checklist means quality gates depend on reviewer memory; a consistent checklist ensures no standard verification step is skipped. |
|
|
825
|
+
| Dependencies section shows inter-pattern relationships | Dependencies section surfaces both what patterns enable and what they depend on. | Hidden dependencies cause merge-order mistakes and broken builds; surfacing them in the PR lets reviewers verify prerequisite work is complete. |
|
|
826
|
+
| Business value can be included or excluded from pattern metadata | Business value display is controlled by the includeBusinessValue option. | Not all consumers need business value context; making it opt-in keeps the default output concise for technical reviewers. |
|
|
827
|
+
| Output can be sorted by phase number or priority | Sorting is deterministic and respects the configured sortBy option. | Non-deterministic ordering produces diff noise between regenerations, making it impossible to tell if content actually changed. |
|
|
828
|
+
| Edge cases produce graceful output | The generator handles missing phases, missing deliverables, and missing phase numbers without errors. | Crashing on incomplete data prevents PR generation entirely; graceful degradation ensures output is always available even with partial inputs. |
|
|
829
|
+
| Deliverable-level filtering shows only matching deliverables within a phase | When a phase contains deliverables with different release tags, only those matching the releaseFilter are shown. | Showing all deliverables regardless of release tag pollutes the PR with unrelated work, obscuring what actually shipped in the target release. |
|
|
830
|
+
|
|
831
|
+
### Pr Changes Options
|
|
832
|
+
|
|
833
|
+
| Rule | Invariant | Rationale |
|
|
834
|
+
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
835
|
+
| Orchestrator supports PR changes generation options | PR changes output includes only patterns matching the changed files list, the release version filter, or both (OR logic when combined). | PR-scoped documentation must reflect exactly what changed, avoiding noise from unrelated patterns. |
|
|
836
|
+
|
|
837
|
+
### Prd Implementation Section
|
|
838
|
+
|
|
839
|
+
| Rule | Invariant | Rationale |
|
|
840
|
+
| --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
841
|
+
| PRD generator discovers implementations from relationship index | When generating PRD for pattern X, the generator queries the relationship index for all files where `implements === X`. No explicit listing in the spec file is required. | The `@architect-implements` tag creates a backward link from code to spec. The relationship index aggregates these. PRD generation simply queries the index rather than scanning directories. |
|
|
842
|
+
| Implementation metadata appears in dedicated PRD section | The PRD output includes a "## Implementations" section listing all files that implement the pattern. Each file shows its `uses`, `usedBy`, and `usecase` metadata in a consistent format. | Developers reading PRDs benefit from seeing the implementation landscape alongside requirements, without cross-referencing code files. |
|
|
843
|
+
| Patterns without implementations render cleanly | If no files have `@architect-implements:X` for pattern X, the "## Implementations" section is omitted (not rendered as empty). | Planned patterns may not have implementations yet. Empty sections add noise without value. |
|
|
844
|
+
|
|
845
|
+
### Prd Implementation Section Testing
|
|
846
|
+
|
|
847
|
+
| Rule | Invariant | Rationale |
|
|
848
|
+
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
849
|
+
| Implementation files appear in pattern docs via @architect-implements | Any TypeScript file with a matching @architect-implements tag must appear in the pattern document's Implementations section with a working file link. | Implementation discovery relies on tag-based linking — missing entries break traceability between specs and code. |
|
|
850
|
+
| Multiple implementations are listed alphabetically | When multiple files implement the same pattern, they must be listed in ascending file path order. | Deterministic ordering ensures stable document output across regeneration runs. |
|
|
851
|
+
| Patterns without implementations omit the section | The Implementations heading must not appear in pattern documents when no implementing files exist. | Rendering an empty Implementations section misleads readers into thinking implementations were expected but are missing, rather than simply not applicable. |
|
|
852
|
+
| Implementation references use relative file links | Implementation file links must be relative paths starting from the patterns output directory. | Absolute paths break when documentation is viewed from different locations; relative paths ensure portability. |
|
|
853
|
+
|
|
854
|
+
### Procedural Guide Codec
|
|
855
|
+
|
|
856
|
+
| Rule | Invariant | Rationale |
|
|
857
|
+
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
858
|
+
| Procedural guides use a dual-source codec | The ProceduralGuideCodec composes auto-generated reference sections (from MasterDataset and taxonomy) with manually-authored procedural content (from preamble `SectionBlock[]`). Auto-generated content covers ~5% of the output (tag reference tables, pattern statistics, session type contract tables extracted from | |
|
|
859
|
+
| blocks). The remaining ~95% is editorial preamble: checklists, decision trees, | | Gap analysis found that SESSION-GUIDES.md and ANNOTATION-GUIDE.md content is overwhelmingly procedural and editorial. Attempting to annotate checklists and walkthroughs as source code would produce worse documentation than hand-authoring. The dual-source pattern (proven by CodecDrivenReferenceGeneration, ErrorGuideCodec, and CliRecipeCodec) composes preamble editorial content with auto-generated reference sections. The codec's value is not in generating the procedural content but in providing a single output pipeline that keeps reference tables current while carrying editorial content in a consistent structure. |
|
|
860
|
+
| Session workflow checklists derive from annotated Rule: blocks | The SessionGuidesModuleSource spec's Rule: blocks (Rules 3-8) are the canonical source for session workflow invariants. The ProceduralGuideCodec extracts structured tables from these Rule: blocks and renders them as developer-facing checklists at the detailed level. The same Rule: blocks produce compact invariant statements for `_claude-md/workflow/` modules at the summary level. Two audiences (public developers and AI sessions) are served from a single annotated source with different rendering detail levels. The codec does not duplicate or re-derive Rule: block content -- it reads from MasterDataset's behavior extraction views. | SessionGuidesModuleSource already captures session type contracts (Rule 3), planning constraints (Rule 4), design constraints (Rule 5), implementation execution order (Rule 6), FSM error reference (Rule 7), and handoff patterns (Rule 8) as structured tables within Rule: block descriptions. These tables contain the same information as the manual SESSION-GUIDES.md checklists, but in a machine-extractable format. Rendering these as developer-facing checklists eliminates the maintenance burden of keeping the manual file in sync with the spec, while the compact rendering for AI context was already delivered by Phase 39. |
|
|
861
|
+
| Annotation guide content remains separate from session guides | The ProceduralGuideCodec produces two separate generated files via two `ReferenceDocConfig` entries: one for session workflow guides (replacing SESSION-GUIDES.md) and one for annotation guides (replacing ANNOTATION-GUIDE.md). The session workflow guide targets workflow practitioners who need to know session type selection, execution order, and FSM error recovery. The annotation guide targets annotation authors who need to know opt-in markers, tag syntax, shape extraction modes, and verification steps. These audiences overlap but have distinct primary needs. The codec class is shared; the config entries and preamble content differ. | SESSION-GUIDES.md and ANNOTATION-GUIDE.md serve different audiences at different points in the development lifecycle. Merging them into a single guide would force annotation authors to navigate session workflow content and vice versa. The existing DocsConsolidationStrategy Phase 5 (Guide trimming) already treats them as separate documents. Using one codec class with two config entries follows the same pattern as `createReferenceCodec` producing multiple documents from different configs. |
|
|
862
|
+
| Decision trees render as Mermaid flowcharts | Session type decision trees and annotation workflow decision trees render as Mermaid flowchart diagrams in the detailed output level. The session type decision tree replaces the ASCII art tree in SESSION-GUIDES.md with a Mermaid `graph TD` diagram that renders as an interactive flowchart on the Starlight website. Decision tree content is authored as fenced mermaid code blocks in the markdown source file, parsed into `MermaidBlock` entries by `loadPreambleFromMarkdown()` at config load time. At summary level, decision trees render as compact text tables instead of diagrams. | The manual SESSION-GUIDES.md uses an ASCII art tree for the session decision flow, which renders poorly on the website and cannot be interacted with. Mermaid flowcharts are already supported by the Starlight website (proven by product area docs with C4Context and graph LR diagrams). Converting decision trees to Mermaid provides visual clarity, click-through navigation, and consistent rendering across platforms. The content block type `mermaid` is already one of the 9 supported SectionBlock types (proven by ReferenceDocShowcase). |
|
|
863
|
+
| Generated guide supersedes manual only at quality parity | The manual `docs/SESSION-GUIDES.md` is retained in the repository until the generated equivalent matches or exceeds its quality across all content dimensions: completeness (all checklists present), accuracy (all FSM states current), visual clarity (decision trees render correctly), and usability (verified by comparison audit). The SessionGuidesModuleSource invariant ("not deleted, shortened, or replaced with a redirect") is respected during the transition period. The quality comparison deliverable produces an explicit audit document recording which sections have parity and which gaps remain. Only after the audit confirms full parity is the manual file replaced with a pointer to the generated output. | SESSION-GUIDES.md is cited in the SessionGuidesModuleSource spec as "the authoritative public human reference" serving developers on libar.dev. Replacing it prematurely with a generated equivalent that lacks checklists, has formatting issues, or omits edge cases would degrade the developer experience. The quality-gated approach ensures the generated version earns its place as the replacement by demonstrating equivalent or better quality, not merely by existing. This is the same principle applied by DocsConsolidationStrategy: "Manual docs retain editorial and tutorial content" until generation quality is sufficient. |
|
|
864
|
+
|
|
865
|
+
### Process Api Hybrid Generation
|
|
866
|
+
|
|
867
|
+
| Rule | Invariant | Rationale |
|
|
868
|
+
| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
869
|
+
| CLI schema is single source of truth for reference tables | A declarative CLI schema in `src/cli/cli-schema.ts` defines all global options, output modifiers, and list filters with their flags, descriptions, defaults, and value types. The three reference tables in `docs-live/reference/PROCESS-API-REFERENCE.md` are generated from this schema by a standalone `ProcessApiReferenceGenerator`. The schema also drives `showHelp()`. | CLI options are defined imperatively in `parseArgs()` (lines 132-265 of `src/cli/process-api.ts`) and `OutputModifiers`/`ListFilters` interfaces (lines 43-83 of `src/cli/output-pipeline.ts`). A declarative schema extracts this into a single structured definition that both documentation and help text consume. The existing `ReferenceDocConfig` system cannot be used because it sources from MasterDataset (annotation-derived data), not static constants (ADR-006). |
|
|
870
|
+
| Narrative prose sections remain manual | PROCESS-API.md sections covering "Why Use This", session type decision tree, workflow recipes, worked examples with expected output, and "Common Recipes" are not generated. They require editorial judgment and context that cannot be extracted from code annotations. The document's value comes from these sections — the generated reference tables are supporting material only. | Generated docs without prose context would be a bare options table — usable as reference but not as a learning resource. The hybrid approach gives both: accurate tables from code, readable narrative from editorial work. |
|
|
871
|
+
| Standalone generator respects ADR-006 single read model | The `ProcessApiReferenceGenerator` imports CLI schema data directly from `src/cli/cli-schema.ts`. It does NOT inject CLI data into MasterDataset or consume MasterDataset for table generation. It implements `DocumentGenerator` and returns `OutputFile[]` via the standard orchestrator write path. | ADR-006 establishes MasterDataset as the sole read model for annotation-sourced data. CLI schema is a static TypeScript constant, not extracted from annotations. Forcing it through MasterDataset would violate the "no parallel pipeline" anti-pattern. A standalone generator with its own data source is architecturally correct. |
|
|
872
|
+
|
|
873
|
+
### Publishing Relocation
|
|
874
|
+
|
|
875
|
+
| Rule | Invariant | Rationale |
|
|
876
|
+
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
877
|
+
| All publishing content moves to MAINTAINERS.md intact | MAINTAINERS.md at the repository root contains all 8 H2 sections previously in docs/PUBLISHING.md: Prerequisites, Version Strategy, Publishing Workflow (with Pre-releases, Subsequent Pre-releases, and Stable Releases subsections), Automated Publishing (GitHub Actions), Pre-commit and Pre-push Hooks, Dry Run, Verifying a Published Package, and Troubleshooting. No content is summarized, condensed, or omitted during the move. The H1 title changes from "Publishing Guide" to "Maintainer Guide" to reflect the broader MAINTAINERS.md convention. PUBLISHING.md contains zero relative links to other docs/ files, so no link rewriting is required. | The relocation is a pure audience-alignment fix, not a content review. Condensing content during the move would conflate two concerns. The maintainer procedures are complete and accurate — they simply live in the wrong location. A faithful copy ensures no institutional knowledge is lost in translation. |
|
|
878
|
+
| docs/PUBLISHING.md is deleted after relocation | After Phase 40 completes, `docs/PUBLISHING.md` does not exist. The file is not kept as a redirect stub or summary pointer. MAINTAINERS.md at the repo root is the sole location for publishing procedures. | A deleted file cannot serve the wrong audience. Keeping docs/PUBLISHING.md as a stub pointing to MAINTAINERS.md would still deploy a maintainer-only page to the website. The correct fix is deletion, not redirection. Maintainers navigating to the repo root will find MAINTAINERS.md via standard GitHub repository conventions. |
|
|
879
|
+
| Cross-references and website manifest are updated | After Phase 40 completes, docs/INDEX.md contains zero references to PUBLISHING.md. The 3 locations that previously referenced it are removed: the Quick Navigation table row (line 32), the Detailed Table of Contents subsection (lines 260-272), and the Document Roles Summary row (line 338). The website content manifest no longer includes PUBLISHING.md in the guides array. A link rewrite entry maps "./PUBLISHING.md" to the GitHub blob URL for MAINTAINERS.md so any remaining cross-references in other docs resolve correctly after website deployment. | Deleting a file without updating its references creates broken links in both the docs/ index and the website. The INDEX.md references are removed entirely (not redirected) because the content is no longer in the docs/ directory. The website manifest removal prevents a dead sync target. The link rewrite handles any generated docs that reference PUBLISHING.md — they will link to the GitHub-hosted MAINTAINERS.md instead of a 404. |
|
|
880
|
+
|
|
881
|
+
### Readme Rationalization
|
|
882
|
+
|
|
883
|
+
| Rule | Invariant | Rationale |
|
|
884
|
+
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
885
|
+
| README must be an npm package landing page | README.md content is scoped to what an npm package consumer needs: title and badges, one-paragraph value proposition, install instructions, quick start (annotate, generate, enforce), one annotated code example, content block summary table, CLI command table, and documentation index. | npm package pages are scanned by developers evaluating installation decisions. Content above 150-200 lines increases time-to-value. Enterprise pitch content (benchmark tables, methodology comparisons, session workflows, relationship models, comparison matrices) is not actionable at install time and belongs on the project website where it receives proper formatting, navigation, and updates without coupling to the package release cycle. The libar.dev website already contains 9 landing page components covering all enterprise pitch content: Metrics.astro (Proven at Scale), Pillars.astro (FSM, dual-source, relationships, codecs), DataAPI.astro (Data API CLI), Workflows.astro (session types), CodeExamples.astro (annotation examples), and Pipeline.astro (four-stage pipeline). |
|
|
886
|
+
| Configuration reference must not be duplicated in README | docs/CONFIGURATION.md is the single source of truth for preset and tag configuration. | README.md lines 441-474 reproduce the exact same preset table and config code examples that appear in docs/CONFIGURATION.md. Duplicate reference content diverges over time -- when a new preset is added, both files require updates. Removing the README copy and pointing to CONFIGURATION.md eliminates the divergence risk and removes approximately 34 lines from the README with no loss of information. |
|
|
887
|
+
| Trimmed README must serve as an effective getting-started page | The website publishes README.md as /architect/getting-started/ via content-manifest.mjs (line 57). After trimming, the remaining content must serve a first-time visitor arriving at that URL: install instructions, a quick annotated code example, CLI commands to run, and navigation links to deeper documentation. | The current 504-line README is a poor getting-started page because the install command is buried after 50+ lines of marketing content. The trimmed 150-line version places install instructions within the first 20 lines and follows with practical steps -- this is a better getting-started experience than the current version. No manifest changes are needed; the trim improves alignment with the URL. |
|
|
888
|
+
|
|
889
|
+
### Reference Codec Core Testing
|
|
890
|
+
|
|
891
|
+
| Rule | Invariant | Rationale |
|
|
892
|
+
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
893
|
+
| Empty datasets produce fallback content | A codec must always produce a valid document, even when no matching content exists in the dataset. | Consumers rely on a consistent document structure; a missing or null document would cause rendering failures downstream. |
|
|
894
|
+
| Convention content is rendered as sections | Convention-tagged patterns must render as distinct headed sections with their rule names, invariants, and tables preserved. | Conventions define project-wide constraints; losing their structure in generated docs would make them unenforceable and undiscoverable. |
|
|
895
|
+
| Detail level controls output density | Each detail level (summary, standard, detailed) must produce a deterministic subset of content, with summary being the most restrictive. | AI session contexts have strict token budgets; uncontrolled output density wastes context window and degrades session quality. |
|
|
896
|
+
| Behavior sections are rendered from category-matching patterns | Only patterns whose category matches the configured behavior tags may appear in the Behavior Specifications section. | Mixing unrelated categories into a single behavior section would produce misleading documentation that conflates distinct concerns. |
|
|
897
|
+
| Source selectors are extracted from matching patterns | Only shapes from patterns whose file path matches the configured source selector glob may appear in the API Types section. | Including shapes from unrelated source paths would pollute the API Types section with irrelevant type definitions, breaking the scoped documentation contract. |
|
|
898
|
+
| Convention and behavior content compose in a single document | Convention and behavior content must coexist in the same RenderableDocument when both are present in the dataset. | Splitting conventions and behaviors into separate documents would force consumers to cross-reference multiple files, losing the unified view of a product area. |
|
|
899
|
+
| Composition order follows AD-5: conventions then shapes then behaviors | Document sections must follow the canonical order: conventions, then API types (shapes), then behavior specifications. | AD-5 establishes a consistent reading flow (rules, then types, then specs); violating this order would confuse readers who expect a stable document structure. |
|
|
900
|
+
| Convention code examples render as mermaid blocks | Mermaid diagram content in conventions must render as fenced mermaid blocks, and must be excluded at summary detail level. | Mermaid diagrams are visual aids that require rendering support; emitting them as plain text would produce unreadable output, and including them in summaries wastes token budget. |
|
|
901
|
+
|
|
902
|
+
### Reference Codec Detail Rendering
|
|
903
|
+
|
|
904
|
+
| Rule | Invariant | Rationale |
|
|
905
|
+
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
906
|
+
| Standard detail level includes narrative but omits rationale | Standard detail level renders narrative prose for convention patterns but excludes rationale sections, reserving rationale for the detailed level only. | Progressive disclosure prevents information overload at the standard level while ensuring readers who need deeper justification can access it at the detailed level. |
|
|
907
|
+
| Deep behavior rendering with structured annotations | Behavior patterns render structured rule annotations (invariant, rationale, verified-by) at detailed level, invariant-only at standard level, and a truncated table at summary level. | Structured annotations are the primary mechanism for surfacing business rules from Gherkin sources; inconsistent rendering across detail levels would produce misleading or incomplete documentation. |
|
|
908
|
+
| Shape JSDoc prose renders at standard and detailed levels | Shape patterns with JSDoc prose include that prose in rendered code blocks at standard and detailed levels. Shapes without JSDoc render code blocks only. | JSDoc prose provides essential context for API types; omitting it would force readers to open source files to understand a shape's purpose, undermining the generated documentation's self-sufficiency. |
|
|
909
|
+
| Shape sections render param returns and throws documentation | Function shapes render parameter, returns, and throws documentation at detailed level. Standard level renders parameter tables but omits throws. Shapes without param docs skip the parameter table entirely. | Throws documentation is diagnostic detail that clutters standard output; separating it into detailed level keeps standard output focused on the function's contract while preserving full error documentation for consumers who need it. |
|
|
910
|
+
| Collapsible blocks wrap behavior rules for progressive disclosure | When a behavior pattern has 3 or more rules and detail level is not summary, each rule's content is wrapped in a collapsible block with the rule name and scenario count in the summary. Patterns with fewer than 3 rules render rules flat. Summary level never produces collapsible blocks. | Behavior sections with many rules produce substantial content at detailed level. Collapsible blocks enable progressive disclosure so readers can expand only the rules they need. |
|
|
911
|
+
| Link-out blocks provide source file cross-references | At standard and detailed levels, each behavior pattern includes a link-out block referencing its source file path. At summary level, link-out blocks are omitted for compact output. | Cross-reference links enable readers to navigate from generated documentation to the annotated source files, closing the loop between generated docs and the single source of truth. |
|
|
912
|
+
| Include tags route cross-cutting content into reference documents | Patterns with matching include tags appear alongside category-selected patterns in the behavior section. The merging is additive (OR semantics). | Cross-cutting patterns (e.g., shared utilities, common validators) belong in multiple reference documents; without include-tag routing, these patterns would only appear in their home category, leaving dependent documents incomplete. |
|
|
913
|
+
|
|
914
|
+
### Reference Codec Diagram Testing
|
|
915
|
+
|
|
916
|
+
| Rule | Invariant | Rationale |
|
|
917
|
+
| ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
918
|
+
| Scoped diagrams are generated from diagramScopes config | Diagram content is determined exclusively by diagramScopes filters (archContext, include, archLayer, patterns), and filters compose via OR — a pattern matching any single filter appears in the diagram. | Without filter-driven scoping, diagrams would include all patterns regardless of relevance, producing unreadable visualizations that obscure architectural boundaries. |
|
|
919
|
+
| Hardcoded diagram sources render deterministic output | Hardcoded diagram sources render without relationship-scoping input and emit stable, source-specific Mermaid content. | Domain diagrams such as pipeline and MasterDataset fan-out encode canonical architecture views that should not depend on ad-hoc test dataset shape. |
|
|
920
|
+
| Multiple diagram scopes produce multiple mermaid blocks | Each entry in the diagramScopes array produces an independent Mermaid block with its own title and direction. | Product areas require multiple architectural views (e.g., system overview and data flow) from a single configuration. |
|
|
921
|
+
|
|
922
|
+
### Reference Codec Diagram Type Testing
|
|
923
|
+
|
|
924
|
+
| Rule | Invariant | Rationale |
|
|
925
|
+
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
926
|
+
| Diagram type controls Mermaid output format | The diagramType field on DiagramScope selects the Mermaid output format. Supported types are graph (flowchart, default), sequenceDiagram, and stateDiagram-v2. Each type produces syntactically valid Mermaid output with type-appropriate node and edge rendering. | Flowcharts cannot naturally express event flows (sequence), FSM visualization (state), or temporal ordering. Multiple diagram types unlock richer architectural documentation from the same relationship data. |
|
|
927
|
+
| Edge labels and custom node shapes enrich diagram readability | Relationship edges display labels describing the relationship type (uses, depends on, implements, extends). Edge labels are enabled by default and can be disabled via showEdgeLabels false. Node shapes in flowchart diagrams vary by archRole value using Mermaid shape syntax. | Unlabeled edges are ambiguous without consulting a legend. Custom node shapes make archRole visually distinguishable without color reliance, improving accessibility and scanability. |
|
|
928
|
+
|
|
929
|
+
### Reference Doc Showcase
|
|
930
|
+
|
|
931
|
+
| Rule | Invariant | Rationale |
|
|
932
|
+
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
933
|
+
| Deep behavior rendering replaces shallow truncation | At standard and detailed levels, behavior sections render full rule descriptions with parsed invariant, rationale, and verified-by content. At summary level, the 120-character truncation is preserved for compact output. Behavior rendering reuses parseBusinessRuleAnnotations from the convention extractor rather than reimplementing structured content parsing. | The current 120-character truncation discards invariants, rationale, and verified-by content that is already extracted and available in BusinessRule.description. Reference documents need the full rule content to serve as authoritative documentation. The convention extractor already parses this structured content via parseBusinessRuleAnnotations -- the behavior builder should delegate to the same function. |
|
|
934
|
+
| Shape sections include JSDoc prose and property documentation | At standard level, shape code blocks are preceded by JSDoc prose when available. At detailed level, interface shapes additionally render a property documentation table. At summary level, only the type-kind table appears. Shapes without JSDoc render code blocks without preceding paragraph. | JSDoc on shapes contains design rationale and usage guidance that is already extracted by the shape extractor. Gating it behind detailed level wastes the data at the most common detail level (standard). The fix is a single condition change: reference.ts line 342 from detailLevel === 'detailed' to detailLevel !== 'summary'. |
|
|
935
|
+
| Diagram scope supports archLayer filtering and multiple diagram types | DiagramScope gains optional archLayer and diagramType fields. The archLayer filter selects patterns by their architectural layer (domain, application, infrastructure) and composes with archContext and archView via OR logic, consistent with existing filter dimensions. The diagramType field controls Mermaid output format: graph (default), sequenceDiagram, stateDiagram-v2, C4Context, classDiagram. Each diagram type has its own node and edge syntax appropriate to the Mermaid specification. | Layer-based views are fundamental to layered architecture documentation -- a developer reviewing the domain layer wants only deciders and value objects, not infrastructure adapters. Multiple diagram types unlock event flow documentation (sequence), FSM visualization (state), architecture overview (C4), and type hierarchy views (class) that flowcharts cannot express naturally. |
|
|
936
|
+
| Every renderable block type appears in the showcase document | The generated REFERENCE-SAMPLE.md at detailed level must contain at least one instance of each of the 9 block types: heading, paragraph, separator, table, list, code, mermaid, collapsible, link-out. At summary level, progressive disclosure blocks (collapsible, link-out) are omitted for compact output. | The sample document is the integration test for the reference codec. If any block type is missing, there is no automated verification that the codec can produce it. Coverage of all 9 types validates the full rendering pipeline from MasterDataset through codec through renderer. |
|
|
937
|
+
| Edge labels and custom node shapes enrich diagram readability | Relationship edges in scoped diagrams display labels describing the relationship semantics (uses, dependsOn, implements, extends). Edge labels are enabled by default and can be disabled via a showEdgeLabels option for compact diagrams. Node shapes vary by archRole value -- services use rounded rectangles, bounded contexts use subgraphs, projections use cylinders, and sagas use hexagons. | Unlabeled edges are ambiguous -- a reader seeing a solid arrow cannot distinguish "uses" from "implements" without consulting an edge style legend. Custom node shapes leverage Mermaid's shape vocabulary to make archRole visually distinguishable without color reliance, improving accessibility. |
|
|
938
|
+
| Extraction pipeline surfaces complete API documentation | ExportInfo.signature shows full function parameter types and return type instead of the placeholder value. JSDoc param, returns, and throws tags are extracted and stored on ExtractedShape. Property-level JSDoc preserves full multi-line content without first-line truncation. Auto-shape discovery mode extracts all exported types from files matching source-selector globs globs without requiring explicit extract-shapes annotations. | Function signatures are the most valuable API surface -- they show what a pattern exports without source navigation. The ExportInfo.signature field already exists in the schema but holds a lossy placeholder. The fix is approximately 15 lines in ast-parser.ts: threading sourceCode into extractFromDeclaration and slicing parameter ranges. Auto-shape discovery eliminates manual annotation burden for files that match source-selector globs. |
|
|
939
|
+
| Infrastructure enables flexible document composition and AI-optimized output | CompositeCodec assembles reference documents from multiple codec outputs by concatenating RenderableDocument sections. The modular claude-md renderer produces token-efficient output using section markers optimized for LLM consumption. The Gherkin tag extractor uses TagRegistry metadata instead of hardcoded if/else branches, making new tag addition a zero-code-change operation. Convention content can be extracted from TypeScript JSDoc blocks containing structured Invariant/Rationale annotations, not only from Gherkin Rule blocks. | CompositeCodec enables referenceDocConfigs to include content from any codec, not just the current 4 sources. The modular claude-md renderer unifies two formatting paths (codec-based markdown vs hand-written markers in context-formatter.ts). Data-driven tag extraction cuts the maintenance burden of the 40-branch if/else in gherkin-ast-parser.ts roughly in half. TypeScript convention extraction enables self-documenting business rules in implementation files alongside their code. |
|
|
940
|
+
|
|
941
|
+
### Reference Generator Testing
|
|
942
|
+
|
|
943
|
+
| Rule | Invariant | Rationale |
|
|
944
|
+
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
945
|
+
| Registration produces the correct number of generators | Each reference config produces exactly 2 generators (detailed + summary), plus meta-generators for product-area and non-product-area routing. | The count is deterministic from config — any mismatch indicates a registration bug that would silently drop generated documents. |
|
|
946
|
+
| Product area configs produce a separate meta-generator | Configs with productArea set route to "product-area-docs" meta-generator; configs without route to "reference-docs". | Product area docs are rendered into per-area subdirectories while standalone references go to the root output. |
|
|
947
|
+
| Generator naming follows kebab-case convention | Detailed generators end in "-reference" and summary generators end in "-reference-claude". | Consistent naming enables programmatic discovery and distinguishes human-readable from AI-optimized outputs. |
|
|
948
|
+
| Generator execution produces markdown output | Every registered generator must produce at least one non-empty output file when given matching data. | A generator that produces empty output wastes a pipeline slot and creates confusion when expected docs are missing. |
|
|
949
|
+
|
|
950
|
+
### Remaining Work Enhancement
|
|
951
|
+
|
|
952
|
+
| Rule | Invariant | Rationale |
|
|
953
|
+
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
954
|
+
| Priority-based sorting surfaces critical work first | Phases with higher priority always appear before lower-priority phases when sorting by priority. | Without priority sorting, critical work gets buried under low-priority items, delaying urgent deliverables. |
|
|
955
|
+
| Effort parsing converts duration strings to comparable hours | Effort strings must be parsed to a common unit (hours) for accurate sorting across different time scales. | Comparing raw strings like "2h" and "3d" lexicographically produces incorrect ordering; normalization to hours ensures consistent comparison. |
|
|
956
|
+
| Quarter grouping organizes planned work into time-based buckets | Phases with a quarter tag are grouped under their quarter heading; phases without a quarter appear under Unscheduled. | Flat lists obscure time-based planning; grouping by quarter lets planners see what is committed per period and what remains unscheduled. |
|
|
957
|
+
| Priority grouping organizes phases by urgency level | Phases are grouped under their priority heading; phases without priority appear under Unprioritized. | Mixing priority levels in a flat list forces readers to visually scan for urgency; grouping by priority makes triage immediate. |
|
|
958
|
+
| Progressive disclosure prevents information overload in large backlogs | When the backlog exceeds maxNextActionable, only the top N phases are shown with a link or count for the remainder. | Displaying hundreds of phases in the summary overwhelms planners; progressive disclosure keeps the summary scannable while preserving access to the full backlog. |
|
|
959
|
+
| Edge cases are handled gracefully | Empty or fully-blocked backlogs produce meaningful output instead of errors or blank sections. | Blank or errored output when the backlog is empty confuses users into thinking the generator is broken rather than reflecting a genuinely empty state. |
|
|
960
|
+
| Default behavior preserves backward compatibility | Without explicit sortBy or groupPlannedBy options, phases are sorted by phase number in a flat list. | Changing default behavior would break existing consumers that rely on phase-number ordering without specifying options. |
|
|
961
|
+
|
|
962
|
+
### Remaining Work Summary Accuracy
|
|
963
|
+
|
|
964
|
+
| Rule | Invariant | Rationale |
|
|
965
|
+
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
966
|
+
| Summary totals equal sum of phase table rows | The summary Active and Total Remaining counts must exactly equal the sum of the corresponding counts across all phase table rows. | A mismatch between summary and phase-level totals indicates patterns are being double-counted or dropped. |
|
|
967
|
+
| Patterns without phases appear in Backlog row | Patterns that have no assigned phase must be grouped into a "Backlog" row in the phase table rather than being omitted. | Unphased patterns are still remaining work; omitting them would undercount the total. |
|
|
968
|
+
| Patterns without patternName are counted using id | Pattern counting must use pattern.id as the identifier, never patternName, so that patterns with undefined names are neither double-counted nor omitted. | patternName is optional; relying on it for counting would miss unnamed patterns entirely. |
|
|
969
|
+
| All phases with incomplete patterns are shown | The phase table must include every phase that contains at least one incomplete pattern, and phases with only completed patterns must be excluded. | Showing fully completed phases inflates the remaining work view, while omitting phases with incomplete patterns hides outstanding work. |
|
|
970
|
+
|
|
971
|
+
### Renderer Block Types
|
|
972
|
+
|
|
973
|
+
| Rule | Invariant | Rationale |
|
|
974
|
+
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
975
|
+
| Document metadata renders as frontmatter before sections | Title always renders as H1, purpose and detail level render as bold key-value pairs separated by horizontal rule. | Consistent frontmatter structure allows downstream tooling and readers to reliably locate the document title and metadata without parsing the full body. |
|
|
976
|
+
| Headings render at correct markdown levels with clamping | Heading levels are clamped to the valid range 1-6 regardless of input value. | Markdown only supports heading levels 1-6; unclamped values would produce invalid syntax that renders as plain text in all markdown processors. |
|
|
977
|
+
| Paragraphs and separators render as plain text and horizontal rules | Paragraph content passes through unmodified, including special markdown characters. Separators render as horizontal rules. | The renderer is a dumb printer; altering paragraph content would break codec-controlled formatting and violate the separation between codec logic and rendering. |
|
|
978
|
+
| Tables render with headers, alignment, and cell escaping | Tables must escape pipe characters, convert newlines to line breaks, and pad short rows to match column count. | Unescaped pipes corrupt table column boundaries, raw newlines break row parsing, and short rows cause column misalignment in every markdown renderer. |
|
|
979
|
+
| Lists render in unordered, ordered, checkbox, and nested formats | List type determines prefix: dash for unordered, numbered for ordered, checkbox syntax for checked items. Nesting adds two-space indentation per level. | Incorrect prefixes or indentation levels cause markdown parsers to break list continuity, rendering nested items as separate top-level lists or plain text. |
|
|
980
|
+
|
|
981
|
+
### Renderer Output Formats
|
|
982
|
+
|
|
983
|
+
| Rule | Invariant | Rationale |
|
|
984
|
+
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
985
|
+
| Code blocks and mermaid diagrams render with fenced syntax | Code blocks use triple backtick fencing with optional language hint. Mermaid blocks use mermaid as the language hint. | Inconsistent fencing breaks syntax highlighting in GitHub/IDE markdown previews and prevents Mermaid renderers from detecting diagram blocks. |
|
|
986
|
+
| Collapsible blocks render as HTML details elements | Summary text is HTML-escaped to prevent injection. Collapsible content renders between details tags. | Unescaped HTML in summary text enables XSS when generated markdown is rendered in browsers; malformed details tags break progressive disclosure in documentation. |
|
|
987
|
+
| Link-out blocks render as markdown links with URL encoding | Link paths with spaces are percent-encoded for valid URLs. | Unencoded spaces produce broken links in markdown renderers, making cross-document navigation fail silently for files with spaces in their paths. |
|
|
988
|
+
| Multi-file documents produce correct output file collections | Output file count equals 1 (main) plus additional file count. The first output file always uses the provided base path. | A mismatch between expected and actual file count causes the orchestrator to write orphaned files or miss outputs, corrupting the generated documentation directory. |
|
|
989
|
+
| Complex documents render all block types in sequence | Multiple block types in a single document render in order without interference. | Block ordering reflects the codec's semantic structure; out-of-order or swallowed blocks would produce misleading documentation that diverges from the source of truth. |
|
|
990
|
+
| Claude MD module renderer produces modular-claude-md compatible output | Title renders as H3 (offset +2), section headings are offset by +2 clamped at H6, frontmatter is omitted, mermaid blocks are omitted, link-out blocks are omitted, and collapsible blocks are flattened to headings. | The modular-claude-md system manages CLAUDE.md as composable H3-rooted modules. Generating incompatible formats (like section markers) produces orphaned files that are never consumed. |
|
|
991
|
+
|
|
992
|
+
### Reporting Codec Testing
|
|
993
|
+
|
|
994
|
+
| Rule | Invariant | Rationale |
|
|
995
|
+
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
996
|
+
| ChangelogCodec follows Keep a Changelog format | Releases must be sorted by semver descending, unreleased patterns grouped under "[Unreleased]", and change types follow the standard order (Added, Changed, Deprecated, Removed, Fixed, Security). | Keep a Changelog is an industry standard format — following it ensures the output is immediately familiar to developers. |
|
|
997
|
+
| TraceabilityCodec maps timeline patterns to behavior tests | Coverage statistics must show total timeline phases, those with behavior tests, those missing, and a percentage. Gaps must be surfaced prominently. | Traceability ensures every planned pattern has executable verification — gaps represent unverified claims about system behavior. |
|
|
998
|
+
| OverviewCodec provides project architecture summary | The overview must include architecture sections from overview-tagged patterns, pattern summary with progress percentage, and timeline summary with phase counts. | The architecture overview is the primary entry point for understanding the project — it must provide a complete picture at a glance. |
|
|
999
|
+
|
|
1000
|
+
### Requirements Adr Codec Testing
|
|
1001
|
+
|
|
1002
|
+
| Rule | Invariant | Rationale |
|
|
1003
|
+
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1004
|
+
| RequirementsDocumentCodec generates PRD-style documentation from patterns | RequirementsDocumentCodec transforms MasterDataset patterns into a PRD-style document with flexible grouping (product area, user role, or phase), optional detail file generation, and business value rendering. | Flexible grouping lets stakeholders view requirements through their preferred lens (area, role, or phase), and detail files provide deep-dive context without bloating the summary document. |
|
|
1005
|
+
| AdrDocumentCodec documents architecture decisions | AdrDocumentCodec transforms MasterDataset ADR patterns into an architecture decision record document with status tracking, category/phase/date grouping, supersession relationships, and optional detail file generation. | Architecture decisions lose value without status tracking and supersession chains; without them, teams act on outdated decisions and cannot trace why a previous approach was abandoned. |
|
|
1006
|
+
|
|
1007
|
+
### Rich Content Helpers Testing
|
|
1008
|
+
|
|
1009
|
+
| Rule | Invariant | Rationale |
|
|
1010
|
+
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1011
|
+
| DocString parsing handles edge cases | DocString parsing must gracefully handle empty input, missing language hints, unclosed delimiters, and non-LF line endings without throwing errors. | Codecs receive uncontrolled user content from feature file descriptions; unhandled edge cases would crash document generation for the entire pipeline. |
|
|
1012
|
+
| DataTable rendering produces valid markdown | DataTable rendering must produce a well-formed table block for any number of rows, substituting empty strings for missing cell values. | Malformed tables break markdown rendering and downstream tooling; missing cells would produce undefined values that corrupt table alignment. |
|
|
1013
|
+
| Scenario content rendering respects options | Scenario rendering must honor the includeSteps option, producing step lists only when enabled, and must include embedded DataTables when present. | Ignoring the includeSteps option would bloat summary views with unwanted detail, and dropping embedded DataTables would lose structured test data. |
|
|
1014
|
+
| Business rule rendering handles descriptions | Business rule rendering must always include the rule name as a bold paragraph, and must parse descriptions for embedded DocStrings when present. | Omitting the rule name makes rendered output unnavigable, and skipping DocString parsing would output raw delimiter syntax instead of formatted code blocks. |
|
|
1015
|
+
| DocString content is dedented when parsed | DocString code blocks must be dedented to remove common leading whitespace while preserving internal relative indentation, empty lines, and trimming trailing whitespace from each line. | Without dedentation, code blocks inherit the Gherkin indentation level, rendering as deeply indented and unreadable in generated markdown. |
|
|
1016
|
+
|
|
1017
|
+
### Robustness Integration
|
|
1018
|
+
|
|
1019
|
+
| Rule | Invariant | Rationale |
|
|
1020
|
+
| --------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
1021
|
+
| Validation runs before extraction in the pipeline | Validation must complete and pass before extraction begins. | Prevents wasted extraction work and provides clear fail-fast behavior. |
|
|
1022
|
+
| Deduplication runs after extraction before assembly | Deduplication processes all extracted content before document assembly. | All sources must be extracted to identify cross-source duplicates. |
|
|
1023
|
+
| Warnings from all stages are collected and reported | Warnings from all pipeline stages are aggregated in the result. | Users need visibility into non-fatal issues without blocking generation. |
|
|
1024
|
+
| Pipeline provides actionable error messages | Error messages include context and fix suggestions. | Users should fix issues in one iteration without guessing. |
|
|
1025
|
+
| Existing decision documents continue to work | Valid existing decision documents generate without new errors. | Robustness improvements must be backward compatible. |
|
|
1026
|
+
|
|
1027
|
+
### Rule Keyword Po C
|
|
1028
|
+
|
|
1029
|
+
| Rule | Invariant | Rationale |
|
|
1030
|
+
| ------------------------------------------ | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1031
|
+
| Basic arithmetic operations work correctly | Arithmetic operations must return mathematically correct results for all valid inputs. | Incorrect arithmetic results silently corrupt downstream calculations, making errors undetectable at their source. The calculator should perform standard math operations with correct results. |
|
|
1032
|
+
| Division has special constraints | Division operations must reject a zero divisor before execution. | Unguarded division by zero causes runtime exceptions that crash the process instead of returning a recoverable error. Division by zero must be handled gracefully to prevent system errors. |
|
|
1033
|
+
|
|
1034
|
+
### Scoped Architectural View
|
|
1035
|
+
|
|
1036
|
+
| Rule | Invariant | Rationale |
|
|
1037
|
+
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1038
|
+
| Scope filtering selects patterns by context, view, or name | A pattern matches a DiagramScope if ANY of three conditions hold: its name is in `scope.patterns`, its `archContext` is in `scope.archContext`, or any of its `archView` entries is in `scope.archView`. These dimensions are OR'd together -- a pattern need only match one. | Three filter dimensions cover different authoring workflows. Explicit names for ad-hoc documents, archContext for bounded context views, archView for cross-cutting architectural perspectives. |
|
|
1039
|
+
| Neighbor discovery finds connected patterns outside scope | Patterns connected to scope patterns via relationship edges (uses, dependsOn, implementsPatterns, extendsPattern) but NOT themselves in scope appear in a "Related" subgraph with dashed border styling. | Scoped views need context. Showing only in-scope patterns without their dependencies loses critical relationship information. Neighbor patterns provide this context without cluttering the main view. |
|
|
1040
|
+
| Multiple diagram scopes compose in sequence | When `diagramScopes` is an array, each scope produces its own Mermaid diagram section with independent title, direction, and pattern selection. At summary detail level, all diagrams are suppressed. | A single reference document may need multiple architectural perspectives. Pipeline Overview shows both a codec transformation view (TB) and a pipeline data flow view (LR) in the same document. |
|
|
1041
|
+
|
|
1042
|
+
### Session Codec Testing
|
|
1043
|
+
|
|
1044
|
+
| Rule | Invariant | Rationale |
|
|
1045
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1046
|
+
| SessionContextCodec provides working context for AI sessions | Session context must include session status with active/completed/remaining counts, phase navigation for incomplete phases, and active work grouped by phase. | AI agents need a compact, navigable view of current project state to make informed implementation decisions. |
|
|
1047
|
+
| RemainingWorkCodec aggregates incomplete work by phase | Remaining work must show status counts, phase-grouped navigation, priority classification (in-progress/ready/blocked), and next actionable items. | Remaining work visibility prevents scope blindness — knowing what's left, what's blocked, and what's ready drives efficient session planning. |
|
|
1048
|
+
|
|
1049
|
+
### Session Guides Module Source
|
|
1050
|
+
|
|
1051
|
+
| Rule | Invariant | Rationale |
|
|
1052
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1053
|
+
| SESSION-GUIDES.md is the authoritative public human reference | `docs/SESSION-GUIDES.md` exists and is not deleted, shortened, or replaced with a redirect. Its comprehensive checklists, CLI command examples, and session decision trees serve developers on libar.dev. | Session workflow guidance requires two formats for two audiences. Public developers need comprehensive checklists with full examples. AI sessions need compact invariants they can apply without reading 389 lines. |
|
|
1054
|
+
| CLAUDE.md session workflow content is derived, not hand-authored | After Phase 39 generation deliverables complete, the "Session Workflows" section in CLAUDE.md contains no manually-authored content. It is composed from generated `_claude-md/workflow/` modules. | A hand-maintained CLAUDE.md session section creates two copies of session workflow guidance with no synchronization mechanism. Regeneration from annotated source eliminates drift. |
|
|
1055
|
+
| Session type determines artifacts and FSM changes | Four 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. | Session type confusion causes wasted work — a design mistake discovered mid-implementation wastes the entire session. Clear contracts prevent scope bleeding between session types. |
|
|
1056
|
+
| Planning sessions produce roadmap specs only | A planning session creates a roadmap spec with metadata, deliverables table, Rule: blocks with invariants, and scenarios. It must not produce implementation code, transition to active, or prompt for implementation readiness. | Planning is the cheapest session type — it produces .feature file edits, no compilation needed. Mixing implementation into planning defeats the cost advantage and introduces untested code without a locked scope. |
|
|
1057
|
+
| Design sessions produce decisions and stubs only | A design session makes architectural decisions and creates code stubs with interfaces. It must not produce implementation code. Context gathering via the Process Data API must precede any explore agent usage. | Design sessions resolve ambiguity before implementation begins. Code stubs in architect/stubs/ live outside src/ to avoid TypeScript compilation and ESLint issues, making them zero-risk artifacts. |
|
|
1058
|
+
| Implementation sessions follow FSM-enforced execution order | Implementation sessions must follow a strict 5-step execution order. Transition to active must happen before any code changes. Transition to completed must happen only when ALL deliverables are done. Skipping steps causes Process Guard rejection at commit time. | The execution order ensures FSM state accurately reflects work state at every point. Writing code before transitioning to active means Process Guard sees changes to a roadmap spec (no scope protection). Marking completed with incomplete work creates a hard-locked state that requires unlock-reason to fix. |
|
|
1059
|
+
| FSM errors have documented fixes | Every Process Guard error code has a defined cause and fix. The error codes, causes, and fixes form a closed set — no undocumented error states exist. | Undocumented FSM errors cause session-blocking confusion. A lookup table from error code to fix eliminates guesswork and prevents workarounds that bypass process integrity. |
|
|
1060
|
+
| Handoff captures session-end state for continuity | Multi-session work requires handoff documentation generated from the Process Data API. Handoff output always reflects actual annotation state, not manual notes. | Manual session notes drift from actual deliverable state. The handoff command derives state from annotations, ensuring the next session starts from ground truth rather than stale notes. |
|
|
1061
|
+
| ClaudeModuleGeneration is the generation mechanism | Phase 39 depends on ClaudeModuleGeneration (Phase 25). Adding `@architect-claude-module` and `@architect-claude-section:workflow` tags to this spec will cause ClaudeModuleGeneration to produce `_claude-md/workflow/` output files. The hand-written `_claude-md/workflow/` files are deleted after successful verified generation. | The annotation work (Rule blocks in this spec) is immediately useful — queryable via `pnpm process:query -- rules`. Generation deliverables cannot complete until Phase 25 ships the ClaudeModuleCodec. This sequencing is intentional: the annotation investment has standalone value regardless of whether the codec exists yet. |
|
|
1062
|
+
|
|
1063
|
+
### Shape Matcher Testing
|
|
1064
|
+
|
|
1065
|
+
| Rule | Invariant | Rationale |
|
|
1066
|
+
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1067
|
+
| Exact paths match without wildcards | A pattern without glob characters must match only the exact file path, character for character. | Loose matching on non-glob patterns would silently include unintended files, causing incorrect shapes to appear in generated documentation. |
|
|
1068
|
+
| Single-level globs match one directory level | A single `*` glob must match files only within the specified directory, never crossing directory boundaries. | Crossing directory boundaries would violate standard glob semantics and pull in shapes from nested modules that belong to different product areas. |
|
|
1069
|
+
| Recursive globs match any depth | A `**` glob must match files at any nesting depth below the specified prefix, while still respecting extension and prefix constraints. | Recursive globs enable broad subtree selection for shape extraction; failing to respect prefix and extension constraints would leak unrelated shapes into the output. |
|
|
1070
|
+
| Source selectors deduplicate matching shapes by name | When multiple patterns match a source selector, the returned shapes must be deduplicated by name so each shape appears at most once. | Duplicate shape names in generated documentation confuse readers and inflate type registries. |
|
|
1071
|
+
|
|
1072
|
+
### Shape Selector Testing
|
|
1073
|
+
|
|
1074
|
+
| Rule | Invariant | Rationale |
|
|
1075
|
+
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1076
|
+
| Reference doc configs select shapes via shapeSelectors | shapeSelectors provides three selection modes: by source path + specific names, by group tag, or by source path alone. | Multiple selection modes let reference docs curate precisely which shapes appear, preventing either over-inclusion of internal types or under-inclusion of public API surfaces. |
|
|
1077
|
+
|
|
1078
|
+
### Source Mapper Testing
|
|
1079
|
+
|
|
1080
|
+
| Rule | Invariant | Rationale |
|
|
1081
|
+
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1082
|
+
| Extraction methods dispatch to correct handlers | Each extraction method type (self-reference, TypeScript, Gherkin) must dispatch to the correct specialized handler based on the source file type or marker. | Wrong dispatch would apply TypeScript extraction logic to Gherkin files (or vice versa), producing garbled or empty results. |
|
|
1083
|
+
| Self-references extract from current decision document | THIS DECISION self-references must extract content from the current decision document using rule descriptions, DocStrings, or full document access. | Self-references avoid circular file reads — the document content is already in memory, so extraction is a lookup operation rather than a file I/O operation. |
|
|
1084
|
+
| Multiple sources are aggregated in mapping order | When multiple source mappings target the same section, their extracted content must be aggregated in the order defined by the mapping table. | Mapping order is intentional — authors structure their source tables to produce a logical reading flow, and reordering would break the narrative. |
|
|
1085
|
+
| Missing files produce warnings without failing | When a referenced source file does not exist, the mapper must produce a warning and continue processing remaining mappings rather than failing entirely. | Partial extraction is more useful than total failure — a decision document with most sections populated and one warning is better than no document at all. |
|
|
1086
|
+
| Empty extraction results produce info warnings | When extraction succeeds but produces empty results (no matching shapes, no matching rules), an informational warning must be generated. | Empty results often indicate stale source mappings pointing to renamed or removed content — warnings surface these issues before they reach generated output. |
|
|
1087
|
+
| Extraction methods are normalized for dispatch | Extraction method strings must be normalized to canonical forms before dispatch, with unrecognized methods producing a warning. | Users write extraction methods in natural language — normalization bridges the gap between human-readable table entries and programmatic dispatch keys. |
|
|
1088
|
+
|
|
1089
|
+
### Source Mapping Validator Testing
|
|
1090
|
+
|
|
1091
|
+
| Rule | Invariant | Rationale |
|
|
1092
|
+
| --------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
1093
|
+
| Source files must exist and be readable | All source file paths in mappings must resolve to existing, readable files. | Prevents extraction failures and provides clear error messages upfront. |
|
|
1094
|
+
| Extraction methods must be valid and supported | Extraction methods must match a known method from the supported set. | Invalid methods cannot extract content; suggest valid alternatives. |
|
|
1095
|
+
| Extraction methods must be compatible with file types | Method-file combinations must be compatible (e.g., TypeScript methods for .ts files). | Incompatible combinations fail at extraction; catch early with clear guidance. |
|
|
1096
|
+
| Source mapping tables must have required columns | Tables must contain Section, Source File, and Extraction Method columns. | Missing columns prevent extraction; alternative column names are mapped. |
|
|
1097
|
+
| All validation errors are collected and returned together | Validation collects all errors before returning, not just the first. | Enables users to fix all issues in a single iteration. |
|
|
1098
|
+
|
|
1099
|
+
### Table Extraction
|
|
1100
|
+
|
|
1101
|
+
| Rule | Invariant | Rationale |
|
|
1102
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1103
|
+
| Tables in rule descriptions render exactly once | Each markdown table in a rule description appears exactly once in the rendered output, with no residual pipe characters in surrounding text. | Without deduplication, tables extracted for formatting would also remain in the raw description text, producing duplicate output. |
|
|
1104
|
+
| Multiple tables in description each render exactly once | When a rule description contains multiple markdown tables, each table renders as a separate formatted table block with no merging or duplication. | Merging or dropping tables would lose distinct data structures that the author intentionally separated, corrupting the rendered documentation. |
|
|
1105
|
+
| stripMarkdownTables removes table syntax from text | stripMarkdownTables removes all pipe-delimited table syntax from input text while preserving all surrounding content unchanged. | If table syntax is not stripped from the raw text, the same table data appears twice in the rendered output -- once from the extracted table block and once as raw pipe characters in the description. |
|
|
1106
|
+
|
|
1107
|
+
### Taxonomy Codec Testing
|
|
1108
|
+
|
|
1109
|
+
| Rule | Invariant | Rationale |
|
|
1110
|
+
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1111
|
+
| Document metadata is correctly set | The taxonomy document must have the title "Taxonomy Reference", a descriptive purpose string, and a detail level reflecting the generateDetailFiles option. | Document metadata drives the table of contents and navigation in generated doc sites — incorrect metadata produces broken links and misleading titles. |
|
|
1112
|
+
| Categories section is generated from TagRegistry | The categories section must render all categories from the configured TagRegistry as a table, with optional linkOut to detail files when progressive disclosure is enabled. | Categories are the primary navigation structure in the taxonomy — missing categories leave developers unable to find the correct annotation tags. |
|
|
1113
|
+
| Metadata tags can be grouped by domain | When groupByDomain is enabled, metadata tags must be organized into domain-specific subsections; when disabled, a single flat table must be rendered. | Domain grouping improves scannability for large tag sets (21 categories in ddd-es-cqrs) while flat mode is simpler for small presets (3 categories in libar-generic). |
|
|
1114
|
+
| Tags are classified into domains by hardcoded mapping | Tags must be classified into domains (Core, Relationship, Timeline, etc.) using a hardcoded mapping, with unrecognized tags placed in an "Other Tags" group. | Domain classification is stable across releases — hardcoding prevents miscategorization from user config errors while the "Other" fallback handles future tag additions gracefully. |
|
|
1115
|
+
| Optional sections can be disabled via codec options | Format Types, Presets, and Architecture sections must each be independently disableable via their respective codec option flags. | Not all projects need all sections — disabling irrelevant sections reduces generated document size and prevents confusion from inapplicable content. |
|
|
1116
|
+
| Detail files are generated for progressive disclosure | When generateDetailFiles is enabled, the codec must produce additional detail files (one per domain group) alongside the main taxonomy document; when disabled, no additional files are created. | Progressive disclosure keeps the main document scannable while providing deep-dive content in linked pages — monolithic documents become unwieldy for large tag sets. |
|
|
1117
|
+
| Format types are documented with descriptions and examples | All 6 format types must be documented with descriptions and usage examples in the generated taxonomy. | Format types control how tag values are parsed — undocumented formats force developers to guess the correct syntax, leading to annotation errors. |
|
|
1118
|
+
|
|
1119
|
+
### Test Content Blocks
|
|
1120
|
+
|
|
1121
|
+
| Rule | Invariant | Rationale |
|
|
1122
|
+
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1123
|
+
| Business rules appear as a separate section | Every Rule block must produce a distinct Business Rule entry containing its description and associated scenarios. | Without guaranteed capture, rule descriptions and rich content (DocStrings, DataTables) would be silently dropped from generated documentation. Rule descriptions provide context for why this business rule exists. You can include multiple paragraphs here. This is a second paragraph explaining edge cases or exceptions. |
|
|
1124
|
+
| Multiple rules create multiple Business Rule entries | Each Rule keyword in a feature file must produce its own independent Business Rule entry in generated output. | Merging rules into a single entry would collapse distinct business domains, making it impossible to trace scenarios back to their governing constraint. Each Rule keyword creates a separate entry in the Business Rules section. This helps organize complex features into logical business domains. |
|
|
1125
|
+
|
|
1126
|
+
### Timeline Codec Testing
|
|
1127
|
+
|
|
1128
|
+
| Rule | Invariant | Rationale |
|
|
1129
|
+
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
1130
|
+
| RoadmapDocumentCodec groups patterns by phase with progress tracking | The roadmap must include overall progress with percentage, phase navigation table, and phase sections with pattern tables. | The roadmap is the primary planning artifact — progress tracking at both project and phase level enables informed prioritization. |
|
|
1131
|
+
| CompletedMilestonesCodec shows only completed patterns grouped by quarter | Only completed patterns appear, grouped by quarter with navigation, recent completions, and collapsible phase details. | Milestone tracking provides a historical record of delivery — grouping by quarter aligns with typical reporting cadence. |
|
|
1132
|
+
| CurrentWorkCodec shows only active patterns with deliverables | Only active patterns appear with progress bars, deliverable tracking, and an all-active-patterns summary table. | Current work focus eliminates noise from completed and planned items — teams need to see only what's in flight. |
|
|
1133
|
+
|
|
1134
|
+
### Traceability Generator
|
|
1135
|
+
|
|
1136
|
+
| Rule | Invariant | Rationale |
|
|
1137
|
+
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1138
|
+
| Cross-references Verified by annotations against actual scenarios | Every `verifiedBy` string extracted from a Rule description is matched against scenario names in the MasterDataset. The traceability matrix shows each Rule with its verification status: verified (all references resolve), partially verified (some resolve), or unverified (none resolve or no annotation). | `parseBusinessRuleAnnotations()` already extracts `verifiedBy` arrays from Rule descriptions. Without cross-referencing against actual scenario names, the traceability report cannot distinguish between claimed and actual test coverage. A dangling reference (scenario name that does not exist) is worse than no annotation because it creates false confidence. |
|
|
1139
|
+
| Detects orphan scenarios and unverified rules | Orphan scenarios (acceptance-criteria scenarios not referenced by any Rule's Verified by annotation) and unverified rules (Rules without a Verified by annotation or with zero matched scenarios) are listed in dedicated sections of the traceability output. | Coverage gaps indicate either missing traceability annotations or actual missing test coverage. Orphan scenarios may be valuable tests that lack traceability links, or dead tests that should be removed. Unverified rules are business constraints with no demonstrated test coverage. |
|
|
1140
|
+
| Traceability output is wired into the docs pipeline | The TraceabilityCodec output is generated as part of `pnpm docs:all` via a `docs:traceability` npm script backed by a ReferenceDocConfig entry in `architect.config.ts`. The output file lands in `docs-live/TRACEABILITY.md`. | The TraceabilityCodec is registered in the CodecRegistry but not wired into `architect.config.ts` or `package.json`. Without config wiring, the codec is only usable programmatically or via tests. Adding it to the docs pipeline makes traceability output a first-class generated artifact alongside CHANGELOG.md, OVERVIEW.md, and other reporting codecs. |
|
|
1141
|
+
|
|
1142
|
+
### Transform Dataset Testing
|
|
1143
|
+
|
|
1144
|
+
| Rule | Invariant | Rationale |
|
|
1145
|
+
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1146
|
+
| Empty dataset produces valid zero-state views | An empty input produces a MasterDataset with all counts at zero and no groupings. | Generators must handle the zero-state gracefully; a missing or malformed empty dataset would cause null-reference errors across all rendering codecs. |
|
|
1147
|
+
| Status and phase grouping creates navigable views | Patterns are grouped by canonical status and sorted by phase number, with per-phase status counts computed. | Generators need O(1) access to status-filtered and phase-ordered views without recomputing on each render pass. |
|
|
1148
|
+
| Quarter and category grouping organizes by timeline and domain | Patterns are grouped by quarter and category, with only patterns bearing the relevant metadata included in each view. | Timeline and domain views must exclude patterns without the relevant metadata to prevent misleading counts and empty groupings in generated documentation. |
|
|
1149
|
+
| Source grouping separates TypeScript and Gherkin origins | Patterns are partitioned by source file type, and patterns with phase metadata appear in the roadmap view. | Codecs that render TypeScript-specific or Gherkin-specific views depend on pre-partitioned sources; mixing sources would produce incorrect per-origin statistics and broken cross-references. |
|
|
1150
|
+
| Relationship index builds bidirectional dependency graph | The relationship index contains forward and reverse lookups, with reverse lookups merged and deduplicated against explicit annotations. | Bidirectional navigation is required for dependency tree queries without O(n) scans per lookup. |
|
|
1151
|
+
| Completion tracking computes project progress | Completion percentage is rounded to the nearest integer, and fully-completed requires all patterns in completed status with a non-zero total. | Inconsistent rounding or a false-positive fully-completed signal on an empty dataset would misrepresent project health in dashboards and generated progress reports. |
|
|
1152
|
+
| Workflow integration conditionally includes delivery process data | The workflow is included in the MasterDataset only when provided, and phase names are resolved from the workflow configuration. | Projects without a delivery workflow must still produce valid datasets; unconditionally requiring workflow data would break standalone documentation generation. |
|
|
1153
|
+
|
|
1154
|
+
### Universal Doc Generator Robustness
|
|
1155
|
+
|
|
1156
|
+
| Rule | Invariant | Rationale |
|
|
1157
|
+
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1158
|
+
| Context - PoC limitations prevent monorepo-scale operation | The document generator must produce correct, deduplicated output and surface all errors explicitly before operating at monorepo scale. | Silent failures and duplicated content in the PoC corrupt generated docs across all 210 target files, making bugs invisible until downstream consumers encounter broken documentation. |
|
|
1159
|
+
| Decision - Robustness requires four coordinated improvements | Robustness improvements must be implemented as four distinct, coordinated modules (deduplication, validation, warning collection, file validation) rather than ad-hoc fixes. | Scattering reliability fixes across existing code creates coupling and makes individual concerns untestable; isolated modules enable independent verification and replacement. |
|
|
1160
|
+
| Duplicate content must be detected and merged | No two sections in a generated document may have identical content fingerprints; duplicates must be merged into a single section with source attribution. | Duplicate sections confuse readers and inflate document size, undermining trust in generated documentation as a reliable replacement for manually maintained docs. Content fingerprinting identifies duplicate sections extracted from multiple sources. When duplicates are found, the system merges them intelligently based on source priority. |
|
|
1161
|
+
| Invalid source mappings must fail fast with clear errors | Every source mapping must pass pre-flight validation (file existence, method validity, readability) before any extraction is attempted. | Without pre-flight validation, invalid mappings produce silent failures or cryptic runtime errors, making it impossible to diagnose configuration problems at monorepo scale. Pre-flight validation catches configuration errors before extraction begins. This prevents silent failures and provides actionable error messages. |
|
|
1162
|
+
| Warnings must be collected and reported consistently | All non-fatal issues during extraction must be captured in a structured warning collector grouped by source, never emitted via console.warn. | Scattered console.warn calls are lost in CI output and lack source context, making it impossible to trace warnings back to the configuration entry that caused them. The warning collector replaces scattered console.warn calls with a structured system that aggregates warnings and reports them consistently. |
|
|
1163
|
+
| Consequence - Improved reliability at cost of stricter validation | Existing source mappings that previously succeeded silently may now fail validation and must be updated to conform to the stricter checks. | Allowing invalid mappings to bypass validation would preserve the silent-failure behavior the robustness work was designed to eliminate. |
|
|
1164
|
+
|
|
1165
|
+
### Validation Rules Codec Testing
|
|
1166
|
+
|
|
1167
|
+
| Rule | Invariant | Rationale |
|
|
1168
|
+
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1169
|
+
| Document metadata is correctly set | The validation rules document must have the title "Validation Rules", a purpose describing Process Guard, and a detail level reflecting the generateDetailFiles option. | Accurate metadata ensures the validation rules document is correctly indexed in the generated documentation site. |
|
|
1170
|
+
| All validation rules are documented in a table | All 6 Process Guard validation rules must appear in the rules table with their correct severity levels (error or warning). | The rules table is the primary reference for understanding what Process Guard enforces — missing rules would leave developers surprised by undocumented validation failures. |
|
|
1171
|
+
| FSM state diagram is generated from transitions | When includeFSMDiagram is enabled, a Mermaid state diagram showing all 4 FSM states and their transitions must be generated; when disabled, the diagram section must be omitted. | The state diagram is the most intuitive representation of allowed transitions — it answers "where can I go from here?" faster than a text table. |
|
|
1172
|
+
| Protection level matrix shows status protections | When includeProtectionMatrix is enabled, a matrix showing all 4 statuses with their protection levels must be generated; when disabled, the section must be omitted. | The protection matrix explains why certain edits are blocked — without it, developers encounter cryptic "scope-creep" or "completed-protection" errors without understanding the underlying model. |
|
|
1173
|
+
| CLI usage is documented with options and exit codes | When includeCLIUsage is enabled, the document must include CLI example code, all 6 options, and exit code documentation; when disabled, the section must be omitted. | CLI documentation in the validation rules doc provides a single reference for both the rules and how to run them — separate docs would fragment the developer experience. |
|
|
1174
|
+
| Escape hatches are documented for special cases | When includeEscapeHatches is enabled, all 3 escape hatch mechanisms must be documented; when disabled, the section must be omitted. | Escape hatches prevent the validation system from becoming a blocker — developers need to know how to safely bypass rules for legitimate exceptions. |
|
|
1175
|
+
|
|
1176
|
+
### Warning Collector Testing
|
|
1177
|
+
|
|
1178
|
+
| Rule | Invariant | Rationale |
|
|
1179
|
+
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1180
|
+
| Warnings are captured with source context | Each captured warning must include the source file path, optional line number, and category for precise identification. | Context-free warnings are impossible to act on — developers need to know which file and line produced the warning to fix the underlying issue. |
|
|
1181
|
+
| Warnings are categorized for filtering and grouping | Warnings must support multiple categories and be filterable by both category and source file. | Large codebases produce many warnings — filtering by category or file lets developers focus on one concern at a time instead of triaging an overwhelming flat list. |
|
|
1182
|
+
| Warnings are aggregated across the pipeline | Warnings from multiple pipeline stages must be collected into a single aggregated view, groupable by source file and summarizable by category counts. | Pipeline stages run independently — without aggregation, warnings would be scattered across stage outputs, making it impossible to see the full picture. |
|
|
1183
|
+
| Warnings integrate with the Result pattern | Warnings must propagate through the Result monad, being preserved in both successful and failed results and across pipeline stages. | The Result pattern is the standard error-handling mechanism — warnings that don't propagate through Results would be silently lost when functions compose. |
|
|
1184
|
+
| Warnings can be formatted for different outputs | Warnings must be formattable as colored console output, machine-readable JSON, and markdown for documentation, each with appropriate structure. | Different consumers need different formats — CI pipelines parse JSON, developers read console output, and generated docs embed markdown. |
|
|
1185
|
+
| Existing console.warn calls are migrated to collector | Pipeline components (source mapper, shape extractor) must use the warning collector instead of direct console.warn calls. | Direct console.warn calls bypass aggregation and filtering — migrating to the collector ensures all warnings are captured, categorized, and available for programmatic consumption. |
|
|
1186
|
+
|
|
1187
|
+
### Zod Codec Migration
|
|
1188
|
+
|
|
1189
|
+
| Rule | Invariant | Rationale |
|
|
1190
|
+
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1191
|
+
| Input codec parses and validates JSON in a single step | Every JSON string parsed through the input codec is both syntactically valid JSON and schema-conformant before returning a typed value. | Separating parse from validate allows invalid data to leak past the boundary — a single-step codec ensures callers never hold an unvalidated value. |
|
|
1192
|
+
| Output codec validates before serialization | Every object serialized through the output codec is schema-validated before JSON.stringify, preventing invalid data from reaching consumers. | Serializing without validation can produce JSON that downstream consumers cannot parse, causing failures far from the source of the invalid data. |
|
|
1193
|
+
| LintOutputSchema validates CLI lint output structure | Lint output JSON always conforms to the LintOutputSchema, ensuring consistent structure for downstream tooling. | Non-conformant lint output breaks CI pipeline parsers and IDE integrations that depend on a stable JSON contract. |
|
|
1194
|
+
| ValidationSummaryOutputSchema validates cross-source analysis output | Validation summary JSON always conforms to the ValidationSummaryOutputSchema, ensuring consistent reporting of cross-source pattern analysis. | Inconsistent validation summaries cause miscounted pattern coverage, leading to false confidence or missed gaps in cross-source analysis. |
|
|
1195
|
+
| RegistryMetadataOutputSchema accepts arbitrary nested structures | Registry metadata codec accepts any valid JSON-serializable object without schema constraints on nested structure. | Registry consumers attach domain-specific metadata whose shape varies per preset — constraining the nested structure would break extensibility across presets. |
|
|
1196
|
+
| formatCodecError produces human-readable error output | Formatted codec errors always include the operation context and all validation error details for debugging. | Omitting the operation context or individual field errors forces developers to reproduce failures manually instead of diagnosing from the error message alone. |
|
|
1197
|
+
| safeParse returns typed values or undefined without throwing | safeParse never throws exceptions; it returns the typed value on success or undefined on any failure. | Throwing on invalid input forces every call site to wrap in try/catch — returning undefined lets callers use simple conditional checks and avoids unhandled exception crashes. |
|
|
1198
|
+
| createFileLoader handles filesystem operations with typed errors | File loader converts all filesystem errors (ENOENT, EACCES, generic) into structured CodecError values with appropriate messages and source paths. | Propagating raw filesystem exceptions leaks Node.js error internals to consumers and prevents consistent error formatting across parse, validate, and I/O failures. |
|
|
1199
|
+
|
|
1200
|
+
---
|