onto-mcp 0.3.0
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/.onto/authority/core-lens-registry.yaml +134 -0
- package/.onto/authority/core-lexicon.yaml +1562 -0
- package/.onto/authority/diagnostic-codes.yaml +94 -0
- package/.onto/domains/accounting/competency_qs.md +384 -0
- package/.onto/domains/accounting/concepts.md +186 -0
- package/.onto/domains/accounting/conciseness_rules.md +160 -0
- package/.onto/domains/accounting/dependency_rules.md +239 -0
- package/.onto/domains/accounting/domain_scope.md +213 -0
- package/.onto/domains/accounting/extension_cases.md +416 -0
- package/.onto/domains/accounting/logic_rules.md +226 -0
- package/.onto/domains/accounting/structure_spec.md +298 -0
- package/.onto/domains/accounting-kr/competency_qs.md +562 -0
- package/.onto/domains/accounting-kr/concepts.md +187 -0
- package/.onto/domains/accounting-kr/conciseness_rules.md +125 -0
- package/.onto/domains/accounting-kr/dependency_rules.md +93 -0
- package/.onto/domains/accounting-kr/domain_scope.md +140 -0
- package/.onto/domains/accounting-kr/extension_cases.md +343 -0
- package/.onto/domains/accounting-kr/logic_rules.md +160 -0
- package/.onto/domains/accounting-kr/structure_spec.md +85 -0
- package/.onto/domains/business/competency_qs.md +263 -0
- package/.onto/domains/business/concepts.md +200 -0
- package/.onto/domains/business/conciseness_rules.md +135 -0
- package/.onto/domains/business/dependency_rules.md +113 -0
- package/.onto/domains/business/domain_scope.md +240 -0
- package/.onto/domains/business/extension_cases.md +249 -0
- package/.onto/domains/business/logic_rules.md +134 -0
- package/.onto/domains/business/structure_spec.md +114 -0
- package/.onto/domains/finance/competency_qs.md +362 -0
- package/.onto/domains/finance/concepts.md +194 -0
- package/.onto/domains/finance/conciseness_rules.md +155 -0
- package/.onto/domains/finance/dependency_rules.md +171 -0
- package/.onto/domains/finance/domain_scope.md +215 -0
- package/.onto/domains/finance/extension_cases.md +350 -0
- package/.onto/domains/finance/logic_rules.md +191 -0
- package/.onto/domains/finance/structure_spec.md +182 -0
- package/.onto/domains/llm-native-development/competency_qs.md +430 -0
- package/.onto/domains/llm-native-development/concepts.md +242 -0
- package/.onto/domains/llm-native-development/conciseness_rules.md +163 -0
- package/.onto/domains/llm-native-development/dependency_rules.md +216 -0
- package/.onto/domains/llm-native-development/domain_scope.md +197 -0
- package/.onto/domains/llm-native-development/extension_cases.md +474 -0
- package/.onto/domains/llm-native-development/logic_rules.md +123 -0
- package/.onto/domains/llm-native-development/prompt_interface.md +49 -0
- package/.onto/domains/llm-native-development/structure_spec.md +245 -0
- package/.onto/domains/market-intelligence/competency_qs.md +274 -0
- package/.onto/domains/market-intelligence/concepts.md +233 -0
- package/.onto/domains/market-intelligence/conciseness_rules.md +165 -0
- package/.onto/domains/market-intelligence/dependency_rules.md +197 -0
- package/.onto/domains/market-intelligence/domain_scope.md +231 -0
- package/.onto/domains/market-intelligence/extension_cases.md +425 -0
- package/.onto/domains/market-intelligence/logic_rules.md +247 -0
- package/.onto/domains/market-intelligence/structure_spec.md +209 -0
- package/.onto/domains/ontology/competency_qs.md +394 -0
- package/.onto/domains/ontology/concepts.md +172 -0
- package/.onto/domains/ontology/conciseness_rules.md +134 -0
- package/.onto/domains/ontology/dependency_rules.md +125 -0
- package/.onto/domains/ontology/domain_scope.md +114 -0
- package/.onto/domains/ontology/extension_cases.md +501 -0
- package/.onto/domains/ontology/logic_rules.md +114 -0
- package/.onto/domains/ontology/problem_framing_profile.md +67 -0
- package/.onto/domains/ontology/structure_spec.md +115 -0
- package/.onto/domains/palantir-foundry/RESEARCH_NOTES.md +911 -0
- package/.onto/domains/palantir-foundry/competency_qs.md +191 -0
- package/.onto/domains/palantir-foundry/competitive_comparison.md +329 -0
- package/.onto/domains/palantir-foundry/concepts.md +197 -0
- package/.onto/domains/palantir-foundry/conciseness_rules.md +245 -0
- package/.onto/domains/palantir-foundry/dependency_rules.md +135 -0
- package/.onto/domains/palantir-foundry/domain_scope.md +395 -0
- package/.onto/domains/palantir-foundry/extension_cases.md +210 -0
- package/.onto/domains/palantir-foundry/logic_rules.md +172 -0
- package/.onto/domains/palantir-foundry/structure_spec.md +291 -0
- package/.onto/domains/software-engineering/competency_qs.md +538 -0
- package/.onto/domains/software-engineering/concepts.md +238 -0
- package/.onto/domains/software-engineering/conciseness_rules.md +167 -0
- package/.onto/domains/software-engineering/dependency_rules.md +216 -0
- package/.onto/domains/software-engineering/domain_scope.md +183 -0
- package/.onto/domains/software-engineering/extension_cases.md +551 -0
- package/.onto/domains/software-engineering/logic_rules.md +240 -0
- package/.onto/domains/software-engineering/problem_framing_profile.md +68 -0
- package/.onto/domains/software-engineering/structure_spec.md +185 -0
- package/.onto/domains/ui-design/competency_qs.md +567 -0
- package/.onto/domains/ui-design/concepts.md +194 -0
- package/.onto/domains/ui-design/conciseness_rules.md +190 -0
- package/.onto/domains/ui-design/dependency_rules.md +323 -0
- package/.onto/domains/ui-design/domain_scope.md +340 -0
- package/.onto/domains/ui-design/extension_cases.md +563 -0
- package/.onto/domains/ui-design/logic_rules.md +349 -0
- package/.onto/domains/ui-design/structure_spec.md +252 -0
- package/.onto/domains/visual-design/competency_qs.md +472 -0
- package/.onto/domains/visual-design/concepts.md +147 -0
- package/.onto/domains/visual-design/conciseness_rules.md +186 -0
- package/.onto/domains/visual-design/dependency_rules.md +282 -0
- package/.onto/domains/visual-design/domain_scope.md +290 -0
- package/.onto/domains/visual-design/extension_cases.md +480 -0
- package/.onto/domains/visual-design/logic_rules.md +232 -0
- package/.onto/domains/visual-design/structure_spec.md +213 -0
- package/.onto/principles/llm-native-development-guideline.md +401 -0
- package/.onto/principles/llm-runtime-interface-principles.md +665 -0
- package/.onto/principles/non-specialist-communication-guideline.md +74 -0
- package/.onto/principles/ontology-as-code-guideline.md +243 -0
- package/.onto/principles/ontology-as-code-naming-charter.md +130 -0
- package/.onto/principles/product-locality-principle.md +129 -0
- package/.onto/principles/productization-charter.md +569 -0
- package/.onto/processes/evolve/material-kind-adapter-contract.md +113 -0
- package/.onto/processes/reconstruct/reconstruct-boundary-contract.md +366 -0
- package/.onto/processes/reconstruct/source-profile-contract.md +107 -0
- package/.onto/processes/reconstruct/source-profiles/code.md +72 -0
- package/.onto/processes/reconstruct/source-profiles/database.md +74 -0
- package/.onto/processes/reconstruct/source-profiles/document.md +71 -0
- package/.onto/processes/reconstruct/source-profiles/spreadsheet.md +79 -0
- package/.onto/processes/review/binding-contract.md +270 -0
- package/.onto/processes/review/execution-preparation-artifacts.md +281 -0
- package/.onto/processes/review/interpretation-contract.md +245 -0
- package/.onto/processes/review/issue-stance-deliberation-contract.md +761 -0
- package/.onto/processes/review/lens-prompt-contract.md +402 -0
- package/.onto/processes/review/lens-registry.md +127 -0
- package/.onto/processes/review/pre-dispatch-contracts.md +428 -0
- package/.onto/processes/review/productized-live-path.md +398 -0
- package/.onto/processes/review/prompt-execution-runner-contract.md +187 -0
- package/.onto/processes/review/record-contract.md +427 -0
- package/.onto/processes/review/record-field-mapping.md +337 -0
- package/.onto/processes/review/review-context-manifest-contract.md +356 -0
- package/.onto/processes/review/review-execution-ux-contract.md +809 -0
- package/.onto/processes/review/review-target-profile-contract.md +259 -0
- package/.onto/processes/review/shared-phenomenon-contract.md +129 -0
- package/.onto/processes/review/synthesize-prompt-contract.md +343 -0
- package/.onto/processes/shared/target-material-kind-contract.md +198 -0
- package/.onto/roles/axiology.md +81 -0
- package/.onto/roles/conciseness.md +36 -0
- package/.onto/roles/coverage.md +34 -0
- package/.onto/roles/dependency.md +37 -0
- package/.onto/roles/evolution.md +35 -0
- package/.onto/roles/logic.md +104 -0
- package/.onto/roles/pragmatics.md +32 -0
- package/.onto/roles/semantics.md +36 -0
- package/.onto/roles/structure.md +33 -0
- package/.onto/roles/synthesize.md +92 -0
- package/AGENTS.md +240 -0
- package/CLAUDE.md +39 -0
- package/README.md +287 -0
- package/bin/onto +92 -0
- package/dist/cli.js +101 -0
- package/dist/core-api/reconstruct-api.js +222 -0
- package/dist/core-api/review-api.js +1271 -0
- package/dist/core-runtime/cli/assemble-review-record.js +431 -0
- package/dist/core-runtime/cli/bootstrap-review-binding.js +186 -0
- package/dist/core-runtime/cli/codex-nested-dispatch.js +226 -0
- package/dist/core-runtime/cli/codex-nested-dispatch.test.js +390 -0
- package/dist/core-runtime/cli/codex-nested-teamlead-executor.js +464 -0
- package/dist/core-runtime/cli/codex-nested-teamlead-executor.test.js +335 -0
- package/dist/core-runtime/cli/codex-review-unit-executor.js +228 -0
- package/dist/core-runtime/cli/complete-review-session.js +64 -0
- package/dist/core-runtime/cli/complexity-assessment.js +153 -0
- package/dist/core-runtime/cli/coordinator-helpers.js +583 -0
- package/dist/core-runtime/cli/coordinator-state-machine-deliberation.test.js +167 -0
- package/dist/core-runtime/cli/coordinator-state-machine.js +794 -0
- package/dist/core-runtime/cli/e2e-codex-multi-agent-fixes.test.js +615 -0
- package/dist/core-runtime/cli/e2e-start-review-session.test.js +312 -0
- package/dist/core-runtime/cli/health.js +44 -0
- package/dist/core-runtime/cli/inline-http-review-unit-executor.js +656 -0
- package/dist/core-runtime/cli/inline-http-review-unit-executor.test.js +567 -0
- package/dist/core-runtime/cli/materialize-review-execution-preparation.js +104 -0
- package/dist/core-runtime/cli/materialize-review-prompt-packets.js +952 -0
- package/dist/core-runtime/cli/migrate-session-roots.js +118 -0
- package/dist/core-runtime/cli/mock-review-unit-executor.js +285 -0
- package/dist/core-runtime/cli/onto-tools.js +369 -0
- package/dist/core-runtime/cli/prepare-review-session.js +272 -0
- package/dist/core-runtime/cli/render-review-final-output.js +350 -0
- package/dist/core-runtime/cli/repo-layout-migration-replace.smoke.test.js +106 -0
- package/dist/core-runtime/cli/review-invoke-auto-resolution.test.js +268 -0
- package/dist/core-runtime/cli/review-invoke-coordinator-topology.test.js +136 -0
- package/dist/core-runtime/cli/review-invoke-resolver-caching.test.js +201 -0
- package/dist/core-runtime/cli/review-invoke-topology-dispatch.test.js +192 -0
- package/dist/core-runtime/cli/review-invoke.js +2030 -0
- package/dist/core-runtime/cli/run-review-prompt-execution.js +2152 -0
- package/dist/core-runtime/cli/session-root-guard.js +168 -0
- package/dist/core-runtime/cli/spawn-watcher.js +173 -0
- package/dist/core-runtime/cli/spawn-watcher.test.js +457 -0
- package/dist/core-runtime/cli/start-review-session.js +68 -0
- package/dist/core-runtime/cli/strip-wrapping-code-fence.js +56 -0
- package/dist/core-runtime/cli/strip-wrapping-code-fence.test.js +79 -0
- package/dist/core-runtime/cli/teamcreate-lens-deliberation-executor.js +412 -0
- package/dist/core-runtime/cli/teamcreate-lens-deliberation-executor.test.js +351 -0
- package/dist/core-runtime/cli/topology-executor-mapping.js +139 -0
- package/dist/core-runtime/cli/topology-executor-mapping.test.js +173 -0
- package/dist/core-runtime/cli/write-review-interpretation.js +81 -0
- package/dist/core-runtime/config/onto-config-cli.js +278 -0
- package/dist/core-runtime/config/onto-config-key-path.js +288 -0
- package/dist/core-runtime/config/onto-config-key-path.test.js +195 -0
- package/dist/core-runtime/config/onto-config-preview.js +108 -0
- package/dist/core-runtime/config/onto-config-preview.test.js +132 -0
- package/dist/core-runtime/discovery/config-chain.js +118 -0
- package/dist/core-runtime/discovery/config-chain.test.js +103 -0
- package/dist/core-runtime/discovery/config-profile.js +199 -0
- package/dist/core-runtime/discovery/config-profile.test.js +233 -0
- package/dist/core-runtime/discovery/host-detection.js +33 -0
- package/dist/core-runtime/discovery/host-detection.test.js +186 -0
- package/dist/core-runtime/discovery/installation-paths.js +21 -0
- package/dist/core-runtime/discovery/installation-paths.test.js +65 -0
- package/dist/core-runtime/discovery/lens-registry.js +60 -0
- package/dist/core-runtime/discovery/lens-registry.test.js +81 -0
- package/dist/core-runtime/discovery/onto-home.js +71 -0
- package/dist/core-runtime/discovery/path-normalization.js +28 -0
- package/dist/core-runtime/discovery/path-normalization.test.js +22 -0
- package/dist/core-runtime/discovery/plugin-path.js +72 -0
- package/dist/core-runtime/discovery/plugin-path.test.js +95 -0
- package/dist/core-runtime/discovery/project-root.js +47 -0
- package/dist/core-runtime/discovery/settings-chain.js +353 -0
- package/dist/core-runtime/discovery/walk-up.js +17 -0
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile-defense.js +344 -0
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile-defense.test.js +915 -0
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile.js +564 -0
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile.test.js +708 -0
- package/dist/core-runtime/evolve/adapters/code-product/parsers/brief-parser.js +165 -0
- package/dist/core-runtime/evolve/adapters/code-product/parsers/brief-parser.test.js +227 -0
- package/dist/core-runtime/evolve/adapters/code-product/validators/validate.js +59 -0
- package/dist/core-runtime/evolve/adapters/code-product/validators/validate.test.js +205 -0
- package/dist/core-runtime/evolve/adapters/methodology/adapter.js +16 -0
- package/dist/core-runtime/evolve/adapters/methodology/adapter.test.js +9 -0
- package/dist/core-runtime/evolve/adapters/methodology/perspectives/authority-consistency.js +298 -0
- package/dist/core-runtime/evolve/adapters/methodology/perspectives/authority-consistency.test.js +70 -0
- package/dist/core-runtime/evolve/adapters/methodology/scope-types/process.js +46 -0
- package/dist/core-runtime/evolve/adapters/methodology/scope-types/process.test.js +73 -0
- package/dist/core-runtime/evolve/adapters/registry.js +47 -0
- package/dist/core-runtime/evolve/adapters/registry.test.js +67 -0
- package/dist/core-runtime/evolve/cli.js +256 -0
- package/dist/core-runtime/evolve/commands/align.js +194 -0
- package/dist/core-runtime/evolve/commands/align.test.js +82 -0
- package/dist/core-runtime/evolve/commands/apply.js +161 -0
- package/dist/core-runtime/evolve/commands/apply.test.js +138 -0
- package/dist/core-runtime/evolve/commands/close.js +39 -0
- package/dist/core-runtime/evolve/commands/close.test.js +99 -0
- package/dist/core-runtime/evolve/commands/defer.js +40 -0
- package/dist/core-runtime/evolve/commands/defer.test.js +134 -0
- package/dist/core-runtime/evolve/commands/draft.js +323 -0
- package/dist/core-runtime/evolve/commands/draft.test.js +178 -0
- package/dist/core-runtime/evolve/commands/e2e-evolve-full-cycle.test.js +208 -0
- package/dist/core-runtime/evolve/commands/error-messages.js +125 -0
- package/dist/core-runtime/evolve/commands/error-messages.test.js +167 -0
- package/dist/core-runtime/evolve/commands/propose-align.js +222 -0
- package/dist/core-runtime/evolve/commands/propose-align.test.js +136 -0
- package/dist/core-runtime/evolve/commands/reconstruct.js +330 -0
- package/dist/core-runtime/evolve/commands/reconstruct.test.js +278 -0
- package/dist/core-runtime/evolve/commands/shared.js +22 -0
- package/dist/core-runtime/evolve/commands/stale-check.js +103 -0
- package/dist/core-runtime/evolve/commands/stale-check.test.js +84 -0
- package/dist/core-runtime/evolve/commands/start.js +887 -0
- package/dist/core-runtime/evolve/commands/start.test.js +396 -0
- package/dist/core-runtime/evolve/config/project-config.js +99 -0
- package/dist/core-runtime/evolve/config/project-config.test.js +170 -0
- package/dist/core-runtime/evolve/renderers/align-packet.js +280 -0
- package/dist/core-runtime/evolve/renderers/align-packet.test.js +332 -0
- package/dist/core-runtime/evolve/renderers/draft-packet.js +303 -0
- package/dist/core-runtime/evolve/renderers/draft-packet.test.js +377 -0
- package/dist/core-runtime/evolve/renderers/format.js +5 -0
- package/dist/core-runtime/evolve/renderers/scope-md.js +237 -0
- package/dist/core-runtime/evolve/renderers/scope-md.test.js +306 -0
- package/dist/core-runtime/govern/cli.js +369 -0
- package/dist/core-runtime/govern/cli.test.js +314 -0
- package/dist/core-runtime/govern/drift-engine.js +103 -0
- package/dist/core-runtime/govern/drift-engine.test.js +319 -0
- package/dist/core-runtime/govern/promote-principle.js +206 -0
- package/dist/core-runtime/govern/promote-principle.test.js +368 -0
- package/dist/core-runtime/govern/queue.js +81 -0
- package/dist/core-runtime/govern/types.js +16 -0
- package/dist/core-runtime/install/cli.js +530 -0
- package/dist/core-runtime/install/detect.js +128 -0
- package/dist/core-runtime/install/detect.test.js +155 -0
- package/dist/core-runtime/install/gitignore-update.js +74 -0
- package/dist/core-runtime/install/gitignore-update.test.js +64 -0
- package/dist/core-runtime/install/install-integration.test.js +373 -0
- package/dist/core-runtime/install/prompts.js +389 -0
- package/dist/core-runtime/install/prompts.test.js +293 -0
- package/dist/core-runtime/install/types.js +26 -0
- package/dist/core-runtime/install/validation.js +295 -0
- package/dist/core-runtime/install/validation.test.js +313 -0
- package/dist/core-runtime/install/writer.js +254 -0
- package/dist/core-runtime/install/writer.test.js +218 -0
- package/dist/core-runtime/learning/extractor.js +461 -0
- package/dist/core-runtime/learning/feedback.js +179 -0
- package/dist/core-runtime/learning/health-report.js +165 -0
- package/dist/core-runtime/learning/health-report.test.js +169 -0
- package/dist/core-runtime/learning/loader.js +388 -0
- package/dist/core-runtime/learning/loader.test.js +102 -0
- package/dist/core-runtime/learning/promote/apply-state.js +240 -0
- package/dist/core-runtime/learning/promote/audit-obligation.js +195 -0
- package/dist/core-runtime/learning/promote/collector.js +432 -0
- package/dist/core-runtime/learning/promote/degraded-state.js +125 -0
- package/dist/core-runtime/learning/promote/domain-doc-proposer.js +166 -0
- package/dist/core-runtime/learning/promote/e2e-promote.test.js +6385 -0
- package/dist/core-runtime/learning/promote/health-snapshot.js +150 -0
- package/dist/core-runtime/learning/promote/insight-reclassifier.js +544 -0
- package/dist/core-runtime/learning/promote/judgment-auditor.js +517 -0
- package/dist/core-runtime/learning/promote/panel-reviewer.js +1158 -0
- package/dist/core-runtime/learning/promote/promote-executor.js +1675 -0
- package/dist/core-runtime/learning/promote/promoter.js +307 -0
- package/dist/core-runtime/learning/promote/retirement.js +122 -0
- package/dist/core-runtime/learning/promote/types.js +23 -0
- package/dist/core-runtime/learning/prompt-sections.js +51 -0
- package/dist/core-runtime/learning/shared/artifact-registry-init.js +45 -0
- package/dist/core-runtime/learning/shared/artifact-registry.js +254 -0
- package/dist/core-runtime/learning/shared/audit-obligation-kernel.js +73 -0
- package/dist/core-runtime/learning/shared/audit-state.js +99 -0
- package/dist/core-runtime/learning/shared/duplicate-check.js +28 -0
- package/dist/core-runtime/learning/shared/llm-caller.js +831 -0
- package/dist/core-runtime/learning/shared/llm-caller.test.js +601 -0
- package/dist/core-runtime/learning/shared/llm-tool-loop.js +393 -0
- package/dist/core-runtime/learning/shared/mode.js +25 -0
- package/dist/core-runtime/learning/shared/paths.js +84 -0
- package/dist/core-runtime/learning/shared/paths.test.js +79 -0
- package/dist/core-runtime/learning/shared/patterns.js +37 -0
- package/dist/core-runtime/learning/shared/recoverability.js +355 -0
- package/dist/core-runtime/learning/shared/recovery-context.js +374 -0
- package/dist/core-runtime/learning/shared/scope.js +1 -0
- package/dist/core-runtime/learning/shared/semantic-classifier.js +94 -0
- package/dist/core-runtime/learning/shared/specs/apply-execution-state-spec.js +42 -0
- package/dist/core-runtime/learning/shared/specs/audit-state-spec.js +37 -0
- package/dist/core-runtime/learning/shared/specs/backup-metadata-spec.js +39 -0
- package/dist/core-runtime/learning/shared/specs/emergency-log-spec.js +41 -0
- package/dist/core-runtime/learning/shared/specs/layout-version-spec.js +38 -0
- package/dist/core-runtime/learning/shared/specs/promote-decisions-spec.js +43 -0
- package/dist/core-runtime/learning/shared/specs/promote-report-spec.js +113 -0
- package/dist/core-runtime/learning/shared/specs/prune-log-spec.js +36 -0
- package/dist/core-runtime/learning/shared/specs/recovery-resolution-spec.js +48 -0
- package/dist/core-runtime/learning/shared/specs/restore-manifest-spec.js +43 -0
- package/dist/core-runtime/learning/shared/specs/spec-helpers.js +64 -0
- package/dist/core-runtime/learning/usage-tracker.js +190 -0
- package/dist/core-runtime/learning/usage-tracker.test.js +176 -0
- package/dist/core-runtime/llm/llm-caller.js +649 -0
- package/dist/core-runtime/llm/llm-tool-loop.js +401 -0
- package/dist/core-runtime/llm/model-switcher.js +62 -0
- package/dist/core-runtime/logger.js +22 -0
- package/dist/core-runtime/onboard/detect-review-axes.js +122 -0
- package/dist/core-runtime/onboard/detect-review-axes.test.js +127 -0
- package/dist/core-runtime/onboard/write-review-block.js +188 -0
- package/dist/core-runtime/onboard/write-review-block.test.js +240 -0
- package/dist/core-runtime/readers/brownfield-builder.js +150 -0
- package/dist/core-runtime/readers/brownfield-builder.test.js +136 -0
- package/dist/core-runtime/readers/code-chunk-collector.js +53 -0
- package/dist/core-runtime/readers/code-chunk-collector.test.js +136 -0
- package/dist/core-runtime/readers/file-utils.js +240 -0
- package/dist/core-runtime/readers/file-utils.test.js +146 -0
- package/dist/core-runtime/readers/lexicon-citation-check.js +93 -0
- package/dist/core-runtime/readers/lexicon-citation-check.test.js +77 -0
- package/dist/core-runtime/readers/mcp-figma.js +30 -0
- package/dist/core-runtime/readers/mcp-figma.test.js +82 -0
- package/dist/core-runtime/readers/mcp-generic.js +31 -0
- package/dist/core-runtime/readers/mcp-generic.test.js +76 -0
- package/dist/core-runtime/readers/ontology-index.js +148 -0
- package/dist/core-runtime/readers/ontology-index.test.js +245 -0
- package/dist/core-runtime/readers/ontology-query.js +168 -0
- package/dist/core-runtime/readers/ontology-query.test.js +311 -0
- package/dist/core-runtime/readers/ontology-resolve.js +48 -0
- package/dist/core-runtime/readers/ontology-resolve.test.js +48 -0
- package/dist/core-runtime/readers/patterns/index.js +7 -0
- package/dist/core-runtime/readers/review-log.js +213 -0
- package/dist/core-runtime/readers/review-log.test.js +313 -0
- package/dist/core-runtime/readers/scan-local.js +102 -0
- package/dist/core-runtime/readers/scan-local.test.js +102 -0
- package/dist/core-runtime/readers/scan-tarball.js +121 -0
- package/dist/core-runtime/readers/scan-tarball.test.js +283 -0
- package/dist/core-runtime/readers/scan-vault.js +34 -0
- package/dist/core-runtime/readers/scan-vault.test.js +81 -0
- package/dist/core-runtime/readers/types.js +42 -0
- package/dist/core-runtime/readers/types.test.js +94 -0
- package/dist/core-runtime/readers/viewpoint-collectors.js +229 -0
- package/dist/core-runtime/reconstruct/artifact-types.js +1 -0
- package/dist/core-runtime/reconstruct/directive-validation.js +123 -0
- package/dist/core-runtime/reconstruct/materialize-preparation.js +251 -0
- package/dist/core-runtime/reconstruct/record.js +198 -0
- package/dist/core-runtime/reconstruct/run.js +578 -0
- package/dist/core-runtime/reconstruct/seed-candidate-validation.js +356 -0
- package/dist/core-runtime/reconstruct/source-observations.js +62 -0
- package/dist/core-runtime/reconstruct/source-profiles.js +73 -0
- package/dist/core-runtime/release-channel/release-channel.js +90 -0
- package/dist/core-runtime/review/artifact-types.js +13 -0
- package/dist/core-runtime/review/citation-audit.js +204 -0
- package/dist/core-runtime/review/citation-audit.test.js +165 -0
- package/dist/core-runtime/review/controlled-lens-deliberation.js +125 -0
- package/dist/core-runtime/review/execution-plan-resolver.js +247 -0
- package/dist/core-runtime/review/execution-plan-resolver.test.js +243 -0
- package/dist/core-runtime/review/execution-topology-resolver-axis-first.test.js +246 -0
- package/dist/core-runtime/review/execution-topology-resolver.js +401 -0
- package/dist/core-runtime/review/execution-topology-resolver.test.js +315 -0
- package/dist/core-runtime/review/failure-records.js +57 -0
- package/dist/core-runtime/review/inline-context-embedder.js +141 -0
- package/dist/core-runtime/review/inline-context-embedder.test.js +154 -0
- package/dist/core-runtime/review/issue-artifact-runtime.js +859 -0
- package/dist/core-runtime/review/legacy-mode-policy.js +88 -0
- package/dist/core-runtime/review/lens-completion-policy.js +17 -0
- package/dist/core-runtime/review/materializers-effort-persist.test.js +79 -0
- package/dist/core-runtime/review/materializers.js +963 -0
- package/dist/core-runtime/review/ontology-path-classifier.js +179 -0
- package/dist/core-runtime/review/ontology-path-classifier.test.js +216 -0
- package/dist/core-runtime/review/packet-boundary-policy.js +215 -0
- package/dist/core-runtime/review/packet-boundary-policy.test.js +107 -0
- package/dist/core-runtime/review/participating-lens-paths.js +61 -0
- package/dist/core-runtime/review/participating-lens-paths.test.js +73 -0
- package/dist/core-runtime/review/review-artifact-utils.js +287 -0
- package/dist/core-runtime/review/review-config-legacy-translate.js +244 -0
- package/dist/core-runtime/review/review-config-legacy-translate.test.js +161 -0
- package/dist/core-runtime/review/review-config-validator.js +289 -0
- package/dist/core-runtime/review/review-config-validator.test.js +236 -0
- package/dist/core-runtime/review/review-execution-profile.js +193 -0
- package/dist/core-runtime/review/review-execution-route.js +52 -0
- package/dist/core-runtime/review/review-progress-contract.js +123 -0
- package/dist/core-runtime/review/review-record-validation.js +251 -0
- package/dist/core-runtime/review/review-result-classification.js +379 -0
- package/dist/core-runtime/review/review-state-machine.js +39 -0
- package/dist/core-runtime/review/route-visibility.js +125 -0
- package/dist/core-runtime/review/shape-pipeline-audit.test.js +311 -0
- package/dist/core-runtime/review/shape-to-topology-id.js +117 -0
- package/dist/core-runtime/review/shape-to-topology-id.test.js +132 -0
- package/dist/core-runtime/review/topology-shape-derivation.js +155 -0
- package/dist/core-runtime/review/topology-shape-derivation.test.js +195 -0
- package/dist/core-runtime/scope-runtime/constants.js +12 -0
- package/dist/core-runtime/scope-runtime/constraint-pool.js +166 -0
- package/dist/core-runtime/scope-runtime/constraint-pool.test.js +674 -0
- package/dist/core-runtime/scope-runtime/domain-validation-log.js +135 -0
- package/dist/core-runtime/scope-runtime/domain-validation-log.test.js +156 -0
- package/dist/core-runtime/scope-runtime/eval-persistence.js +65 -0
- package/dist/core-runtime/scope-runtime/eval-persistence.test.js +84 -0
- package/dist/core-runtime/scope-runtime/event-pipeline.js +64 -0
- package/dist/core-runtime/scope-runtime/event-pipeline.test.js +450 -0
- package/dist/core-runtime/scope-runtime/event-store.js +39 -0
- package/dist/core-runtime/scope-runtime/event-store.test.js +95 -0
- package/dist/core-runtime/scope-runtime/gate-guard.js +348 -0
- package/dist/core-runtime/scope-runtime/gate-guard.test.js +1047 -0
- package/dist/core-runtime/scope-runtime/hash.js +4 -0
- package/dist/core-runtime/scope-runtime/hash.test.js +33 -0
- package/dist/core-runtime/scope-runtime/id.js +4 -0
- package/dist/core-runtime/scope-runtime/id.test.js +17 -0
- package/dist/core-runtime/scope-runtime/reducer.js +297 -0
- package/dist/core-runtime/scope-runtime/reducer.test.js +759 -0
- package/dist/core-runtime/scope-runtime/scope-manager.js +161 -0
- package/dist/core-runtime/scope-runtime/state-machine.js +309 -0
- package/dist/core-runtime/scope-runtime/state-machine.test.js +704 -0
- package/dist/core-runtime/scope-runtime/types.js +116 -0
- package/dist/core-runtime/scope-runtime/types.test.js +69 -0
- package/dist/core-runtime/target-material-kind.js +256 -0
- package/dist/core-runtime/translate/render-for-user.js +169 -0
- package/dist/core-runtime/translate/render-for-user.test.js +122 -0
- package/dist/mcp/server.js +1011 -0
- package/dist/mcp/tool-schemas.js +93 -0
- package/dist/providers/capability-contract.js +1 -0
- package/package.json +68 -0
- package/settings.example.json +33 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 2
|
|
3
|
+
last_updated: "2026-03-30"
|
|
4
|
+
source: bundled-domain-baseline
|
|
5
|
+
status: established
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Software Engineering Domain — Dependency Rules
|
|
9
|
+
|
|
10
|
+
Classification axis: **linkage type** — dependencies and connections classified by the type of relationship between components.
|
|
11
|
+
|
|
12
|
+
## Acyclic Dependencies
|
|
13
|
+
|
|
14
|
+
### Acyclic Dependencies Principle (ADP)
|
|
15
|
+
|
|
16
|
+
The dependency graph of packages/modules must be a Directed Acyclic Graph (DAG). If cycles exist, there is no valid build order, and changes in one module propagate unpredictably through the cycle.
|
|
17
|
+
|
|
18
|
+
- Module dependency graph: acyclic (DAG). Cycles make build order undeterminable and initialization order indeterminate
|
|
19
|
+
- Package/library dependencies: acyclic. Circular dependencies prevent deployment units from being separated
|
|
20
|
+
- Type-only imports and value imports must be distinguished. Type-only imports do not cause runtime cycles and are therefore evaluated at a separate severity level
|
|
21
|
+
- **Build order implication**: A DAG can be topologically sorted — this sort defines the build order. If module A depends on B, B must be built before A. Cycles make topological sort impossible, which is why build systems reject circular dependencies
|
|
22
|
+
|
|
23
|
+
### Breaking Cycles
|
|
24
|
+
|
|
25
|
+
When a circular dependency is detected, apply one of the following strategies:
|
|
26
|
+
|
|
27
|
+
- **Dependency Inversion**: If module A depends on module B and B depends on A, extract an interface from the dependency direction that should be reversed. Module A defines the interface; module B implements it. The dependency direction reverses: B now depends on A's interface, breaking the cycle. Cross-reference: 'Direction Rules' (Dependency Inversion Principle)
|
|
28
|
+
- **Event-based decoupling**: Replace direct calls with events. Module A publishes an event; module B subscribes. Neither module imports the other. The event schema becomes the contract. Appropriate when the interaction is asynchronous or fire-and-forget
|
|
29
|
+
- **Shared kernel**: Extract the shared types/functions that both modules need into a third module. Both A and B depend on the shared module, but not on each other. Appropriate when the cycle is caused by shared type definitions. Cross-reference: 'Package/Module Dependency Patterns' (Shared Kernel pattern)
|
|
30
|
+
- Real example: npm detects circular dependencies at install time and logs a warning. Go prohibits import cycles entirely — the compiler rejects them. Python allows circular imports but they cause `ImportError` at runtime if the cycle involves module-level code execution
|
|
31
|
+
|
|
32
|
+
## Direction Rules
|
|
33
|
+
|
|
34
|
+
### Dependency Inversion Principle (DIP)
|
|
35
|
+
|
|
36
|
+
High-level modules must not depend on low-level modules. Both must depend on abstractions. Abstractions must not depend on details. Details must depend on abstractions.
|
|
37
|
+
|
|
38
|
+
- Upper layer -> lower layer: allowed
|
|
39
|
+
- Lower layer -> upper layer: prohibited (layer inversion)
|
|
40
|
+
- Business logic -> direct dependency on external library: discouraged (abstract via interface)
|
|
41
|
+
- Test -> production code: allowed
|
|
42
|
+
- Production code -> test: prohibited
|
|
43
|
+
|
|
44
|
+
### Clean Architecture Dependency Rule
|
|
45
|
+
|
|
46
|
+
Source code dependencies must point inward. The innermost layer (Entities/Domain) depends on nothing. The outermost layer (Frameworks/Drivers) depends on everything inward. No inner layer may import, reference, or name anything from an outer layer. Cross-reference: structure_spec.md 'Architectural Patterns' (Clean Architecture)
|
|
47
|
+
|
|
48
|
+
### Stable Dependencies Principle (SDP)
|
|
49
|
+
|
|
50
|
+
Depend in the direction of stability. A module should depend only on modules that are more stable (harder to change) than itself. Stability is measured by the ratio of incoming dependencies (afferent coupling) to total dependencies. A module with many dependents and few dependencies is stable — changing it would break many consumers, so it resists change.
|
|
51
|
+
|
|
52
|
+
- If a volatile module (frequently changed) depends on another volatile module, changes cascade unpredictably
|
|
53
|
+
- If a stable module depends on a volatile module, the stable module is forced to change when the volatile module changes, contradicting its stability
|
|
54
|
+
- Real example: Spring Framework's `@Autowired` — the application code depends on Spring's stable interfaces (DI container), not on specific implementation classes. NestJS providers follow the same pattern. Go achieves this through implicit interface satisfaction — any type that implements the methods of an interface satisfies it, without declaring the dependency
|
|
55
|
+
|
|
56
|
+
### Stable Abstractions Principle (SAP)
|
|
57
|
+
|
|
58
|
+
A package should be as abstract as it is stable. Stable packages (many dependents) should consist primarily of interfaces and abstract classes, so that dependents can extend them without modifying them. Volatile packages (few dependents) should be concrete, containing implementations.
|
|
59
|
+
|
|
60
|
+
- A stable, concrete package is a problem: it is hard to change (many dependents) and impossible to extend (no abstractions)
|
|
61
|
+
- An abstract, volatile package is a problem: it has abstractions that nobody uses
|
|
62
|
+
|
|
63
|
+
## Type Location and Dependency Direction
|
|
64
|
+
|
|
65
|
+
- When shared types are defined in a specific module, unintended dependency directions are created. Placing shared types at the lowest dependency layer is structurally safe
|
|
66
|
+
- The module location of a type definition implicitly declares that type's contract level. When the consumer is at the system's external boundary, maintaining it as a kernel contract is advantageous for intent preservation
|
|
67
|
+
- Moving a type to the consumer module can cause the producer to depend on the consumer, resulting in a structural constraint violation
|
|
68
|
+
|
|
69
|
+
## Diamond Dependencies
|
|
70
|
+
|
|
71
|
+
- A diamond of the form A -> B, A -> C, B -> D, C -> D: allowed (provided D's versions match)
|
|
72
|
+
- Simultaneous dependency on different versions of the same module: prohibited (version conflict)
|
|
73
|
+
- Resolution: the dependency management system must select a single version. npm uses tree deduplication (hoisting); Go uses minimum version selection; Maven uses "nearest definition wins." Each strategy has different conflict behavior
|
|
74
|
+
|
|
75
|
+
## Package/Module Dependency Patterns
|
|
76
|
+
|
|
77
|
+
### Shared Kernel
|
|
78
|
+
|
|
79
|
+
- Extract types/functions that multiple modules need into a dedicated "kernel" module. Both depend on the kernel, not on each other
|
|
80
|
+
- The shared kernel must be small and change infrequently. Frequent changes make it a bottleneck
|
|
81
|
+
- Real example: shared protobuf/gRPC definitions placed in a dedicated schema repository
|
|
82
|
+
|
|
83
|
+
### Anti-corruption Layer
|
|
84
|
+
|
|
85
|
+
- When integrating with an external system whose model does not match the internal domain, create an adapter layer that translates between the two. Internal code depends on the adapter, not on the external model
|
|
86
|
+
- Real example: Stripe SDK wraps Stripe's REST API with typed objects matching the consumer's language idioms
|
|
87
|
+
|
|
88
|
+
### Published Language
|
|
89
|
+
|
|
90
|
+
- When two systems exchange data, define a shared contract (schema, message format) that both agree to. Neither side's internal model leaks through the contract. Versioned independently
|
|
91
|
+
- Real example: Protocol Buffers `.proto` files — both client and server generate code from the same definition
|
|
92
|
+
|
|
93
|
+
### Conformist
|
|
94
|
+
|
|
95
|
+
- When a dependency's model cannot be changed (third-party API, legacy system), the consumer adopts the dependency's model as-is. Simplest pattern but creates tight coupling
|
|
96
|
+
- Real example: AWS SDK — consumers conform to AWS's API model (ARNs, IAM policy format) rather than translating
|
|
97
|
+
|
|
98
|
+
## API Dependency Management
|
|
99
|
+
|
|
100
|
+
### REST API Versioning Strategies
|
|
101
|
+
|
|
102
|
+
| Strategy | Mechanism | Trade-off |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| URL path versioning | `/api/v1/users`, `/api/v2/users` | Simple routing but pollutes URI space. Most common in practice (GitHub, Stripe, Google) |
|
|
105
|
+
| Header versioning | `Accept: application/vnd.api.v2+json` | Clean URLs but harder to test (requires custom headers). Used by GitHub API |
|
|
106
|
+
| Query parameter | `/api/users?version=2` | Simple but easy to forget. Rarely used for major versioning |
|
|
107
|
+
| Content negotiation | Media type includes version | Most RESTful but complex implementation |
|
|
108
|
+
|
|
109
|
+
Real example: Stripe uses URL path versioning combined with API version dates (`Stripe-Version: 2023-10-16`). Each API version is a snapshot of the API's behavior. Old versions are maintained indefinitely.
|
|
110
|
+
|
|
111
|
+
### gRPC Backward Compatibility Rules
|
|
112
|
+
|
|
113
|
+
- **Field numbering**: Never reuse a field number after removing a field. Mark removed fields as `reserved`. Reusing a number causes existing clients to misinterpret the data
|
|
114
|
+
- **Field evolution**: Adding a new field is backward compatible (old clients ignore unknown fields). Removing a required field is a breaking change. Changing a field's type is a breaking change
|
|
115
|
+
- **`oneof` evolution**: Adding a new field to a `oneof` is backward compatible. Removing a field from a `oneof` is a breaking change
|
|
116
|
+
- **Service evolution**: Adding a new RPC method is backward compatible. Removing or renaming an RPC method is a breaking change
|
|
117
|
+
|
|
118
|
+
### GraphQL Schema Evolution
|
|
119
|
+
|
|
120
|
+
- Adding a new field to a type is backward compatible (existing queries do not request it)
|
|
121
|
+
- Removing a field is a breaking change (existing queries that request it will fail). Use `@deprecated(reason: "Use fieldX instead")` before removal
|
|
122
|
+
- Adding a required argument to a field is a breaking change. Adding an optional argument is backward compatible
|
|
123
|
+
- Schema stitching and federation introduce cross-service schema dependencies. A change in one service's schema can break the composed schema
|
|
124
|
+
|
|
125
|
+
### Breaking vs Non-breaking Changes Classification
|
|
126
|
+
|
|
127
|
+
| Change Type | Breaking? | Explanation |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| Add optional field | No | Existing consumers ignore it |
|
|
130
|
+
| Add required field | Yes | Existing consumers do not send it |
|
|
131
|
+
| Remove field | Yes | Existing consumers still expect it |
|
|
132
|
+
| Rename field | Yes | Equivalent to remove + add |
|
|
133
|
+
| Change field type | Yes | Existing consumers send/expect wrong type |
|
|
134
|
+
| Widen value range | No | Existing consumers send a subset |
|
|
135
|
+
| Narrow value range | Yes | Existing consumers may send invalid values |
|
|
136
|
+
| Add enum value | Depends | Breaking if consumers use exhaustive matching |
|
|
137
|
+
|
|
138
|
+
Cross-reference: logic_rules.md 'Type System Logic' (enum/union breaking changes); logic_rules.md 'Inter-module Contract Logic' (backward compatibility rules).
|
|
139
|
+
|
|
140
|
+
## Runtime Dependency Rules
|
|
141
|
+
|
|
142
|
+
### Service Discovery Patterns
|
|
143
|
+
|
|
144
|
+
- **DNS-based**: Services registered in DNS (e.g., `user-service.internal`). Simple but DNS TTL causes stale entries; no health checking
|
|
145
|
+
- **Service registry (Consul, Eureka, etcd)**: Services register and discover through a registry with health checking. Registry itself must be clustered to avoid single point of failure
|
|
146
|
+
- **Sidecar proxy (Envoy, Istio)**: Proxy co-located with each service handles discovery, routing, load balancing. Language-agnostic but adds operational complexity
|
|
147
|
+
|
|
148
|
+
### Circuit Breaker
|
|
149
|
+
|
|
150
|
+
- When a dependency fails repeatedly, stop sending requests (open circuit). After a timeout, allow a probe request (half-open). If it succeeds, close; if it fails, re-open
|
|
151
|
+
- Key thresholds: failure rate (e.g., 50%), minimum request count before evaluating (e.g., 20), open-state timeout (e.g., 30s)
|
|
152
|
+
- Real example: Resilience4j (JVM), Envoy proxy (infrastructure level)
|
|
153
|
+
|
|
154
|
+
### Bulkhead
|
|
155
|
+
|
|
156
|
+
- Isolate resources (thread pools, connection pools) between dependencies. If one dependency exhausts its allocation, others are unaffected
|
|
157
|
+
- Without bulkheads, one slow dependency can consume all connection pool entries, causing cascading failure
|
|
158
|
+
|
|
159
|
+
### Timeout and Retry Policies
|
|
160
|
+
|
|
161
|
+
- Every outbound call must have an explicit timeout. Without it, an unresponsive dependency blocks indefinitely
|
|
162
|
+
- **Exponential backoff with jitter**: Wait 2^n * base_delay + random jitter. Prevents thundering herd (synchronized retries after failure)
|
|
163
|
+
- **Maximum retries**: 2-3 for idempotent operations, 0 for non-idempotent (unless idempotency keys are used). Unlimited retries overload recovering dependencies
|
|
164
|
+
|
|
165
|
+
## Build/Package Dependency Rules
|
|
166
|
+
|
|
167
|
+
### Lock File Management
|
|
168
|
+
|
|
169
|
+
- Lock files (`package-lock.json`, `yarn.lock`, `Pipfile.lock`, `go.sum`, `Cargo.lock`) must be committed to version control. They ensure deterministic builds — every developer and CI system installs exactly the same dependency versions
|
|
170
|
+
- Without a lock file, `npm install` or `pip install` may resolve to different versions at different times, causing "works on my machine" failures
|
|
171
|
+
- Lock file conflicts during merge should be resolved by running the package manager's install/lock command, not by manually editing the lock file
|
|
172
|
+
|
|
173
|
+
### Dependency Resolution Algorithms
|
|
174
|
+
|
|
175
|
+
- **SAT solving (npm, pip)**: The dependency resolver models version constraints as a boolean satisfiability problem and finds a compatible set of versions. Can handle complex constraints but may be slow for large dependency trees. npm v7+ uses a tree-building algorithm with deduplication
|
|
176
|
+
- **Minimum version selection (Go)**: Always selects the minimum version that satisfies all constraints. Produces reproducible builds without a lock file (go.sum verifies checksums, not versions). Simpler and more predictable than SAT solving, but requires all modules to declare accurate minimum versions
|
|
177
|
+
- **Nearest definition wins (Maven)**: In a diamond dependency, the version declared closest to the root of the dependency tree wins. Can produce surprising results when transitive dependencies declare different versions
|
|
178
|
+
|
|
179
|
+
### Transitive Dependency Management
|
|
180
|
+
|
|
181
|
+
- **Peer dependencies (npm)**: Package requires a specific version installed by the consumer, not by itself. Used for plugins. npm v7+ warns if missing
|
|
182
|
+
- **Optional dependencies**: Enhance functionality but are not required. Package must function if absent. Checked at runtime with try/catch on import
|
|
183
|
+
- **Phantom dependencies**: npm/Yarn hoist shared dependencies to root `node_modules`, allowing code to import undeclared packages. pnpm prevents this with strict `node_modules` structure
|
|
184
|
+
|
|
185
|
+
### Dependency Security
|
|
186
|
+
|
|
187
|
+
- **Audit**: Run `npm audit`, `pip audit`, or equivalent in CI. Critical vulnerabilities (RCE, data breach): fix immediately. High: within days. Medium: within sprint
|
|
188
|
+
- **Supply chain security**: Verify integrity via checksums (go.sum), signatures (Sigstore), and SBOM generation. Real example: `event-stream` npm incident (2018) — malicious dependency added by compromised maintainer
|
|
189
|
+
- **Update strategy**: Dependabot/Renovate create PRs for updates. Auto-merge patches (semver-compatible), manual review for minor/major. Full test suite required on every update PR
|
|
190
|
+
|
|
191
|
+
## Referential Integrity
|
|
192
|
+
|
|
193
|
+
- A module referenced by import/require must actually exist
|
|
194
|
+
- All types referenced in a public API must be exported
|
|
195
|
+
- Environment variables referenced in configuration must actually be defined
|
|
196
|
+
- When the same function name exists in multiple files, limiting the search scope to a specific file when enumerating change targets causes omissions structurally. The full search (grep) results must be stated to prevent scope mismatch
|
|
197
|
+
|
|
198
|
+
## Source of Truth Management
|
|
199
|
+
|
|
200
|
+
- When data collection input paths number 3 or more, the consumption timing and source of truth designation for each path are required
|
|
201
|
+
- When migrating a source of truth, if the existing document's "definition authority" rules and the new system's source of truth declaration coexist, the dependency direction becomes duplicated. The existing rules must also be updated during migration
|
|
202
|
+
- When data is delivered through two paths — event stream (structural state) and file (semantic context) — the priority in case of inconsistency must be specified as a contract
|
|
203
|
+
|
|
204
|
+
## External Dependency Management
|
|
205
|
+
|
|
206
|
+
- Production dependencies and development-only dependencies must be distinguished (dependencies vs devDependencies)
|
|
207
|
+
- External API calls must have a fallback path in case of failure. Cross-reference: 'Runtime Dependency Rules' (Circuit Breaker, Timeout and Retry Policies)
|
|
208
|
+
- The license of external dependencies must be compatible with the project license
|
|
209
|
+
- For detecting changes from external-service-based sources, using service-provided metadata (lastModified, etc.) is advantageous for preventing false positives
|
|
210
|
+
- A pattern that concentrates external interface definitions in a single file (like MCP tool definitions) is prone to growing into a God Module. A distributed registration pattern maintains correct dependency directions
|
|
211
|
+
|
|
212
|
+
## Related Documents
|
|
213
|
+
- concepts.md — term definitions for dependency, source of truth, contract, API versioning, etc.
|
|
214
|
+
- structure_spec.md — layer structure principles, module structure rules, architectural patterns
|
|
215
|
+
- logic_rules.md — dependency logic, circular dependency rules, inter-module contract logic, security logic
|
|
216
|
+
- competency_qs.md — dependency verification questions
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 3
|
|
3
|
+
last_updated: "2026-03-31"
|
|
4
|
+
source: bundled-domain-baseline
|
|
5
|
+
status: established
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Software Engineering Domain — Domain Scope Definition
|
|
9
|
+
|
|
10
|
+
This is the reference document used by coverage to identify "what should exist but is missing."
|
|
11
|
+
This domain applies when **reviewing** a software system.
|
|
12
|
+
|
|
13
|
+
## Major Sub-areas
|
|
14
|
+
|
|
15
|
+
Classification axis: **concern** — classified by the design concerns that a software system must address.
|
|
16
|
+
|
|
17
|
+
Applicability markers:
|
|
18
|
+
- **(required)**: Must be addressed in any software system review. Absence indicates a fundamental gap
|
|
19
|
+
- **(when applicable)**: Address when the system's architecture includes the relevant pattern. Not addressing it when the pattern is absent is correct, not a gap
|
|
20
|
+
- **(scale-dependent)**: Becomes required beyond a scale threshold. The threshold should be documented per sub-area
|
|
21
|
+
|
|
22
|
+
### Data & State
|
|
23
|
+
- **Data Modeling** (required): entities, relationships, type definitions, schema design. Uber's Schemaless demonstrates schema-on-read (MySQL stores JSON blobs, schema evolution without migrations). Netflix EVCache handles 30M+ req/s, illustrating consistency vs availability trade-offs. Event Sourcing (Greg Young, EventStore) stores state as immutable event logs — Axon Framework implements this on the JVM with built-in CQRS. Data modeling must declare schema-on-write vs schema-on-read, as this determines migration strategy and consistency guarantees
|
|
24
|
+
- **State Management** (required): state transitions, invariants, recovery paths, concurrency control. CQRS (Command Query Responsibility Segregation) separates read and write models — the write side enforces invariants via commands, the read side serves optimized projections. Saga patterns (choreography vs orchestration) coordinate distributed state changes across service boundaries without distributed transactions
|
|
25
|
+
- **Event Sourcing** (when applicable): event storage, state reconstruction, projections, terminal states, partial commit prevention. Event Store (eventstore.com) provides a purpose-built database for event sourcing with built-in projections and subscriptions
|
|
26
|
+
|
|
27
|
+
### Interface & Contract
|
|
28
|
+
- **API Design** (required): public interfaces, versioning, contracts, backward compatibility. REST maturity is measured by Richardson's Maturity Model (L0: HTTP tunnel → L3: hypermedia/HATEOAS). GraphQL (Facebook, 2015) lets clients specify exact data shapes, solving over/under-fetching. gRPC (Google) uses Protocol Buffers for schema-first, strongly-typed RPC with HTTP/2 multiplexing. Stripe's rolling API versioning pins each customer to their integration version, avoiding the "upgrade cliff." OpenAPI/Swagger provides machine-readable specs enabling automated client generation and contract testing
|
|
29
|
+
- **Type System** (required): discriminated union, exhaustive check, type-level safety mechanisms. TypeScript's discriminated unions with exhaustive switch/case checking eliminate an entire class of runtime errors at compile time. Rust's `Result<T, E>` and `Option<T>` force callers to handle both success and failure paths (see also: concepts.md §Type Safety Mechanisms)
|
|
30
|
+
- **Error Handling** (required): error classification, recovery strategies, fallback paths, user guidance. Error classification should distinguish operational errors (expected, recoverable: network timeout, validation failure) from programmer errors (unexpected, non-recoverable: null dereference, assertion violation). Circuit breaker patterns (Netflix Hystrix, Resilience4j) prevent cascading failures by failing fast when downstream services are unhealthy
|
|
31
|
+
- **Requirements & Specification** (when applicable): functional and non-functional requirements capture, acceptance criteria, traceability from requirements to implementation. IEEE 830 (SRS) provides a standard format. Requirements must be testable — each requirement should map to at least one verification method. Non-functional requirements (performance, security, availability) must be quantified. Applicable when formal requirements management is practiced; implicit for small-team projects with clear verbal agreements
|
|
32
|
+
|
|
33
|
+
### Security & Auth
|
|
34
|
+
- **Authentication/Authorization** (required): user identification, permission systems, access control. OAuth 2.0/OIDC are the industry standards for delegated auth. JWT enables stateless authentication but requires careful token expiration, refresh rotation, and revocation handling. RBAC vs ABAC represent different authorization models — RBAC assigns permissions to roles, ABAC evaluates policies against attributes at runtime
|
|
35
|
+
- **Security** (required): input validation, injection prevention, data encryption, supply chain security. OWASP Top 10 (2021) classifies critical risks: A01 Broken Access Control through A10 SSRF. Log4Shell (CVE-2021-44228) demonstrated supply chain risk — a single Log4j vulnerability compromised millions of systems. The SolarWinds attack (2020) showed compromised build pipelines can inject malicious code into trusted updates, affecting 18,000+ organizations
|
|
36
|
+
|
|
37
|
+
### Verification & Quality
|
|
38
|
+
- **Test Strategy** (required): unit/integration/E2E coverage, verification criteria, test data management. Google's Testing Pyramid: many unit tests (fast, isolated), fewer integration tests (service boundaries), minimal E2E tests (slow, brittle). Fowler distinguishes sociable tests (real collaborators) from solitary tests (test doubles). Property-based testing (QuickCheck, Hypothesis, fast-check) generates random inputs to discover edge cases. Mutation testing (Stryker, PIT) validates test suite effectiveness by checking that tests catch injected mutations (see also: structure_spec.md §Verification Structure)
|
|
39
|
+
- **Verification Design** (when applicable): verification timing (shift-left), structural vs semantic verification, specification requirements when delegating to AI agents. Netflix Chaos Engineering (Chaos Monkey, 2011) injects failures in production to verify resilience — accepting failure as inevitable and testing recovery paths
|
|
40
|
+
- **Performance** (scale-dependent): response time, throughput, caching strategy. Load testing tools (k6, Gatling, Locust) simulate concurrent users to identify bottlenecks before production. Key metrics: p50/p95/p99 latency, throughput (RPS), error rate under load
|
|
41
|
+
|
|
42
|
+
### Structure & Architecture
|
|
43
|
+
- **Module Separation** (required): layer structure, dependency direction, separation of concerns. Hexagonal Architecture (Cockburn, 2005) isolates domain logic from infrastructure through ports and adapters, making the core testable without databases or HTTP. Clean Architecture (Robert C. Martin) enforces the Dependency Rule: dependencies point only inward. Domain-Driven Design (Evans, 2003) organizes code around bounded contexts. Microservices (Sam Newman) decompose systems into independently deployable services, trading operational complexity for deployment independence
|
|
44
|
+
- **Data Flow** (required): input-to-processing-to-output paths, transformation chains, source of truth designation. Pipe-and-filter architecture (Unix philosophy) composes systems from small, focused transformations. Event-driven architecture uses event buses (Kafka, RabbitMQ) to decouple producers from consumers
|
|
45
|
+
- **Event/Messaging** (when applicable): message queues, asynchronous processing, pipeline scalability. Apache Kafka provides durable, partitioned event logs enabling replay and exactly-once semantics. Message delivery guarantees (at-most-once, at-least-once, exactly-once) have fundamental trade-offs with latency and complexity
|
|
46
|
+
|
|
47
|
+
### Operations, Deployment & Maintenance
|
|
48
|
+
- **Deployment/Operations** (scale-dependent): CI/CD, environment separation, monitoring, logging. The 12-Factor App defines 12 principles for cloud-native applications (codebase, dependencies, config, backing services, build/release/run, processes, port binding, concurrency, disposability, dev/prod parity, logs, admin processes). GitOps (Weaveworks) uses Git as the single source of truth for declarative infrastructure. Feature flags (LaunchDarkly, Unleash) decouple deployment from release, enabling progressive rollouts without redeployment. Google SRE defines error budgets, SLIs/SLOs/SLAs, and toil reduction. DORA metrics (Deployment Frequency, Lead Time, Change Failure Rate, Time to Restore) measure delivery performance
|
|
49
|
+
- **Internationalization/Accessibility** (scale-dependent): multi-language, time zones, accessibility standards. **Applicability conditions**: Required when (1) the system serves users in multiple locales, (2) the system is subject to accessibility regulations (ADA, EAA, EN 301 549), or (3) the system is public-facing web/mobile. Not applicable for internal tools with a single-locale user base unless regulatory requirements mandate it. WCAG 2.1 defines A/AA/AAA conformance levels. ICU handles locale-aware formatting, collation, and transliteration. See concepts.md §Internationalization/Accessibility Terms for definitions
|
|
50
|
+
- **Maintenance** (when applicable): corrective maintenance (fixing defects discovered after delivery), adaptive maintenance (accommodating environment changes — OS upgrades, dependency updates, regulatory changes), perfective maintenance (improving performance/maintainability based on user feedback), preventive maintenance (refactoring to prevent anticipated problems). IEEE 14764 classifies these four categories. Technical debt management maps to preventive maintenance. Corrective/adaptive are reactive; perfective/preventive are proactive. See concepts.md §Change Management Terms for related terminology
|
|
51
|
+
|
|
52
|
+
### Documentation & Consumers
|
|
53
|
+
- **Document Design** (when applicable): dual-consumer handling for AI agents and humans, separation of contract documents vs guide documents, separation of information structure and rendering. Diátaxis classifies documentation into 4 types: tutorials (learning), how-to guides (task), reference (information), explanation (understanding). ADRs (Michael Nygard) capture the "why" behind architectural choices in structured format (context, decision, consequences). API-first design ensures contracts are defined before implementation
|
|
54
|
+
- **Constraint Design** (when applicable): hard/soft constraint classification, invariant vs best-effort boundary, pre-inclusion vs post-verification. Hard constraints: invariants that must never be violated (data integrity, security). Soft constraints: preferences relaxed under pressure (response time targets, cache hit ratios)
|
|
55
|
+
|
|
56
|
+
## Normative System Classification
|
|
57
|
+
|
|
58
|
+
Standards governing software engineering operate at three distinct layers. Each layer has different enforcement mechanisms and change velocity.
|
|
59
|
+
|
|
60
|
+
| Layer | Scope | Enforcement | Change Velocity | Examples |
|
|
61
|
+
|---|---|---|---|---|
|
|
62
|
+
| Layer 1 — Language/Runtime | Syntax, semantics, built-in APIs | Compiler/interpreter rejection | Slow (years) | ECMAScript, JLS, Go Spec, Rust Reference |
|
|
63
|
+
| Layer 2 — Framework/Library | Conventions imposed by frameworks | Runtime errors, lint rules | Medium (quarterly) | React hooks rules, Spring IoC, Rails conventions |
|
|
64
|
+
| Layer 3 — Industry/Organization | Cross-technology principles | Code review, audit | Fast (per incident) | OWASP Top 10, 12-Factor, SOLID, DDD patterns |
|
|
65
|
+
|
|
66
|
+
**Why this matters**: A review that cites only Layer 3 principles without checking Layer 1/2 conformance misses concrete, enforceable violations. Conversely, a review that only checks Layer 1/2 conformance without Layer 3 assessment misses systemic design issues.
|
|
67
|
+
|
|
68
|
+
## Required Concept Categories
|
|
69
|
+
|
|
70
|
+
These are concept categories that must be addressed in any software system.
|
|
71
|
+
|
|
72
|
+
| Category | Description | Risk if Missing | Example of Failure |
|
|
73
|
+
|---|---|---|---|
|
|
74
|
+
| Happy path | Normal behavior for expected inputs | Incomplete functional definition | API returns 200 but response body format is unspecified |
|
|
75
|
+
| Error path | Handling of abnormal inputs/states | Defenseless during failures | Unhandled exception crashes process; user sees raw stack trace |
|
|
76
|
+
| Boundary condition | Min/max values, empty inputs, concurrent access | Edge case failures | Integer overflow in payment calculation; empty array dereference |
|
|
77
|
+
| Lifecycle | Creation → use → disposal, state transitions | Resource leaks, zombie objects | Database connection pool exhaustion from unclosed connections |
|
|
78
|
+
| Traceability | Change rationale, decision justification, audit trail | Unmaintainable | 3-year-old conditional with no comment or commit message explaining why it exists |
|
|
79
|
+
| Source of truth | The authoritative data/definition source when inconsistencies arise | Unable to resolve information conflicts | User profile cached in 3 services diverges; no system is designated authoritative |
|
|
80
|
+
| Concurrency | Thread safety, race conditions, deadlock prevention | Data corruption under load | Two threads updating the same balance without locking; lost update |
|
|
81
|
+
| Idempotency | Operations that produce the same result when executed multiple times | Duplicate side effects | Payment charged twice because retry logic doesn't check for existing transaction |
|
|
82
|
+
| Observability | Logging, metrics, and tracing for runtime behavior | Silent failures, undiagnosable production issues | Error rate spikes but no logs indicate which endpoint or upstream service is responsible |
|
|
83
|
+
|
|
84
|
+
## Reference Standards/Frameworks
|
|
85
|
+
|
|
86
|
+
| Standard | Application Area | Usage | When to Apply |
|
|
87
|
+
|---|---|---|---|
|
|
88
|
+
| OWASP Top 10 (2021) | Security | Web application security vulnerability classification | Every web-facing system; review checklist for security |
|
|
89
|
+
| 12-Factor App | Deployment/Operations | Cloud-native application design principles | Cloud-deployed services; SaaS architecture review |
|
|
90
|
+
| REST Maturity Model (Richardson) | API Design | API design level assessment (L0–L3) | Reviewing or designing REST APIs |
|
|
91
|
+
| SOLID Principles | Module separation, type system | Five principles of object-oriented design | Object-oriented codebases; module boundary review |
|
|
92
|
+
| Event Sourcing Pattern | Event Sourcing | Event storage, state reconstruction, projections | Systems requiring full audit trail or temporal queries |
|
|
93
|
+
| Diátaxis Framework | Document Design | Tutorial/How-to/Reference/Explanation 4-way classification | Documentation review or creation |
|
|
94
|
+
| IEEE 830 (SRS) | Requirements | Software Requirements Specification format | Formal requirements documentation |
|
|
95
|
+
| ISO 25010 | Quality Model | Software quality characteristics (8 characteristics, 31 sub-characteristics) | System quality attribute assessment |
|
|
96
|
+
| TOGAF | Architecture | Enterprise architecture framework and ADM (Architecture Development Method) | Enterprise-scale architecture decisions |
|
|
97
|
+
| C4 Model (Simon Brown) | Architecture | 4-level architecture diagramming (Context, Container, Component, Code) | Architecture documentation and communication |
|
|
98
|
+
| Arc42 | Architecture | Pragmatic architecture documentation template (12 sections) | Documenting system architecture decisions |
|
|
99
|
+
| Domain-Driven Design (Eric Evans) | Structure & Architecture | Bounded contexts, aggregates, ubiquitous language | Complex domains with rich business logic |
|
|
100
|
+
| Google SRE Workbook | Operations | Error budgets, SLIs/SLOs, incident management | Production systems requiring reliability guarantees |
|
|
101
|
+
| IEEE 14764 | Maintenance | Software maintenance process and classification (corrective/adaptive/perfective/preventive) | Systems with ongoing maintenance operations |
|
|
102
|
+
| WCAG 2.1 | Accessibility | Web Content Accessibility Guidelines (A/AA/AAA conformance levels) | Public-facing web applications; legally mandated accessibility |
|
|
103
|
+
|
|
104
|
+
## Bias Detection Criteria
|
|
105
|
+
|
|
106
|
+
- If ⌈N/2.5⌉ or more of the Major Sub-areas (§Major Sub-areas) are not represented at all → **insufficient coverage**. **N** = the number of `###` subsections under §Major Sub-areas (count at review time — do not hard-code). At review time the reviewer counts the current `###` headings under §Major Sub-areas and computes the threshold from N, so adding or removing a sub-area updates the threshold automatically without editing this rule
|
|
107
|
+
- If concepts from a specific area account for more than 70% of the total → **area bias**
|
|
108
|
+
- If only the happy path is defined with no error path → **path bias**
|
|
109
|
+
- If creation/use is defined but disposal/cleanup is missing → **incomplete lifecycle**
|
|
110
|
+
- If 2 or more data sources lack a designated source of truth → **undesignated authority**
|
|
111
|
+
- If the document design area is missing in a system where AI agents are consumers/executors → **missing consumer perspective**
|
|
112
|
+
- If only synchronous request-response is considered with no async patterns (queues, events, callbacks) → **concurrency blindness**. Production systems require async for resilience and scalability
|
|
113
|
+
- If only server-side logic is addressed with no client-side considerations → **deployment bias**. Full-stack systems need design decisions on both sides of the network boundary
|
|
114
|
+
- If testing covers only unit tests with no integration or E2E strategy → **test level bias**. Each level catches different defect classes; missing any level leaves a verification gap (see also: structure_spec.md §Verification Structure)
|
|
115
|
+
- If security addresses only authentication without authorization → **security scope bias**. Auth without authz means every authenticated user has full access (OWASP A01)
|
|
116
|
+
- If only read operations are designed with no write/mutation considerations → **operation bias**. Ignoring write paths produces systems that fail under mutation load
|
|
117
|
+
|
|
118
|
+
## Inter-Document Contract
|
|
119
|
+
|
|
120
|
+
This section declares which file owns which cross-cutting topic, preventing rule duplication and phantom references.
|
|
121
|
+
|
|
122
|
+
### Rule Ownership
|
|
123
|
+
|
|
124
|
+
| Cross-cutting Topic | Owner File | Other Files |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| Dependency direction rules | dependency_rules.md | structure_spec.md (references only) |
|
|
127
|
+
| Backward compatibility classification | dependency_rules.md | logic_rules.md (references only) |
|
|
128
|
+
| Concept definitions | concepts.md | All other files reference, do not redefine |
|
|
129
|
+
| Structural coherence rules | structure_spec.md §Golden Relationships | Other files reference |
|
|
130
|
+
| Conciseness criteria | conciseness_rules.md | Other files reference |
|
|
131
|
+
| Competency questions | competency_qs.md | Other files provide inference path targets |
|
|
132
|
+
| Error handling design | logic_rules.md §Error Handling Logic | dependency_rules.md (cascading failure mechanisms) |
|
|
133
|
+
| Performance optimization rules | logic_rules.md §Performance Logic | structure_spec.md (thresholds), domain_scope.md (SLOs) |
|
|
134
|
+
|
|
135
|
+
### Required Substance per Sub-area
|
|
136
|
+
|
|
137
|
+
Each sub-area declared in Major Sub-areas must have corresponding substance in at least one of:
|
|
138
|
+
- concepts.md: term definitions
|
|
139
|
+
- logic_rules.md or structure_spec.md or dependency_rules.md: operational rules
|
|
140
|
+
- competency_qs.md: verification questions
|
|
141
|
+
|
|
142
|
+
A sub-area with declaration but no substance in any file is a "ghost sub-area" and must either be populated or annotated with applicability conditions.
|
|
143
|
+
|
|
144
|
+
### Cross-cutting Concern Attribution
|
|
145
|
+
|
|
146
|
+
When a concern spans multiple sub-areas, attribute it to the sub-area where the concern has its **primary enforcement point**:
|
|
147
|
+
|
|
148
|
+
1. **Primary enforcement point**: The sub-area whose rules would be violated if the concern is not addressed. Example: input validation spans Interface & Contract (API design) and Security & Auth (injection prevention). Primary enforcement: Security & Auth, because the security consequence is the enforcement driver
|
|
149
|
+
2. **Secondary references**: Other sub-areas reference the primary sub-area's rules rather than duplicating them
|
|
150
|
+
3. **Tie-breaking**: If enforcement is equally distributed, attribute to the sub-area with fewer existing items (load balancing)
|
|
151
|
+
|
|
152
|
+
### Classification Axis Relationships
|
|
153
|
+
|
|
154
|
+
The domain files use three related concern axes — they are facets of the same domain, not independent classification systems:
|
|
155
|
+
|
|
156
|
+
| File | Axis | Facet |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| domain_scope.md | concern | What design concerns exist (scope) |
|
|
159
|
+
| logic_rules.md | system construction concern | What concerns are governed by rules (rules) |
|
|
160
|
+
| competency_qs.md | verification concern | What concerns must be verified (questions) |
|
|
161
|
+
|
|
162
|
+
### Sub-area to CQ Section Mapping
|
|
163
|
+
|
|
164
|
+
| Sub-area | CQ Sections | Coverage |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| Data & State | CQ-D (Data Flow) | Full |
|
|
167
|
+
| Interface & Contract | CQ-I (Change Impact), CQ-E (Error Handling), CQ-R (Requirements) | Full |
|
|
168
|
+
| Security & Auth | CQ-SE (Security) | Full |
|
|
169
|
+
| Verification & Quality | CQ-V (Testing/Verification), CQ-P (Performance) | Full |
|
|
170
|
+
| Structure & Architecture | CQ-S (Structural Understanding), CQ-M (Event/Messaging) | Full |
|
|
171
|
+
| Operations, Deployment & Maintenance | CQ-O (Deployment/Operations), CQ-MT (Maintenance) | Full |
|
|
172
|
+
| Documentation & Consumers | CQ-A (AI Agent Collaboration) | Partial (AI-focused) |
|
|
173
|
+
|
|
174
|
+
Cross-cutting CQ sections (not mapped to a single sub-area):
|
|
175
|
+
- CQ-T (Types and Constraints) — spans Interface & Contract + Data & State
|
|
176
|
+
- CQ-B (Boundary Conditions) — spans all sub-areas
|
|
177
|
+
- CQ-C (Concurrency) — spans Data & State + Structure & Architecture
|
|
178
|
+
- CQ-DE (Dependencies) — spans Structure & Architecture + Operations
|
|
179
|
+
|
|
180
|
+
## Related Documents
|
|
181
|
+
- concepts.md §Architecture Core Terms — definitions of terms within this scope
|
|
182
|
+
- structure_spec.md §Required Module Structure Elements — specific rules for module structure, test organization
|
|
183
|
+
- competency_qs.md — questions this scope must be able to answer
|