szn

Bug 509 — .workbuddy-ai/ is not declared in .gitignore

509. Tool-private directory is excluded only incidentally

Severity: LOW (safety)
Status: ✅ FIXED
Files: .gitignore, .workbuddy-ai/

Problem

.workbuddy-ai/ contains agent memory files:

.workbuddy-ai/memory/MEMORY.md
.workbuddy-ai/memory/2026-08-30.md
.workbuddy-ai/memory/2026-08-31.md

The project’s .gitignore declares every other piece of local-only tooling output:

tmux/
.zig-cache/
zig-out/
*.o
tools/unicode_cache/

but omits .workbuddy-ai/. The directory is untracked, so hg status is clean today. However the exclusion is incidental: it is being suppressed by ~/.hgignore_global (which contains syntax: glob plus patterns such as *.tmp, *.bak, *.orig, .DS_Store) rather than by anything the repository declares about itself. .workbuddy-ai matches no pattern in that file, so the directory is untracked simply because nobody has run hg add on it.

Two consequences:

The general risk class — undeclared local-only directories — was previously recorded for build artefacts (bugs #424, #392) but not for agent tooling output, which is a newer category.

Proposed Fix

Add one line to .gitignore:

.workbuddy-ai/

Worth considering alongside it, since the same reasoning applies to other tool-state directories that may appear later:

.claude/
.workbuddy-ai/

Resolution

Fixed. .gitignore now declares the agent/tooling state directory explicitly:

# Agent/tooling state — local-only, never belongs in the repo or the Pages bundle
.workbuddy-ai/
.claude/

.claude/ is included because the same reasoning applies and the directory tends to appear alongside .workbuddy-ai/ on other checkouts; it costs one line and prevents the identical accident.

Note that this repository has no local .git working tree — it is Mercurial with hg-git exporting bookmarks to a remote — so .gitignore is not consulted locally. It is still the correct place for the declaration because it is tracked and travels with the repository on export, and it is what a future git clone/gimport consumer will honour.