Skip to content

Use Project Actions to wait for pull request gates #87

Closed

Description

@lastobelus

Goal

Make LastCode pull-request babysitting stop consuming agent turns while GitHub CI and Codex review are merely pending. A resumable Wait for PR Project Action performs the waiting; the originating thread resumes only when the agent can or should act.

Deliver the workflow through two coordinated repositories:

  • LastCode owns the polling helper, focused tests, and checked-in t3.json Action.
  • agent-contexts owns the LastCode-specific babysit skill that launches the Action and retains review, fix, validation, and merge judgment.

Slice 1: Wait for PR

The Action is branch-scoped and read-only. It resolves the single open pull request for the current worktree branch and observes one exact (PR, head SHA, base SHA) boundary.

It returns when:

  • a new current-head Codex review completes, whether clean or finding-bearing;
  • current-head CI fails or is unexpectedly cancelled;
  • CI succeeds after the current-head review was already completed and handled before this Action launch;
  • the PR head or base changes, mergeability becomes blocked, the PR closes, authentication fails, or polling fails.

It keeps waiting when CI succeeds while the current-head Codex review is still pending. Pending includes an active Codex eyes reaction or a requested review with no exact-head terminal result.

Review detection is deterministic: exact-head formal reviews and threads, Codex comments naming the reviewed commit, and reactions on the relevant trigger comment. Ambiguous evidence remains pending. No model classifier is included.

The skill handles existing review artifacts before launch, so the Action treats its launch snapshot as the handled baseline. If the agent rejects a review without a commit, it can relaunch the Action and wait for CI. If it pushes a fix, all old review and CI evidence is stale and the new head starts a fresh cycle.

Done when

  • focused tests cover pending review, new clean review, new finding-bearing review, CI success while review remains pending, CI failure, stale head/base, and ambiguous review evidence;
  • t3.json exposes Wait for PR through the normal Project Action import path;
  • the agent-contexts babysit skill validates and appears in a fresh LastCode thread;
  • the implementation PR dogfoods the waiter once against real GitHub CI/review state.

Excludes

  • the separate resumable Full CI Action;
  • automatic setup, installers, migrations, repair flows, or manual-polling fallback;
  • compatibility behavior or support for older LastCode versions;
  • Luna or another model-based review classifier;
  • automatic review requests, review disposition, code changes, replies, thread resolution, full local CI, or merge inside the waiter.

Follow-up slice

Add a separate resumable Run Full CI Action so the agent can choose when local exact-head validation should run. It must remain independent rather than being automatically chained from Wait for PR. Stacked delivery is available if that later slice genuinely depends on this one.

Activity

  1. lastobelus commented on Aug 25, 2026

    @lastobelus
    OwnerAuthor

    Work intent

    phase: review
    summary: "Published LastCode PR #88 and agent-contexts PR #3; exact-head quick CI passed and both Codex reviews are requested. Current-main fixture/format repairs needed by the mandatory gate are isolated in a housekeeping commit."
    touch-points:
      - "lastCode: t3.json"
      - "lastCode: scripts/lastcode-wait-for-pr helper and focused tests"
      - "lastCode: current-main formatting and test-fixture alignment"
      - "agent-contexts: LastCode context hook and babysit skill"
      - "LastCode target clone: ignored skill discovery link"
    done-when:
      - "Focused tests cover pending, clean, findings, CI success-with-review-pending, CI failure, drift, and ambiguous review evidence."
      - "t3.json exposes Wait for PR through the normal import path."
      - "The agent-contexts babysit skill validates and appears in a fresh LastCode thread."
      - "The LastCode implementation PR dogfoods the waiter against real GitHub CI/review state."
    excludes:
      - "Resumable Full CI Action"
      - "Automatic setup, installers, migrations, repair, or manual-polling fallback"
      - "Compatibility or support for older LastCode versions"
      - "Luna or other model-based review classification"
      - "Review requests, finding disposition, code mutation, full local CI, or merge inside the waiter"
    blocked-by: []
    may-block:
      - "Issue #87 follow-up slice: resumable Run Full CI Action"
    branch: "lastCode: lastcode/project-action-pr-babysit (PR #88); agent-contexts: feat/lastcode-babysit (PR #3)"
  2. lastobelus commented on Aug 25, 2026

    @lastobelus
    OwnerAuthor

    Slice 1 shipped

    This issue remains open for the separately scoped resumable Run Full CI action. Both issue project items remain In Progress for that follow-up.

  3. lastobelus commented on Aug 25, 2026

    @lastobelus
    OwnerAuthor

    Slice 2 work intent

    phase: implementation
    summary: "Add the independent resumable Run Full CI action and teach the canonical babysit skill when to choose it."
    touch-points:
      - "lastCode: t3.json Run Full CI action"
      - "agent-contexts: LastCode babysit skill action selection and completion handling"
    done-when:
      - "Run Full CI invokes the existing pinned exact-head full-CI runner."
      - "The babysit skill chooses Wait for PR for external gates and Run Full CI only after review/check gates are ready."
      - "The implementation dogfoods both actions, passes exact-head review/full CI, and guarded-merges."
    excludes:
      - "Action chaining or automatic gate selection"
      - "New CI wrapper or server orchestration"
      - "Setup, installer, migration, repair, compatibility, or old-version handling"
      - "Model-based classification or manual polling fallback"
    blocked-by: []
    branch: "lastCode: lastcode/project-action-full-ci; agent-contexts: lastcode/babysit-full-ci-action"
  4. lastobelus commented on Aug 25, 2026

    @lastobelus
    OwnerAuthor

    Slice 2 shipped

    Both project items are Done. This completes the issue.

  5. 47 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions