Skip to content

fix(retention): fail closed on stale empty workspace after the closed twin - #191

Merged
nish3451 merged 8 commits into
mainfrom
lane1/retention-stale-empty-empty-workspace-fix
Aug 19, 2026
Merged

fix(retention): fail closed on stale empty workspace after the closed twin#191
nish3451 merged 8 commits into
mainfrom
lane1/retention-stale-empty-empty-workspace-fix

Conversation

@nish3451

Copy link
Copy Markdown
Collaborator

The closed-twin fix (PR #105) pinned the canonical retention workspace to the git main worktree and proved its freshness, but two follow-up contracts were still open on main.

  1. canonicalMainWorktree resolved the canonical workspace from the first git worktree list --porcelain entry — only conventionally the main worktree. A detached main worktree leaves the twin holding refs/heads/main; the twin heads the porcelain list and the gate would inspect the twin's empty state roots. Resolve the canonical workspace by git-dir ownership instead: the entry whose git-dir equals the repository's common git dir, never a linked worktree, never whichever worktree heads the list.

  2. The check script still had a hollow-pass path: an aligned canonical workspace with no client records and no failures green-passed when the automation file was missing. The Friday loop is required before the first client is active, so a missing guard must fail loudly even at zero clients.

Pin the canonical workspace to the git-dir owner and fail closed on a missing automation file. The regression suite now covers the stale+empty workspace under both conditions (with and without the automation file), the closed-twin git-dir ownership, and the no-client pass when the automation is in place.

Re-verification: node scripts/test-retention-automation.mjs passes the full suite.

… twin

The closed-twin fix (PR #105) pinned the canonical retention workspace to
the git main worktree and proved its freshness, but the canonical workspace
resolution still came from the first 'git worktree list --porcelain' entry
— only conventionally the main worktree. A detached main worktree leaves
the twin holding refs/heads/main; the twin heads the porcelain list and
the gate would inspect the twin's empty state roots. Resolve the canonical
workspace by git-dir ownership instead: the entry whose git-dir equals the
repository's common git dir, never a linked worktree, never whichever
worktree heads the list.

The check script also still had a hollow-pass path: an aligned canonical
workspace with no client records and no failures green-passed when the
automation file was missing. The Friday loop is required before the first
client is active, so a missing guard must fail loudly even at zero clients.

Pin the canonical workspace to the git-dir owner and fail closed on a
missing automation file. The regression suite now covers the stale+empty
workspace under both conditions (with and without the automation file),
the closed-twin git-dir ownership, and the no-client pass when the
automation is in place.

Co-authored-by: lane1-worker <noreply@commandcode.ai>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@nish3451, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Limit details: You’ve used the included review currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: c6adfec8-dd94-4105-abcc-9d711378486e

📥 Commits

Reviewing files that changed from the base of the PR and between be092b0 and bf4b634.

📒 Files selected for processing (5)
  • .lane/reports/lane1-retention-stale-empty-empty-workspace-20260817.md
  • README.md
  • scripts/check-retention-automation.mjs
  • scripts/lib/retention-preflight.mjs
  • scripts/test-retention-automation.mjs

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@nish3451
nish3451 merged commit c0127be into main Aug 19, 2026
2 checks passed
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.

2 participants