Skip to content

Add landing orchestration workflows#42

Merged
roodboi merged 10 commits into
mainfrom
hack-agent/landing-orchestration
Mar 26, 2026
Merged

Add landing orchestration workflows#42
roodboi merged 10 commits into
mainfrom
hack-agent/landing-orchestration

Conversation

@roodboi

@roodboi roodboi commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add landing workflow commands for adopting, composing, verifying, superseding, closing out, and queueing stacked work
  • support explicit landing metadata including tickets, landing PR linkage, and post-merge superseded PR closure
  • make stack compose able to push and open or refresh the landing PR, and make stack closeout --apply close superseded PRs after landing merge
  • make stack queue landing-aware and verification-aware so source PRs stay out of queue once a landing batch exists

Verification

  • mise exec -- go test ./...
  • mise exec -- go build ./...
  • mise exec -- go run ./tools/gendocs
  • scripts/sandbox/seed-fixtures.sh && scripts/sandbox/run-live-queue.sh && scripts/sandbox/report-fixtures.sh with GH_TOKEN pinned to roodboi

@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: 1867aebd3c

ℹ️ 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".

Comment thread internal/cmd/root.go Outdated
Comment thread internal/cmd/root.go

@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: 79b517c2b7

ℹ️ 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".

Comment thread internal/cmd/root.go Outdated
Comment thread internal/cmd/root.go Outdated

@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: 4d2c86fe6e

ℹ️ 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".

Comment thread internal/cmd/root.go Outdated
Comment on lines +2274 to +2279
if landing.LandingPRNumber > 0 {
pr, err := runtime.GitHub.ViewPR(runtime.Context, landing.LandingPRNumber)
if err != nil {
return nil, err
}
return []store.PullRequest{pr}, nil

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 Re-resolve landing PR when recorded PR number is stale

When LandingPRNumber is set, resolveLandingPRs returns that PR unconditionally and never falls back to head-branch discovery. If the recorded PR was closed/replaced (a common recovery path), queue, supersede, and closeout will operate on or block on the stale PR even when a unique open PR exists for the landing branch, which breaks the main landing workflow until users manually edit local state.

Useful? React with 👍 / 👎.

Comment thread internal/cmd/root.go Outdated
Comment on lines +2335 to +2338
if !ticketRefPattern.MatchString(trimmed) {
return nil, fmt.Errorf("invalid ticket reference %q", trimmed)
}
normalized := strings.ToUpper(trimmed)

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 Enforce full ticket token validation in --ticket parsing

parseTicketRefs uses ticketRefPattern.MatchString, which accepts partial matches, then stores the full token. Inputs like ABC-123/extra or fooABC-1 pass validation and are persisted as ticket refs, so closeout metadata can contain malformed ticket IDs even though the command claims to validate explicit ticket references.

Useful? React with 👍 / 👎.

@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: 02909ed732

ℹ️ 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".

Comment thread internal/cmd/root.go
Comment on lines +2101 to +2105
pr, err := runtime.GitHub.ViewPR(runtime.Context, number)
if err != nil {
return supersedePlan{}, err
}
plan.SupersededPRs = append(plan.SupersededPRs, pr)

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 Validate superseded PRs belong to landing source branches

buildSupersedePlan accepts any PR numbers passed via --prs and records them as superseded without checking that their heads are among the landing record’s SourceBranches. In this flow, a typo or stale PR number is treated as valid, and closeout --apply later uses that recorded list to close those unrelated open PRs automatically. Add a guard here to reject PRs whose HeadRefName is not part of the composed source branch set before persisting supersede metadata.

Useful? React with 👍 / 👎.

@roodboi roodboi merged commit b1d236a into main Mar 26, 2026
3 checks passed
@roodboi roodboi deleted the hack-agent/landing-orchestration branch March 26, 2026 19:42

@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: 2fbc0475df

ℹ️ 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".

Comment thread internal/cmd/root.go
Comment on lines +2554 to +2555
pr := prs[0]
return queuePlan{}, false, fmt.Errorf("branch %q is part of landing batch %q; queue landing PR #%d instead and keep source PRs out of the merge queue", branch, landingBranch, pr.Number)

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 Skip historical landing batches when queueing source branches

buildSourceLandingQueuePlan always rejects queueing a source branch once it appears in any landing record, even when the only landing PR is already MERGED/CLOSED. Because landing records are persisted and never pruned in this commit, a branch that later gets new commits and a new PR remains permanently blocked with "queue landing PR" guidance that can be impossible to follow; this prevents normal queue handoff after a completed or abandoned landing batch.

Useful? React with 👍 / 👎.

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