Skip to content

test(ce-babysit-pr): state and pin the review-gate acquisition rules - #1632

Open
khsaurabh wants to merge 3 commits into
EveryInc:mainfrom
khsaurabh:fix/1618-review-gate-acquisition
Open

test(ce-babysit-pr): state and pin the review-gate acquisition rules#1632
khsaurabh wants to merge 3 commits into
EveryInc:mainfrom
khsaurabh:fix/1618-review-gate-acquisition

Conversation

@khsaurabh

Copy link
Copy Markdown
Contributor

Summary

Issue #1618: ce-babysit-pr's settle gate rests on a four-surface lookup (PR-body reactions, top-level comments, check runs on the head, reviews) that the agent performs from settle.md prose. The five eval cells cover the reasoning from prepared data; nothing pinned the acquisition rules, and two of them were not stated at all.

Takes the issue's option (b): state the rules, pin them deterministically. No live-fixture eval cell (option a) - it trades determinism and needs a stable subject; easy to add later if you want realism coverage too.

settle.md now states, next to the review-still-coming gate:

  • Identity correlation - REST returns cursor[bot], GraphQL returns cursor; normalize (strip trailing [bot], lowercase) before comparing a reviewer across surfaces.
  • Head attribution - reactions and top-level comments are PR-scoped (no commit identity); check runs and reviews are commit-scoped. A PR-scoped announcement binds to the head current when it was posted; if the head moved, it announces a review of the earlier head and the wait clears only on output against the current head.
  • Pagination - every surface paginates; a truncated first page can hide the exact announcement or terminal verdict the gate turns on.
  • Probe failure - a failed or partial lookup is inconclusive, never "no review coming"; the gate stays uncleared within the existing bounded-wait ceilings.

Validation

  • New tests/skills/ce-babysit-pr-settle-acquisition.test.ts - 4 contract tests pinning each rule in settle.md.
  • bun test tests/skills/ce-babysit-pr-settle-acquisition.test.ts tests/ce-babysit-pr-snapshot.test.ts tests/ce-babysit-pr-contract.test.ts - 220 pass, 0 fail.

Closes #1618

Security Disclosure

No security-relevant changes.

Agent Disclosure

  • Model: Instinct agent (harness does not expose the model identity)

Issue EveryInc#1618: the settle gate's four-surface lookup (reactions, top-level
comments, check runs, reviews) is agent-prose; the eval cells cover the
reasoning from prepared data but nothing pinned the acquisition rules.
settle.md now states them explicitly - identity correlation across
REST/GraphQL bot logins, head attribution for PR-scoped vs commit-scoped
surfaces, pagination, and probe failure as inconclusive - and a new bun
contract suite pins all four. Option (b) from the issue; no live-fixture
eval cell (determinism).

@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: df9e98ac46

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


**Acquisition rules for that lookup (mechanical, not judgment):**

- **Identity correlation.** The same reviewer appears with different logins across APIs - REST returns `cursor[bot]` / `chatgpt-codex-connector[bot]`, GraphQL returns `cursor` / `chatgpt-codex-connector`. Normalize before comparing: strip a trailing `[bot]` and lowercase. Never correlate a reviewer across surfaces on the raw login string.

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 Preserve actor type when normalizing reviewer identities

When a GitHub App slug and a human login share the same base name, unconditional [bot] stripping collapses distinct actors into one key. A terminal check or review from one actor can then be mistaken for output satisfying the other's announcement, clearing the gate and potentially allowing stack-land to merge while the actual reviewer is still running. Preserve the actor kind during normalization and correlate only proven Bot/App identities; treat ambiguous cross-kind matches as inconclusive.

AGENTS.md reference: AGENTS.md:L136-L138

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 413165d. Normalization now keeps the actor kind attached to the normalized name: a [bot] identity correlates only across app/bot surfaces, a human login sharing the base name is a different actor, and a cross-kind match is inconclusive - never evidence the announced review finished.

Comment on lines +20 to +21
expect(SETTLE_BODY).toMatch(/strip a trailing `\[bot\]`/)
expect(SETTLE_BODY).toMatch(/[Nn]ever correlate a reviewer across surfaces on the raw login/)

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 Assert the lowercase normalization requirement

This test pins suffix stripping but never asserts the second required operation, lowercasing, so deleting and lowercase from settle.md leaves the entire suite green. That permits case-varying API identities to stop correlating without the mechanical guard detecting the regression; add a direct assertion for the lowercase requirement as the smallest falsifiable unit.

AGENTS.md reference: AGENTS.md:L216-L219

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 413165d. The test now asserts strip a trailing \[bot]` and lowercase` as one pinned phrase, so deleting the lowercase half fails the suite.

@khsaurabh

Copy link
Copy Markdown
Contributor Author

The test job failure here is an upstream flake, not this PR: this diff touches only ce-plan settle guidance and its contract test, and the failing test (ce-work serial cross-model transaction > scope expansion) lives in tests/skills/ce-work-cross-model-integration.test.ts, which fails nondeterministically on pristine main (2/2 local runs, sibling test in the same file). Reproduced and filed as #1635. Pushed an empty commit to re-run CI.

Codex review on EveryInc#1632: unconditional [bot] stripping collapses an app slug
and a human login that share a base name into one key, so one actor's
terminal output could clear the gate for the other's announced review. Pin
lowercasing as its own assertion (deleting it left the suite green) and
require cross-kind matches to be treated as inconclusive.
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.

ce-babysit-pr review-gate evals test the reasoning but not the lookup

2 participants