Skip to content

Commit c00fa82

Browse files
authored
✨ Execute Markdown workflows without Git (#443) (#826)
* ✨ Add source-bundle workflow identity A workflow definition can now be the source itself. The v2 descriptor addresses exact bytes by logical path, so a file outside a repository, an untracked file and a modified tracked file all have one immutable identity before anything retains them. Identity is two domain-separated, length-framed SHA-256 computations over the entrypoint, the canonical source manifest and the component mapping, through the platform's own `crypto`. The exact target stays outside the bundle hash and inside the definition: selecting a section does not change the bytes in the bundle. Host paths, props and retrieval metadata are not members of the shape at all. Parsing is closed and canonical. Logical paths are NFC scalar values without NUL, C0, DEL, backslash or `#`; manifests arrive in UTF-8 byte order with no duplicates, and a parser refuses a malformed order rather than sorting it. Snapshot verification copies the caller's buffers before checking them, so a later mutation of a caller-owned array cannot change what a run would retain. `WorkflowDefinition` stays v1-only here, so existing storage and runtime code remains coherent; storage, lifecycle, journals and artifacts become version-aware in the next commit. Refs #443 * ✨ Retain source-bundle workflow runs A workflow run can now be a run of the bytes it retains. Storage, lifecycle, journals and artifacts each became version-aware by their own identity rather than by widening version 1's, so a Git run keeps exactly the schema, record, descriptor, journal value and artifact bytes it always had. Live storage gains a second immutable inventory. Version 2 keeps every version-1 object byte for byte, replaces `workflow_run` with one that has no base column, and adds the two definition-source tables. Recognition reads the application id, then dispatches on version 1 or 2 and holds the whole inventory to that version's declaration: a hybrid, an extra object or version 0 is the file disagreeing with itself, never a migration candidate. Creating a version-2 run crosses only the trusted lifecycle transition. Public `WorkflowRunStorage.create()` stays version-1 and refuses a source-bundle descriptor, because that request carries a descriptor and no bytes. The transition copies the caller's buffers and holds them to the descriptor before the transaction opens, then writes schema, run, manifest, de-duplicated content, Workspace, lifecycle and the first execution together or not at all. Source is proved before anything moves. A version-2 run's content is re-derived from its own store — every length, every source hash and the bundle hash — and a missing entry, damaged content or a disagreeing hash refuses with the run's lifecycle and journal untouched. A version-1 run's content crosses the host-captured `LegacyWorkflowSourceReader`, which is a direct closure reachable through no Context, Api, component or Plugin; Workflow recomputes the returned root and component blob identities from the bytes themselves before any of it counts as this run's. A creation is held to its own descriptor before persistence, so a host that cannot obtain a Git definition's Markdown never reaches the transaction that would make the run exist. The public and durable `WorkflowRun` is one closed union. Version 1 keeps its exact three members; version 2 records `definitionVersion`, `bundleHash` and its exact target and invents no base or pinned commit. Readers accept either exact member set in any key order and nothing between them. Artifacts keep the physical container at version 1 and dispatch the semantic format from the header. Format 1 keeps its manifest, identity domain and Git closure byte for byte; format 2 has manifest version 2, the `xmd-artifact\0v2\0` domain, its own closed inventory, and one entry/content pair per logical source. The writer selects the format from the run's version and the reader verifies only the format its header declares. Refs #443 * ✨ Start workflows from retained source `xmd workflow start ./notes.md` now runs the file's current bytes. A file outside a repository starts, an untracked file starts, and a modified tracked file runs what it says rather than what its last commit said — because the run retains those bytes before it becomes durable, and a record naming a commit while executing something else was the thing that could not be true. Establishment reads the supplied root once. The logical entrypoint is the file's own final segment, normalized; the containing directory, the absolute path and the invocation working directory never reach the descriptor. Declared components are resolved against the root's own directory, read as bytes, decoded strictly and parsed — so a declaration this command cannot read refuses the start before any storage exists, rather than surfacing the first time a document writes the name. Every source's identity is the hash of the bytes that were actually read, and the descriptor is parsed back through storage's own closed parser before it is offered to anything. Git is provenance now, not retrieval. A start records where it happened when that is cheaply available, as replaceable metadata; a directory that is not a working tree simply has none, and the start is an ordinary start. Nothing reads it back to find a source. After admission the CLI executes the closure the lifecycle authenticated and nothing it read itself. The run id is reported only once the creation transaction has committed, and the post-admission reloads are gone: a candidate that remained a second path to execution would be a second answer to what the run is a run of. `workflow-source.ts` is now only the legacy version-1 Git reader, captured by the Deno host on both the run-host and lifecycle installations and reachable through no Context, Api, component or Plugin. It maps an unreadable object into the categorical failure Workflow declares for it and judges nothing else: Workflow recomputes the returned blob identities itself. Status and history render a source-bundle run by its entrypoint and bundle hash, with no base line and no fabricated commit. Refs #443 * 📝 Specify source-bundle workflow durability A workflow definition is two versions now, and the five authoritative documents say so. Version 2 is a source bundle: the exact bytes themselves, addressed by logical paths and retained with the run, so a file outside a repository, an untracked file and a file edited since its last commit all start and all stay runnable after the original is edited, moved or deleted. Version 1 is unchanged in shape, identity, behavior and bytes, and nothing migrates between them. `specs/workflow-spec.md` states the closed descriptor union and its dispatch by kind, the logical-path grammar, the domain-separated source and bundle hashes and what each commits to, the target's exclusion from the bundle hash and its place in identity, per-version compatible reuse, the two immutable live schema versions and their recognition, what a retained source has to prove, the creation union with its owned copies and one atomic transaction, the order that puts every source check before recovery and admission, the legacy source reader and its validation, and the five source refusals. `specs/xmd-artifact-spec.md` keeps the physical container at schema version 1 and splits the semantic format: format 1 retains its manifest, identity domain and Git closure byte for byte, and format 2 declares its own manifest version, `xmd-artifact\0v2\0` domain, closed inventory and one entry/content pair per logical source. The reader selects the verifier from the header and never reads one version's closure as the other's. `specs/workflow-workspace-spec.md` states the start ordering, the boundary that proves source before recovery, execution records, Workspace attachment or replay, the reference grammar `start` accepts, the fork candidate's independence from the source run and from every file it was read from, and the status shapes that carry no fabricated Git fields. `architecture.md` records the terminology, the two live schema versions, the CLI candidate against the authoritative retained source, and the inventory rows for the definition, the reader and both artifact formats. Two things are stated as undelivered rather than described as done: the artifact-backed fork, which this revision supplies the authenticated source input for, and #822's extraction of `workflowInstallation({ base })` — still the one place this package reaches Git to establish a run. Refs #443 * 🐛 Narrow v1-only test hosts * 🐛 Install the legacy source reader in v1 CLI test hosts * 🐛 Split the Deno-only source-bundle fork tier into its own file * 🐛 Settle a committed run interrupted from the executor hold
1 parent 2231b64 commit c00fa82

75 files changed

Lines changed: 8151 additions & 1136 deletions

File tree

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: 123 additions & 46 deletions
Large diffs are not rendered by default.

‎packages/cli/src/cli.ts‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,9 +1624,9 @@ interface PropsPhase {
16241624
* The immutable definition a `workflow start` established, when it did.
16251625
*
16261626
* Established here rather than later because the props a run is created with
1627-
* are the ones the *pinned* document declares: reading the working tree to
1628-
* build the bindings and then executing the commit would let help and parsing
1629-
* describe a document that is not the one running.
1627+
* are the ones the *retained* document declares: binding against one reading
1628+
* of the file and then executing another would let help and parsing describe
1629+
* a document that is not the one running.
16301630
*/
16311631
established?: EstablishedDefinition;
16321632
}
@@ -1961,7 +1961,7 @@ function exactRoot(root: RootDocumentSource, target: string | undefined): RootDo
19611961
/**
19621962
* The props phase of a `workflow` invocation.
19631963
*
1964-
* `start` reads what the pinned definition declares, so its generated
1964+
* `start` reads what the definition it establishes declares, so its generated
19651965
* `--props-*` arguments are exactly `xmd run`'s for that document. A `fork`
19661966
* reads the same way, from the definition it names as its third argument: the
19671967
* fork is a run of that document, so its props are that document's — merged
@@ -2035,10 +2035,10 @@ function* prepareWorkflowProps(
20352035
return { args, bindings: [], workflow, error: established.error.message };
20362036
}
20372037

2038-
const root = retainedSource(
2039-
established.value.definition.rootDocumentPath,
2040-
established.value.source,
2041-
);
2038+
const { definition } = established.value;
2039+
const root = retainedSource(definition.entrypoint, established.value.source, {
2040+
...(definition.targetPath === undefined ? {} : { target: definition.targetPath }),
2041+
});
20422042
try {
20432043
const document = yield* inspectDocument(root);
20442044
const bindings = buildBindings(document.props);
@@ -3044,11 +3044,11 @@ function* runCommand(
30443044
const helpRequest = takeHelpFlag(evalFlags.rest);
30453045

30463046
// Before the props phase, because that phase establishes a workflow start's
3047-
// definition from Git in order to read what the *pinned* document declares.
3048-
// On a host without workflow support the first thing a caller would otherwise
3049-
// see is whatever Git said about their directory, which is not the reason the
3050-
// command is not going to run. Help is exempt: the grammar is the same
3051-
// everywhere, and describing it costs nothing.
3047+
// definition in order to read what the *retained* document declares. On a
3048+
// host without workflow support the first thing a caller would otherwise see
3049+
// is a refusal about their document, which is not the reason the command is
3050+
// not going to run. Help is exempt: the grammar is the same everywhere, and
3051+
// describing it costs nothing.
30523052
let workflowHost: WorkflowHost | undefined;
30533053
if (!helpRequest.requested && namesWorkflow(helpRequest.args)) {
30543054
try {

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
import type { WorkflowExecutionTransitions } from "@executablemd/workflow/deno";
3333
import type { WorkflowRunDatabase } from "@executablemd/workflow";
3434
import type { HelperAssembly } from "@executablemd/workflow/credential-helper";
35-
import { readDefinitionSource } from "./workflow-source.ts";
35+
import { readLegacyDefinitionSource } from "./workflow-source.ts";
3636
import type { WorkflowHost } from "./workflow.ts";
3737
import { gitHubIssuesConfiguration } from "./github-issues-config.ts";
3838
import { gitHubPullRequestsConfiguration } from "./github-pull-requests-config.ts";
@@ -57,13 +57,17 @@ export function* useDenoWorkflowHost(helper: HelperAssembly): Operation<Workflow
5757
const gitHubPullRequests = yield* gitHubPullRequestsConfiguration();
5858
return {
5959
useRunHost(): Operation<WorkflowExecutionTransitions> {
60-
return useWorkflowRunHost({ root });
60+
// The same reader the lifecycle installation captures. A version-1 run
61+
// needs its Markdown to begin, fork or stage, and the transitions this
62+
// returns are what admit those — so a host that could export a legacy run
63+
// and not resume one would be two hosts wearing one name.
64+
return useWorkflowRunHost({ root, legacySource: readLegacyDefinitionSource });
6165
},
6266
useLifecycle(): Operation<void> {
6367
// The reader goes into the provider's closure, not onto a request. An
6468
// export seals the document a run was of, and a caller that could hand
6569
// that in would be sealing its own bytes as somebody else's evidence.
66-
return useWorkflowLifecycle({ root, definitionSource: readDefinitionSource });
70+
return useWorkflowLifecycle({ root, legacySource: readLegacyDefinitionSource });
6771
},
6872
useDelivery(): Operation<void> {
6973
return useWorkflowInputDelivery({ root });

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

Lines changed: 129 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* The components a workflow root is closed over, established from Git.
2+
* The components a workflow root is closed over, and where they come from.
33
*
44
* A workflow root may declare a fixed bundle of authored Markdown components in
55
* its own frontmatter:
@@ -11,27 +11,32 @@
1111
* Planning: ./Planning.md
1212
* ```
1313
*
14-
* The declaration is authored beside the root and read from the same pinned
15-
* commit the root came from, so the whole procedure — root and components — is
16-
* one immutable object graph. A working tree with uncommitted edits runs the
17-
* committed components for exactly the reason it runs the committed root: a
18-
* record that named a commit while executing something else would be a claim
19-
* about something that never happened.
14+
* The declaration is authored beside the root and read from beside it: each
15+
* path is resolved against the root's own directory, read as bytes, and
16+
* retained with the run. So the whole procedure — root and components — is one
17+
* immutable set of bytes from the moment the run becomes durable, and a working
18+
* tree with uncommitted edits runs what it says rather than what its last
19+
* commit said.
2020
*
2121
* What each declaration produces is two views of one bundle. The **identity**
22-
* view is what the workflow definition retains: name, canonical
23-
* repository-relative path, and the blob's own object id. The **execution**
24-
* view is the same entries plus the exact source read from the commit, which is
25-
* what canonical core resolves the names against. Because the hash is
26-
* identity, changing what a component says changes the definition rather than
27-
* changing what a retained definition executes.
22+
* view is what the workflow definition retains: name, logical path inside the
23+
* bundle, and the source hash of the bytes that were read. The **execution**
24+
* view is the same entries plus that source as text, which is what canonical
25+
* core resolves the names against. Because the hash is identity, changing what
26+
* a component says changes the definition rather than changing what a retained
27+
* definition executes.
2828
*
29-
* Everything here goes through the contextual `Git` capability and the
30-
* engine's own Markdown parser. Nothing reads the filesystem, resolves a
31-
* module, or searches a directory.
29+
* ## The legacy half
30+
*
31+
* `reconstructBundle()` rebuilds a version-1 run's bundle out of the commit it
32+
* pinned, through the contextual `Git` capability. It is reached only from the
33+
* legacy source reader this host supplies to the Workflow lifecycle; nothing
34+
* establishing a new bundle goes near it.
3235
*/
3336

34-
import { Err, Ok } from "effection";
37+
import { readFile } from "node:fs/promises";
38+
import { join } from "node:path";
39+
import { Err, Ok, until } from "effection";
3540
import type { Operation, Result } from "effection";
3641
import {
3742
CORE_COMPONENT_NAMES,
@@ -40,8 +45,14 @@ import {
4045
RESERVED_STRUCTURAL,
4146
} from "@executablemd/core";
4247
import type { WorkflowBundleComponent } from "@executablemd/core/host";
43-
import { readGitObject, revParse } from "@executablemd/workflow";
48+
import {
49+
decodeSourceText,
50+
readGitObject,
51+
revParse,
52+
sourceContentHash,
53+
} from "@executablemd/workflow";
4454
import type { GitObjectFormat, WorkflowComponentEntry } from "@executablemd/workflow";
55+
import type { EstablishedComponent } from "./workflow-definition.ts";
4556

4657
/** Hexadecimal digits per object id, by the format that names them. */
4758
const OBJECT_ID_LENGTHS: Readonly<Record<GitObjectFormat, number>> = { sha1: 40, sha256: 64 };
@@ -61,10 +72,11 @@ function unavailable(message: string, cause?: unknown): WorkflowBundleUnavailabl
6172
/**
6273
* One declared component, normalized against the root's own directory.
6374
*
64-
* `path` is already canonical: repository-relative, POSIX, with the single
65-
* optional leading `./` removed. It is what the definition retains and what
66-
* Git is asked for; the spelling the document wrote is not kept, because two
67-
* spellings of one path would be two identities for one bundle.
75+
* `path` is already canonical: bundle-relative, POSIX, with the single optional
76+
* leading `./` removed. It is the logical path the definition retains and the
77+
* path this host reads beside the root; the spelling the document wrote is not
78+
* kept, because two spellings of one path would be two identities for one
79+
* bundle.
6880
*/
6981
export interface DeclaredComponent {
7082
readonly name: string;
@@ -183,15 +195,15 @@ function usableName(name: string): WorkflowBundleUnavailableError | undefined {
183195
}
184196

185197
/**
186-
* The repository-relative path a declaration names, or the refusal saying why
187-
* it names none.
198+
* The bundle-relative path a declaration names, or the refusal saying why it
199+
* names none.
188200
*
189-
* A declared path locates a Markdown blob beside the root inside one commit, so
190-
* it is deliberately the narrowest thing that can do that: relative, POSIX,
191-
* forward only, and Markdown. Everything else — an absolute path, a
192-
* backslash, a URL, a package specifier, a glob, a directory, a traversal that
193-
* would land back inside the repository anyway — is refused rather than
194-
* repaired, because a repaired path runs a file the author did not write down.
201+
* A declared path locates one Markdown file beside the root, so it is
202+
* deliberately the narrowest thing that can do that: relative, POSIX, forward
203+
* only, and Markdown. Everything else — an absolute path, a backslash, a URL, a
204+
* package specifier, a glob, a directory, a traversal that would land back
205+
* under the root's own directory anyway — is refused rather than repaired,
206+
* because a repaired path runs a file the author did not write down.
195207
*/
196208
function canonicalPath(value: string, directory: string, name: string): Result<string> {
197209
const refuse = (reason: string): Result<string> =>
@@ -210,7 +222,7 @@ function canonicalPath(value: string, directory: string, name: string): Result<s
210222
return refuse("is absolute, and a declaration is relative to the document beside it");
211223
}
212224
if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(value)) {
213-
return refuse("is a URL, and a declaration names a file in this repository");
225+
return refuse("is a URL, and a declaration names a file beside the document");
214226
}
215227
if (/[*?[\]{}]/.test(value)) {
216228
return refuse("contains glob syntax, and a declaration names exactly one file");
@@ -235,7 +247,7 @@ function canonicalPath(value: string, directory: string, name: string): Result<s
235247
// is no directory convention this costs: a bundled component lives beside the
236248
// document that declares it, and nothing beside it is a package.
237249
if (segments[0]?.startsWith("@") === true) {
238-
return refuse("is a package specifier, and a declaration names a file in this repository");
250+
return refuse("is a package specifier, and a declaration names a file beside the document");
239251
}
240252
if (!relative.endsWith(".md")) {
241253
return refuse("is not a Markdown file, and a bundled component is Markdown");
@@ -253,26 +265,28 @@ function isPlainObject(value: unknown): value is Record<string, unknown> {
253265
}
254266

255267
/**
256-
* Read every declared component out of one commit, and parse it.
268+
* Read every declared component from the directory the root sits in, and parse
269+
* it.
270+
*
271+
* A declared path is a logical path inside the bundle *and* the path the file
272+
* has beside the root, which is what makes a declaration portable: the run
273+
* retains `Discovery.md`, and this host happens to find it next to the document
274+
* that named it. The host directory is joined on here and nowhere else.
257275
*
258-
* Each source is read as a blob, so a declaration that names a directory, a
259-
* submodule, or a path the commit does not hold fails here rather than
260-
* executing as whatever Git chose to print. Each blob's own object id becomes
261-
* the source hash, under the repository's object format, so there is one hash
262-
* algorithm and it is Git's.
276+
* Each source's identity is the source-bundle hash of its own bytes, so what
277+
* the descriptor names and what executes come from one read of one file.
263278
*
264279
* Parsing happens here too. A bundled component that is not Markdown the engine
265280
* can read refuses the start before storage is created and before any component
266281
* code runs — rather than surfacing the first time a document writes its name.
267282
*/
268283
export function* readBundle(
269-
pinnedCommit: string,
284+
directory: string,
270285
declared: readonly DeclaredComponent[],
271-
objectFormat: GitObjectFormat,
272-
): Operation<Result<readonly WorkflowBundleComponent[]>> {
273-
const components: WorkflowBundleComponent[] = [];
286+
): Operation<Result<readonly EstablishedComponent[]>> {
287+
const components: EstablishedComponent[] = [];
274288
for (const component of declared) {
275-
const loaded = yield* readComponent(pinnedCommit, component, objectFormat);
289+
const loaded = yield* readComponent(directory, component);
276290
if (!loaded.ok) {
277291
return loaded;
278292
}
@@ -282,39 +296,49 @@ export function* readBundle(
282296
}
283297

284298
function* readComponent(
285-
commit: string,
299+
directory: string,
286300
declared: DeclaredComponent,
287-
objectFormat: GitObjectFormat,
288-
): Operation<Result<WorkflowBundleComponent>> {
301+
): Operation<Result<EstablishedComponent>> {
289302
const { name, path } = declared;
290-
let content: string;
291-
let sourceHash: string;
303+
// Joined from the root's own directory. The declaration was already refused
304+
// if it was absolute, a URL, a glob, or walked the tree, so what is joined
305+
// here stays beneath the directory the document lives in.
306+
const host = join(directory, ...path.split("/"));
307+
308+
let bytes: Uint8Array;
292309
try {
293-
// `cat-file blob` first: it refuses a tree, so a declaration that names a
294-
// directory fails before its object id is taken as a component's identity.
295-
content = yield* readGitObject(commit, path);
296-
sourceHash = (yield* revParse(`${commit}:${path}`)).toLowerCase();
310+
bytes = new Uint8Array(yield* until(readFile(host)));
297311
} catch (error) {
298312
return Err(
299313
unavailable(
300-
`the component "${name}" is not a file this workflow's commit holds at ${path}. ` +
301-
"Commit the component beside the document that declares it.",
314+
`the component "${name}" is not a file beside the document that declares it at ` +
315+
`${path}. Put the component next to the document, or correct the path it declares.`,
302316
error,
303317
),
304318
);
305319
}
306-
if (sourceHash.length !== OBJECT_ID_LENGTHS[objectFormat] || !/^[0-9a-f]+$/.test(sourceHash)) {
320+
321+
const text = decodeSourceText(bytes);
322+
if (!text.ok) {
307323
return Err(
308324
unavailable(
309-
`the component "${name}" did not resolve to an object this repository's format names.`,
325+
`the component "${name}" at ${path} is not well-formed UTF-8, so it is not Markdown ` +
326+
"this command can read.",
310327
),
311328
);
312329
}
313-
const parsed = yield* parseComponent(name, path, content);
330+
331+
const parsed = yield* parseComponent(name, path, text.value);
314332
if (!parsed.ok) {
315333
return parsed;
316334
}
317-
return Ok({ name, path, sourceHash, content });
335+
return Ok({
336+
name,
337+
path,
338+
sourceHash: yield* sourceContentHash(bytes),
339+
content: text.value,
340+
bytes,
341+
});
318342
}
319343

320344
function* parseComponent(name: string, path: string, content: string): Operation<Result<void>> {
@@ -346,7 +370,7 @@ export function* reconstructBundle(
346370
retained: readonly WorkflowComponentEntry[],
347371
objectFormat: GitObjectFormat,
348372
): Operation<Result<readonly WorkflowBundleComponent[]>> {
349-
const loaded = yield* readBundle(
373+
const loaded = yield* readGitBundle(
350374
pinnedCommit,
351375
retained.map((entry) => ({ name: entry.name, path: entry.path })),
352376
objectFormat,
@@ -366,3 +390,49 @@ export function* reconstructBundle(
366390
}
367391
return loaded;
368392
}
393+
394+
/**
395+
* Read every retained component out of one commit, for a version-1 resume.
396+
*
397+
* The legacy half, and the only place in this module that reaches Git. A
398+
* version-1 definition pins a commit and a path per component, so its bundle is
399+
* rebuilt from objects rather than from files — a working tree edited since the
400+
* run started continues the run it started.
401+
*/
402+
function* readGitBundle(
403+
pinnedCommit: string,
404+
declared: readonly DeclaredComponent[],
405+
objectFormat: GitObjectFormat,
406+
): Operation<Result<readonly WorkflowBundleComponent[]>> {
407+
const components: WorkflowBundleComponent[] = [];
408+
for (const { name, path } of declared) {
409+
let content: string;
410+
let sourceHash: string;
411+
try {
412+
// `cat-file blob` first: it refuses a tree, so a declaration that names a
413+
// directory fails before its object id is taken as a component's identity.
414+
content = yield* readGitObject(pinnedCommit, path);
415+
sourceHash = (yield* revParse(`${pinnedCommit}:${path}`)).toLowerCase();
416+
} catch (error) {
417+
return Err(
418+
unavailable(
419+
`the component "${name}" is not a file this workflow's commit holds at ${path}.`,
420+
error,
421+
),
422+
);
423+
}
424+
if (sourceHash.length !== OBJECT_ID_LENGTHS[objectFormat] || !/^[0-9a-f]+$/.test(sourceHash)) {
425+
return Err(
426+
unavailable(
427+
`the component "${name}" did not resolve to an object this repository's format names.`,
428+
),
429+
);
430+
}
431+
const parsed = yield* parseComponent(name, path, content);
432+
if (!parsed.ok) {
433+
return parsed;
434+
}
435+
components.push({ name, path, sourceHash, content });
436+
}
437+
return Ok(Object.freeze(components));
438+
}

0 commit comments

Comments
 (0)