Repository navigation
Commit 392c006
authored
* ✨ Expose the repository vocabulary to an ordinary xmd run (#643)
The provider exists; this is what reaches it. The Deno source entrypoint and the
compiled binary install it for `xmd run` and for an approved `xmd plan --run`,
parameterized by the same credential-helper assembly the workflow host uses and
by the two existing host configurations, both read and validated before a
document expands rather than in the middle of one.
Node and Bun register the same thirteen declarations and install no operational
provider, so `xmd syntax` describes one language everywhere and every repository
operation on those runtimes reaches a clear provider-absence error before a
lock, a credential, a subprocess or a request exists. That is the whole
implementation of the portable half: one array, declared once, with three
consumers — the workflow attachment, `xmd syntax` and `xmd plan`, and an
ordinary document execution.
`run-repositories.ts` names the managed root and the unsupported installer and
is on the shared command path; `deno-repositories.ts` assembles the live
provider and is imported only by the two Deno entrypoints. The split is load
bearing rather than tidy: the adapter's module graph reaches `node:sqlite`,
which Bun has no built-in for, so a static import from shared code would stop
`xmd` loading on Bun entirely instead of refusing one operation.
A nested `<Execution host="run">` child installs no provider here. Giving a
child a live one is inseparable from placing it in the document's contextual
repository — a child that had authority but discovered the process directory
would operate on a checkout nobody named — so both land together, later,
as one change. At this level `xmd test`, a nested child and a workflow execution
all reach provider absence.
The public specifications describe the ordinary profile, the compiled smoke
proves the provider and its kernel-released lock survive `deno compile`, and CI
carries the smoke as its own step.
* ✨ Give an ordinary xmd run the repository vocabulary, root and nested (#643)
The provider exists; this is everything that reaches it. The Deno source
entrypoint and the compiled binary install it for `xmd run` and for an approved
`xmd plan --run`, parameterized by the same credential-helper assembly the
workflow host uses and by the two existing host configurations, both read and
validated before a document expands rather than in the middle of one.
Node and Bun register the same thirteen declarations and install no operational
provider, so `xmd syntax` describes one language everywhere and every repository
operation there reaches a clear provider-absence error before a lock, a
credential, a subprocess or a request exists. One array, declared once, with
three consumers: the workflow attachment, `xmd syntax` and `xmd plan`, and an
ordinary document execution.
`run-repositories.ts` names the managed root and the unsupported installer and
sits on the shared command path; `deno-repositories.ts` assembles the live
provider and is imported only by the two Deno entrypoints. That split is load
bearing rather than tidy: the adapter's module graph reaches `node:sqlite`,
which Bun has no built-in for, so a static import from shared code would stop
`xmd` loading on Bun entirely instead of refusing one operation.
A nested `<Execution host="run">` child is an ordinary run whatever command
hosts it, and gets what one gets: a provider instance of its own — its own
invocation identity, leases and Push evidence — and the working directory the
`<Execution>` was written in. Those two are one thing. A child is a root
execution in a scope that does not descend from the document's, so it inherits
no `API.Env` handler and would otherwise stand in the *process* directory: a
`<Dir>` would scope every component inside it except the child, and the child's
own provider would discover its ambient Git from whatever checkout the process
happened to be launched in. Authority without placement is worse than neither,
so the contextual directory is captured on the last line still inside the
invocation, carried privately on `ChildInvocation`, and installed ahead of the
root, the provider and the execution.
Evidence: ORC1–ORC19 and ORC21, the retained workflow regression, the compiled
smoke, and portable parity under Node and Bun.
* 📝 Specify persistent Dir creation (#643)
* ✨ Make <Dir> create the directory it names (#643)
`<Dir path>` installed a working directory and created nothing, so a document
that named a directory which was not there ran its content somewhere that did
not exist. It now performs one provider-neutral directory act before it installs
cwd and before any content expands.
`API.Files` gains a mandatory `ensureDirectory`. It recursively creates a
missing target, succeeds for an existing directory without replacing it or
clearing its contents, and refuses a file or another non-directory at the target
or on the way to it. Success carries nothing at all — no path, no handle, and no
word on whether this call is what created it — for the same reason `deleteFile`
carries nothing: a document that asked for a directory to exist has been
answered by its existence, and a caller that could tell the two apart would be
branching on a race.
The host provider creates directly and persistently. There is no rollback and no
teardown removal: a later failure of the content running inside a directory says
nothing about whether the directory should exist. It is also the one operation
here that accepts an absolute path, which is `<Dir>`'s established exception, so
it resolves its own destination rather than inheriting the rule that refuses one.
The workflow provider publishes one `workspace_file` effect. The recursive
creation runs inside its savepoint, so a refusal after a partial creation leaves
neither the parent nor a rolled-back transaction — the effect that follows still
commits. An absolute path there is a logical Workspace path used as written, and
names nothing on the host.
Shared `<Dir>` calls only `API.Files.ensureDirectory`, through core's door that
turns an illegal provider throw into a fenced failure. It reaches no `API.Fs`,
no `@effectionx/fs`, no runtime API and no Repository composition, and it
changes no Repository selection or identity member.
`allow={["write"]}` now authorizes persistent recursive creation, so the pinned
paired identity is versioned to
`@executablemd/workflow/composition/dir-v2#Dir`. A continuation retaining the
former identity — which authorized placement that created nothing — refuses
before generated execution and before any mutation.
The thirteen composition components take their accepted descriptions.
Evidence: HF15b, HF24–HF28, FF2, the compiled contract probe, WF23–WF26,
WGAC17, ORC6–ORC6i, runtime parity under Deno, Node and Bun, and ORC20.
* 🧪 Make the Dir evidence discriminate what it claims (#643)
Seven corrections to the previous feedback commit. The production contract, the
public `ensureDirectory` export, the versioned `dir-v2#Dir` identity and the
thirteen accepted descriptions are unchanged.
`Dir.ts` said "It creates nothing", which the change had made false. Its module
documentation now describes what it does: ensure or create the target, then
expand content there, restore the enclosing directory on the way out, and delete
nothing when it does.
FF2's shipped-component half searched the escaping error for content markers.
That could not tell "the content never expanded" from "the content expanded and
its text is not in this message". Sentinel components record whether they ran,
so the assertion is about expansion rather than about a string.
HF26 and ORC6b covered regular files only. Both now cover the frozen matrix: a
regular file and a supported special entry, each at the target and each as an
intermediate. The special entry is a symbolic link to a file — a link to a
directory is a directory to enter, which is the parity decision both providers
make, so using one would have tested the opposite claim.
ORC6 inferred ordering from a nested `<File>` landing, which proves nothing
because a write creates its own parents. A probe now runs first inside the
region and records that the directory already exists and that the contextual
working directory is the ensured target.
ORC6c inferred cwd restoration after cancellation from where a later run's files
landed, but a fresh execution is handed its cwd explicitly. It now reads the
contextual directory from inside the region and again from the enclosing scope
after the halt.
WGAC17 gains the current-admission control as committed evidence: it resumes,
completes, and publishes no further effect or root. Root invariance is described
as what it is — no published mutation — rather than as a call count, which it is
not: an ensure that found the directory already there would publish no root
either. The call count is WF26's, which decorates `mkdir` and counts it.
Four documentation blocks had been orphaned from their declarations by code
inserted between them, WF23's comment still described the ordering proof it no
longer used, and `logicalTarget` was a generator that never yielded.
* 📝 Prove the generated Dir executed, and say what each observable supports (#643)
Comment and evidence corrections. No production behavior changes.
WGAC17's shared setup now reads the retained ordered `workspace_file` effects
and requires an `ensure-directory` for `/generated` ahead of the nested write to
`/generated/inside.md`. That is what says the generated `<Dir>` actually ran
under the current admission — the fragment's text says what was asked for, and
only the committed order says what happened. Pointing it at a target the run
never ensures fails both cases, since the setup guards each.
The comments now claim only what their observables support. This test proves the
generated Dir effect occurred and that resuming publishes no further effect or
root. WF26 proves a completed `<Dir>` replay makes no second low-level `mkdir`
call. Root invariance proves neither: an ensure finding the directory already
there would publish no root either. The former-identity case no longer claims
anything about a second creation — it establishes refusal before generated
execution or publication, which is its whole subject.
The control's name said "does not create again", which is WF26's claim rather
than this one's; it now names what it proves.
Two stale comments removed: ORC6's header still said the nested `<File>` landing
observes ordering, which the probe beneath it contradicts, and HF26 carried its
pre-revision two-case explanation above the corrected four-case one.
* 🤖 Regenerate the publish workflow for testing's new runtime dependency (#643)
`packages/testing/src/execution-harness.ts` imports `cwd` from
`@executablemd/runtime`, so `packages/testing/package.json` gained
`@executablemd/runtime` — but the workflow generated from those manifests was
not regenerated with it.
The generated graph is what orders publication, so the stale copy had `testing`
waiting only on `core` and `durable-streams`. It could therefore publish before
the `runtime` package it now depends on.
CI checks this in every `test-deno` shard by regenerating and diffing, which is
why all nine failed together and in under a minute, before any test ran.
* 🐛 Write the syntax catalog whole, and state the CLI tier's commit identity (#643)
Two failures, both revealed rather than caused by the previous commit: the
stale publish workflow had been killing all nine `test-deno` shards before a
test ran, so nothing underneath it had been reported yet.
## The catalog was truncated when stdout was a pipe
`process.stdout` is synchronous for a file or a terminal and asynchronous for a
pipe, and the `syntax` case handed its whole document to `write` without
waiting. The run then ended and the process exited with most of the document
still in a buffer, so `xmd syntax --json > file` was whole at 89252 bytes while
`xmd syntax --json | …` stopped at 65394 — inside a token, which is why the
reader saw "Unexpected end of JSON input" rather than a short catalog.
This became visible now because this branch registers the repository
vocabulary in the catalog, which is what first pushed it past the buffer. The
write now waits for the callback, so it finishes before anything can exit.
Only that one write is changed. The other large writes in this file stream in
chunks rather than handing over a single document, and none of them is near the
buffer.
## The CLI tier read the host's Git identity
`runOrdinary` installed the provider without saying who a commit is by, so it
fell through to the production default — the caller's own `git config`. ORC18
and ORC15 therefore asserted something about who ran them: green on a machine
with `user.name` set, `UnresolvedGitIdentityError` on every runner. It now
states a fixture identity, the same correction the workflow tier already
carries. ORC19 was never affected: it commits inside a subprocess whose
environment it builds itself.
Verified against a reproduced runner rather than a reading — with
`user.useConfigOnly` set and no configuration file, the four CLI suites pass
11/33, and the npm-bin suite passes 1/2 with a rebuilt package.
---------
Co-authored-by: Taras Mankovski <[email protected]>
1 parent fef5de8 commit 392c006
51 files changed
Lines changed: 4206 additions & 347 deletions
File tree
- .github/workflows
- packages
- cli
- src
- tests
- support
- core
- src
- tests
- runtime
- tests
- testing
- src
- workflow
- src
- composition
- components
- deno/workspace
- tests
- scripts
- tests
- specs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
225 | 232 | | |
226 | 233 | | |
227 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
Large diffs are not rendered by default.
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
0 commit comments