Skip to content

feat(run): --frontier — run only a graph's unblocked, unmerged issues and report the next wave #1293

Open

Description

@admarble

Tier: judgment Found: 2026-10-03, feasibility review of running /graph-run through sequant run.

Problem. /graph-run runs a dependency graph one wave at a time: it works out which issues are unblocked (every dependency merged), not merged yet and not already running, launches only those, and waits for the merges before planning the next wave. sequant run has the pieces but not this step, so today the skill does it by hand every wave.

Design (one wave per invocation)

sequant run --frontier <issues…> treats the given issues as the graph:

  1. Read each issue's edges: the existing depends on markers and labels, plus blocked by markers. Under --frontier the flag itself is the opt-in that feat: lightweight content pre-flight for --chain (AC presence, dependency-order sanity) #762 asked for, and it only filters, it never reorders.
  2. A dependency counts as satisfied only when its issue is closed with stateReason: COMPLETED. Dependencies outside the given set count too.
  3. Frontier = satisfied ∩ open ∩ not in flight (no held per-issue lock and no in-progress phase in .sequant/state.json) ∩ not awaiting merge (state ready_for_merge or an open PR for the issue).
  4. Run only the frontier, through the existing parallel path and --concurrency.
  5. End with a report that sorts every issue in the set into: launched, blocked (naming each open dependency), awaiting merge, in flight, done. It also lists the issues that become unblocked once this wave merges.

AC

  • AC-1: sequant run --frontier <issues…> is a registered option in bin/cli.ts and reaches the orchestrator. Evidence: sequant run --help | grep -- --frontier and a run-flags.test.ts case that parses it
  • AC-2: With --frontier, an issue launches only if every dependency it declares (depends on or blocked by markers, line-leading, plus depends-on/N labels) is closed as completed, including dependencies outside the given set. Evidence: a gate test with a mocked gh showing a set where one issue's dependency is open, so that issue is held and its sibling launches; mutation-verified by dropping the closed-state check
  • AC-3: Without --frontier, behavior doesn't change: sortByDependencies still honors only depends on, and no issue is filtered out. Evidence: the existing batch-executor.test.ts dependency tests pass unchanged, plus a new case asserting a blocked by marker doesn't reorder a run without the flag
  • AC-4: Issues that are in flight (held lock or in-progress phase) or awaiting merge (ready_for_merge state or an open PR) are excluded from the frontier and reported as such. Evidence: a gate test covering each of the three exclusion sources; mutation-verified by removing the open-PR check
  • AC-5: The end-of-run report lists every issue in the set under exactly one of launched / blocked (with the open dependency numbers) / awaiting merge / in flight / done, and lists the issues that this wave's merges would unblock. Evidence: a snapshot or string test of the report for a 5-issue fixture graph with at least one issue in each bucket
  • AC-6: --frontier --dry-run prints the frontier and the report without creating worktrees or launching phases. Evidence: a test asserting no worktree-manager or phase-executor call under dry-run
  • AC-7: A dependency cycle within the set is a hard error naming the cycle, before any worktree is created. Evidence: a gate test with a two-issue cycle fixture; mutation-verified by removing the cycle check
  • AC-8: --frontier combined with --chain, --stacked or --batch is rejected with a message naming the conflict. Evidence: a run-flags.test.ts case per combination
  • AC-9: A body line containing Blocked by or Depends on mid-line (for example the metadata form **Epic:** … **Blocked by:** #<n>), which the line-anchored parser skips, produces a warning naming the issue, so an edge the parser can't see doesn't widen the frontier silently. Evidence: a gate test with a metadata-line fixture asserting the warning text; mutation-verified by removing the warning
  • AC-10: docs/guides/writing-issues.md and docs/reference/run-command.md document --frontier: which markers it reads, what "satisfied" means, and that merging remains a human step. Evidence: grep -n -- "--frontier" docs/guides/writing-issues.md docs/reference/run-command.md matches in both

Non-Goals

Open questions

  • Satisfied = issue closed as completed. Merged PRs have sometimes left their issue open (2026-09-30), which makes the frontier too conservative, never wrong. Should "satisfied" also accept a merged PR whose closingIssuesReferences names the dependency?

May touch

  • bin/cli.ts, src/commands/run.ts, src/commands/run-flags.ts, src/lib/workflow/run-orchestrator.ts, src/lib/workflow/batch-executor.ts, src/lib/workflow/dependency-markers.ts, tests beside each, docs/guides/writing-issues.md, docs/reference/run-command.md

Activity

  1. added
    enhancement
    cli
    on Oct 4, 2026
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

    clienhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions