Skip to content

feat!: ignore .devflow/ wholesale at repo root (clean break, drop nested allowlist)#245

Merged
dean0x merged 3 commits into
mainfrom
feat/gitignore-devflow-wholesale
Jun 21, 2026
Merged

feat!: ignore .devflow/ wholesale at repo root (clean break, drop nested allowlist)#245
dean0x merged 3 commits into
mainfrom
feat/gitignore-devflow-wholesale

Conversation

@dean0x

@dean0x dean0x commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

Simplifies how Devflow's .devflow/ runtime folder is git-tracked. Replaces the complex nested .devflow/.gitignore ("ignore everything, then re-include decisions + feature knowledge") with a single .devflow/ entry in the project's root .gitignore. The whole runtime folder is ignored by default; sharing its contents is now opt-in.

Motivated by recurring friction — the selective re-include policy created conflicts and got in the way during normal work. Clean break for v2: no migration sweep.

What changed

New model — the ensure-devflow-init hook is the live, every-project mechanism:

  • Appends .devflow/ to the root .gitignore (creates the file if absent; idempotent grep guard)
  • Writes a new .root-gitignore-configured marker (renamed from .gitignore-configured) so projects set up under the old model are retrofitted lazily on the next session — no migration needed

Removed the old nested-gitignore machinery:

  • getDevflowGitignoreContent() deleted (TS + CJS mirror)
  • getGitignoreEntries() now returns ['.claude/', '.devflow/']
  • Deleted the sync-devflow-gitignore v1/v2/v3 migrations and the consolidate migration's Step‑5 nested-gitignore creator
  • Consolidate migration no longer strips .devflow/ from the root .gitignore

This repo: untracked .devflow/ (git rm --cached, 9 files) and added .devflow/ to the root .gitignore. Working copies remain on disk (now ignored).

Docs: CLAUDE.md updated — the "(committed to git)" annotations for .devflow/features/ and decisions-ledger.jsonl now read "gitignored by default".

Behavioral note (breaking)

Because the hook fires every session, a project that was intentionally committing .devflow/ content (e.g. shared decisions/knowledge) will get .devflow/ auto-added to its root .gitignore. Already-tracked files stay tracked (git honors existing tracking); only new .devflow/ files become ignored. The appended line documents how to opt back in.

Testing

  • Full default test suite green: 65 files, 1904 tests, exit 0
  • tsc clean; full npm run build clean
  • Updated 5 affected test suites to the wholesale-ignore model (project-paths, migrations, shell-hooks, eager-memory-refresh S9, decisions-ledger)

Follow-up — gap fixes (commit c8d41e5)

Self-review of the change above surfaced gaps that this commit closes:

1. Memory-coupling bug (correctness). The only runtime writer of the root .gitignore entry — ensure-devflow-init — was reached only behind the memory-enabled gate in all three memory hooks. A project with memory OFF but decisions/knowledge ON never got .devflow/ ignored (the deleted sync-devflow-gitignore migrations used to cover this). Fixed by decoupling the write from any feature toggle:

  • Extracted a single-source scripts/hooks/ensure-root-gitignore helper (the marker fast-path + grep idempotency guard + create/append + comment line).
  • ensure-devflow-init now sources it (one implementation of the write).
  • The always-on, memory-independent session-start-context sources it too — this is the path that covers memory-off projects.
  • Added deterministic init-time ensureDevflowGitignore (appends only .devflow/, never .claude/), called unconditionally when a git root exists.

2. Removed the dead dream-commit machinery. It auto-committed .devflow/ artifacts via git add (no -f) — a permanent no-op now that .devflow/ is ignored wholesale. Deleted the 223-line script + its three skill Auto-commit sections, and dropped the now-orphaned autoCommit dream-config field plus its misleading devflow decisions --status line. Added a purge-orphaned-dream-commit-hook-v1 global migration — the installer copies scripts/ additively (copyDirectory never deletes), so the orphaned hook would otherwise linger in every existing ~/.devflow/scripts/hooks/.

3. Stale "committed to git" comments fixed (migrations.ts ADR-012 → ADR-021 supersession; init.ts features/).

5. Opt-in guidance — a Privacy & Sharing section added to README.md (gitignored by default; how to share everything or selectively re-include decisions.md / pitfalls.md / KNOWLEDGE.md).

Decisions captured this session: ADR-021 (reverse the sharing policy) and PF-014 (the gitignore/memory coupling).

Testing (follow-up): full suite green — 64 files, 1870 tests, exit 0 (deleted dream-commit.test.ts; added ensure-root-gitignore, memory-independent session-start-context, ensureDevflowGitignore, and the new migration). tsc + full npm run build clean.

🤖 Generated with Claude Code

dean0x added 3 commits June 21, 2026 10:59
…ted allowlist)

Replace the nested .devflow/.gitignore "ignore-everything-then-re-include
decisions/features" policy with a single .devflow/ entry in the project's root
.gitignore. The whole runtime folder is now ignored by default; sharing
.devflow/ content (decisions, knowledge bases) becomes opt-in.

The ensure-devflow-init hook is the live, every-project mechanism: it now
appends .devflow/ to the root .gitignore (creating the file if absent,
idempotent) and writes a new .root-gitignore-configured marker so projects set
up under the old model are retrofitted lazily on the next session. No migration
sweep — clean break for v2.

- project-paths.ts/.cjs: getGitignoreEntries() now includes .devflow/; removed
  getDevflowGitignoreContent()
- migrations.ts: removed sync-devflow-gitignore v1/v2/v3 migrations and the
  Step-5 nested-gitignore creator; stop stripping .devflow/ from the root
  .gitignore during consolidation
- ensure-devflow-init: write the root .gitignore instead of the nested allowlist
- tests: updated project-paths, migrations, shell-hooks, eager-memory-refresh
  (S9), and decisions-ledger to the wholesale-ignore model
- repo: untracked .devflow/ (git rm --cached) and added .devflow/ to the root
  .gitignore
- docs: CLAUDE.md reflects the new policy

BREAKING CHANGE: .devflow/ is gitignored by default. Projects that previously
committed decisions/feature-knowledge under .devflow/ keep those files tracked
(git honors existing tracking), but new .devflow/ content will not be tracked.
Remove the .devflow/ entry from .gitignore to opt back into sharing.
…am-commit)

Follow-up to the .devflow/ wholesale-ignore change (PR #245), closing gaps
surfaced in self-review.

Decouple the root .gitignore write from the memory toggle (PF-014). Extract a
single-source ensure-root-gitignore helper; ensure-devflow-init sources it, and
the always-on session-start-context sources it too — so memory-off projects
(decisions/knowledge only) still get .devflow/ ignored. Add deterministic
init-time ensureDevflowGitignore (appends only .devflow/, never .claude/),
called unconditionally when a git root exists.

Remove dead dream-commit machinery: the helper auto-committed .devflow/ artifacts
via 'git add' (no -f), a permanent no-op under wholesale ignore (ADR-021). Delete
the script and its three skill Auto-commit sections, and drop the now-orphaned
autoCommit dream-config field plus its misleading 'decisions --status' line. Add
purge-orphaned-dream-commit-hook-v1 global migration (the installer copies
scripts/ additively, so the orphan would otherwise linger on existing machines).

Fix stale 'committed to git' comments (migrations.ts ADR-012, init.ts features/)
now that .devflow/ is gitignored by default. Document Privacy & Sharing (opt-in)
in README.

Tests: ensure-root-gitignore, memory-independent session-start-context,
ensureDevflowGitignore, and the new migration. Full suite green (64 files / 1870).
…tted' ledger wording

- CLAUDE.md: document the new global migration alongside purge-learning-global-v1.
- migrations.ts: decisions-ledger-unify-v1 no longer calls the anchored ledger
  'committed' — both the ledger and the raw observation log are gitignored under
  .devflow/ by default (ADR-021).
@dean0x dean0x merged commit afb7cf4 into main Jun 21, 2026
2 checks passed
@dean0x dean0x deleted the feat/gitignore-devflow-wholesale branch June 21, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant