3.8 KiB
3.8 KiB
| id | ticket | title | status | created | ref_decisions | tags | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0119 | multi-frontend-serializable-ir | Document IRBackend serializability invariants | in_progress | 2026-07-15 |
|
|
Briefing
DEC-0044 locks the common IRBackend handoff as a serializable-by-design data contract. The first implementation step is to make that rule visible in compiler-general specs before changing code or tests.
Objective
Document the serializability invariants for the common IRBackend handoff in the compiler-general backend specification, and connect those invariants to the conformance matrix when a test row is useful.
Dependencies
- Accepted decision:
DEC-0044. - Existing common backend spec:
docs/specs/compiler/20. IRBackend to IRVM Lowering Specification.md. - Existing conformance matrix:
docs/specs/compiler/22. Backend Spec-to-Test Conformance Matrix.md.
Scope
- Add a compiler-general subsection defining
IRBackendas a serializable-by-design data contract. - State the allowed public contract shapes: primitives, strings, enums, immutable values, ordered lists, explicit ids, and source attribution values.
- State the forbidden public contract shapes: callbacks, service objects, frontend AST/parser/token/semantic/editorial objects, mutable global state, object-identity semantics, unordered contract collections, cyclic public references, lazy process-dependent values, and selected wire formats.
- Define the relationship between table-scoped ids such as
FileId,ModuleId,CallableId, andIntrinsicIdand future codec eligibility. - Add conformance matrix rows only for invariants that have direct test coverage in the follow-up plans.
Non-Goals
- Do not choose JSON, Protobuf, RPC, process isolation, plugin loading, or any concrete wire format.
- Do not define a schema language.
- Do not change Java model code in this plan.
- Do not move PBS-specific lowering rules into compiler-general specs.
Execution Method
- Update
docs/specs/compiler/20. IRBackend to IRVM Lowering Specification.md.- Add the serializability subsection near the existing common
IRBackendcontract section. - Use normative
MUST,MUST NOT, andSHOULDlanguage matchingDEC-0044. - Keep the wording data-shape focused, not transport focused.
- Add the serializability subsection near the existing common
- Update
docs/specs/compiler/22. Backend Spec-to-Test Conformance Matrix.md.- Add rows for public-contract serializability guardrails only if the row can name or anticipate concrete tests from
PLN-0121andPLN-0122. - Keep rows under compiler-general/backend ownership.
- Add rows for public-contract serializability guardrails only if the row can name or anticipate concrete tests from
- Check that PBS lowering spec remains scoped to populating the handoff.
- If references are needed, link to the compiler-general spec rather than restating the full rule.
Acceptance Criteria
- The compiler-general spec states that public
IRBackendcontract types are serializable by design. - The spec explicitly forbids callbacks, services, frontend-owned objects, mutable global state, identity-based semantics, unordered output-affecting collections, cycles, process-dependent lazy values, and wire-format selection.
- The spec preserves
DEC-0044's deferral of codecs and external process design. - Any conformance matrix changes map to concrete tests planned in
PLN-0121orPLN-0122.
Tests
Run documentation validation available in the repository, if any. At minimum, run discussion validate after the plan's implementation and manually inspect the changed spec section for normative consistency with DEC-0044.
Affected Artifacts
docs/specs/compiler/20. IRBackend to IRVM Lowering Specification.mddocs/specs/compiler/22. Backend Spec-to-Test Conformance Matrix.md- Optional reference touch only:
docs/specs/compiler-languages/pbs/13. Lowering IRBackend Specification.md