Commit Graph

2 Commits

Author SHA1 Message Date
41a655320a HC021+HC031完全実装: Analyzer IO Safety + Brace Heuristics
## 実装完了
-  HC021 (Analyzer IO Safety): FileBox直接使用を検出
-  HC031 (Brace Heuristics): ブレース不一致をファイルレベルで検出

## 修正内容
1. **cli.hako**: charCodeAt除去(StringBox未実装メソッド)
   - fancy quote変換ロジック削除(CRLF正規化のみ残す)

2. **HC031 line番号修正**:
   - 問題: "mismatch:" のコロンが line番号解析と干渉
   - 修正: "mismatch -" に変更 + ":: path:1" 明示追加

3. **HC021 expected.json更新**:
   - --rules filtering動作確認済み
   - 他ルールのwarning削除(HC012/HC014/HC022)

## テスト結果
```
[TEST/OK] HC011, HC012, HC015-HC018, HC021, HC022, HC031 
[TEST/FAIL] HC013, HC014 (expected.json古い、要更新)
```

## 技術ノート
- PHI pred mismatch: 現在のコードで再現不可
- 歴史的修正(phi_merge_helper.rs)で既に解決済みの可能性
- ホットフィックス(no_ast=1デフォルト)も寄与

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 12:20:25 +09:00
89f1541918 WIP: HC031 (Brace Heuristics) - implementation ready, VM issues remain
⚠️ Status: Work In Progress
- Rule implementation complete but test fails due to VM execution issues
- Test shows empty diagnostics - possible VM crash during execution
- User fixed Rust-layer newline bug (HEX encoding), but deeper VM issue remains

 Implementation:
- tools/hako_check/rules/rule_brace_heuristics.hako: Complete implementation
  - Counts open/close braces (skips comments, handles string literals)
  - Reports mismatch with clear message format
- tools/hako_check/tests/HC031_brace_heuristics/: Test files ready
  - ok.hako: Balanced braces (2 open, 2 close)
  - ng.hako: Unbalanced braces (2 open, 1 close) - should trigger warning
  - expected.json: Expected warning defined

 Known Issues:
- VM execution fails before producing diagnostics JSON
- Test output: {"diagnostics":[]}
- Possible causes: Runtime error in rule code, VM memory issue
- Requires deeper investigation of VM execution path

🎯 Next steps:
- Debug VM execution with minimal HC031 test case
- Check if issue is in _split_lines, _remove_strings, or main logic
- Consider simplified version without string literal handling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 04:17:57 +09:00