From bcf09c413d6efa9b2fce1de5d8a581fef7732dd8 Mon Sep 17 00:00:00 2001 From: Malte Ubl Date: Sat, 17 Oct 2026 19:46:29 -0700 Subject: [PATCH] spm: cache verification results and infer emit targets 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 --- examples/spm-demo/.gitignore | 1 + examples/spm-demo/measure.sh | 32 ++++++ examples/spm-demo/src/ts-api-utils.ts | 5 +- packages/pm/src/sync.ts | 49 ++++++-- packages/pm/src/verify.ts | 157 ++++++++++++++++++++++++-- 5 files changed, 225 insertions(+), 19 deletions(-) create mode 100644 examples/spm-demo/measure.sh diff --git a/examples/spm-demo/.gitignore b/examples/spm-demo/.gitignore index 359c537c5..972972eaf 100644 --- a/examples/spm-demo/.gitignore +++ b/examples/spm-demo/.gitignore @@ -2,3 +2,4 @@ node_modules/ .scriptc-pm/ .scriptc/ bin/ +results/ diff --git a/examples/spm-demo/measure.sh b/examples/spm-demo/measure.sh new file mode 100644 index 000000000..721027d63 --- /dev/null +++ b/examples/spm-demo/measure.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Compile every probe in src/ with scriptc, with and without extra flags +# (e.g. --sources), and record coverage, build result and Node parity. +# sh measure.sh