Repository navigation
Description
Summary
Squad's archival routine (decision-record archiving and agent-history summarization) can permanently destroy state when .squad/ is git-excluded.
Archival works by moving content out of a source file and into an archive file. If the archive destination is untracked, the removal from the tracked source commits — but the destination never does. The content is gone with no error, no warning, and a success report.
How it was found
During the gh-aw pre-E2E triage session, Scribe reported "no archival required" while having actually archived 25 decision records and 3 agent-history entries to new, untracked files.
Staging the result produced 752 deletions vs 265 insertions. It was caught only because a human git-safety rule (stop and inspect if the diff looks wrong) fired before commit. Nothing in the tooling flagged it.
Repaired in #1782 by re-homing all content into already-tracked archive destinations. Verified via literal containment: 23 + 6 + 2 + 2 headings removed, 0 lost.
Why it happens
.squad/ is git-excluded in this checkout (.git/info/exclude). Under that condition:
- files already tracked still commit normally
- files newly created are silently never added
Archival creates timestamped destination files (e.g. history-archive-<timestamp>.md, decisions/archive/<date>-archived-pre7d.md). Those are new, therefore untracked, therefore uncommittable. The source file's removal is tracked and commits fine.
Result: archival becomes deletion.
Impact
Any user with a git-excluded or gitignored .squad/ is exposed. This is not specific to this repository — excluding .squad/ is a reasonable and common choice, and the archival path is automatic. The failure is silent and the reported outcome is success.
Proposed fix
Before any archive write, verify the destination is tracked:
git ls-files --error-unmatch <destination>
- exit 0 → proceed
- non-zero → redirect to an existing tracked archive, or abort with a clear error
Never move content out of a tracked file into a destination that cannot be committed.
Two supporting lessons worth encoding
- Verify archival by entry count, not file size.
decisions.mdshrank while the report claimed growth, because a merge added entries and an archive removed entries in the same pass. Size is not a valid integrity signal here. - Never report a gate outcome that wasn't verified. The "no archival required" claim was the reason nobody looked. A gate that reports without measuring is worse than no gate.
Success criteria
- Archival refuses to write to an untracked destination, or redirects to a tracked one
- Archival reports entry counts moved (source removed / destination added), not file sizes
- A test proves the failure: with
.squad/excluded, trigger archival and assert no content is lost across a commit boundary. The test must fail against the current pre-fix behavior.
Notes
- Repair PR: chore(squad): repair archival data loss and record gh-aw triage session state #1782
- The untracked artifact from the incident (
.squad/decisions/archive/2026-08-20-archived-pre7d.md, 22,150 bytes) was retained on disk as a redundant copy but remains uncommittable.
Activity
github-actions commentedon Aug 21, 2026
📋 Assigned to Scribe (Session Logger)
Issue: #1783 — Archival can silently destroy state: writes to untracked destinations are deletions
Scribe will pick this up in the next Copilot session.
bradygaster commentedon Aug 21, 2026
Sibling of #1774 — same routine, two distinct failure modes. Recording the relationship so they get one fix, not two.
decisions-archive.md(tracked)Both produce the same user-visible outcome — a tracked source shrinks and the content is gone — and both were self-reported as successful.
Suggest a single fix at the archive call site that satisfies both:
git ls-files --error-unmatch <dest>); if not, redirect to an existing tracked archive or abort.decisions.mdshrank while a merge was simultaneously adding entries.Either failure mode alone destroys history. A fix for one does not close the other.
fix(squad): stop `squad nap` from destroying decision history
fix(squad): make archival incapable of destroying state
fix(squad): make archival CRLF-safe and its entry split lossless
fix(squad): stop `squad nap` from destroying decision history
fix(squad): make Scribe archival incapable of destroying state (githu…