---
id: 11563
title: Harness-Scratch `.gitignore` Extensions
state: CLOSED
labels:
  - enhancement
  - developer-experience
  - ai
assignees:
  - neo-gemini-pro
createdAt: '2026-05-18T00:51:28Z'
updatedAt: '2026-06-07T17:13:03Z'
githubUrl: 'https://github.com/neomjs/neo/issues/11563'
author: neo-gemini-pro
commentsCount: 0
parentIssue: null
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-05-18T04:22:56Z'
---
# Harness-Scratch `.gitignore` Extensions

## Objective
Extend the repository's `.gitignore` to prevent the staging and committing of common AI agent harness scratch files and temporary artifacts.

## Current Pain Point
As observed by @neo-opus-ada in PR #11443 (Cycle 1 contamination), agents are prone to committing unrelated working files and local scratch documents. This creates noise in PRs, violates hygiene, and wastes review cycles.

Empirical contamination patterns observed:
- `.gemini/` directory (Gemini MCP CLI tool-call dumps)
- `pr_*_body.md`, `pr_*_review.md` (PR-draft text files at root)
- `patch_adr.{js,py,mjs}` (one-off patching scripts)
- `scratch.mjs` (Node REPL scratch)
- `ticket-*.md` (ticket-body drafts at root)

## Tasks
1. Update `.gitignore` to explicitly ignore:
    - `.gemini/`
    - `pr_*.md`
    - `scratch*.mjs`
    - `patch_*.js`, `patch_*.py`, `patch_*.mjs`
    - `ticket-*.md`
2. Ensure that these exclusions don't accidentally block legitimate framework code or expected documentation (e.g., scoping the ignore rules to the root directory where appropriate, or using explicit prefixing).

## Related
- Issue #11442 (Intercept mechanical hygiene defects via pre-commit hook) - Sibling ticket covering whitespace/lint hygiene.
- PR #11443 (Where the contamination was observed).

## Avoided Traps
- **Pre-commit script complexity**: Handling this via `.gitignore` is a simple, zero-cost structural fix that prevents the files from even being tracked, avoiding the need for complex pre-commit hook logic just to filter out agent scratch files.

## Timeline

- 2026-05-18T00:51:29Z @neo-gemini-pro added the `enhancement` label
- 2026-05-18T00:51:29Z @neo-gemini-pro added the `developer-experience` label
- 2026-05-18T00:51:29Z @neo-gemini-pro added the `ai` label
- 2026-05-18T00:53:11Z @neo-gemini-pro assigned to @neo-gemini-pro
- 2026-05-18T00:53:37Z @neo-gpt cross-referenced by #11558
- 2026-05-18T00:54:55Z @neo-gemini-pro cross-referenced by PR #11566
- 2026-05-18T04:12:33Z @neo-gemini-pro referenced in commit `22844ba` - "chore(hygiene): exclude agent harness scratch files (#11563)

Resolves #11563

Extended the repository's `.gitignore` to prevent staging and committing of common AI agent harness scratch files and temporary artifacts. This intercepts mechanical hygiene defects and repository pollution at the track boundary.

Evidence: L1 (static ignore configuration) → L1 required. No residuals.

## Deltas from ticket

* Added exact inclusions for the `.gemini/` directory, markdown files starting with `pr_` and `ticket-`, and scratch/patch scripts.
* Used negation patterns to ensure tracked canonical files in `.gemini/` (`concepts/`, `settings.template.json`) are not ignored.

## Test Evidence

* N/A - structural exclusion mechanism.

## Post-Merge Validation

- [ ] Contributors may need to manually run `git rm --cached <file>` if any of these were previously checked into active worktrees.

FAIR-band: Mechanical Hygiene / Repository Infrastructure"
- 2026-05-18T04:22:56Z @tobiu closed this issue

