vouchington-tooling 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -1
- package/dist/agent-blackboard/client.d.mts +6 -0
- package/dist/cli/commands/fresh-base.d.mts +6 -0
- package/dist/cli/commands/fresh-base.mjs +14 -0
- package/dist/cli/index.mjs +3 -0
- package/dist/cli/parse-fresh-base.d.mts +2 -0
- package/dist/cli/parse-fresh-base.mjs +15 -0
- package/dist/cli/parse.d.mts +5 -0
- package/dist/cli/parse.mjs +3 -0
- package/dist/cli/usage.d.mts +1 -1
- package/dist/cli/usage.mjs +3 -1
- package/dist/fresh-base/classify.d.mts +21 -0
- package/dist/fresh-base/classify.mjs +29 -0
- package/dist/fresh-base/index.d.mts +4 -0
- package/dist/fresh-base/index.mjs +2 -0
- package/dist/fresh-base/run.d.mts +25 -0
- package/dist/fresh-base/run.mjs +66 -0
- package/dist/gh-cli/closing-refs.d.mts +24 -0
- package/dist/gh-cli/closing-refs.mjs +37 -0
- package/dist/gh-cli/index.d.mts +3 -0
- package/dist/gh-cli/index.mjs +2 -0
- package/dist/gh-cli/non-closing-refs.d.mts +11 -0
- package/dist/gh-cli/non-closing-refs.mjs +24 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +3 -0
- package/dist/mcp-server/context.d.mts +3 -0
- package/dist/mcp-server/dispatch.d.mts +3 -0
- package/dist/mcp-server/dispatch.mjs +7 -1
- package/dist/mcp-server/fake-blackboard.test-helpers.d.mts +2 -0
- package/dist/mcp-server/fake-blackboard.test-helpers.mjs +3 -0
- package/dist/mcp-server/handlers-pr.d.mts +1 -1
- package/dist/mcp-server/handlers-pr.mjs +6 -97
- package/dist/mcp-server/handlers-retrospective-save.d.mts +10 -0
- package/dist/mcp-server/handlers-retrospective-save.mjs +138 -0
- package/dist/mcp-server/handlers-retrospective.d.mts +1 -12
- package/dist/mcp-server/handlers-retrospective.mjs +1 -154
- package/dist/mcp-server/handlers-session.mjs +25 -6
- package/dist/mcp-server/handlers-snapshot-cleanup.d.mts +7 -0
- package/dist/mcp-server/handlers-snapshot-cleanup.mjs +36 -0
- package/dist/mcp-server/harness.test-helpers.d.mts +2 -0
- package/dist/mcp-server/harness.test-helpers.mjs +1 -0
- package/dist/mcp-server/policy-run.d.mts +1 -0
- package/dist/mcp-server/policy-run.mjs +1 -0
- package/dist/mcp-server/pr-body.d.mts +4 -2
- package/dist/mcp-server/pr-body.mjs +15 -3
- package/dist/mcp-server/pr-defaults.d.mts +3 -0
- package/dist/mcp-server/pr-defaults.mjs +7 -2
- package/dist/mcp-server/pr-input.d.mts +12 -5
- package/dist/mcp-server/pr-input.mjs +21 -4
- package/dist/mcp-server/pr-live.d.mts +3 -1
- package/dist/mcp-server/pr-live.mjs +7 -2
- package/dist/mcp-server/pr-mode.d.mts +7 -0
- package/dist/mcp-server/pr-mode.mjs +34 -0
- package/dist/mcp-server/pr-no-source.d.mts +9 -0
- package/dist/mcp-server/pr-no-source.mjs +22 -0
- package/dist/mcp-server/pr-prepare.d.mts +25 -0
- package/dist/mcp-server/pr-prepare.mjs +103 -0
- package/dist/mcp-server/preview-registry.d.mts +25 -0
- package/dist/mcp-server/preview-registry.mjs +38 -0
- package/dist/mcp-server/retrospective-check.d.mts +3 -0
- package/dist/mcp-server/retrospective-check.mjs +38 -0
- package/dist/mcp-server/retrospective-input.mjs +2 -2
- package/dist/mcp-server/retrospective-preview.d.mts +17 -0
- package/dist/mcp-server/retrospective-preview.mjs +60 -0
- package/dist/mcp-server/snapshot-registry.d.mts +25 -0
- package/dist/mcp-server/snapshot-registry.mjs +32 -0
- package/dist/mcp-server/tools-pr.mjs +20 -4
- package/dist/mcp-server/tools-retrospective.mjs +25 -5
- package/dist/mcp-server/tools.mjs +6 -0
- package/dist/pull-request-diff/diff-size.d.mts +29 -0
- package/dist/pull-request-diff/diff-size.mjs +35 -0
- package/dist/pull-request-diff/index.d.mts +2 -0
- package/dist/pull-request-diff/index.mjs +1 -0
- package/dist/retrospective-distill/args.d.mts +13 -0
- package/dist/retrospective-distill/args.mjs +27 -0
- package/dist/retrospective-distill/checkpoint-entry.d.mts +2 -0
- package/dist/retrospective-distill/checkpoint-entry.mjs +11 -0
- package/dist/retrospective-distill/fixtures.test-helpers.d.mts +3 -0
- package/dist/retrospective-distill/fixtures.test-helpers.mjs +21 -0
- package/dist/retrospective-distill/flag-args.d.mts +5 -0
- package/dist/retrospective-distill/flag-args.mjs +31 -0
- package/dist/retrospective-distill/index.d.mts +10 -0
- package/dist/retrospective-distill/index.mjs +6 -0
- package/dist/retrospective-distill/partition-records.d.mts +6 -0
- package/dist/retrospective-distill/partition-records.mjs +49 -0
- package/dist/retrospective-distill/retrospective-entry.d.mts +3 -0
- package/dist/retrospective-distill/retrospective-entry.mjs +4 -0
- package/dist/retrospective-distill/run.d.mts +5 -0
- package/dist/retrospective-distill/run.mjs +28 -0
- package/dist/retrospective-distill/session-types.d.mts +17 -0
- package/dist/retrospective-distill/session-types.mjs +1 -0
- package/dist/retrospective-distill/shape.d.mts +29 -0
- package/dist/retrospective-distill/shape.mjs +111 -0
- package/docs/mcp-server.md +95 -23
- package/package.json +20 -5
- package/skills/agent-workflow/SKILL.md +20 -0
- package/skills/agent-workflow/references/four-refs.md +74 -0
- package/skills/blackboard/SKILL.md +21 -1
- package/skills/github-issue/SKILL.md +6 -0
- package/skills/manifest.json +11 -5
- package/skills/postgres-node-performance-tuning/SKILL.md +2 -0
- package/skills/postgres-node-performance-tuning/references/performance-patterns.md +76 -0
- package/skills/postgres-node-performance-tuning/references/reading-plans.md +111 -0
- package/skills/postgres-schema-design/references/relations.md +18 -0
- package/skills/retrospective/SKILL.md +3 -1
- package/skills/retrospective-distill/SKILL.md +72 -4
- package/skills/revisit-followups/SKILL.md +17 -0
- package/skills/stacked-prs/SKILL.md +47 -16
- package/skills/stacked-prs/references/drain.md +168 -0
- package/skills/stacked-prs/references/gh-stack.md +143 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# gh-stack mechanics
|
|
2
|
+
|
|
3
|
+
Official docs (do not copy): [About](https://docs.github.com/en/pull-requests/get-started/about-stacked-prs),
|
|
4
|
+
[CLI](https://docs.github.com/en/pull-requests/reference/stacked-prs-cli-commands),
|
|
5
|
+
[Managing](https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/managing-stacked-pull-requests),
|
|
6
|
+
[Merging](https://docs.github.com/en/pull-requests/how-tos/merge-and-close-pull-requests/merging-stacked-pull-requests).
|
|
7
|
+
|
|
8
|
+
## Setup
|
|
9
|
+
|
|
10
|
+
- Install on first stacked use: `gh extension install github/gh-stack`. The feature is in public
|
|
11
|
+
preview.
|
|
12
|
+
- If `gh stack` exits 9 (stacks are not enabled on the repository), do not bundle the source issues
|
|
13
|
+
into one pull request. Open one pull request on the default branch for the bottom issue, wait for
|
|
14
|
+
it to merge, then open the next. Say that stacks are unavailable.
|
|
15
|
+
- Workflows that must run on stacked pull requests must not set `pull_request.branches` or
|
|
16
|
+
`branches-ignore`. GitHub evaluates `branches: [main]` against `stack.base.ref`, but
|
|
17
|
+
`gh stack submit` opens mid-stack pull requests before the stack object exists
|
|
18
|
+
([github/gh-stack#425](https://github.com/github/gh-stack/issues/425)), so the filter skips them
|
|
19
|
+
permanently. After a workflow trigger change lands on the default branch, rebase existing stacks
|
|
20
|
+
(`gh stack rebase` or `gh stack sync`) so parent branches include it.
|
|
21
|
+
|
|
22
|
+
## Agent commands
|
|
23
|
+
|
|
24
|
+
Use only non-interactive forms, and run every `gh stack` command without a TTY. Run
|
|
25
|
+
`git config rerere.enabled true` before the first `init`, which otherwise prompts. An explicit
|
|
26
|
+
`checkout` prompts when local and remote compositions differ, and `submit --auto` prompts to
|
|
27
|
+
create ordinary pull requests when stacks are disabled; without a TTY these fail instead, so treat
|
|
28
|
+
a failure as the exit-9 recovery above rather than answering a prompt.
|
|
29
|
+
|
|
30
|
+
- `gh stack init <branch>`, rooted on the default branch only.
|
|
31
|
+
- `gh stack add <branch>`, after the layer cap check in [SKILL.md](../SKILL.md#work-bottom-up).
|
|
32
|
+
- `gh stack checkout <stack-or-pr-number>` imports an existing remote stack. See
|
|
33
|
+
[Import a stack](#import-a-stack-before-acting-on-it).
|
|
34
|
+
- `gh stack submit --auto` creates drafts. Immediately update each new pull request's title and
|
|
35
|
+
body with the repository's pull request description tool; auto titles and bodies are not
|
|
36
|
+
sufficient, and an unstamped body fails the ownership check in [drain.md](drain.md).
|
|
37
|
+
- `gh stack link <branch-or-pr>...` (bottom to top) registers a stack without local tracking. It
|
|
38
|
+
pushes the branches and creates a draft pull request for any branch without one. Update each
|
|
39
|
+
pull request it created the same way as after `submit --auto`.
|
|
40
|
+
- `gh stack view --json` is for acting only. Never use it, or `gh stack bottom`, to decide
|
|
41
|
+
topology, ownership, or bottom-ness.
|
|
42
|
+
- `gh stack rebase`, `gh stack rebase --upstack`, `gh stack rebase --continue`,
|
|
43
|
+
`gh stack rebase --abort`.
|
|
44
|
+
- `gh stack sync` fetches, fast-forwards the trunk, cascade-rebases every layer onto its updated
|
|
45
|
+
parent, and pushes all branches with `--force-with-lease --atomic`. It rewrites every layer's
|
|
46
|
+
head, so treat it like a rebase: stop the poll first, never run it over a queued layer, and
|
|
47
|
+
expect reviewed heads to change. Do not check out the default branch. Run it without a TTY (a
|
|
48
|
+
TTY prompts on local/remote divergence; without one it aborts) and without `--prune`.
|
|
49
|
+
- `gh stack push`.
|
|
50
|
+
- `gh stack up <n>`, `gh stack down <n>`, `gh stack top`, `gh stack bottom`, for movement only.
|
|
51
|
+
- `gh stack merge <pr> --yes --squash`, or the repository's merge strategy. The pull request number
|
|
52
|
+
is required. `--yes` skips a prompt that a non-interactive runner cannot answer.
|
|
53
|
+
- `gh stack unstack [<stack-number>]` (alias `delete`) recovers a mis-rooted stack. With no
|
|
54
|
+
argument it targets the active stack. It unstacks on GitHub and removes local tracking; add
|
|
55
|
+
`--local` to remove only local tracking. Pull requests and branches survive. GitHub leaves
|
|
56
|
+
queued or auto-merge pull requests stacked, and then keeps the stack.
|
|
57
|
+
|
|
58
|
+
Never run the interactive forms: `gh stack submit` without `--auto`, `gh stack modify`, bare
|
|
59
|
+
`gh stack checkout`, `gh stack switch`, or bare `gh stack merge` (a TUI that lands the whole
|
|
60
|
+
stack). `gh stack checkout <branch>` resolves only stacks this worktree already tracks. Do not run
|
|
61
|
+
`gh stack trunk` from a linked worktree whose default branch is checked out elsewhere.
|
|
62
|
+
|
|
63
|
+
## Worktree and scope
|
|
64
|
+
|
|
65
|
+
- One worktree per stack. Move with `up` and `down`. Do not add a worktree per layer:
|
|
66
|
+
`gh stack rebase --upstack` rewrites upper branches, and git refuses to update a branch checked
|
|
67
|
+
out in another worktree.
|
|
68
|
+
- `git diff --name-only origin/<default>...HEAD` lists what lands if this layer and every layer
|
|
69
|
+
below merge.
|
|
70
|
+
- `git diff --name-only <parent>...HEAD` is this layer's review scope.
|
|
71
|
+
|
|
72
|
+
## Import a stack before acting on it
|
|
73
|
+
|
|
74
|
+
`gh stack rebase`, `sync`, `push`, and movement act only on stacks the worktree's local record
|
|
75
|
+
tracks. A stack created from another worktree, session, or machine is not tracked. Before rebasing
|
|
76
|
+
or pushing a layer, including when a shepherd instruction says to, import the stack:
|
|
77
|
+
|
|
78
|
+
1. `gh stack checkout <stack-number>`, with the number from `pulls/<N>.stack.number`. It records
|
|
79
|
+
the stack and checks out the top-most unmerged layer. When the worktree already tracks a
|
|
80
|
+
matching stack it only switches branches, so remote-tracking refs can be stale.
|
|
81
|
+
2. Resolve the remote gh-stack uses once (`remote.pushDefault` when set, else the only remote,
|
|
82
|
+
else `origin`), and read `origin` below as that remote.
|
|
83
|
+
3. gh-stack keeps existing local layer branches as they are, so a stale one makes the next rebase
|
|
84
|
+
start from stale commits. Run `git fetch origin`, then for each unmerged layer branch `<b>` run
|
|
85
|
+
`git rev-list --left-right --count "$b...origin/$b"` (left: local-only commits; right: commits
|
|
86
|
+
only on the pull request head). Branch names may contain shell metacharacters: pass each as a
|
|
87
|
+
quoted variable, never paste it into a command line, and skip names that start with `-`:
|
|
88
|
+
- `0 0`: up to date.
|
|
89
|
+
- `0 N`: fast-forward. Use `git merge --ff-only origin/<b>` on the checked-out layer and
|
|
90
|
+
`git branch -f <b> origin/<b>` on any other.
|
|
91
|
+
- A left count above `0` (ahead or diverged): inspect before rewriting or pushing, as the
|
|
92
|
+
consumer's git procedure describes. Do not open another pull request for the layer.
|
|
93
|
+
|
|
94
|
+
## Submit and verify the remote stack
|
|
95
|
+
|
|
96
|
+
- A pull request's base branch selects its comparison target. Chaining bases alone does not
|
|
97
|
+
register a native stack. `gh stack init` and `add` record a local plan. Neither local tracking
|
|
98
|
+
nor a successful pull request creation proves GitHub registered the stack.
|
|
99
|
+
- Once an upper layer has committed, reviewable work and its local checks pass, submit the layers
|
|
100
|
+
as drafts with `gh stack submit --auto` while the lower pull request is still open and unqueued.
|
|
101
|
+
- Verify remote registration before asking to merge or enqueue the lower pull request. An open
|
|
102
|
+
pull request already in a merge queue cannot join a new stack. If it was queued externally, stop
|
|
103
|
+
registering and report the blocker. Do not dequeue it without authorization or rewrite it. When
|
|
104
|
+
it leaves the queue, re-read it: retry registration if it is still open and unqueued, or recover
|
|
105
|
+
as below if it merged. If it closed without merging, report the broken dependency.
|
|
106
|
+
- Do not wait for upper-layer CI or ready status to register the dependency. Do not create empty
|
|
107
|
+
placeholder layers, or start work held for approval, only to preserve a stack.
|
|
108
|
+
- After each submission or link, read every intended pull request's `pulls/<N>.stack` and the
|
|
109
|
+
single-stack endpoint. Require the same stack number, the intended bottom-to-top order, and the
|
|
110
|
+
expected bases. Missing preview metadata leaves membership unknown: report that, and do not infer
|
|
111
|
+
success from local tracking.
|
|
112
|
+
- If the lower pull request merges before registration, GitHub can reject linking it. Re-read the
|
|
113
|
+
forge, fetch, and rebase the remaining work onto the updated default branch without replaying
|
|
114
|
+
the merged layer. Keep any upper pull request already created. Register several remaining open
|
|
115
|
+
layers as a stack and verify their bases. For a single survivor, read its remote base, retarget
|
|
116
|
+
it to the default branch if needed, and verify that before shepherding it alone: a head rebase
|
|
117
|
+
does not change a base. Report sequential pull requests when no stack registered. Do not recreate
|
|
118
|
+
the merged bottom or chain bases by hand as a substitute.
|
|
119
|
+
|
|
120
|
+
## Lower-layer review fix
|
|
121
|
+
|
|
122
|
+
Check out the layer that owns the change and commit there. Then run `gh stack rebase --upstack`
|
|
123
|
+
and `gh stack push` once. Do not duplicate the fix in an upper layer.
|
|
124
|
+
|
|
125
|
+
## The forge is the only truth
|
|
126
|
+
|
|
127
|
+
Every fact the procedure branches on (topology, layer state, ownership, head SHA) comes from the
|
|
128
|
+
REST or GraphQL API, never from local gh-stack metadata. A local base ref can go stale after a
|
|
129
|
+
remote relink or rebase and silently replay already-landed commits. `gh stack view --json` also
|
|
130
|
+
errors from a worktree whose current branch is not in the stack, which is normal right after a
|
|
131
|
+
merge retargets it.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
gh api "repos/{owner}/{repo}/pulls/<N>" --jq '{stackPresent: has("stack"), stack: .stack}'
|
|
135
|
+
gh api "repos/{owner}/{repo}/stacks/<n>" # layers bottom to top, with head.sha and author
|
|
136
|
+
gh api --paginate "repos/{owner}/{repo}/stacks" --jq '.[] | select(.open)' # state is null
|
|
137
|
+
# and ?state=open is ignored
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- Use the single-stack endpoint for one stack's layers. The list form returns each layer's
|
|
141
|
+
`base.ref` as `null`.
|
|
142
|
+
- `.stack` is a preview field. Its absence is not proof a pull request is unstacked: report "stack
|
|
143
|
+
membership unknown" instead of assuming it is unstacked.
|