docs: ドキュメント配置ルール(SSOT)確立

## 追加内容
- CLAUDE.md にドキュメント配置ルール(SSOT)セクション追加
- DOCS_LAYOUT.md (SSOT): 置き場所ルール定義
- phases/README.md: Phase ドキュメント説明
- design/README.md: 設計図ドキュメント説明
- investigations/README.md: 調査ログ説明

## ルール概要
1. **Phase 文書** → phases/phase-<N>/
2. **設計図** → design/
3. **調査ログ** → investigations/ (結論を 10-Now/20-Decisions に反映)

## 導線
- CLAUDE.md で概要説明
- DOCS_LAYOUT.md で詳細定義(SSOT)
- 各フォルダ README で参照方法

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-14 18:27:24 +09:00
parent e4678585d5
commit 4b87b6cc88
12 changed files with 289 additions and 22 deletions

View File

@ -343,7 +343,8 @@ pub fn emit_mir_json_for_harness(
B::Or => "|",
};
let mut obj = json!({"op":"binop","operation": op_s, "lhs": lhs.as_u32(), "rhs": rhs.as_u32(), "dst": dst.as_u32()});
// dst_type hint for string concatenation: if either side is String-ish and op is '+', mark result as String handle
// dst_type hint for string concatenation: ONLY if BOTH sides are explicitly String-ish and op is '+', mark result as String handle
// Option C: Unknown/None types default to Integer arithmetic (conservative)
if matches!(op, B::Add) {
let lhs_is_str = match f.metadata.value_types.get(lhs) {
Some(MirType::String) => true,
@ -355,7 +356,9 @@ pub fn emit_mir_json_for_harness(
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => false,
};
if lhs_is_str || rhs_is_str {
// Changed: require BOTH to be explicitly String (lhs_is_str && rhs_is_str)
// Default: Unknown → Integer arithmetic
if lhs_is_str && rhs_is_str {
obj["dst_type"] =
json!({"kind":"handle","box_type":"StringBox"});
}
@ -733,6 +736,7 @@ pub fn emit_mir_json_for_harness_bin(
B::Or => "|",
};
let mut obj = json!({"op":"binop","operation": op_s, "lhs": lhs.as_u32(), "rhs": rhs.as_u32(), "dst": dst.as_u32()});
// Option C: Unknown/None types default to Integer arithmetic (conservative)
if matches!(op, B::Add) {
let lhs_is_str = match f.metadata.value_types.get(lhs) {
Some(MirType::String) => true,
@ -744,7 +748,9 @@ pub fn emit_mir_json_for_harness_bin(
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => false,
};
if lhs_is_str || rhs_is_str {
// Changed: require BOTH to be explicitly String (lhs_is_str && rhs_is_str)
// Default: Unknown → Integer arithmetic
if lhs_is_str && rhs_is_str {
obj["dst_type"] =
json!({"kind":"handle","box_type":"StringBox"});
}