Skip to content

feat(queue): keep waiting landings, and list them - #97

Merged
PiquelChips merged 1 commit into
mainfrom
feat/land-pending
Nov 23, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
feat/land-pending

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

A landing that conflicted or lacked evidence only said so to whoever ran it. Nothing remembered it, so nobody else could see what waited on a target, or why.

Each waiting landing is now kept durably in its target's queue directory, replacing the last attempt's, and forgotten once it lands or the target turns out to have it already. The file holds what lands, what the evidence must be about, and either the missing requirements or the core.conflict statement, whose payload lists the paths.

A stack that waits is kept whole, as the landing of the change it was asked for, so retrying it lands the rest once the change it waits on can. Queue::pending lists every waiting landing on every target, reading without the locks: a landing that ends while it reads is skipped.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

Queue API (apps/origin-src/src/queue/mod.rs)

  • Adds pub fn pending(store: &Store<P>) -> Result<Vec<Pending>, StoreError> to Queue.
  • pending lists waiting landings across all targets, sorted by target.
  • pending takes no locks. It skips lock and temporary files.
  • It tolerates missing directories and files that disappear during reading.
  • It reports other I/O errors and malformed records.
  • It refreshes conflict paths from their statements.
  • land_change and land_target call session.forget before returning Unchanged.
  • The queue documentation describes waiting changes and per-landing queue files.

Pending record format (apps/origin-src/src/queue/pending.rs, new)

  • Encodes a Pending landing as versioned text. The record holds the header, target, proposal, subject, and either missing requirements or a conflict statement.
  • Decoding returns None for missing, malformed, or unknown required fields.
  • A restored conflict has an empty path list.
  • With several conflict lines, the last line sets the restored block.
  • A conflict takes precedence over missing requirements.

Session persistence (apps/origin-src/src/queue/session.rs)

  • pending_path maps a change to change-{id} and a target to target-{id} under the target queue directory.
  • keep writes the pending file durably. It replaces any previous file for that landing.
  • Adds fn forget(&self, proposal: &Proposal) -> Result<(), StoreError>. It removes the pending file and syncs the parent directory. A missing file counts as success. Other I/O errors are returned.
  • The landing flow calls forget when a revision is unchanged or after an acceptance is appended.
  • The landing flow calls keep before returning for missing evidence or conflicts.

Tests (apps/origin-src/src/queue/tests/)

  • changes.rs: Round-trips pending landings for evidence and conflict blockers. Rejects the legacy origin pending 2 encoding. Checks that a stack waiting on CI evidence is stored as one pending landing. After evidence is issued, both changes land, with the upper change as the proposal, and no pending entries remain.
  • conflicts.rs: Checks that the pending queue holds the blocked landing. After a new revision merges and lands, checks that the queue is empty.
  • evidence.rs: Checks that the pending queue holds the blocked landing while evidence is missing. After valid evidence lands the change, checks that the queue is empty.
  • mod.rs: Replaces the TreeId and PolicyError imports with Tree and Requirement.

Scope of change: 7 files, +259/−11 lines.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The queue now persists waiting landings as per-proposal files and exposes them through Queue::pending, sorted by target. It removes records when proposals land or become unchanged. Pending records encode evidence and conflict blockers, with tests covering encoding and queue state.

Changes: Pending landing storage and listing

Layer / File(s) Summary
Pending record format and session persistence
apps/origin-src/src/queue/pending.rs, apps/origin-src/src/queue/session.rs, apps/origin-src/src/queue/tests/changes.rs
Pending records use a versioned text format. Sessions store records for evidence- or conflict-blocked landings and remove them after landing or when a revision is unchanged. Tests cover record round trips and a stack that resumes after evidence is supplied.
Queue listing and pending-state checks
apps/origin-src/src/queue/mod.rs, apps/origin-src/src/queue/tests/conflicts.rs, apps/origin-src/src/queue/tests/evidence.rs, apps/origin-src/src/queue/tests/mod.rs
Queue::pending reads records across targets, refreshes conflict paths, and sorts results by target. Tests check that blocked landings appear in the queue and disappear after they land.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Session
  participant TargetQueueDirectory
  participant QueuePending
  participant Store
  Session->>TargetQueueDirectory: Write pending record
  QueuePending->>TargetQueueDirectory: List and read pending records
  opt Conflict record
    QueuePending->>Store: Read referenced statement
    Store-->>QueuePending: Return statement paths
  end
  QueuePending-->>Caller: Return sorted pending landings
Loading

Possibly related PRs

  • sourceorigin-dev/origin#156: Retries waiting landings when evidence arrives and when a server opens a repository, using the pending records this change stores.
  • sourceorigin-dev/origin#16: Resumes waiting landings and reads the waiting-landing records this change writes.
  • sourceorigin-dev/origin#13: Introduces the queue and conflict-blocked landing behavior that this change persists and exposes.

Suggested labels: enhancement, area/landing

Merge Risk: Minimal · up to c18ad

This change keeps waiting landings on disk and lists them, so conflicts and missing evidence become visible to everyone. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(queue): keep waiting landings, and list them" matches the main changes. The PR stores landings that wait on conflicts or missing evidence in per-target pending files, forgets them once…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(queue): keep waiting landings, and list them" matches the main changes. The PR stores landings that wait on conflicts or missing evidence in per-target pending files, forgets them once they land or the target already has them, and adds a public Queue::pending method that lists waiting landings across targets. The title names both the storage behavior and the listing API, and it is specific enough for a teammate scanning history. Minor note: the title does not mention the proposal-unchanged cleanup or the stack-kept-whole behavior, but those are secondary details.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit files a waiting change with care,
Its blocker written neatly there.
The queue lists what must wait,
Then clears the file when landings complete.
“Hop back,” says the rabbit, “the stack can proceed!”

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: da418619-4c80-4dab-a2ed-73d1f6d6dbd8
Commits

Reviewing files that changed from the base of the PR and between 90139cc and c18ad21.

Files selected for processing: 7

  • apps/origin-src/src/queue/mod.rs
  • apps/origin-src/src/queue/pending.rs
  • apps/origin-src/src/queue/session.rs
  • apps/origin-src/src/queue/tests/changes.rs
  • apps/origin-src/src/queue/tests/conflicts.rs
  • apps/origin-src/src/queue/tests/evidence.rs
  • apps/origin-src/src/queue/tests/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/land-pending branch 3 times, most recently from 4c854f1 to ae1ba2c Compare November 23, 2026 12:30
Base automatically changed from feat/land-targets to main November 23, 2026 18:02
A landing that conflicted or lacked evidence only said so to whoever ran
it. Nothing remembered it, so nobody else could see what waited on a
target, or why.

Each landing that waits is now kept durably in its target's queue
directory, `queue/<target id>/change-<id>` or `target-<target id>`,
replacing the last attempt's, and forgotten once it lands or the target
turns out to have it already. The file holds what lands, what the
evidence must be about, and either the requirements missing or the
`core.conflict` statement, whose payload lists the paths.

A stack that waits is kept whole, as the landing of the change it was
asked for, so retrying it lands the rest once the change it waits on
can. `Queue::pending` lists every landing that waits, on every target,
reading without the locks: a landing that ends while it reads is
skipped.
@PiquelChips
PiquelChips merged commit b2774e1 into main Nov 23, 2026
6 checks passed
@PiquelChips
PiquelChips deleted the feat/land-pending branch November 23, 2026 21:38
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