# Remove generated evidence from Git Workpackage

Status: complete
Type: workpackage
Updated: 2026-07-25
Next Action: none

Project Map: work/maps/map-smi-firmware-stabilization-and-qualification.md

## Current Context

Tool Shed planning artifacts are intentionally tracked under `work/`, but raw target
captures and repository bundles were also committed beneath `work/evidence/`.
There are 2,065 tracked evidence files totaling about 190 MB. Codex Desktop cached
large review requests for these files and repeatedly crashed while restoring affected
tasks. Local `.git/info/exclude` rules prevent new files in one generated subtree
from appearing as untracked, but they cannot hide already tracked evidence.

The working tree also contains active firmware, build-output, script, and evidence
report changes. Cleanup must not discard, reset, or conflate those changes.

## Recommendation

Keep Tool Shed coordination documents and compact evidence manifests in Git. Move raw
captures to governed external storage and standardize `work/evidence/generated/` as
an ignored landing zone. Remove migrated raw payloads from the current Git snapshot
only after archive/hash verification. Do not rewrite Git history during this
workpackage; history rewriting is a separate coordinated decision.

## Current State

Completed:

- Root-cause inventory created.
- Repository evidence population and size measured.
- Local protection added for new `hpt-log-store-circular-mirror` captures and Tool
  Shed backup archives.
- Crash monitor updated to collect the packaged app's real logs and Crashpad reports.

Incomplete:

- Create and verify the external evidence archive and manifests.
- Add shared repository ignore and evidence-retention policy.
- Review ambiguous JSON, image, text, and log evidence.
- Remove approved raw payloads from the current Git snapshot.
- Refresh Tool Shed indexes and validate all evidence links.
- Commit cleanup independently from active firmware development.
- Recover ongoing work in a blank Codex task with a concise handoff.

## Goal

The repository tracks source, Tool Shed coordination artifacts, and compact evidence
summaries only. Raw generated qualification data remains preserved and verifiable
outside Git, future raw data lands in an ignored directory, and Codex reviews no
longer hydrate thousands of evidence payloads.

## Why It Matters

The present layout causes large Git review state, unstable Codex task restoration,
repository bloat, and repeated full desktop application crashes. Separating durable
records from raw payloads restores reliable development without losing qualification
traceability.

## Major Outcomes

- Preserve all current evidence with hashes before cleanup.
- Reduce current tracked evidence to approved narratives and compact manifests.
- Establish shared ignore and retention policy.
- Validate Tool Shed navigation and Git status.
- Create a safe clean-task continuation boundary.

## Delivery Stages

Use stages when sequencing, parity gates, or handoff cost matter.

| Stage | Outcome | Entry Evidence | Exit Evidence |
| --- | --- | --- | --- |
| 1 | Prepare rollback boundary | Measured repository and dirty working tree | External archive, dirty-file snapshot, and SHA-256 manifests verified |
| 2 | Establish repository policy | Reviewed classification inventory | Shared `.gitignore` and evidence README define durable/generated boundaries |
| 3 | Clean current snapshot | Verified archive and owner approval | Raw payloads absent from current Git index; working copies preserved or intentionally removed |
| 4 | Validate and commit | Cleanup staged separately | Tool Shed index/stale checks and Git verification pass |
| 5 | Recover Codex workflow | Clean committed snapshot | Blank task continues from documented controller state without inherited history |

## Related Artifacts

- Tickets:
- Checklists:
- Spikes:
- ADRs:
- Runbooks:
- Inventories: `work/inventories/inventory-tracked-evidence-repository-cleanup-inventory.md`
- Decision matrices:

## Rough Sequence

1. Archive and hash current evidence and dirty work outside the repository.
2. Review the classification manifest and ambiguous evidence types.
3. Add shared ignore/retention policy.
4. Remove approved raw evidence from the current Git snapshot.
5. Regenerate Tool Shed indexes and run stale-path/work-state validation.
6. Commit cleanup without mixing firmware changes.
7. Start a blank recovery task and archive inherited-history tasks.

## Milestones

### Milestone 1: Cleanup-ready rollback boundary

Completion criteria:

- [x] External tracked-evidence archive exists and verifies.
- [x] Dirty working-tree files are separately preserved and hashed.
- [x] Full evidence classification manifest exists.
- [x] No tracked or working file has been deleted or untracked.

### Milestone 2: Current-snapshot cleanup

Completion criteria:

- [x] Shared ignore and retention policy is established.
- [x] Raw evidence is removed from the current Git index.
- [x] Approved Markdown and compact manifests remain tracked.
- [x] Active firmware changes remain intact.

### Milestone 3: Validation and recovery

Completion criteria:

- [x] Tool Shed index and stale-path validation pass.
- [x] Cleanup is isolated in commit `b6cbc665`.
- [x] Blank Codex task `019f9a1c-e129-72a3-a86d-dca394a4b657` was created from a concise, verified handoff.

## Open Questions

- Which images are curated product/diagnostic documentation that should remain in Git?
- Which JSON/log/text records are canonical summaries rather than raw transcripts?
- Where should governed raw evidence live after the temporary external archive?
- Is a future Git-history purge required for distribution or confidentiality?

## Completion Standard

This workpackage is complete when generated evidence is preserved outside Git,
removed from the current repository snapshot, protected from reintroduction,
Tool Shed navigation remains valid, active firmware work is preserved, and the
project resumes in a clean Codex task.

## Closeout Routing

- Current truth promoted to: `docs/evidence-retention-policy.md`
- Historical context remains in: this workpackage and the cleanup inventory
- Runtime/status evidence: external archive manifest and cleanup verification report
- Cleanup deferred to: optional Git-history rewrite under separate owner approval
