Repository navigation
Commit fef5de8
authored
* ✨ Add the ordinary run's repository provider (#643)
The seam exists; this is the second implementation of it. A provider that works
against the caller's own filesystem rather than a retained workflow run: no
WorkflowRun, no Workspace, no journal, nothing to replay. What makes a checkout
this execution's is an advisory lock, and what makes it the same checkout
tomorrow is the sidecar beside it.
It discovers the repository the execution was started inside — canonical common
directory as identity, canonical checkout root as the selection, so starting in
a linked worktree names the same repository as starting in the primary checkout
while Git operations still act on the worktree. It places managed Repositories
and Worktrees under `~/.xmd/repositories` at a digest of their whole identity,
describes each with a closed version 1 sidecar written by exclusive temporary
sibling plus atomic rename only after the checkout is complete, and holds each
slot for one document execution with a kernel-released non-blocking advisory
lock — so a second process is refused immediately rather than made to wait, and
a crash releases the slot without cleanup. Nothing deletes, resets, cleans,
fetches or repairs a managed checkout: what is in one is somebody's work.
Local Git performs the same authored transitions the workflow performers do,
directly against the authenticated checkout, under the same fixed configuration
that disables hooks, signing, file-system monitors and repository-supplied
helper programs. A commit records the invoking user's own effective Git
identity, captured from the trusted host before the document expands; a host
that can name no identity refuses `<Git.Commit>` and names the commands that fix
it rather than writing the workflow identity into somebody's repository, and
every other component stays usable.
Push keeps the observe/adopt/fast-forward/refuse rules and stores one private
evidence entry per verified publication in the provider instance's own closure.
`<PullRequest>` requires the exact matching entry that instance holds: a Push
for another checkout, repository, origin, destination, branch or commit is
irrelevant, a later Push of the same destination supersedes the earlier entry,
and missing or conflicting evidence is a local refusal before a credential is
opened. Nothing crosses executions.
No entrypoint installs any of this yet — the suites install it themselves
through the trusted test installer, and `architecture.md` gains the terminology
these structures need but no status row, because nothing on main can reach them.
The certified tier suite is split by capability rather than carried whole:
ambient and local Git, managed checkouts, live remotes. Every describe block is
intact, all 51 cases are preserved, and shared fixtures moved to
tests/support/run-composition-tier.ts.
* 🔒️ Select a checkout only under the whole repository identity (#643)
`selectCheckout()` admitted a registered checkout as a candidate when its
identity's `locatorFingerprint` equalled the authenticated contextual one. A
fingerprint names where a repository came from, not which repository it is: two
`<Repository>` elements naming one url under two names are two repositories,
with separate slots, separate advisory leases and separate Push evidence, and
every other member of their identities is equal.
So a `<Dir>` into the second one, written where the first is the Repository in
scope, passed selection authentication against the first and then acted in a
checkout the first never selected. Under that path `<Git.Switch>` moved the
second repository's branch, and `<Git.Push>` reached its origin and recorded
publication evidence for it.
The candidate now has to equal the contextual identity under
`sameRepositoryIdentity`, so every member of `REPOSITORY_IDENTITY_MEMBERS`
participates and the comparison stays in one place rather than becoming a
second partial one. Nothing legitimate narrows: every checkout of a repository
already carries that repository's identity, and a Worktree registers under its
owner's, so longest-containing-checkout selection among a repository's own
checkouts is unchanged.
The regression asks for the refusal at the three surfaces that reach different
things — a local mutation, a publication and a Git host — and observes the
second repository's branch, head, index, working tree and remote refs rather
than inferring them. It counts the authentication sessions the host opened and
the credentials the Git host was asked for, so "nothing was reached" is
measured. Two controls keep it from passing vacuously: the same document shape
reaching every one of those boundaries when the identity does match, with the
session counter non-empty there under the same fixtures, and a Worktree of the
Repository in scope still operating when entered by its returned path.
* 🐛 Stop the ordinary-run tier depending on the host's Git identity (#643)
Two CI-only failures, both in this tier's own tests.
`refsOf` used `toSorted()`. The Node shards run
`tsc --project tsconfig.node.json`, which targets ES2022, so the call does not
exist there — TS2550, before a single test runs, on all five shards. Reverted
to `sort()`, which is what the neighbouring helpers in this tier already do:
the array being sorted is the one `map` just made, so there is nothing of
anyone else's to mutate.
Eleven cases then failed on `UnresolvedGitIdentityError` — ORC3, ORC4, ORC5,
four in ORC14, three in ORC15 and one in ORC17. They reach `<Git.Commit>`
without saying who the commit is by, so the provider fell through to its
production default and read the *host's* Git configuration. That passes on a
machine with `user.name` set and fails on every CI runner, which is to say the
suite was asserting something about who ran it rather than about the document.
`runOrdinaryDocument` now installs a fixed identity, spread first so a case
that supplies its own reader still wins — which is how the ORC13 cases that are
*about* identity resolution keep working, including the one that proves
`<Git.Commit>` refuses when the host can say nothing.
Verified by reproducing the runner rather than trusting the reading: with
`user.useConfigOnly` set and no configuration file, `git var GIT_AUTHOR_IDENT`
fails exactly as it does in CI, and the four suites went from 6 failed
(11 steps) to 17 passed (60 steps). They also still pass with an identity
present, so neither direction is assumed.
---------
Co-authored-by: Taras Mankovski <[email protected]>
1 parent 1721c06 commit fef5de8
19 files changed
Lines changed: 5462 additions & 5 deletions
File tree
- packages/workflow
- src/deno/run-composition
- tests
- support
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
2384 | 2388 | | |
2385 | 2389 | | |
2386 | 2390 | | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
2390 | 2395 | | |
2391 | 2396 | | |
2392 | 2397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
0 commit comments