Skip to content

feat(babysit): add release threshold for review findings - #13

Merged
MajesteitBart merged 2 commits into
mainfrom
fix/babysit-release-threshold
Oct 8, 2026
Merged

MajesteitBart merged 2 commits into
mainfrom
fix/babysit-release-threshold

Conversation

@MajesteitBart

Copy link
Copy Markdown
Owner

Summary

  • Add P0–P3 severity reporting and allow P2/P3 findings to be deferred without blocking readiness.
  • Require recorded user approval to defer P0, P1, or unrated findings; support atomic decisions across multiple threads.
  • Add review round counts and next-step guidance to inspection and wake reports, and update babysit documentation.
  • Add threshold and deferral coverage.

Testing

  • Not run (no test results provided).

…g merges

Babysit runs treated every valid review finding as a merge blocker and had no
way to record a deferral, so Rukoo #2 ran 14 Codex rounds (54 P2, 10 P1) and
optimal-hermes #1 ran 12 before the user stepped in.

Helper:
- Read the Codex P0-P3 badge for each thread, only when a configured reviewer
  opened it. No other comment text is kept.
- Add `decide --decision deferred`, with batch --finding. P0, P1, and unrated
  findings need --user-approved, recorded only on those findings.
- Report codeReview.rounds and `next` actions, including a head-aware prompt
  to request review of a repaired head.
- Show open findings by severity, deferrals, and rounds in wake messages.

Skill:
- Severity triage table: P0/P1 block; P2/P3 are deferred unless a commit is
  already going out for another reason.
- Round budget: ask the user before pushing after a fourth review that still
  raises new P0/P1 findings.
- List the only merge gates; optional checks and local reviews are not gates.
- Request re-review in the same step as each push, run inspect after pushes,
  merge without asking again, one agent per branch.
@clark-review

clark-review Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Mira PR Walkthrough

This PR adds P0–P3 severity reporting and a release threshold that allows P2/P3 findings to be deferred without blocking readiness. Deferring P0, P1, or unrated findings requires recorded user approval, with support for atomic decisions across multiple review threads. It also adds review round counts and next-step guidance to inspection and wake reports, updates documentation, and adds threshold and deferral coverage.

graph LR
  github["skills/babysit/scripts/github.mjs"] --> inspect["skills/babysit/scripts/inspect.mjs"]
  inspect --> babysit["skills/babysit/scripts/babysit.mjs"]
  inspect --> wake["skills/babysit/scripts/wake.mjs"]
Loading
Confidence: 3/5   ◉◉◉○○   Needs validation
  • The scope includes targeted coverage, but metadata alone cannot verify approval enforcement or atomic decisions, and no test results were provided.

Key files to review:

  • skills/babysit/scripts/github.mjs:205 — Embedded or quoted badges can classify unrated findings as P2/P3 and bypass the deferral approval requirement.

9 files reviewed · 1 comment (⚠️ 1 warning)


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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T19:44:43.460041Z fb1a3ca Manual request
🔒 Security Review ✅ Completed 2026-10-08T19:22:51.159516Z 3866bc8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clark-review clark-review 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.

Mira Review Summary

skills/babysit/scripts/github.mjs recognizes a priority badge only at the start of a finding, so embedded or quoted badges can misclassify unrated findings as P2/P3. This can let those findings be deferred without the required approval.

Key Issues

Issue Location
🔴 Embedded or quoted badges can classify unrated findings as P2/P3 and bypass the deferral approval requirement. skills/babysit/scripts/github.mjs:205

Comment thread skills/babysit/scripts/github.mjs Outdated
* Only this token is kept, never the text around it.
*/
export function reviewSeverity(body) {
const match = /!\[(P[0-3]) Badge\]/u.exec(String(body ?? "").slice(0, 300));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug
⚠️ Warning

Only recognize a priority badge at the start of the finding

The regex accepts a badge anywhere in the first 300 characters, including quoted examples or code snippets. For example, a configured reviewer's unrated comment starting with Example: \P2 Badge`becomes P2.findingSeveritytrusts this token, anddecide --decision deferred` then discharges the finding without user approval. Match only the opening priority badge, allowing the Markdown/HTML wrappers used by actual reviewer output, and add regression coverage for quoted and embedded badges.


Prompt for AI Agents
Update reviewSeverity in skills/babysit/scripts/github.mjs at line 205 to recognize only an opening priority badge, allowing the Markdown and HTML wrappers in the existing Codex badge fixture. Reject badges embedded in prose, quotations, and code examples. Add regression cases in tests/babysit/threshold.test.mjs showing these comments remain unrated and require user approval for deferral.

Not useful? Reply @miracodeai reject to dismiss this suggestion.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3866bc8efb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const entry = {
threadId: thread.id,
author: first?.author ?? null,
severity: findingSeverity(thread, policy),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Revalidate deferrals after reviewer policy changes

When a P2/P3 finding is deferred and init is later rerun with a different --code-reviewer, the thread becomes unrated under the current policy, but classification still accepts the old decision solely because its threadVersion matches. The PR can therefore remain ready without the --user-approved authorization now required for that finding; deferred decisions should be invalidated or reauthorized when their recorded severity no longer matches the current severity.

Useful? React with 👍 / 👎.

Comment on lines +17 to +18
const TRIAGE =
"Triage open findings by severity: fix P0/P1; fix a P2/P3 only when you already push a commit for another reason and the fix is small and safe, otherwise decide --decision deferred.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escalate P0/P1 findings after the fourth review round

When codeReview.rounds reaches four and the latest review still has an open P0/P1, nextActions continues to emit the unconditional instruction to fix it. This conflicts with the newly documented round budget, which requires stopping and asking the user before another push, and SKILL.md explicitly tells agents to perform the reported next actions. Include the round count and open severities when selecting this action so the wake directs the agent to escalate instead of beginning a fifth repair cycle.

Useful? React with 👍 / 👎.

reviewSeverity accepted a priority badge anywhere in the first 300
characters, so a reviewer comment that quoted `![P2 Badge](x)` became P2
and could be deferred without the user's approval. Match only a badge at
the start of the comment, inside Codex's bold and <sub> wrappers.

classify kept a deferral as long as the thread text was unchanged. After
`init` changed the reviewer, a deferred P2 became unrated but stayed
discharged. A deferral now holds only while it would still be allowed:
the finding is P2/P3, or the user approved deferring it at its current
severity. Otherwise it reopens.
@MajesteitBart

Copy link
Copy Markdown
Owner Author

@codex review

@MajesteitBart

Copy link
Copy Markdown
Owner Author

Triage of the first review round, fixed in fb1a3ca:

Both have regression tests in tests/babysit/threshold.test.mjs that fail on 3866bc8. pnpm check passes.

Deferred, non-blocking:

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb1a3ca204

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

},
findings: { open, discharged },
tested: testedView(state, head),
next: nextActions(reasons, staleReviews.length > 0),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include next-action changes in the wake key

When a clean review arrives for an older commit while the current head remains unreviewed, staleReviews.length changes this action from the opening-review guidance to the repaired-head instruction to request @codex review, but summary contains neither next nor stale reviews. Because recordObservation suppresses wakes when the summary-derived newsKey is unchanged, a durable watcher emits no event in this scenario and the agent can continue waiting indefinitely instead of requesting review of the current head; include the action-driving state in the summary/news key.

Useful? React with 👍 / 👎.

Comment on lines +17 to +18
const TRIAGE =
"Triage open findings by severity: fix P0/P1; fix a P2/P3 only when you already push a commit for another reason and the fix is small and safe, otherwise decide --decision deferred.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include unrated and refuted findings in triage guidance

When the only open finding is unrated, or a P0/P1 is a false positive, this next action provides no applicable route to clear the gate: it mentions only fixing P0/P1 and fixing or deferring P2/P3, despite decide supporting refutation and requiring user approval to defer unrated findings. Since the skill directs agents to perform reported next actions before yielding, the guidance can stall on an unrated finding or prompt an unnecessary code change for a refutable blocking finding; explicitly cover refutation and the user-approved deferral path for P0/P1 and unrated findings.

Useful? React with 👍 / 👎.

@MajesteitBart

Copy link
Copy Markdown
Owner Author

Second review round, at fb1a3ca: two P2 findings, both deferred as non-blocking.

Follow-up for a later PR: make next cover refutation, user-approved deferral, and the round budget (together with the deferred round-1 P2 on line 18), and add the action-driving state to the news key.

@MajesteitBart
MajesteitBart merged commit c2961b1 into main Oct 8, 2026
4 checks passed
@MajesteitBart
MajesteitBart deleted the fix/babysit-release-threshold branch October 8, 2026 19:46
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