Files
hx/docs/adr/0020-external-change-baseline.md
T
johannesandClaude Sonnet 5.5 a94632ea3d chore: delete code comments, add ratchet lint and ADRs
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>
2026-11-21 13:37:32 +01:00

15 lines
1022 B
Markdown

# Attribute on-disk changes during a run to hx and re-baseline the read-guard
Status: accepted
## Context
During an agent run, files can change through bash, subagents or aborted tools that already wrote. Those are the agent's own changes, not the user's. Treating them as external edits would block the agent's next edit via the read-guard. Separately, a file can change on disk while the lens is still checking it, making the findings untrustworthy.
## Decision
Anything that changed on disk during the run is attributed to hx (not the user) and the read-guard is re-baselined, including after our own formatting. Only edits made while the model was thinking count as external. A freshness gate labels results when a file changed during the check instead of trusting them.
## Consequences
No spurious "file changed externally" errors for the agent; genuinely external edits made between turns are still detected by the mtime watcher.
Code: crates/hx-lens/src/lib.rs (turn-start/end handling, report freshness gate)