98fcdcb2e2
python's GenericResource wires the whole generic command set, the glob resolver and the VFS/FUSE ops from one table, and TypeScript had every ingredient but no class that assembled them, so a custom backend there was still written out by hand. Adds GenericResource<A>, generic over the accessor so the table is checked against the core functions it holds rather than against Accessor. It keeps TypeScript's own wiring style: commands() and ops() return arrays instead of python's register() loop mutating state in the constructor. And there is no sdk.ts, because core's barrel is 99 lines and gated in both directions while the ./* exports map already makes every module importable, so the five names the new example and doc reach for are the only additions to it. Both classes gained sizes_always_known and supports_snapshot. Without the first, no user-written backend could be mounted on FSKit at all, since resolve_backend refuses a resource that cannot size its files. The two one-file examples answer one shared truth file, so the two SDKs cannot drift without a red build. docs/typescript/resource/new.mdx is the twin of the python page, whose stale du_total/du_all is corrected to du. The layout baseline drops to 255: resource/generic was one of the counted divergences.
58 lines
5.0 KiB
JSON
58 lines
5.0 KiB
JSON
{
|
|
"baseline": 255,
|
|
"baseline_reason": "Every divergence below the excused ones predates the gate and each needs its own decision, so --strict fails on a rise rather than demanding zero. Lower this number whenever a divergence is closed; the gate fails on a drop too, so an improvement cannot be silently spent. Items 31-37 of the cleanup plan are scoped from this report. The unit is one module, never one directory: a one-sided directory counts once per module inside it, so it cannot absorb new modules without moving the number. An excused directory is the deliberate exception -- it excuses its whole subtree, because the excuse is that there is no counterpart to mirror, which makes growth inside it expected rather than drift.",
|
|
"directories": {
|
|
"python_only": {
|
|
"runtime/wasm": "The wasmtime WASI host. npm ships quickjs-emscripten and pyodide with their own hosts and python has no equivalent, so there is nothing to mirror. CLAUDE.md says do not port it.",
|
|
"runtime/python/sandlock": "Confines the host python3 with Landlock and seccomp, both Linux kernel features with no browser analogue and no node binding to mirror (sandlock ships python and go SDKs over its C ABI, and no npm package). The TypeScript python tier reaches the host through runtime/python/local.ts, which could wrap the same CLI; mirror this directory there if that lands.",
|
|
"bridge": "sync.py and thread.py exist to run an event loop on a worker thread for the FUSE callbacks, which python needs because its FUSE loop is threaded and node's is not.",
|
|
"agents/agno": "Ecosystem split: agno is a python-only framework.",
|
|
"agents/camel": "Ecosystem split: camel is a python-only framework, and pyproject declares it conflicting with the openai extra.",
|
|
"agents/openai_agents": "Ecosystem split: the openai-agents SDK is python-only.",
|
|
"agents/openhands": "Ecosystem split: openhands is a python-only framework.",
|
|
"agents/pydantic_ai": "Ecosystem split: pydantic-ai is a python-only framework.",
|
|
"commands/builtin/hf_buckets": "hf_buckets is python's name for the backend typescript calls hf; the alias is already declared in spec/parity_exceptions.json under command_io_aliases.",
|
|
"core/hf_buckets": "Same hf_buckets/hf alias as above.",
|
|
"core/hf_buckets/du": "Same hf_buckets/hf alias as above."
|
|
},
|
|
"typescript_only": {
|
|
"resource/opfs": "OPFS is the one typescript-only backend, declared in spec/parity_exceptions.json. There is no browser filesystem API for python to mirror.",
|
|
"core/opfs": "OPFS backend core, browser-only.",
|
|
"core/opfs/du": "OPFS backend core, browser-only.",
|
|
"commands/builtin/opfs": "OPFS command wrappers, browser-only.",
|
|
"generated": "browser/src/generated/wasm.ts is a build artifact embedded for the browser bundle, not a source module.",
|
|
"workspace/fixtures": "Test-only helpers: unreachable from the barrel, absent from dist (tsup entry is src/index.ts and files is [\"dist\"]), and imported only by tests.",
|
|
"cli/bin": "An npm package declares its executable as a real file under bin/; python declares console_scripts in pyproject.toml instead.",
|
|
"server/bin": "Same npm bin convention as cli/bin.",
|
|
"commands/builtin/hf": "typescript's name for python's hf_buckets; see the alias in spec/parity_exceptions.json.",
|
|
"core/hf": "Same hf/hf_buckets alias as above.",
|
|
"core/hf/du": "Same hf/hf_buckets alias as above."
|
|
}
|
|
},
|
|
"modules": {
|
|
"ops": {
|
|
"python_only": {
|
|
"file": "MirageFile: a sync file object over the Ops facade for embedding python code (with open-style usage). An npm consumer holds promises, not file objects, so there is nothing to mirror.",
|
|
"host_io": "The re-entrancy bypass the two patched doors (ops/open, ops/os_patch) read, so a backend serving an op reaches the host instead of being handed its own physical path back. Nothing to mirror for the same reason os_patch has nothing: node is never monkeypatched.",
|
|
"open": "The open() constructor for MirageFile; same embedding convenience as ops/file.",
|
|
"os_patch": "Patches the host interpreter's builtins.open/os functions onto a workspace, a CPython-only trick with no npm analogue."
|
|
}
|
|
},
|
|
"core/object_store": {
|
|
"typescript_only": {
|
|
"fakes": "Test-only in-memory driver shared by the kit's colocated *.test.ts files; python's twin is tests/core/object_store/conftest.py, which lives outside mirage/ and is not scanned."
|
|
}
|
|
},
|
|
"runtime/sandbox/ssh": {
|
|
"python_only": {
|
|
"sdk": "The asyncssh import shim (None when the ssh extra is absent), the same shape daytona and e2b carry in their baselined sdk modules; TypeScript loads ssh2 through loadOptionalPeer inside runtime.ts, so there is no ts twin."
|
|
}
|
|
},
|
|
"core/dropbox": {
|
|
"typescript_only": {
|
|
"_test_util": "The FakeDropboxRpc transport fake shared by rmdir.test.ts and rename.test.ts. TypeScript colocates tests with sources, so a shared test helper lands in the source directory; python keeps the same fake in tests/core/dropbox/conftest.py, which this gate does not scan. core/gdrive carries an identical _test_util.ts, still counted in the baseline rather than excused here."
|
|
}
|
|
}
|
|
}
|
|
}
|