diff --git a/.changeset/state-gitignore-slim.md b/.changeset/state-gitignore-slim.md new file mode 100644 index 0000000..004630e --- /dev/null +++ b/.changeset/state-gitignore-slim.md @@ -0,0 +1,18 @@ +--- +"@stainless-code/codemap": patch +--- + +Slim the auto-generated `/.gitignore` header for consumer clarity: + +- Drop the internal function-name reference (`ensureStateGitignore`) — consumers can't look it up. +- Drop the "Rule 9 analogue" / "bump alongside any new cache" line — it was guidance for codemap contributors, leaking into every consumer's checkout. +- Reframe "blacklist" / parenthetical mention of tracked files in plainer language. + +Existing two-line header (`# codemap-managed — edits will be overwritten by ensureStateGitignore.` / `# Blacklist of generated artifacts...`) becomes: + +``` +# Managed by codemap — overwritten on next run. +# Generated artifacts only; user-authored config (config.*, recipes/) stays tracked. +``` + +**One-time rewrite on consumer side.** The reconciler matches the canonical body via exact string comparison, so every consumer's next `codemap` run rewrites `/.gitignore` to the new shape (no entries change — only the comment lines). Harmless; the blacklist entries (`index.db`, `index.db-shm`, `index.db-wal`, `audit-cache/`) are unchanged. diff --git a/.codemap/.gitignore b/.codemap/.gitignore index 4099e2e..3011fd4 100644 --- a/.codemap/.gitignore +++ b/.codemap/.gitignore @@ -1,6 +1,5 @@ -# codemap-managed — edits will be overwritten by `ensureStateGitignore`. -# Blacklist of generated artifacts; tracked sources (recipes/, config.*) -# default to tracked. Bump alongside any new cache (Rule 9 analogue). +# Managed by codemap — overwritten on next run. +# Generated artifacts only; user-authored config (config.*, recipes/) stays tracked. index.db index.db-shm index.db-wal diff --git a/fixtures/minimal/.codemap/.gitignore b/fixtures/minimal/.codemap/.gitignore index 4099e2e..3011fd4 100644 --- a/fixtures/minimal/.codemap/.gitignore +++ b/fixtures/minimal/.codemap/.gitignore @@ -1,6 +1,5 @@ -# codemap-managed — edits will be overwritten by `ensureStateGitignore`. -# Blacklist of generated artifacts; tracked sources (recipes/, config.*) -# default to tracked. Bump alongside any new cache (Rule 9 analogue). +# Managed by codemap — overwritten on next run. +# Generated artifacts only; user-authored config (config.*, recipes/) stays tracked. index.db index.db-shm index.db-wal diff --git a/src/application/state-dir.ts b/src/application/state-dir.ts index e20d88d..8bba4fb 100644 --- a/src/application/state-dir.ts +++ b/src/application/state-dir.ts @@ -48,9 +48,8 @@ export function resolveStateDir(opts: ResolveStateDirOpts): string { * the source of truth — header, blank lines, and ordering all reproduce * verbatim. Add new generated artifacts in the same PR that introduces them. */ -export const STATE_GITIGNORE_BODY = `# codemap-managed — edits will be overwritten by \`ensureStateGitignore\`. -# Blacklist of generated artifacts; tracked sources (recipes/, config.*) -# default to tracked. Bump alongside any new cache (Rule 9 analogue). +export const STATE_GITIGNORE_BODY = `# Managed by codemap — overwritten on next run. +# Generated artifacts only; user-authored config (config.*, recipes/) stays tracked. index.db index.db-shm index.db-wal