Skip to content

Commit b1d236a

Browse files
authored
Merge pull request #42 from hack-dance/hack-agent/landing-orchestration
Add landing orchestration workflows
2 parents 8df1e13 + 2fbc047 commit b1d236a

31 files changed

Lines changed: 5797 additions & 1016 deletions

README.md

Lines changed: 83 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,137 @@
11
# stack
22

3-
`stack` is a CLI for stacked pull requests on GitHub.
3+
`stack` is a CLI for stacked pull requests and landing orchestration on GitHub.
44

5-
It helps you split one large change into a chain of smaller dependent PRs, keep
6-
their branch relationships straight, update PR bases when parents move, and hand
7-
the ready bottom PR to GitHub merge queue without turning your repo into
8-
something only one tool understands.
5+
It helps you do two related jobs without inventing a hosted control plane:
6+
7+
- keep an explicit parent graph for ordinary stacked PRs
8+
- turn a verified set of existing PRs into one explicit landing branch and landing PR
99

1010
![Status demo](docs/demo/status.gif)
1111

1212
![Queue demo](docs/demo/queue.gif)
1313

1414
## What stacked PRs are
1515

16-
A stacked PR flow takes one bigger feature and breaks it into a sequence:
16+
A stacked PR flow splits one larger change into a chain:
1717

1818
- branch A targets `main`
1919
- branch B builds on A and its PR targets A
2020
- branch C builds on B and its PR targets B
2121

22-
That makes review smaller and landing order clearer, but it also creates work:
23-
when A changes or merges, B and C need to move with it.
22+
That gives reviewers smaller PRs. It also makes landing order explicit. The
23+
cost is that branch heads and PR bases need to move together when something
24+
lower in the stack changes or merges.
2425

2526
## What `stack` does
2627

2728
`stack` keeps that workflow explicit and repairable:
2829

29-
- you create or track a branch inside a stack
30-
- you restack branches when parents move
31-
- you submit one normal GitHub PR per branch
32-
- you sync local stack state after merges or GitHub-side changes
33-
- you queue the bottom PR when it is ready
30+
- create or track branches inside a stack
31+
- restack branches when parents move
32+
- submit one normal GitHub PR per tracked branch
33+
- compose one landing branch from a selected verified subset
34+
- attach verification and ticket metadata to the landing branch
35+
- mark original PRs as superseded and close them out after landing
36+
- hand the real merge target to GitHub auto-merge or merge queue
3437

3538
The branches stay ordinary Git branches. The PRs stay ordinary GitHub PRs. If
36-
you stop using `stack`, the repository still looks like a normal repository.
37-
38-
## Merge queue
39-
40-
`stack queue` is for the bottom branch in a healthy stack. It verifies the PR
41-
base, head, and remote state, then hands that PR to GitHub auto-merge or merge
42-
queue. After the merge lands, `stack sync` helps the rest of the stack catch up
43-
without guessing through ambiguous cases.
44-
45-
That handoff uses GitHub's own auto-merge path via `gh pr merge --auto`, so the
46-
repository must have auto-merge enabled. If the repo also uses merge queue,
47-
GitHub decides whether the PR goes straight to auto-merge or enters the queue.
48-
49-
## How it differs from Graphite and similar tools
50-
51-
`stack` is closest in spirit to tools that keep explicit local stack metadata,
52-
but it is deliberately simple:
53-
54-
- it works with ordinary branches and ordinary GitHub PRs
55-
- it keeps stack intent locally, not in a hosted control plane
56-
- it favors previews, confirmations, and repair loops over hidden automation
57-
- it stays legible even if someone on the team never installs the tool
58-
59-
That makes it a good fit for teams that want stacked PRs on GitHub without
60-
adopting a more opinionated end-to-end workflow.
39+
you stop using `stack`, the repo still looks like a normal repo.
6140

62-
## Install
41+
## Two landing paths
6342

64-
```bash
65-
brew tap hack-dance/homebrew-tap
66-
brew install hack-dance/tap/stack
67-
```
43+
Use the basic stacked-PR flow when each branch should land in order as its own
44+
PR.
6845

69-
More install and source-build options live in [docs/install.md](docs/install.md).
46+
Use the landing workflow when the graph is useful for organization and repair,
47+
but the real merge target should be one combined landing PR. That is the right
48+
path when you already have a pile of open PRs, want to verify a strict subset,
49+
and need the originals to become traceability-only.
7050

7151
## Quick start
7252

53+
Clean stack:
54+
7355
```bash
7456
stack init --trunk main --remote origin
7557
stack create feature/base
7658
stack create feature/child
77-
stack status
7859
stack submit --all
7960
stack queue feature/base
8061
```
8162

82-
Before using `stack queue`, make sure the GitHub repository has auto-merge
83-
enabled.
63+
Landing workflow from an existing PR pile:
64+
65+
```bash
66+
stack init --trunk main --remote origin
67+
stack adopt pr 353 --parent main
68+
stack adopt pr 354 --parent pr/353
69+
stack compose discovery-core --from pr/353 --to pr/354 --ticket LNHACK-66 --open-pr
70+
stack verify add stack/discovery-core --type sim --run-id run-123 --passed
71+
stack supersede --landing stack/discovery-core --prs 353,354 --close-after-merge
72+
stack queue stack/discovery-core
73+
stack closeout stack/discovery-core --apply
74+
```
8475

8576
For the full daily workflow, start with [docs/usage.md](docs/usage.md).
8677

78+
For the real operator workflow around one combined landing PR, start with
79+
[docs/landing-workflow.md](docs/landing-workflow.md).
80+
81+
## Merge queue
82+
83+
`stack` does not reimplement merge queue. It only hands off the chosen PR
84+
through `gh pr merge --auto`.
85+
86+
Sometimes that PR is the bottom tracked branch. Sometimes it is the landing PR.
87+
GitHub decides whether the handoff becomes auto-merge or queue entry.
88+
89+
The repo must have auto-merge enabled before `stack queue` can work.
90+
8791
## Starting from existing PRs
8892

8993
You do not need to start with a clean stack on day one.
9094

91-
If you already have a pile of open PRs, `stack` can still help you turn them
92-
into an explicit stack so you can test them as a composed set, land them in a
93-
clean order, and handle conflicts with less guesswork.
95+
If you already have a larger PR pile, `stack` can help you:
96+
97+
- adopt the existing heads into an explicit graph
98+
- repair parent order and base drift
99+
- compose one strict landing branch from a verified subset
100+
- keep the original PRs for traceability instead of queueing them directly
101+
102+
Use [docs/adopting-existing-prs.md](docs/adopting-existing-prs.md) to make the
103+
graph explicit, then [docs/landing-workflow.md](docs/landing-workflow.md) to
104+
turn that graph into one landing PR.
105+
106+
## How it differs from Graphite and similar tools
107+
108+
`stack` stays deliberately simple:
109+
110+
- ordinary branches
111+
- ordinary GitHub PRs
112+
- explicit local metadata
113+
- previews and repair loops instead of hidden automation
94114

95-
The practical path is:
115+
That makes it a good fit for teams that want stacked PRs and landing batches on
116+
GitHub without committing the repo to a hosted workflow layer.
117+
118+
## Install
96119

97-
1. check out the repo locally and make sure you have local branches for the PR heads you care about
98-
2. decide the intended parent chain or grouping
99-
3. run `stack track <branch> --parent <parent>` for each branch
100-
4. run `stack status` and `stack sync` to see what does not match yet
101-
5. use `stack move`, `stack restack`, and `stack submit` to bring the stack into shape
120+
```bash
121+
brew tap hack-dance/homebrew-tap
122+
brew install hack-dance/tap/stack
123+
```
102124

103-
That adoption flow is documented in [docs/adopting-existing-prs.md](docs/adopting-existing-prs.md).
125+
More install and source-build options live in [docs/install.md](docs/install.md).
104126

105127
## Documentation
106128

107129
- [docs/README.md](docs/README.md) for the full docs index
108-
- [docs/adopting-existing-prs.md](docs/adopting-existing-prs.md) for grouping and ordering an existing PR set
130+
- [docs/usage.md](docs/usage.md) for the standard stacked-PR loop
131+
- [docs/landing-workflow.md](docs/landing-workflow.md) for the landing-orchestration path
132+
- [docs/adopting-existing-prs.md](docs/adopting-existing-prs.md) for making an existing PR graph explicit
109133
- [docs/how-it-works.md](docs/how-it-works.md) for the model and workflow
110-
- [docs/usage.md](docs/usage.md) for everyday commands and repair loops
111-
- [docs/troubleshooting.md](docs/troubleshooting.md) for common failure modes
134+
- [docs/troubleshooting.md](docs/troubleshooting.md) for failure modes and repair paths
112135
- [docs/cli/stack.md](docs/cli/stack.md) for generated command reference
113136

114137
Contributor docs live in [docs/testing.md](docs/testing.md) and

docs/README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,34 @@
11
# Docs
22

3-
Start here if you want the public documentation for `stack`.
3+
Start here if you want the public docs for `stack`.
4+
5+
## Choose your path
6+
7+
If you are starting a clean stack and want the normal branch-by-branch flow:
8+
9+
- read [usage.md](usage.md)
10+
11+
If you already have a PR pile and want one explicit landing PR:
12+
13+
- read [landing-workflow.md](landing-workflow.md)
14+
15+
If you first need to make an existing PR graph explicit before either path:
16+
17+
- read [adopting-existing-prs.md](adopting-existing-prs.md)
418

519
## Product docs
620

721
- [install.md](install.md) for Homebrew, release artifacts, and source builds
8-
- [adopting-existing-prs.md](adopting-existing-prs.md) for turning an existing PR set into an explicit stack
9-
- [how-it-works.md](how-it-works.md) for stacked PR concepts, merge queue, and workflow shape
10-
- [usage.md](usage.md) for the everyday command flow
22+
- [usage.md](usage.md) for the standard stacked-PR loop
23+
- [landing-workflow.md](landing-workflow.md) for landing-branch composition, verification, superseded PRs, queue handoff, and closeout
24+
- [adopting-existing-prs.md](adopting-existing-prs.md) for turning an existing PR set into an explicit graph
25+
- [how-it-works.md](how-it-works.md) for the core model and workflow shape
1126
- [troubleshooting.md](troubleshooting.md) for repair paths when state drifts
1227
- [cli/stack.md](cli/stack.md) for generated command reference
1328

14-
## More docs
29+
## Contributor docs
1530

1631
- [testing.md](testing.md) for unit, fixture, and live sandbox verification
1732
- [releasing.md](releasing.md) for release automation and Homebrew publishing
1833
- [demo/README.md](demo/README.md) if you need to regenerate the README demos
34+
- [landing-workflow-followups.md](landing-workflow-followups.md) for the historical feature request that drove the landing-orchestration work

0 commit comments

Comments
 (0)