Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/state-gitignore-slim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@stainless-code/codemap": patch
---

Slim the auto-generated `<state-dir>/.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 `<state-dir>/.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.
5 changes: 2 additions & 3 deletions .codemap/.gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions fixtures/minimal/.codemap/.gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/application/state-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading