docs: Phase 109 plan (error_tags hints SSOT)

- Add hint policy to joinir-design-map.md
- Document format: [joinir/<category>/<tag>] <msg>  Hint: <hint>
- Establish SSOT for error messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-17 23:45:32 +09:00
parent 46c924ac6d
commit 23e7f4629f

View File

@ -24,6 +24,33 @@ Related:
---
## Design Notes箱理論の“効いてるところ”
このプロジェクトで JoinIR が効いている理由は、「PHI/CFG を一枚岩にせず、“意味の境界”を箱で分けている」点にある。
- スコープ解決の SSOT を固定する(検索順): `ConditionEnv → LoopBodyLocalEnv → CapturedEnv → CarrierInfo`
- 「なぜこの変数が見える/見えないか」を、層の契約として説明できるようにする
- ループは “形pattern” を言語化して段階投入するfixture + shape guard + Fail-Fast
- pattern を増やす代わりに、policyfamilyで “同型” を吸収する
- Capability は “解禁の順序” を SSOT 化する(最小形→回帰で積み上げ)
- 未対応は best-effort で誤魔化さず、Fail-Fast で理由を固定する
改善の方向(将来):
- policy Reject の "hint" を `error_tags` に集約して、修正方針を 1 行で出せるようにするPhase 109 候補)
## Error Tags with Hints (Phase 109)
**SSOT**: error_tags is the single source for "tag + message + hint" errors.
**Policy**:
- policy/validator/merge use error_tags (no raw strings)
- hint is "1-line fix suggestion" only (no long explanations)
- Format: `[joinir/<category>/<tag>] <message> Hint: <hint>`
**Examples**:
- `[joinir/phase107/balanced_depth_scan/missing_tail_inc] ... Hint: add 'i = i + 1' at top-level`
- `[joinir/phase100/pinned/reassigned] ... Hint: remove reassign, or promote to carrier`
## 1枚図: レイヤーAST → JoinIR → MIR → Backend
```mermaid