Skip to content

feat(agents): safer init re-runs for mirrors, markers, and MCP merge#155

Merged
SutuSebastian merged 4 commits into
mainfrom
feat/agents-init-safety
May 27, 2026
Merged

feat(agents): safer init re-runs for mirrors, markers, and MCP merge#155
SutuSebastian merged 4 commits into
mainfrom
feat/agents-init-safety

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

Summary

  • codemap agents init no longer mirrors your whole .agents/ tree — IDE wiring syncs only bundled template paths (rules/codemap.md, skills/codemap/SKILL.md).
  • <!-- codemap-init:managed --> provenance--force overwrites mirror files only when that marker is present; user-owned files at the same path are left alone (error instead of clobber).
  • Invalid MCP JSON shapes are rejected even with --force — same policy as unparseable JSON; init never resets mcpServers / servers maps.
  • Docs + e2e harnessdocs/agents.md updated; scripts/agents-init-dummy-corpus.test.mjs exercises all paths on a copy of fixtures/minimal.

Test plan

  • bun test src/agents-init.test.ts src/agents-init-mcp.test.ts src/cli.test.ts
  • bun test scripts/agents-init-dummy-corpus.test.mjs
  • CODEMAP_ROOT=fixtures/minimal bun scripts/query-golden.ts
  • Pre-commit lint-staged (format, lint, typecheck, affected tests)

Init must not clobber consumer-owned files: bundled-only IDE mirrors,
codemap-init:managed provenance before --force overwrite, and reject
invalid MCP map shapes instead of resetting them.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: 9dccc7a

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Warning

Review limit reached

@SutuSebastian, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 2 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0377d9a8-39c2-427d-a4b8-d5b4cd2ec207

📥 Commits

Reviewing files that changed from the base of the PR and between 1bcca3a and 9dccc7a.

📒 Files selected for processing (12)
  • .agents/rules/codemap.md
  • .agents/skills/codemap/SKILL.md
  • .changeset/agents-init-safety.md
  • .gitignore
  • docs/agents.md
  • scripts/agents-init-dummy-corpus.test.mjs
  • src/agents-init-mcp.test.ts
  • src/agents-init-mcp.ts
  • src/agents-init.test.ts
  • src/agents-init.ts
  • templates/agents/rules/codemap.md
  • templates/agents/skills/codemap/SKILL.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agents-init-safety

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.

… isolation

Migrate pre-marker copy-mode mirrors via codemap-pointer-version heuristic;
drop dead force on MCP upsert helpers; isolate e2e MCP from Windsurf homedir;
gitignore .tmp and document mirror provenance in agents.md.
Document legacy mirror heuristic and symlink copy-mode marker behavior;
extend dummy-corpus and unit coverage for legacy migration and symlink refusal.
@SutuSebastian SutuSebastian merged commit 450ca2e into main May 27, 2026
11 checks passed
@SutuSebastian SutuSebastian deleted the feat/agents-init-safety branch May 27, 2026 15:17
@github-actions github-actions Bot mentioned this pull request May 27, 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