Merge rules-editor branch types through explicit compatibility rules
Conditional branches return incompatible values but the checker chooses the first branch type. Define their common result rule.
- Focused work estimate
- 3h + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Type inference · Control flow
Estimated field mix
- Compiler and language tooling100%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
Fictional rules editor Willow supports numbers, strings, booleans, records and functions in a deliberately small language. Define syntax and type rules locally; no arbitrary code execution is needed.
Setup prerequisites
- Create synthetic AST fixtures and a written type-rule table.
- Define source spans and structured diagnostic output.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- CTYPE-101 · Assign explicit types to rules-editor literals
- CTYPE-102 · Resolve expression identifiers through lexical scope
- CTYPE-103 · Explain rules-editor operator operand mismatches
- CTYPE-104 · Check function calls for arity before argument inference
- CTYPE-105 · Unify rules-editor type variables with an occurs check
- CTYPE-106 · Report missing rules-editor record fields without losing known fields
Acceptance criteria
- Compatible branches infer documented type
- Incompatible branches report both spans
- Condition must be boolean
Implementation constraints
- Do not introduce implicit coercion without a declared rule.
Verification to include
- Check matching branches
- Check number versus record branches
Deliverables
- Conditional rule and compatibility cases
Rollout and recovery
Reject mixed branches until the rule is stable.
Value of the work
For the engineer: Practice type environments, unification and explainable rejection.
For the team: Inspect whether developer tooling catches mistakes without hiding uncertainty.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.