Skip to content

feat(index): cross-process lock, unlock CLI, and errors.log#129

Merged
SutuSebastian merged 1 commit into
mainfrom
feat/index-lock
May 25, 2026
Merged

feat(index): cross-process lock, unlock CLI, and errors.log#129
SutuSebastian merged 1 commit into
mainfrom
feat/index-lock

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

Summary

  • Cross-process index lock at <state-dir>/index.lock (JSON { pid, started_at }) with in-process serialization in runCodemapIndex
  • Fail-fast when another live indexer holds the lock; auto-steal stale locks (dead PID / age threshold)
  • codemap unlock [--force] to recover from crashed indexers
  • Append parse failures to <state-dir>/errors.log (gitignored via state-dir reconciler)
  • Updates delivery tracker (P0 merged) and agents.md hook+lock note

Implements PR 3 / index-lock-and-error-log. parse-worker-hardening remains a follow-up stack commit.

Test plan

  • bun test src/application/index-lock.test.ts
  • bun test src/application/run-index.test.ts
  • lint-staged on commit
  • Manual: run two concurrent codemap indexes — second fails with unlock hint
  • Manual: codemap unlock after kill -9

Acquire <state-dir>/index.lock before indexing with in-process serialization,
fail-fast when another live indexer holds the lock, and append parse failures
to errors.log. Adds codemap unlock for stale lock recovery.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 25, 2026

🦋 Changeset detected

Latest commit: 53d1553

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 Minor

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 25, 2026

Warning

Review limit reached

@SutuSebastian, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 34 minutes and 50 seconds.

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

⌛ How to resolve this issue?

After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f3e0de2-9cd7-4c89-b25c-89d9a869e63f

📥 Commits

Reviewing files that changed from the base of the PR and between 4318cc4 and 53d1553.

📒 Files selected for processing (13)
  • .changeset/index-lock-error-log.md
  • docs/agents.md
  • docs/plans/agent-surface-delivery.md
  • src/application/error-log.ts
  • src/application/index-engine.ts
  • src/application/index-lock.test.ts
  • src/application/index-lock.ts
  • src/application/run-index.ts
  • src/application/state-dir.ts
  • src/cli/bootstrap.ts
  • src/cli/cmd-index.ts
  • src/cli/cmd-unlock.ts
  • src/cli/main.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/index-lock

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.

@SutuSebastian SutuSebastian merged commit 6648add into main May 25, 2026
12 checks passed
@SutuSebastian SutuSebastian deleted the feat/index-lock branch May 25, 2026 08:42
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