Build the SEA-DSL parsing, validation, formatting, and compilation toolchain with IDE/LSP support, ensuring deterministic AST → IR → Manifest output and strict flow annotation contracts.
| ADR ID | Decision Title | Impact on This Plan |
|---|---|---|
| ADR-004 | Semantic Core Formalization | SEA-DSL is the canonical source of semantics. |
| ADR-023 | SEA-DSL Policy Shift | SBVR is historical/import-only; SEA-DSL is runtime. |
| ADR-012 | Delivery Pipeline | Toolchain is the front-end of the spec → code pipeline. |
| ADR-017 | MCP-LSP Integration Architecture | LSP hover/diagnostics are authoritative semantic probes. |
| PRD ID | Requirement Title | Satisfied By (SDS) | Acceptance Criteria |
|---|---|---|---|
| PRD-001 | Unified Business Semantics | SDS-002 | DSL parsing + validation |
| PRD-002 | Automated Rule Enforcement | SDS-002 | Policy validation + evaluation |
| SDS ID | Service/Component | Bounded Context | SEA-DSL Spec File | Implementation Status |
|---|---|---|---|---|
| SDS-002 | Semantic Core DSL Service | semantic-core |
N/A | MVP (doc) |
| SDS-027 | Isomorphic Semantic Compiler | shared |
N/A | Proposed |
graph TD
ADR4[ADR-004: Semantic Core] --> PRD1[PRD-001: Unified Semantics]
ADR23[ADR-023: SEA-DSL Policy Shift] --> PRD2[PRD-002: Rule Enforcement]
PRD1 --> SDS2[SDS-002: DSL Service]
PRD2 --> SDS2
Updated 2025-12-30: Added specific dependencies from gap analysis section 1.2 (SEA-DSL Parsing & Compilation).
| Dependency | Type | Version | NPM/PyPI Package | Justification | ADR/SDS Reference |
|---|---|---|---|---|---|
| Tree-sitter | Parser Framework | 0.24.x |
tree-sitter, tree-sitter-cli (Node); tree-sitter (Python) |
High-performance incremental parser for SEA-DSL grammar. Enables IDE-grade parse performance. | ADR-004, SDS-002 |
| SEA™ Grammar | Custom | N/A | Custom tree-sitter grammar in tools/grammars/sea/ |
Define .sea file syntax for parsing into AST. |
ADR-004, REF-001 |
| Babel Traverse | Node.js Library | 7.x |
@babel/traverse, @babel/types |
Navigate and transform parsed AST nodes using visitor pattern. | Developer Tooling REF-001 |
| OPA (Rego) | Policy Engine | 0.70.x |
@open-policy-agent/opa-wasm (Node); opa (CLI binary) |
Execute SEA-DSL policies at runtime. Deterministic policy evaluation. | SDS-002, ADR-028 |
1
2
3
4
5
6
7
8
# Node.js dependencies
pnpm add tree-sitter tree-sitter-cli @babel/traverse @babel/types @open-policy-agent/opa-wasm
# Python dependencies (in pyproject.toml)
pip install tree-sitter
# OPA CLI (via mise)
mise use opa@0.70.0
1
2
3
4
5
6
7
8
9
10
11
// SEA-DSL Parser Port
interface SeaDslParserPort {
parse(source: string): Promise<SeaAst>;
validate(ast: SeaAst): Promise<ValidationReport>;
}
// Policy Evaluator Port (wraps OPA)
interface PolicyEvaluatorPort {
evaluatePolicy(policyId: string, input: object): Promise<PolicyResult>;
compileRego(regoSource: string): Promise<CompiledPolicy>;
}
tools/schemas/ast-v3.schema.jsontools/schemas/sea_ir.schema.jsontools/flow_lint.pytools/ast_to_ir.py1
2
3
4
5
6
/
├── tools/flow_lint.py
├── tools/ast_to_ir.py
├── tools/schemas/ast-v3.schema.json
├── tools/schemas/sea_ir.schema.json
└── docs/reference/sea_dsl_language_reference.yml
| Cycle | Branch | Wave | Files Modified | Files Created | Specs Implemented |
|---|---|---|---|---|---|
| C1A | cycle/p015-c1a-dsl-contract |
1 | docs/reference/sea_dsl_language_reference.yml |
— | Grammar and idioms |
| C1B | cycle/p015-c1b-ast-lint |
1 | tools/flow_lint.py, tools/schemas/ast-v3.schema.json |
— | Flow annotation contract |
| C2A | cycle/p015-c2a-ide-support |
2 | docs/specs/shared/sds/041-ultimate-lsp-hover-specification.md |
— | LSP hover + diagnostics |
docs/reference/sea_dsl_language_reference.yml, docs/reference/sea_dsl_language_idioms.ymltools/flow_lint.py, tools/schemas/ast-v2.schema.jsondocs/specs/shared/sds/041-ultimate-lsp-hover-specification.mdsea_dsl_language_reference.ymltools/flow_lint.py --strictast_to_ir.py reject dotted annotation keys entirely (to match the “nested JSON only” rule)? Reject entirely| Risk | Likelihood | Impact | Mitigation Strategy |
|---|---|---|---|
| Authoring friction due to strict annotations | Medium | Medium | Provide examples + editor hints; allow warn-only mode temporarily. |
| Schema/tool mismatch | Medium | High | Treat schemas as canonical; update docs + tests together. |
| Type | ID/Doc | Document |
|---|---|---|
| ADR | ADR-004 | docs/specs/shared/adr/004-semantic-core-formalization.md |
| ADR | ADR-023 | docs/specs/shared/adr/023-sea-dsl-policy-shift.md |
| PRD | PRD-001 | docs/specs/semantic-core/prd/001-unified-business-semantics.md |
| PRD | PRD-002 | docs/specs/semantic-core/prd/002-automated-rule-enforcement.md |
| SDS | SDS-002 | docs/specs/semantic-core/sds/002-semantic-core-dsl-service.md |
| SDS | SDS-052 | docs/specs/shared/sds/052-semantic-tooling-ide-integration.md |
Note: SDS-041 (Ultimate LSP Hover) has been superseded by SDS-052 per ADR-017.