Repository navigation
refactor(global): the packages read the files they ship through one port - #292
Open
rami-hatoum wants to merge 2 commits into
Open
rami-hatoum wants to merge 2 commits into
rami-hatoum wants to merge 2 commits into
Conversation
…ShippedFiles port A package computes where its files are and never how they are read. ShippedFiles reads the text or the bytes of a file, or the names of the files in a folder, at a URL the package computes from its own import.meta.url. shippedFilesOnDisk is the one reader and the one module of the port that imports node:fs, behind an entry of its own, @on.auto/operations/shipped-files-on-disk, so the main and testing entries reach no file system for it. shippedFilesInMemory is a fake over a map for unit tests, held to the same tests as the reader on disk. The testing entry also gives measuredEnvironment, the coverage folder a test hands a worker or a process, and modulesReachedFrom, the files and packages an entry reaches through the imports that load at run time, which the test of the package's entries walks with. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…hippedFiles port A package computes where its files are and never how they are read. The server composes the reader once, shippedFilesOnDisk in src/server-options/composed-options.ts, as ServerOptions.shippedFiles, and hands it to each package that reads, as a dependency of the function or factory that reads. What a package read it hands on as content, never as a path. - workflow-engine: a pool is handed the files its workers start with as a value, keyed by worker module, which handedWorkersOf and handedFilesOf read through the reader before the pool is made; programPool stays synchronous, and every worker starts with its files, an evaluation worker asked before any reserve among them. freshInstance, machineSandboxOf, filterSandboxOf and sandboxAnswers take the reader. - definitions: handedWorkersWithChecks answers the files of a pool that checks saves, the kept lib for the check worker in place of the sandbox, and the check worker makes its checker of them with serveJobsWith and sandboxLibFrom. - providers: readProviders(shippedFiles) reads the entries and the documents beside them and hands on each document as its text and the bytes it takes, measured once from the bytes read; the documents:translate command reads the manifests through the reader on disk, and a file given to it itself. - tool-servers and connections: a connection of a provider reads its document from those the providers handed on, a place of documents of the kind shipped, and its bound compares the bytes they measured; a document the operator names by its path is read as before. - api: readPageStyle reads the typefaces through the reader; the server reads the style once, at its start beside the providers' entries, so a typeface that cannot be read stops it. - server: the settings are read against the providers it ships, and the guides and recipes through the reader; what a server is started with and answers moves to src/server-options, which the start and the composition import, so no module imports the start for it. - workflow-host: the reactions name the sandbox their filters are matched in, and the tests of the views fold on testFoldPoolOf, with the measured pool settings of definitions. - ledger: the test of the entries walks its imports with modulesReachedFrom of the testing entry of operations, as the portability test of the engine does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Several packages ship files beside their code and read them from disk where they need them, each in its own way: the provider entries and their OpenAPI documents, the sandbox lib the program check compiles against, the engine's WebAssembly, the guides, recipes and terminology the server serves to agents, and the landing page's typefaces. A package should compute where its files are and never how they are read: how is one decision, taken once, by the server that composes the packages.
ShippedFiles, in@on.auto/operations, reads text, bytes or the names in a folder at a URL a package computes from its own location. Its one implementation on disk lives behind a subpath entry of its own, as the ledger keeps itssqlite3entry, so the main entry loads no file system; a fake over a map is in the testing entry, and the same tests run on both.Splits the lint limits asked for: the server's start sequence, the pool's program job and its checks, and the shared test helpers each have a module of their own; the server's options types live in a leaf module.
Tests
pnpm checkpasses on each commit.