BOHICA-LABS / BOHICA-LABS/vsdd-factory

feat(factory-health): bootstrap .factory/.gitignore so dispatcher logs / tmp / locks don't accumulate in the orphan branch

Open
#230 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
6h 43m
Merged PRs (30d)
29

Description

## Summary

After `/vsdd-factory:factory-health` mounts the `.factory/` worktree on the `factory-artifacts` orphan branch, no `.gitignore` is bootstrapped inside that worktree. Transient state — `dispatcher-internal-*.jsonl` from factory-obs, possible lock files, tmp scratch, OTEL temp data — accumulates as untracked content inside the orphan branch's worktree.

Without an ignore policy:
- `git status` inside `.factory/` always shows `logs/` as untracked, even when nothing intentional changed.
- If a future state-manager run does `git add -A`, transient logs get committed permanently to `factory-artifacts`.
- The signal-to-noise ratio of `git status` in the worktree is terrible.

## Repro

Fresh project, run `/vsdd-factory:factory-health`. Worktree mounts at `.factory/`. After any factory-obs activity:

```
$ cd .factory && git status --porcelain
?? logs/
?? logs/dispatcher-internal-2026-06-23.jsonl
```

No `.gitignore`, no policy.

## Proposed fix

Factory-health step 5 (directory structure) should also create `.factory/.gitignore`:

```gitignore
# Auto-generated by /vsdd-factory:factory-health
# Dispatcher / runtime logs are not artifacts — keep out of factory-artifacts commits
logs/
*.log

# Lock files
*.lock
.factory-lock
.factory-health-in-progress

# Temp / scratch
tmp/
.tmp/
*.tmp
*.swp

# OS noise
.DS_Store
Thumbs.db

# Editor noise
.vscode/
.idea/
*~

# Local-only OTEL / collector state
.otel-state/
```

Commit this `.gitignore` to `factory-artifacts` as part of the initial bootstrap (alongside STATE.md and the `.gitkeep` files).

## Acceptance criteria

- [ ] Factory-health bootstraps `.factory/.gitignore` on first run.
- [ ] `logs/` and other transient state are ignored inside the orphan-branch worktree.
- [ ] Subsequent `state-manager` commits do not pick up transient log files.
- [ ] Existing projects can run `/vsdd-factory:factory-health` and have the `.gitignore` retroactively created (idempotent).

## Found during

`/vsdd-factory:factory-health` on `switchboard-blue` (2026-06-23, vsdd-factory@1.0.0-rc.21). After mount + first dispatcher activity, `logs/dispatcher-internal-2026-06-23.jsonl` was untracked inside the worktree with no `.gitignore` policy. The first commit I made deliberately did NOT include `logs/` — but a future `git add -A` operation by state-manager would silently commit it.

## Related

- (this session, filed) #206 — dispatcher race + filed earlier suggestion that dispatcher-internal logs belong outside the user's repo entirely. This issue is the BACKSTOP if that doesn't happen.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.