Repository navigation
Draft
Conversation
spm runs pnpm, enumerates installed package instances from the isolated node_modules/.pnpm layout, locates each instance's upstream TypeScript (local override, tarball source or sourcesContent, npm provenance, registry gitHead, version tag), fetches the package directory at that commit (blobless sparse git, or the codeload archive with an in-process gzip + tar reader), verifies it against the published artifact (byte-exact sourcesContent, token-normalized re-emit equivalence, a structural check for bundles, and an exported-name surface check), and writes per-instance overlays plus .scriptc-pm/manifest.json (schema 1) and scriptc-sources.lock.json for scriptc --sources. It has no npm dependencies and compiles to a native binary with scriptc; scripts/smoke.sh checks that the Node and native lanes produce identical output on the public demo app in examples/spm-demo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rces) `scriptc build|run|coverage --sources[=<manifest>]` reads a scriptc-pm schema-1 manifest (default: the nearest .scriptc-pm/manifest.json above the entry) and compiles each augmented package instance from its TypeScript overlay instead of its published JS. - Instances are keyed by realpath(installedDir). The resolver redirects an import that lands in an instance's installed directory to the instance's exports inside its overlay (resolveSourceOverlayModule); overlay files compile as program modules. - tsgo gets the pilot's "paths" injection, but only for names with a single augmented instance; other instances start dropped, and a second installed copy of a redirected name drops it too. - Fallback per instance through the drop-and-reload loop: a preflight diagnostic in an overlay, a program type error naming it, a top-level require() edge to it, a lowering refusal inside it, or a program that only fails against the source surface (probe) drops the overlay and the package compiles from published JS. Reasons are reported on stderr and as "source"/"source-fallback" rows in coverage. - Build caches key by the manifest's lockDigest and bytes instead of being bypassed; the network-fetching --provenance-sources pilot stays uncacheable and becomes one more producer of the same overlay set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Warm syncs reuse the content check result, keyed by the integrity-pinned package and the commit-pinned tree. When a package's tsconfig cannot be read, candidate targets are bounded by the syntax and downlevel helpers in the published JS of the matching module format, and the target search stops early when the published entry has no counterpart. Adds the demo's measure.sh, which compiles every probe with and without extra scriptc flags and records coverage, build result and Node parity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yntax A module:commonjs package has no package.json type, so its overlay was classified CommonJS and scriptc rejected the TypeScript's import/export syntax (SC1013). Overlays now get type module unless the source uses CommonJS-only TypeScript forms (export =, import x = require()); the published format stays in the manifest as publishedFormat. Policy fallback reasons now start with a reason code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Writes the additive schema-1 ambientDeclarations list that the compiler side (stacked PR on poc/spm-compiler) loads for active overlays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
This adds
packages/pm(@scriptc/pm, binsscriptc-pmandspm), a proof of concept of the scriptc-pm design.spm wraps pnpm. After
pnpm installit finds the upstream TypeScript for each installed package instance and checks that it corresponds to the published artifact. It writes per-instance source overlays plus.scriptc-pm/manifest.json(schema 1) forscriptc --sources. It has no npm dependencies, and it compiles to a native binary with scriptc that behaves identically to the Node build.This branch also merges
poc/spm-compiler, which adds--sources, for the end-to-end evaluation.What it does
spm install [pnpm args]. Runspnpm install, thenspm sync.spm sync. For every instance innode_modules/.pnpm:scriptc-pm.json; complete shipped.tsorsourcesContent; npm provenance (the subject digest is checked, the signature is not); the registrygitHeadplusrepository; a version tag.exact: byte equality with shippedsourcesContentor shipped.ts;equivalent: re-emit with the project's TypeScript and a token-normalized per-module comparison;structural: for bundles without maps;.scriptc-pm/overlay/<instance>/pkg, with anode_moduleslink to pnpm's resolved deps. Also writesscriptc-sources.lock.jsonand the manifest.spm status [--json]. Augmented instances and fallbacks with reason codes.Results on the public demo (
examples/spm-demo)Augmentation. 40 instances, 20 source candidates, 12 augmented: 3
exact, 9equivalent, all with an identical surface. The 8 fallbacks carry reasons: 6upstream-js, 1 codegenmissing-module, and ts-api-utils atstructural(a tsup bundle without maps). Every design MVP target reached the expected identity and content level, except ts-api-utils.Cost. A cold
spm synctakes about 5 s for this closure; a warm one takes 0.24 s natively. On a warm cache,spm installadds about 0.25 s over plain pnpm.Native parity.
scriptc coveragereports 100% static (1713 statements) and the binary is 2.7 MB.packages/pm/scripts/smoke.shchecks byte-identical stdout, manifest, lock and overlays between the Node and native lanes.End to end. With
scriptc --sources, 1 of 12 overlays compiles from source (@typescript-eslint/visitor-keys). The other 11 fall back to published JS:unknown-typed class fields, theError.causeredeclaration, array-typed destructuring and string-indexing shapes,export =under ESNext, andTemporal;useDefineForClassFields: falsepackages);.d.tsis not loaded, and untyped devDependency imports fail;No demo probe newly builds or newly matches Node, so spm is not useful end to end yet. The detailed table, findings, and what would change the verdict are in NOTES.md.
Contract notes
package.jsontypeismodulewhenever the source uses ES module syntax. Copying the sourcetype(DESIGN.md §5.3.4) made everymodule: commonjspackage unusable with SC1013.ambientDeclarationsfield is proposed as a follow-up.Not in scope (POC)
why,doctor,fetch;All are listed in NOTES.md.
Validation
scripts/smoke.sh: real pnpm install, then Node vs native comparison, with cold caches.oxlint --deny-warnings packages/pmandoxfmt --checkon the package.pnpm -r build.🤖 Generated with Claude Code