Classify every comment as tautology, stale, excuse or decision record. Tautology/stale/excuse comments are deleted (excuses filed as issues #196-#236), decisions moved to docs/adr/0001-0034. - scripts/lint-comments.sh + .comment-baseline: per-file comment count may only go down; wired into tests/all.sh - .claude/skills/delete-comment: repeatable audit workflow - cargo fmt applied to touched crates Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
718 B
718 B
Compaction cut points keep roles alternating
Status: accepted
Context
The summary must be folded into the history without breaking provider rules: roles alternate and every tool_use keeps its result.
Decision
Compaction cuts at the latest user prompt and folds the summary into it. Inside one long tool loop with no prompt to cut at, it cuts before an assistant message and the summary becomes its own leading user message, so the kept history still alternates and the pending tool_use still has its result.
Consequences
Summaries sit at a prompt boundary when possible; the fallback handles single huge tool loops.
Code: crates/hx-core/src/compact.rs (plan, Plan, test for the no-prompt case)