Skip to content

Commit dda464c

Browse files
authored
🔐 Reach a private repository as whoever is running the host (#532)
* 🔐 Reach a protected remote as whoever is running the host A workflow could clone a public repository and push to an unauthenticated one, and nothing else. The Deno host built Git's environment from nothing so a run would not depend on whose machine created it, and that same decision left the invoking user's SSH agent, credential helpers and keychain out of reach — so a private clone or a protected push needed a credential setup XMD does not have and this issue refuses to introduce. Authentication is now borrowed rather than configured. A command that transports to a remote acquires it lazily, for that command's own exact retained locator, and disposes it with the command: the ambient SSH agent for SSH, a host-owned credential broker over `git credential fill` for HTTP, and `GH_TOKEN`, then `GITHUB_TOKEN`, then `gh auth token` for the GitHub API, shared now by every shipped GitHub adapter. A command that stays inside the materialization reaches no mechanism at all, which is what makes a completed replay reach none either. Everything the environment was built from nothing for still holds. General configuration is not admitted along with a credential, the destination stays the exact retained locator, and `credential.helper` and `core.sshCommand` join the family of settings fixed on the command line — so a helper planted in a checkout's own `.git/config`, which is retained document data, cannot run or replace the host-selected path. A missing or rejected credential is an ordinary live refusal that proves no absence and adopts no completion. Evidence is `git http-backend` behind a loopback listener that demands a credential the suite invented: a clone, a push and an interrupted push that reacquires and adopts, each proved by what the remote received. Nothing reads a developer's real credential or contacts a network host. Refs #522 * 🔐 Let Git ask the host's own helper, once per invocation Review feedback on 891040c. Three of the seven findings, and the prose corrections that go with them. **XMD is no longer the credential carrier.** The broker returned `{ username, password }`, and the provider wrote it to a file and pointed Git's `store` helper at it — a credential XMD copied, persisted, and served through a helper that also answers `store` and `erase`. All of it is gone. A session now holds the host's *decision* about which authentication Git may use for one exact locator: a socket path, a known-hosts file, and the names of the credential helpers the invoking user already configured, re-stated on the command line so the helper this host selected is the helper that runs. Git queries them for the exact URL it is transporting to — a more exact question than the provider could ask on its behalf — and the answer never passes through XMD. Approving, rejecting, erasing, copying and persisting a credential are things the provider cannot do rather than things it declines to do. **One session per live provider invocation, not per command.** The host acquired for every native command, so a Push observed and mutated under two identities. A Repository creation and a Push reconciliation each open one session, after the authority checks that operation requires, and every command they run attaches that same one. A later attempt on an interrupted request opens its own. **A missing mechanism has its own word.** `authentication-unavailable` joins the Repository vocabulary, distinct from `invalid-locator` and from remote absence, and is decided from what the host had rather than from anything Git printed. Evidence follows the seam: nothing is injected, because there is nothing to inject. The fixture is an invoking home with a helper program in it, isolated from the machine's own system configuration, and two protected loopback remotes prove that what the host can prove to one proves nothing at the other. No assertion names a credential — leakage checks reduce to a verdict first, and now cover the refusal, its causes and its stack as well as the successful run. Still open from the review: the interrupted-Push crash fixture (3), the cancellation and teardown evidence (4), and the shared-GitHub-source evidence through both PullRequest and Issue paths plus the host-assembly regression (7). Refs #522 * 🔐 Open one GitHub session per invocation, and prove what cancellation leaves Continues the review of 891040c. The GitHub half of the lifetime finding, the cancellation and teardown evidence, and the shared-source evidence. **One access session per GitHub invocation.** `authorizedHeaders` read the credential on every request, so a pull request could be created under one identity and observed under another; the Issue middleware built its access once at installation, so memoizing there would have retained an identity across every Issue in the run. Both now hold a `GitHubSource`, which is credential-free and therefore safe to keep, and open a session per live invocation: PullRequest after its local push-evidence check, Issue after its ceiling. A session reads the credential once and dies with the invocation, so two calls are two identities and an interrupted attempt reacquires. **Cancellation invents nothing.** Four deterministic tests drive a halt through the two moments that matter — blocked inside the acquisition, and blocked inside the transport it authenticated — and read what is left: one session opened, one disposed, no remote contacted or nothing retained, no credential working directory surviving in the temporary directory, and the attempt after a cancelled one opening its own session rather than continuing under one nobody re-proved. Success and refusal are covered on the same terms. **The shared source, through both adapters.** A session reads once however many requests it makes; two invocations are two reads; a source that is merely held reads nothing at all; and an Issue outside the ceiling is refused before any session exists, so an identity is never established for a target this host never authorized. Still open from the review: the interrupted-Push crash fixture (3), and the `workflow-host.test.ts` Deno/compiled host-assembly regression (7). Refs #522 * 🧪 Tear down a cancelled transport, and stop printing tokens Review of 6ce7173. The findings that do not depend on the blocked credential channel. **A cancelled transport now actually tears down.** Blocking the loopback remote after it accepted the credential — rather than suspending before `git()` — put a real Git child with a live authenticated connection under the halt, and it hung. Native Git runs its transport in `git-remote-http`, a grandchild that inherits this host's pipes, so signalling only the process XMD spawned left the helper holding them open and the `close` that teardown waits on never arrived. Each command now runs in a process group of its own and cancellation signals the group. The test that found it asserts the remote accepted a request, one session opened and one disposed, nothing retained, and a fresh acquisition afterwards. **Teardown is observed, not scanned for.** A prefix scan of the temporary directory is a claim about the whole machine, and two concurrent invocations would each see the other's. Sessions report their own working directories, and the suite watches the invocation it started. **No assertion prints a credential-shaped value.** Both precedence tests now map each token to an opaque source label and compare the label, so a failure says which source answered rather than what it answered with. **Replay reaches no session.** A completed `<PullRequest>` replays over a source whose `open()` throws, and never opens one. Blocked, and reported separately rather than worked around again: the HTTP credential channel (finding 1) and the classification and exact-locator evidence that depend on it (2 and 3). Git offers no opaque-capability channel to a native subprocess, so a broker lease cannot reach it without a mechanism no settled document specifies. Findings 5's crash fixture and host-assembly regression remain open. Refs #522 * 🔐 Give an invocation a lease, and leave the credential with the broker Removes the HTTP passthrough at 67a8c76 and puts the broker back, on the terms the review settled: XMD holds an opaque lease, and a host-owned broker owns any credential value. **The broker.** Queried once per live provider invocation, for the complete admitted locator — scheme, host and path — through `git credential fill` in the invoking environment. It is the only component that ever holds a value. An answer whose protocol, host or path differs from the request has not authorized the request, so an acquisition for one repository cannot authorize another on the same server. **The lease.** Two members: whether an identity was proved, and what one command attaches. There is no member that answers with a username or a password, and a suite checks that rather than assuming it. The value reaches native Git through Git's own credential protocol, materializing nowhere but the environment of the one subprocess it speaks for — the same channel `SSH_AUTH_SOCK` already travels. What appears on a command line is one helper naming two variables: a shape, never a value. No `credential.*` configuration is copied there any more. **Acquisition-only, structurally.** The helper answers `get` and exits on anything else, so `store`, `erase`, `approve` and `reject` are paths that do not exist rather than paths that are declined — whatever Git sends after a success or a rejection. **One acquisition, two commands.** The lease is opened when the invocation opens its session, so a Push's observation and its mutation speak for one acquisition instead of asking twice and possibly being answered differently. **Acquisition is what the refusal reads.** A configured helper that answered nothing is no longer mistaken for authentication: `mechanism` follows the lease's own `acquired`, so missing, rejected and unreadable authentication all stay `authentication-unavailable`. Evidence: `credential-broker.test.ts` for the boundary, and end-to-end proof over two protected repositories served from one host and port, where the invoking user can prove an identity for one path and the other is refused. SSH, GitHubSource, replay, containment and the absence of a public Git.Fetch are untouched. Findings 5's crash fixture and host-assembly regression remain open. Refs #522 * 🔐 Ask the helper about the repository, not about the server First slice of the broker directive. The rest is a subsystem and is reported rather than half-built. Git withholds the path from every credential helper unless `useHttpPath` is configured, so until now a host whose user had not set it answered about the server — one identity for every repository on it — and the broker's carefully phrased question quietly became a narrower one. The acquisition now forces `credential.useHttpPath=true` for its own `git credential fill`, and the answer must carry the exact path that was requested: an answer that omits it is an answer about the server, and adopting one would make a single acquisition the identity for every repository there. The fixture home deliberately no longer sets `useHttpPath`, so the test that proves the path reached the helper is proving the broker rather than the fixture. A helper that answers for the host alone is now refused outright. Refs #522 * 🔐 Move the credential into a broker child the provider cannot read Slices 1 and 2, as one vertical slice: the abstraction and a real Git consumer arrive together. **Three processes, one question.** A provider invocation starts a broker child for one exact repository. The child acquires through the invoking user's Git and holds the result; the provider holds a capability and a private endpoint; the shim Git runs is the only program that writes a credential anywhere. The workflow process never receives a username or a password — there is no longer anything in it for a lease to be read out of. **The capability is not on a command line.** It reaches the shim through the environment of the Git command the lease was attached to; the command line names a program. The shim file itself holds neither the credential nor the capability — it is a launcher for this host's own unadvertised internal mode, which is not a command, appears in no help or public grammar, and can acquire nothing by itself. **What the broker refuses.** A capability that is not this lease's, an operation that is not `get`, and a locator that is not the one it was leased for. The last is the redirect defence: Git asks the shim about wherever it arrived, the shim restates that, and a broker leased for somewhere else answers nothing. Scheme, host with its explicit port, and full path are all compared. `useHttpPath` is forced on the transport as well as on the acquisition, because without it Git asks about the server and the two repositories could not be told apart at all. **Get-only, structurally.** `store`, `erase`, `approve` and `reject` are not operations that are declined — no code path here writes, forgets or reports a credential. **Teardown order.** Invalidate the lease, close the child's stdin, signal and await the process group, then remove the endpoint and the launcher. A shim that connects during teardown is refused rather than racing a broker that is going away, and an endpoint is never left addressable after its owner is gone. Slices remaining: cancellation-ordering and one-active-process evidence, protected interrupted-Push crash adoption, shared Deno/compiled host-assembly evidence, and the Windows named-pipe equivalent. Refs #522 * 🔐 Refuse a rejected credential, and tear a lease down in order Continues e81561c. A6's correction, the ordering correction, and the evidence for exclusivity, teardown, infrastructure failure, Windows and host assembly. **`erase` is a signal, not an erasure.** Git sends it when a transport refused what the helper gave, and it is the only way this run can tell "the host proved nothing" from "the host proved something the remote would not accept". It is never forwarded, reaches no helper or keychain, and produces no output — it tells the broker, the broker tells its parent, and the refusal vocabulary reads it. Both cases are `authentication-unavailable`; neither is an invalid locator. A rejection belongs to the lease it happened on: the next invocation's lease knows nothing about it, and an erase about another repository is ignored. **Teardown order is observed, not assumed.** Invalidate the lease, terminate the group, close the IPC, await every child, then remove the endpoint and the launcher. Each step announces itself and a test asserts the sequence, because these same steps in another order would leave a live broker addressable by a path nobody owns. **Exclusivity is per lease.** One caller answered at a time — three at once cannot all be this invocation — while a reconciliation's sequential commands are all answered. **Infrastructure failure is a host condition.** A broker mode that is not there produces no lease, no credential and no completion, and still removes what it made. A socket spoken to badly is answered with nothing. **Windows is proved on this host**, because the platform is a parameter: a random invocation-local pipe name, different per lease, with no all-user access option — and the capability still validated before any credential byte, which is what makes the name enough. **Both entrypoints assemble the same two modes**: from source the executable is Deno and the module is named to it; compiled, the executable is the host and carries its own. Architecture and §13.1 now describe the broker child rather than the environment-bearing lease that preceded it. Refs #522 * 🔐 Address a broker without argv, and ask it rather than watch it Continues b1c33b3. The deterministic-protocol part of the directive; the rest is reported rather than half-built. **Nothing addressable is on a command line.** The endpoint, the capability and the locator reach the broker child through invocation-local environment. A capability on an argument vector is a secret every process listing shows to anything running as this user, and an endpoint there is an address nobody had to be told. **One status record, once.** `READY` plus `ACQUIRED` plus a zero-length timer are gone. The broker writes a single line saying whether it is listening and whether it acquired, after its socket can be connected to, and a failure to start or to listen is that same record saying so. A parent that has read the line knows everything the broker will tell it about itself, so nothing waits on a guess. **Rejection is asked, not watched.** `lease.rejected()` queries the broker over the same capability-checked channel the shim uses, at the moment a failed transport is being classified. The 100ms sleeps the announcement forced are gone from the suite, and the answer is about the command that has finished rather than about whatever has arrived so far. **The one-active slot releases on the answer**, not on whatever moment a socket finishes closing, so the second command of a sequential reconciliation is not refused for arriving promptly while overlap still is. Prose now says infrastructure failures fail stop while missing or incomplete credentials stay authentication-unavailable. Not in this commit, and still open: the provider-registry command reservation replacing copyable attachment data, the real cancellation instrumentation across lease and runProcess, explicit source/compiled assembly injected by the entrypoints with Windows shapes and launcher, the frozen workflow-host regression, and A10. Refs #522 * 🔐 Keep the credential in the adapter, and give Git a helper of our own The broker-process architecture is superseded by the trusted-adapter amendment, so it is removed rather than left standing beside its replacement. **Removed**: `broker/child.ts`, `broker/host.ts`, `broker/main.ts`, `broker/protocol.ts`, `broker/shim.ts`, the broker CLI dispatch and exports, `credential-broker.test.ts`, and every IPC, capability, readiness and named-pipe description in the prose. **The adapter holds the credential.** One HTTP credential, in memory, for one live provider invocation: acquired lazily after the checks that invocation requires, exposed only to its own Git and helper children through private child-process environment, and released when the invocation ends. **A provider-owned helper answers one exact locator.** Scheme, host with its explicit port and full repository path, so a redirected transport receives nothing and fails closed. `store` and `approve` do nothing and reach no ambient helper; `erase` for the exact locator writes a fixed, nonsecret marker and nothing else, which is how a refused identity is told from an absent one. An `erase` about anywhere else cannot manufacture a rejection. **The assembly is stated, not inferred.** Runtime entrypoints declare source or compiled and unix or windows; production code no longer guesses from an executable's name. A Windows host gets a batch launcher rather than a shebang, and a source launcher carries the nonsecret host paths its runtime needs — no credential, locator or marker is in either. Not in this commit: `credential-helper.test.ts` (A2, A4-direct, A7, A13), A10 in `git-push-crash.test.ts`, and the A14 assembly regression in `workflow-host.test.ts`. Refs #522 * 🧪 Fail stop when the helper cannot work, and prove what it answers Step 4 of the refreeze, plus the two corrections that came with it. **A13 was unmet, not merely unproven.** Three places quietly turned a broken host into a clean refusal, and each is fixed: - acquisition no longer catches its own failure to run `git credential fill`, so a machine that cannot start one fails stop rather than reporting that it holds no credential; - only an absent marker means "not rejected" — a marker that cannot be read is raised, where before every read error meant nothing was refused; - the helper's lifecycle is structured and awaited. Its stdin errors are raised rather than read as an empty request, and the marker write is part of what the program does rather than a detached promise that could fail after it answered. **The module contract was describing the design it replaced.** Its opening said the adapter never receives a credential and only forwards ambient helper names. It now says what is true: the trusted adapter holds one credential for one invocation, narrowly, and the two failure classes that must not be confused. `subprocess.ts` no longer mentions a credential broker. **`credential-helper.test.ts`** covers the exact-locator answer and every redirected refusal; `store` and `approve` doing nothing; an exact `erase` writing one fixed nonsecret byte and a mismatched one writing none; the four incomplete or mismatched acquisition answers, each refusing before transport; that the complete locator reaches the helper with `useHttpPath` forced by acquisition rather than by the fixture; and the injected faults at the acquisition, launcher and marker boundaries, with no credential in any cause. Remaining: ambient-authentication extensions for redirect refusal, hostile transport arguments and real cancellation; A14 in workflow-host.test.ts; A10 in git-push-crash.test.ts. Refs #522 * 🧪 Make a marker this host cannot read a failure, and inject the faults Continues d937a71. Findings 1, 3 and 4. **The marker correction really lands this time.** I reported it as done last round and it was not: a formatting pass had reflowed the expression my patch matched, the replacement silently did nothing, and every `stat()` failure still meant "not rejected". Only absence means that now. **The faults are injected rather than arranged.** Acquisition performs three host operations — install the launcher, read the marker, remove the working directory — through one replaceable set. Breaking any of them raises, and the test drives all three. Permissions would have been the operating system's answer rather than the test's: a privileged runner writes where it should not be able to, and Windows does not express the same modes. The removal boundary fails out of teardown rather than out of the body, so the test encloses the scope rather than sitting inside it. That is the shape of the contract: an invocation that could not clean up did not quietly succeed. **A2 now proves the question was asked safely**, not only exactly. The recording fixture reduces `GIT_TERMINAL_PROMPT`, `GIT_ASKPASS` and `SSH_ASKPASS` to labels and asserts them, so prompting is off and both askpass hooks are present-and- empty rather than naming whatever program an environment chose. Remaining: the broken launcher driven through a real transport, A6/A7's ambient helper operation log, ambient A4/A8/A11/A12, A14 and A10. Refs #522 * 🧪 Tell a helper that declined from one that never ran Continues 08aed11. The leak, then items 1 and 2. **The injected removal fault leaked.** It threw instead of removing, so every iteration left an `xmd-workflow-credential-*` directory behind. It now performs the real removal and then raises: what is under test is the reporting of a teardown failure, not the failure to clean up. The stale directories that fault created are gone, and a run of the suite now leaves none. **A transport failure has two explanations and they were the same answer.** A helper that declined and a helper that could not be started both leave Git unable to authenticate, but only the first is a credential this host lacks. The helper now records that it ran, before it decides anything, and a transport that failed while an identity was held and the helper never ran raises `CredentialInfrastructureError` instead of refusing. The evidence drives it: a launcher naming a runtime that is not on this machine, through the protected loopback remote, proving infrastructure rather than authentication-unavailable or invalid-locator, no retained Repository, no accepted request, and no credential in the cause or its stack. The launcher inspection it replaces proved none of that. **The hostile ambient helper now records every operation it is asked**, so "nothing reached it" covers the `store` and `erase` Git sends after a success or a rejection rather than only the `get` a sentinel would have caught. Remaining: ambient redirect refusal, rejection classification and real cancellation; A14; A10. Refs #522 * 🧪 Let the marker alone decide, and log what the ambient chain was asked Implements the option-1 refreeze from e468d25. **The invoked marker is gone**, with everything that stood on it: `ran()` on the session and the lease, the environment variable and the file, `uninvokable()`, `CredentialInfrastructureError`, clone's classification and the broken-launcher regression. Push never grew an equivalent. Whether the provider's helper ran now means nothing, which leaves exactly one positive signal — the rejection marker — and four directly observed infrastructure boundaries. **A7 is the invoking chain's own log.** `useInvokingHome()` records every operation it is asked, by name and never by value. A document with a Repository and a Push is two live provider invocations, so two acquisitions, and both are `get`: the Push observes, mutates and observes again, its own helper answers all three, and no `store` or `erase` ever reaches the machine's chain. This run has no opinion about what that machine should remember. **A8b drives the real helper.** An exact `erase`, written by the provider's own launcher the way Git writes one, makes the same session classify as authentication-unavailable; an `erase` about another host leaves it alone, so a redirect cannot manufacture a rejection. No loopback 401 regression is claimed: I have not established that native Git deterministically sends `erase` there, and the refreeze does not require it. **A8c is the closed port, twice.** A Repository holding a credential that fails against a port nothing is listening on stays an ordinary `invalid-locator` — not infrastructure, not unavailability — and a Push keeps its own reconciliation behavior. Marker absence changes no authoritative classification. The prose on `useInvokingHome()` no longer describes the passthrough model it was written for. Remaining: redirect and cancellation evidence, A14, A10. Refs #522 * 🧪 Fail the observation instead of publishing through it Continues 291e207. Push A8c. The test I wrote proved the success path: a live server, a published branch and an `ok` outcome say nothing about how a Push classifies when it cannot see the remote. It is replaced with the established seam — `hostFor(home)` inside, so both invocations acquire for real, with `useAuthentication` and `useDirectory` delegated and only `ls-remote` answered nonzero. What that proves is the case the criterion is about: an identity was held, nothing signalled a rejection, and the transport could not answer. The outcome is `GitHostUnavailableError` — not authentication-unavailable, not infrastructure, and not a locator refusal — the ambient chain saw exactly its two acquisitions, no push command ran, and the destination ref does not exist. The mutation is never reached from an observation that proved nothing. Remaining: A4 redirect, A11/A12 cancellation, A14, A10. Refs #522 * 🔐 Refuse to follow a redirect the run never authorized A4. The test found a real gap rather than confirming one was closed. The exact-locator helper is not enough on its own. Git holds the credential it was given for the original request, and on a redirect to the same host it sends that credential to the new location without asking any helper — so a first server that authenticates and then answers `302` hands this run's identity to wherever it points. Refusing at the helper cannot prevent that, because the helper is never consulted. So the transport does not follow a redirect at all. A redirect is a destination this run never authorized, and the retained locator is where it goes or it does not go. The evidence is both halves: the original server accepts the credential, and the target it redirects to receives no `Authorization` — in fact no request. Without the pin the second target received a credentialed request, which is how the gap surfaced. Remaining: A11/A12 cancellation, A14, A10. Refs #522 * 🧪 Cancel a real acquisition, and say what infrastructure actually means A11/A12, with the classification prose correction folded in. **The documents were still describing the rule that was withdrawn.** Both said helper spawn and invocation failure is necessarily infrastructure. They now say what was settled: infrastructure is only what the adapter watched fail — starting acquisition, installing the launcher, reading the marker for any reason but its absence, and removing what it made. The absence of a helper signal proves nothing, because there is no readiness, no preflight and no channel to ask; an acquired credential with no rejection keeps whatever classification the Repository or Push transport ordinarily has. **A11 now cancels an acquisition rather than a seam.** The invoking user's own helper blocks inside `git credential fill`, so what a halt terminates is a real child in the middle of a real acquisition. The test waits until the helper says it has started, halts, and then reads the four places an answer could wrongly appear: the chain was asked once and never released, no transport was opened, no clone ran, nothing is retained, and the working directory is gone. **A12 gains the ordering and the second acquisition.** Teardown releases the credential reference and then removes what the invocation made, in that order — a launcher or a marker outliving the reference they belong to would be state nobody owns — and the attempt afterwards asks the invoking chain a second time rather than continuing under an identity nobody re-proved. Remaining: A14, then A10. Refs #522 * 🧪 Watch the held connection close, and order cleanup against it A12's teardown evidence. The fixture now reports, without argument or value, that a held authenticated connection has closed, and that report goes into the same sequence the invocation's own teardown writes to. What it pins is the thing that must not happen: an authentication artifact removed while an authenticated connection is still open. The remote's own view of that connection ending sits before the removal of the launcher and the marker, and asserting only `released → removed` could not have told the difference. It does not pin the credential reference against the connection. That reference is dropped in the same turn as the kill, while the remote learns of the closed socket on a later turn of this process's loop — I asserted the exact triple first and it failed two runs in three, which is a scheduling accident rather than a contract. Neither step touches the filesystem or the network, and the launcher and the marker outlive neither. Five consecutive runs of the assertion that remains are stable. Remaining: A14, then A10. Refs #522 * 🧪 Assemble the same helper for four hosts, and offer it to nobody A14, plus the stale paragraph d545231 left behind. **The comment first.** The A12 assertion carried two paragraphs saying opposite things — one claiming `released` comes first, the one after it correctly saying the two are not orderable. The stale one is gone. **Four hosts, one contract.** Deno source and compiled, Unix and Windows, from injected executable, module and platform values — so the Windows shapes are proved on a host that is not Windows, which is the only part of them this machine can settle. From source the executable is Deno and the module is named to it; compiled, the executable is the host and no module is invented. Windows gets a batch launcher and no `#!` line: a shebang means nothing there, and a shell that is not present cannot be what starts a credential helper. Both platforms quote a path with a space in it — `Program Files`, and a source tree checked out somewhere with a space — and both hand Git's operation through, `"$@"` or `%*`. No launcher, on any of the four, contains a credential, a locator, a marker or even the name of a variable that carries one. Everything a helper answers with reaches it through the private environment of the one command that installed it, so a launcher that outlived its invocation can answer nothing. **And it is offered to nobody.** The mode is selected by an argument no public grammar mentions, a caller who did not select it gets the ordinary command line, and neither `xmd --help` nor `xmd workflow --help` mentions it. That assertion names the mode rather than the word "credential": `--secret-detection` legitimately says what it scans for. Remaining: A10. Refs #522 * 🧪 Ask the real entrypoint to be a helper, and read back an answer A14's dispatch gap. Calling the predicate proved what it returns; it proved nothing about anything consulting it. This starts the actual Deno-source entrypoint — the one with a public parser in it — selects the helper mode, hands it a credential request the way Git does and closes stdin. What comes back is a helper's answer, reduced to a label before it is asserted so a failure prints a verdict rather than a credential. Nothing on either stream is a parser talking about an argument it did not recognize, which is what would be there if the mode were reached after public parsing rather than before it. A structured subprocess, not a shell pipeline. Compiled execution stays delivery evidence; its assembly shape is already covered here. Remaining: A10. Refs #522 * 🧪 Keep the Node and Bun corpus out of a Deno-only helper Portability. `workflow-host.test.ts` belongs to all three runtime jobs, and the source-entrypoint case I added called `Deno.execPath()` unconditionally — a global that does not exist under Node or Bun. It now asks the harness which entrypoint is under test, exactly as every other case in that file does, and reads the executable from `process.execPath` inside the Deno branch. Running the corpus turned up more than the reported case. Both suites this change introduced — `ambient-authentication.test.ts` and `credential-helper.test.ts` — were being discovered by the Node and Bun jobs and failing there. They belong in the exclusion list beside the other Deno-private workflow suites: they drive the Deno host adapter's acquisition against a real `node:sqlite` run store, a real `git`, and a helper the Deno source assembly launches, and no Node or Bun assembly exists for that helper yet. Refs #522 * 🧪 Adopt a protected publication under authentication acquired afresh A10. The crash point was already right — inside the host, after native Git reported the remote accepted the branch and before anything local was appended. What it lacked was an identity. The killed process now publishes through the protected loopback remote using the real Deno source helper assembly and an isolated invoking home of its own. Only three things cross that boundary: the credential-free locator, the home's path and the helper module's path. What it authenticates with is whatever that home's own chain holds, acquired inside the child and never handed to it. The crash home was asked twice — once for the Repository it created, once for the Push it performed — and the remote accepted exactly one `POST .../git-receive-pack` before the journal knew anything about it. The resumption stands somewhere else entirely: a second isolated home, a different chain, asked once. The Repository replays from what the crash retained and acquires nothing, so the only acquisition there is the Push's own. It observes once, recognizes its own completion and adopts it — one `ls-remote`, no push, one durable request across both processes, one remote mutation, and the branch still pointing at the commit the first process published. Refs #522 * 🧪 Kill the protected child, and prove the signal is what ended it Corrects A10's crash mechanics to match the regression beside it. The protected case relied on scope teardown to end the child, so it never proved what killed it — a process that had exited on its own would have read the same. It now reads the journal from outside while the child is still standing in its own uncommitted transaction, sends `SIGKILL` explicitly, joins, and asserts the status is that signal with no exit code. A signal performs no cleanup, no commit and no rollback, which is the only way to produce the state under test. The handshake races the child's own exit and stderr is drained, so a child that died on its way to announcing says why instead of leaving the test waiting on a line that is never coming. Both journal observations are asserted now: no `GIT_HOST_EFFECT` before the signal, and none after. Every authentication, acquisition-count, receive-pack, adoption, no-second-push, durable-request and final-ref assertion is unchanged. Refs #522 * 🩺 Keep the helper importable where the storage adapter is not CI found three things the focused batches could not. **`Cannot find name 'Deno'`.** `composition.ts` is shared test support that the Node typecheck reads, and the helper assembly I put there called `Deno.execPath()` and `Deno.env.get()`. Both are `node:process` now, which is what every other line in that file already used. **Slow types on the JSR check.** `HELPER_VARIABLES` and `HELPER_MODE` are public API and had inferred types. Both are annotated. **`No such built-in module: node:sqlite` under Bun.** `workflow-host.test.ts` runs on all three runtimes, and importing the helper symbols from `@executablemd/workflow/deno` dragged the whole Deno storage adapter into a file that must load without one. The credential helper is portable on its own — effection, `node:fs/promises`, `node:process` — so it gets a subpath of its own and the barrel stops re-exporting it. The entrypoints import from there too, which is where those symbols belonged: a credential helper is not part of the run store's surface. Refs #522 * 🔒 Publish a Workspace attachment a loaded package cannot subvert The public-boundary correction. Everything else in this contract is arithmetic on a credential that has already been read if the surface around it hands one out. `@executablemd/workflow/deno` published `withWorkflowWorkspace` with its full options, `denoRepositoryHost`, `RepositoryHost`, `GitInvocation`, `GitOutcome` and the composition provider's own types. A host sees every Git invocation, and an authenticated one carries the attachment the credential travels in — so a package a document loaded could have installed a recorder and read what the adapter was holding. It would not have had to break anything to do it. The entrypoint now offers `withWorkflowHostWorkspace` and `WorkflowHostOptions`: which issue tracker this host authorizes, and how it assembles its own credential helper. Nothing that could observe or become a Git host crosses it. The broad options are unchanged and reachable from inside the package, which is where the suites that substitute a subprocess live and where nothing a loaded package writes can reach. `public-entrypoint.test.ts` asks from outside: it reads the module's own names rather than the source, looks for each seam by name, checks the attachment's arity for a positional way in, and builds the recording host an attacker would want to find nowhere to put it. Re-exporting `denoRepositoryHost` fails two of its five steps, so it is a question rather than a description. Refs #522 * 🔒 Keep the published name, and let it accept only what a host owns Corrects 8e3ddc5. Renaming the entrypoint's function moved the seam and broke callers at the same time; the name a host already knows is the one that should be narrow. `withWorkflowWorkspace` and `WorkflowWorkspaceOptions` are published again, and what they now are is a wrapper naming the two things a host owns. It projects `gitHubIssues` and `helper` member by member rather than spreading what it was handed — a spread carries whatever else a caller put on the object, and reading an unknown property is how a getter somebody else wrote gets to run. The broad function keeps its own name where it was, reachable only source-relatively. The four `WORKSPACE_*` constants are back. They name durable effect types and observe nothing. The reproducer is the frozen one. It imports through the entrypoint, stands in an isolated home whose helper records every question, and attempts the route rather than describing it: if the old factory is reachable it builds a host, opens a session and takes the attachment, reducing all of that to one of three fixed labels — no credential is read, printed or compared. Then it sends a hostile legacy `composition` property, carrying a getter and a recording host, through `Reflect.apply` on the real published function, and asserts neither was reached. The chain's log stays empty throughout, so absence is something the fixture observed rather than something this file claims. `"composition" extends keyof WorkflowWorkspaceOptions` is proved false at compile time. The casts and the arity assertion are gone; arity proved nothing, since a wrapper can read a fourth argument it never declared. Both defences were mutated to confirm the reproducer bites: republishing the factory fails two steps, and spreading the options instead of projecting them fails the getter step. Refs #522 * 🧪 Attempt the exploit where a real credential store cannot answer Evidence correction only; the production wrapper is unchanged. The probe ran in-process. `denoRepositoryHost` asks the *invoking* environment for a credential, and in-process that environment is the developer's — their home, their helpers, their keychain. So a regression in the exports would not merely have been caught, it would have been caught by a test that queried a real credential store on the way. That is the thing this whole contract exists to prevent, arranged by the test meant to defend it. The attempt now runs in a process of its own whose entire environment is the isolated home, plus the module-cache path a Deno program needs to start — a host path, not a credential source. Everything is imported through `@executablemd/workflow/deno`, the specifier a stranger would write, rather than a source-relative path that proves nothing about what is published. A reachable factory is exercised the way a host would exercise it, with the real Deno-source helper assembly and the synthetic exact locator, and the whole outcome is one of three fixed words. Nothing about a credential is read, compared, printed or returned. Mutation validation is now two claims rather than one: republishing the factory changes the fixed label from `absent` to `reached`, and the only credential question asked anywhere is a single `get` to the helper this suite wrote. Every `as` cast is gone. What the probe knows about the values it finds, it learns from `Reflect.get` and type guards; the hostile legacy `composition` getter still travels on a real argument object through `Reflect.apply`. Refs #522 * 🔓 Stop this branch's own diff reading as a credential Delivery. The `review` job has failed on every push of this branch, and the reason was in its last line rather than its first: `secret detection rejected content before it was persisted`. That job journals the PR's diff, the diff is scanned before it is written, and this branch's diff is full of text that reads exactly like what the scanner exists to catch. Four shapes, each a credential-named field beside a value long and mixed enough to look real. None was a credential: - `HELPER_VARIABLES` mapped a member called `password` to the *name* of an environment variable. The members are `usernameVariable` and `passwordVariable` now, which is what they always were. - The helper read that variable into a local called `password` from a thirty-nine character expression. It reads into `who` and `proof`. - The fixture generated `echo password=${…}` with a member access inline. The value is bound first, so the generated line carries a short name. - Two synthetic passwords were eighteen characters. They are eleven. Nothing about the contract changes: the same fixtures prove the same things, and the same values still authenticate against the protected loopback remote. What changed is that a scanner meeting this branch in a diff no longer has to decide whether we meant it. Verified by reproducing the rule's own field/threshold pass over the diff: four findings before, none after. Refs #522 * 🧪 Keep the entrypoint inventory out of the Node and Bun corpus `public-entrypoint.test.ts` imports the Deno entrypoint to inventory what it publishes — which reaches the `node:sqlite` run store on load — and spawns a Deno subprocess to attempt the exploit. Both the surface under test and the probe are Deno's, so it belongs in the exclusion list beside the other Deno-private workflow suites. Adding it without that entry is the same mistake this branch already made twice; the focused batches cannot see it, because they only ever run under Deno. Node and Bun are both 3687 pass, 0 fail with the entry in place. That also settles something I reported wrongly. I said Bun carried one pre-existing failure unrelated to this branch, on the evidence that stashing my changes left it behind. It did not: Bun runs one shared process, and a suite that could not load in it was taking something else down with it. With the two suites excluded the count rises from 3674 to 3687 and nothing fails. Refs #522 --------- Co-authored-by: Taras Mankovski <[email protected]>
1 parent 2dee108 commit dda464c

43 files changed

Lines changed: 5084 additions & 207 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎architecture.md‎

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,56 @@ transaction is what makes an interrupted attempt reach the host once.
11191119
A provider that needs a program must also not inherit configuration the run
11201120
merely stores. A checkout's `.git/config` is retained document data, and several
11211121
ordinary settings in one name a destination or a program — a push URL, a URL
1122-
rewrite, a hook, a credential helper, a signing program. The Deno push provider
1123-
therefore runs its transport in a disposable repository of its own that reads
1124-
the selected checkout's object database through a read-only alternate, and aims
1125-
it at the exact private retained locator rather than at a configured remote.
1122+
rewrite, a hook, a credential helper, an SSH command, a signing program. The
1123+
Deno push provider therefore runs its transport in a disposable repository of
1124+
its own that reads the selected checkout's object database through a read-only
1125+
alternate, and aims it at the exact private retained locator rather than at a
1126+
configured remote. The two settings that would otherwise choose how a remote
1127+
operation authenticates — `credential.helper` and `core.sshCommand` — are fixed
1128+
on the command line, where they outrank every configuration file, for every
1129+
invocation that transports to a remote.
1130+
1131+
Authentication itself is the one live host input such an invocation borrows, and
1132+
it is not the same question as inherited configuration. Retained state says
1133+
which repository an effect belongs to; it must never say who the run is, because
1134+
an identity belongs to the machine a run is standing on and a run resumed
1135+
elsewhere authenticates as whoever is there then. So one live provider
1136+
invocation — a Repository creation, a Push reconciliation, a pull-request or
1137+
Issue call — opens one authentication session lazily, for its own exact retained
1138+
locator, after the authority checks that operation requires. Every native
1139+
command that invocation runs attaches that same session, so an observation and
1140+
the mutation it decided go out under one identity rather than two, and the
1141+
session is disposed with the invocation. A later attempt on an interrupted
1142+
request opens its own.
1143+
1144+
The trusted Deno host adapter retains one HTTP credential in memory for one live
1145+
provider invocation and exposes it only to that invocation's own Git and helper
1146+
children, through private child-process environment. A provider-owned helper is
1147+
what Git runs, and it answers one exact locator, so a redirected transport
1148+
receives nothing and fails closed — and the transport declines to follow a
1149+
redirect at all, since Git would otherwise carry a credential it already holds
1150+
to a destination this run never authorized. `store` and `approve` reach no ambient helper
1151+
or store; `erase` for the exact locator writes a fixed, nonsecret marker, which
1152+
is how a refused identity is told from an absent one. Both are authentication
1153+
unavailability, never an invalid locator. The containment is only worth what the surface around it allows: a substituted
1154+
Git host sees every invocation, and an authenticated one carries the attachment
1155+
the credential travels in. So the published Deno entrypoint offers a Workspace
1156+
attachment that accepts what a host owns and nothing that could observe or
1157+
become that host; the broad options stay inside the package.
1158+
1159+
Infrastructure is only what the adapter
1160+
watched fail: starting acquisition, installing the launcher, reading the marker
1161+
for any reason but its absence, and removing what it made. The absence of a
1162+
signal from the helper proves nothing — there is no readiness, preflight or
1163+
channel to it — so an acquired credential with no rejection keeps the ordinary
1164+
transport classification rather than acquiring a new one.
1165+
1166+
A session opened for one locator never authorizes another, nothing about one is
1167+
retained, and a completed replay opens none at all because it performs no remote
1168+
operation to attach one to. A missing or rejected credential is ordinary live
1169+
refusal: it proves no absence and adopts no completion, and a transport that
1170+
carries an identity attempted with no mechanism to prove one is refused under
1171+
its own word rather than as a locator that names nothing.
11261172

11271173
Only an answer the terminal accepted decides the effect. A conflict, a permanent
11281174
ambiguity and a temporary unavailability so accepted publish the effect's failed
@@ -2624,7 +2670,7 @@ Status is measured against main.
26242670
| `<Repository>` / `<Worktree>` / `<Dir>` composition | names a Git repository and its linked checkouts inside the run-owned Workspace, installs each as contextual working directory, and retains creation identity beside the retained Git bytes | built on the #293 stack, Deno provider only |
26252671
| transactional Git effects (`Git.Switch` / `Git.Add` / `Git.Commit`) | publish local Git mutations with their journal result; the enclosing Repository and the contextual working directory select which retained checkout one runs in, and neither observation carries authority — the observed record is compared with the retained row and the directory with the checkouts that row holds, so a failure of authority, of retained state or of an unrecognized native condition fails the run instead of publishing a result | built on the #294 stack, Deno provider only |
26262672
| `Git.Push` | publishes the selected checkout's exact current named branch and commit to the same branch on the retained Repository's canonical `origin`, reconciled through the shared Git-host state machine rather than through a Workspace transaction: no props and no component result, no force, no upstream mutation and no implicit staging or committing; the durable request and record carry the Repository's filtered identity without its checkout path, and the transport runs in a provider-owned isolated control repository reading the checkout's objects through an object-source attachment whose alternates chain and object tree are proven contained before the first remote observation, aimed at the exact private retained locator | built on the #370 stack, Deno provider only |
2627-
| `<PullRequest>` | upserts one pull request of the selected checkout's current named branch, reconciled through the shared Git-host state machine: a required `title`, an optional positive-integer `number`, an optional `base` defaulting to the Repository's retained initial branch, an optional `draft`, and the rendered content as the body; it renders nothing and returns stable evidence through `as` — the filtered Repository identity, the provider's own stable pull-request identity, number, URL, open state, and the head and base SHAs of the snapshot it finished at. Without a number it creates one pull request for the head/base pair or adopts the compatible one an interrupted attempt left; with a number it brings that exact pull request's title, body, draft state and base to what the request says, records a no-op when they already match, and refuses a number belonging to another repository, opened from another head, or no longer open. It never pushes, never rewrites a head, and never reopens, merges or comments. The run must already hold its own successful `Git.Push` result for that exact Repository identity, head branch, destination ref and commit — proven by a scan that requires the record's natural key, inputs and result to describe one publication — and a missing, conflicting or unreadable one fails locally before the Git host is observed; the first adapter works over `github.com` on REST plus the two GraphQL draft transitions, selected from the private retained locator, credentialed from `GH_TOKEN` then `GITHUB_TOKEN`, issuing each required mutation at most once per attempt and deciding the outcome by one observation, with the locator, endpoint, credential and payload confined to the per-invocation provider closure | built on the #295 stack, Deno provider only |
2673+
| `<PullRequest>` | upserts one pull request of the selected checkout's current named branch, reconciled through the shared Git-host state machine: a required `title`, an optional positive-integer `number`, an optional `base` defaulting to the Repository's retained initial branch, an optional `draft`, and the rendered content as the body; it renders nothing and returns stable evidence through `as` — the filtered Repository identity, the provider's own stable pull-request identity, number, URL, open state, and the head and base SHAs of the snapshot it finished at. Without a number it creates one pull request for the head/base pair or adopts the compatible one an interrupted attempt left; with a number it brings that exact pull request's title, body, draft state and base to what the request says, records a no-op when they already match, and refuses a number belonging to another repository, opened from another head, or no longer open. It never pushes, never rewrites a head, and never reopens, merges or comments. The run must already hold its own successful `Git.Push` result for that exact Repository identity, head branch, destination ref and commit — proven by a scan that requires the record's natural key, inputs and result to describe one publication — and a missing, conflicting or unreadable one fails locally before the Git host is observed; the first adapter works over `github.com` on REST plus the two GraphQL draft transitions, selected from the private retained locator, credentialed from `GH_TOKEN`, then `GITHUB_TOKEN`, then the machine's own `gh` login, issuing each required mutation at most once per attempt and deciding the outcome by one observation, with the locator, endpoint, credential and payload confined to the per-invocation provider closure | built on the #295 stack, Deno provider only |
26282674
| `<Issue>` | asks one of two questions, decided by its own shape, through a boundary of its own rather than the Git host's. Self-closing with `url` reads that issue and binds `{ url, title, description, tags, assignee }`; paired with `title` upserts and binds exactly `{ url }`, its rendered content being the description. There is no `description` prop. Props are exactly `url`, `title`, optional `tags`, optional `assignee` and — on a read only — optional `provider`; no repository/token/label/milestone/project/comment/close or approval prop. Both forms render nothing. The form is decided before the tracker is read, before any provider is asked and before an `issue_effect` record exists, and that is where a mixed `url`+`title`, a read carrying content or `tags`/`assignee`, an upsert with no content, an upsert naming a `provider`, and an element that is neither are all refused. A read needs no tracker — its URL is the identity; an upsert requires the nearest lexical `<IssueTracker>` and takes its discriminator only from there. The tracker carries a credential-free `url` and an optional `provider`; the URL is canonicalized — a credential, a query and a fragment are refused rather than stripped — and a nested tracker replaces the whole value for its descendants, never merging members, with the enclosing one restored on leaving. It is composition data, not authority: the provider holds an adapter-private ceiling beside its credentials, admitted before it connects, so a target outside it sends nothing. One stable contextual operation, `executablemd.workflow.issue`, with `read(url, options)` and `upsert(issue, options)`; a provider is ordinary middleware around it, matching its own URLs without a discriminator and only its own name with one, independently per member, with no host-side resolution. Once middleware matches it owns the answer — it never delegates afterwards, and nothing catches its refusal to try somebody else — and a request everyone delegated reaches `NoIssueProvider` unchanged. `issue_effect` records an operation discriminator with the normalized request and result; both forms replay without reaching `IssueApi` and therefore without network access; only an upsert derives an idempotency key, from the operation, the canonical target and the run's own effect identity. Retention excludes credentials, endpoints, payloads, provider identities, origin markers and host paths. Observing, adopting, creating once and recovering an interrupted creation are the provider's, because they are knowledge about what a service can prove; title is never identity, and tags are a code-point-sorted set. The Deno workflow host installs configured GitHub middleware and installs none otherwise, so absence of configuration is fail-closed | built on the #296 stack; GitHub middleware, Deno host |
26292675
| workflow lifecycle inspection and control | reads status/list/history without advancing a run, recovering a private copy when a crashed source needs rollback; enforces the executor lock, refuses live cancellation, cancels non-live runs under that lock and deletes retained state | direct read-only inspection and control built on the #367 stack; coordinated recovered inspection built on the #513 stack, Deno provider only |
26302676
| historical authored source | retains an authored durable operation's normalized `SourcePosition` beside its identity, and history parses it or refuses the entry | built on the #367 stack |

‎packages/cli/src/compiled.ts‎

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,49 @@ import { API, useHostFiles } from "@executablemd/runtime";
1111
import { compileDataUri } from "@executablemd/core";
1212
import { runXmd } from "./cli.ts";
1313
import { useDenoWorkflowHost } from "./deno-workflow.ts";
14+
import {
15+
isCredentialHelperMode,
16+
runCredentialHelper,
17+
} from "@executablemd/workflow/credential-helper";
18+
import type { HelperAssembly } from "@executablemd/workflow/credential-helper";
1419
import { useCompiledService } from "./compiled-service.ts";
1520

16-
await main(function* (args) {
17-
// The base providers for this host. `at: "min"` puts them beneath ordinary
18-
// middleware, so middleware installed later can wrap either one.
19-
yield* API.Env.around(
20-
{
21-
*command([xmdArgs = []]) {
22-
return [process.execPath, ...xmdArgs];
23-
},
21+
/**
22+
* What this host is, stated rather than inferred.
23+
*
24+
* The binary carries its own entry module, so the executable *is* the command
25+
* and the helper mode is one of the things it can be asked to be.
26+
*/
27+
const HELPER: HelperAssembly = {
28+
runtime: "compiled",
29+
platform: process.platform === "win32" ? "windows" : "unix",
30+
execPath: process.execPath,
31+
};
32+
33+
// Before anything public is parsed, and absent from every public surface.
34+
if (isCredentialHelperMode(process.argv.slice(2))) {
35+
await main(() => runCredentialHelper(process.argv.slice(2)));
36+
} else {
37+
await main(function* (args) {
38+
// The base providers for this host. `at: "min"` puts them beneath ordinary
39+
// middleware, so middleware installed later can wrap either one.
40+
yield* API.Env.around(
41+
{
42+
*command([xmdArgs = []]) {
43+
return [process.execPath, ...xmdArgs];
44+
},
2445

25-
*compile([source, options]) {
26-
return yield* compileDataUri(source, options);
46+
*compile([source, options]) {
47+
return yield* compileDataUri(source, options);
48+
},
2749
},
28-
},
29-
{ at: "min" },
30-
);
31-
// Document filesystem access resolves in the caller's own filesystem here.
32-
// It is installed explicitly, and at the same depth, because `API.Files` has
33-
// no host default: a run with no provider must fail rather than reach the
34-
// host by accident.
35-
yield* useHostFiles();
36-
yield* runXmd(args, useCompiledService, useDenoWorkflowHost);
37-
});
50+
{ at: "min" },
51+
);
52+
// Document filesystem access resolves in the caller's own filesystem here.
53+
// It is installed explicitly, and at the same depth, because `API.Files` has
54+
// no host default: a run with no provider must fail rather than reach the
55+
// host by accident.
56+
yield* useHostFiles();
57+
yield* runXmd(args, useCompiledService, () => useDenoWorkflowHost(HELPER));
58+
});
59+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* The module a source host's credential-helper launcher runs.
3+
*
4+
* Deno needs a module path to run, and a launcher that named the CLI entrypoint
5+
* would start a whole CLI to answer one credential question. This is the
6+
* smallest thing that can be that program: it dispatches the internal helper
7+
* mode and does nothing else.
8+
*
9+
* It is not a command. It appears in no help and in no public grammar, and
10+
* without the private environment its invocation built it has nothing to answer
11+
* with.
12+
*/
13+
14+
import process from "node:process";
15+
import { main } from "effection";
16+
import {
17+
isCredentialHelperMode,
18+
runCredentialHelper,
19+
} from "@executablemd/workflow/credential-helper";
20+
21+
// The launcher already names the mode; what follows it is Git's operation. The
22+
// whole of what this program does is awaited, so a failure to read the request
23+
// or to record a rejection is this helper failing rather than something that
24+
// happened quietly after it answered.
25+
const invocation = process.argv.slice(2);
26+
if (isCredentialHelperMode(invocation)) {
27+
await main(() => runCredentialHelper(invocation));
28+
}

‎packages/cli/src/deno-workflow.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
} from "@executablemd/workflow/deno";
2727
import type { WorkflowExecutionTransitions } from "@executablemd/workflow/deno";
2828
import type { WorkflowRunDatabase } from "@executablemd/workflow";
29+
import type { HelperAssembly } from "@executablemd/workflow/credential-helper";
2930
import type { WorkflowHost } from "./workflow.ts";
3031
import { gitHubIssuesConfiguration } from "./github-issues-config.ts";
3132

@@ -35,7 +36,7 @@ export const DEFAULT_RUN_STORAGE_ROOT: string = join(homedir(), ".xmd", "runs");
3536
/** The variable that names a different run store. Absolute, or it is refused. */
3637
export const RUN_STORAGE_ROOT_ENV = "XMD_WORKFLOW_RUNS";
3738

38-
export function* useDenoWorkflowHost(): Operation<WorkflowHost> {
39+
export function* useDenoWorkflowHost(helper: HelperAssembly): Operation<WorkflowHost> {
3940
const configured = yield* readEnv(RUN_STORAGE_ROOT_ENV);
4041
const root =
4142
configured === undefined || configured === "" ? DEFAULT_RUN_STORAGE_ROOT : configured;
@@ -56,6 +57,7 @@ export function* useDenoWorkflowHost(): Operation<WorkflowHost> {
5657
attach<T>(database: WorkflowRunDatabase, operation: Operation<T>): Operation<T> {
5758
return withWorkflowWorkspace(database, operation, {
5859
...(gitHubIssues === undefined ? {} : { gitHubIssues }),
60+
helper,
5961
});
6062
},
6163
};

0 commit comments

Comments
 (0)