Skip to content

docs(state-gitignore): slim header for consumer clarity#91

Merged
SutuSebastian merged 1 commit into
mainfrom
docs/state-gitignore-slim
May 15, 2026
Merged

docs(state-gitignore): slim header for consumer clarity#91
SutuSebastian merged 1 commit into
mainfrom
docs/state-gitignore-slim

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

Summary

The auto-generated <state-dir>/.gitignore (written by ensureStateGitignore) had a 3-line header that wasn't earning its keep for the consumer audience it lands in:

  • # codemap-managed — edits will be overwritten by \ensureStateGitignore`.` — leaks an internal function name a consumer can't look up.
  • # Blacklist of generated artifacts; tracked sources (recipes/, config.*) default to tracked. — "blacklist" jargon, and the parenthetical references files that aren't even in this file.
  • # Bump alongside any new cache (Rule 9 analogue). — guidance for codemap contributors; wrong audience entirely.

Replace with two plain-English lines:

# Managed by codemap — overwritten on next run.
# Generated artifacts only; user-authored config (config.*, recipes/) stays tracked.

Blacklist entries themselves (index.db, index.db-shm, index.db-wal, audit-cache/) unchanged.

Migration

ensureStateGitignore uses exact-string comparison to detect drift, so every consumer's next codemap run rewrites <state-dir>/.gitignore to the new shape exactly once. No behavioural change — same blacklist, slimmer comments.

Also regenerated:

  • .codemap/.gitignore (this repo's own state-dir; reconciler ran end-to-end as the validation step)
  • fixtures/minimal/.codemap/.gitignore (test fixture)

Test plan

  • bun test src/application/state-dir.test.ts — 15 pass, 0 fail (existing tests are content-agnostic — assert via constant import).
  • Reconciler runs end-to-end against the in-tree state dir, produces the new canonical body byte-for-byte.
  • bun run format:check clean.

The auto-generated `<state-dir>/.gitignore` header had three comment lines:

  # 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).

Two issues for the consumer audience this file actually targets:

- `ensureStateGitignore` is an internal function name; a consumer reading
  the rendered .gitignore has no way to look it up.
- The "Rule 9 analogue" / "bump alongside any new cache" line is guidance
  for codemap contributors — wrong audience.

Replace with two plain-English lines:

  # Managed by codemap — overwritten on next run.
  # Generated artifacts only; user-authored config (config.*, recipes/) stays tracked.

The blacklist entries themselves (index.db + WAL/SHM, audit-cache/) are
unchanged. ensureStateGitignore's drift detection (exact string match)
means every consumer's next codemap run rewrites the file to the new
shape one time; no behavioural difference.

Regenerated `.codemap/.gitignore` (in-tree) and
`fixtures/minimal/.codemap/.gitignore` to match the new canonical body.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@SutuSebastian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 51 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e6f48fa-17aa-4fe7-a0cd-59f0c46baa85

📥 Commits

Reviewing files that changed from the base of the PR and between c67f112 and a771c4f.

📒 Files selected for processing (4)
  • .changeset/state-gitignore-slim.md
  • .codemap/.gitignore
  • fixtures/minimal/.codemap/.gitignore
  • src/application/state-dir.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/state-gitignore-slim

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

🦋 Changeset detected

Latest commit: a771c4f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stainless-code/codemap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@SutuSebastian SutuSebastian merged commit 82bca4b into main May 15, 2026
11 checks passed
@SutuSebastian SutuSebastian deleted the docs/state-gitignore-slim branch May 15, 2026 18:41
@github-actions github-actions Bot mentioned this pull request May 15, 2026
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