Sibling articles under this feature previously restated requirements in inconsistent forms.
Rules pipeline contract - Design model
Platform spec article
Rules pipeline contract - Design model
Spec standingStandard
-
This feature hub owns normative MUST/SHOULD contract text for Rules pipeline contract.
Context
Decision
This feature hub owns normative MUST/SHOULD contract text. Sibling articles must not redefine hub requirements and should link here for authority.
Consequences
Contract changes start on the hub or in linked ADRs, then propagate to articles and implementation anchors.
Verification anchors
site/website/src/content/docs/platform-spec/compiler/semantic-pipeline/rules-pipeline-contract/index.mdxarticle bundle under the same feature directory.
-
Platform-spec text supersedes informal crate comments for Rules pipeline contract.
Context
Implementation crates accumulated informal notes that diverged from published contracts.
Decision
Normative platform-spec prose and ADRs under this feature supersede informal comments in implementation crates until explicitly migrated into spec text.
Consequences
Engineers file spec/ADR updates when behavior changes; crate comments are non-authoritative for conformance arguments.
Verification anchors
compiler/crates/beskid_analysis/src/analysis/rules/compiler/crates/beskid_analysis/src/analysis/diagnostic_kinds.rscompiler/crates/beskid_analysis/src/services.rs
-
Monolithic semantic passes blocked incremental invalidation.
Context
Monolithic semantic passes blocked incremental invalidation.
Decision
Semantic rules are grouped in
analysis/rules/staged/with explicit stage boundaries wired throughservices.rsfor CLI and LSP.Consequences
New rules declare their stage; cross-stage dependencies are documented in the hub articles.
Verification anchors
compiler/crates/beskid_analysis/src/analysis/rules/.
- Rules pipeline contract - Contracts and edge cases States the normative guarantees and what happens at boundaries or failure edges.
- Rules pipeline contract - Design model Explains the persistent concepts, entities, and boundaries this feature relies on.
- Rules pipeline contract - Examples Gives concrete newcomer-friendly scenarios mapped to real compiler paths.
- Rules pipeline contract - FAQ and troubleshooting Answers common operator and contributor questions with practical next checks.
- Rules pipeline contract - Flow and algorithm Walks through runtime/order-of-operations behavior in the implementation.
- Rules pipeline contract - Verification and traceability Shows how the team proves this feature works and where evidence lives.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Staged pipeline
Section titled “Staged pipeline”Semantic rules run as ordered SemanticPipelineRule stages on the post-merge syntax snapshot (syntax_generation_id).
flowchart LR merge[mod merge + reparse] gate[syntax generation gate] s1[early binding stages] s8[stage8_metaprogramming] late[type + effect checks] hir[HIR normalization] merge --> gate --> s1 --> s8 --> late --> hir
Anchored code paths
Section titled “Anchored code paths”compiler/crates/beskid_analysis/src/analysis/rules/staged.rscompiler/crates/beskid_analysis/src/analysis/diagnostic_kinds.rscompiler/crates/beskid_analysis/src/services.rs
Meta contributions and staged rules
Section titled “Meta contributions and staged rules”After the mod host merges emit contributions into the syntax model and bumps syntax_generation_id, the staged semantic pipeline (SemanticPipelineRule in compiler/crates/beskid_analysis/src/analysis/rules/staged.rs) must run on the post-merge program snapshot. stage8_metaprogramming is reserved for meta-specific semantic checks that still belong to ordinary diagnostics (for example validating attributes produced by meta); it must not replace the mod host’s collect/generate/analyze/rewrite orchestration.
Inspector-only meta that does not emit still runs before the semantic diagnostics gate on the same snapshot generation so diagnostics from meta and builtin rules share one ordering pass unless explicitly partitioned by diagnostic phase metadata.
Practical notes
Section titled “Practical notes”- Prefer tracing from CLI/test entry points into analysis/codegen crates before changing internals.
- Treat diagnostics and tests as part of the contract, not optional implementation details.
- If behavior changes, update this article and add/adjust tests in
compiler/crates/beskid_testsorcompiler/crates/beskid_e2e_tests.