Repository navigation
Commit fa3b2ac
committed
✨ Retain one REPL entry's pull requests and the evidence it read (#181, 5/6)
An authored REPL entry can now publish a branch, open or bring up to date its
pull request, read the reviews, comments and checks the Git host holds for it,
leave at a question and continue from acknowledged work. Delivery 5 of #181.
A pull request is a statement about a branch a Git host already holds, and this
entry never makes one exist. So the only thing that authorizes one is a
completely validated saved Push request paired with its own acknowledged receipt
and reached by this execution. An ordinary run proves that by scanning its own
journal; an entry cannot, because its segment is reopened hours later beside
other entries. A bare receipt, a local Commit or File result, a handler's
synthetic `Git.push` answer, a failed Push and another entry's history authorize
none. The last publication to a branch decides what is on it, in the order the
journal acknowledged them — replay may revisit two concurrent children either
way round, so arrival order would let a superseded head keep authorizing work —
and a publication standing after the current position is not evidence, because a
previous session getting further than this one does not authorize this one.
Both external protocols settle through one `git_host_effect` type, and a failed
envelope names no kind. The admission reader therefore classifies from the
preceding unconsumed request in the same coroutine and that request's own
expected worker name, rather than reading every refusal as a publication the way
it could while publication was the only protocol there. Two readers that each
passed over the other's failures would each see an orphan where the other saw a
pair.
The request is written down before the service is contacted, keeping the head,
base, number, title, verbatim body and draft it asked for, so an interrupted
upsert reconciles that exact question without rereading a checkout that has
moved. Both ordinary middleware chains compose on a fresh call through
invocation-local defaults: what a handler may decide is what to ask for, not
what was answered. An answer that never delegated binds only the closed result
contract and retains nothing; once the owned terminal has run its outcome binds
or fails, so a rewritten return cannot bind another pull request and a swallowed
delegated failure stays a failure.
The three evidence reads need no Repository, working directory, managed root,
Git session or native hold, so they are declared and installed for an entry that
holds no checkout. Retention begins at the admitted-read seam and nowhere
earlier: provider matching, the configured allowed list and target validation
run on every execution, including the one that reopens a saved read. Removing
the repository from that list refuses to continue while leaving the record in
history — wrapping the public dispatch in a durable envelope instead would
record questions the run was never permitted to ask. What is retained is the
answer produced inside that seam, so a transformation before admission changes
the recorded question while one after delegation reruns live over the saved
snapshot. Each read installs its own scoped bridge permitting one admitted
handoff, which is what makes nesting and concurrency work without coordination;
the durable name omits the owner so a fork can inherit it, and ownership is
checked explicitly from the record, including a failed read's description.
Intentionally unchanged: Push's request format, dispatch and native fingerprint
boundary; the Git-host worker, the GitHub pull-request provider and the admitted
read adapter; Workflow's pull request, reads, forks and lifecycle; ordinary-run
behavior; File, Dir, selection, local Git and Issue contracts; the CLI factory
signature and owner bytes. No implicit Push, no second reconciliation state
machine, no general publication API and no new operator setting.
Known limitation: an unacknowledged pull request may already have changed the
service, and the saved request is preserved for existing reconciliation to
settle rather than retried; an unacknowledged read may simply run again.
Evidence (F1–F6, all green on this tree): F1 9 suites/81 steps · F2 6/47 · F3
24/156 · F4 18/107 · F5 source 1/1, `deno task build` exit 0, compiled 1/1 ·
F6 Node 48/48 and Bun 48/48, `git diff --check` clean. `deno task lint` exits 0
and `deno task check` reports no errors. F6's Bun invocation needs the
`--timeout=300000` the repository's own Bun runner always passes; the landed
`repl-push-pty` row times out under a bare `bun test` for the same reason.1 parent b786d94 commit fa3b2ac
2 files changed
Lines changed: 10 additions & 4 deletions
File tree
- packages/git/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | | - | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | | - | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
0 commit comments