Relationships
#4888 Scorecard scanCode: scan each code module once with the extension-scoring FromSites functions
Opened by zack · 11/18/2026· Shipped 11/18/2026
What
Once the extension-scoring package from swamp-club#4874 is published, switch scanCode in lib/infrastructure/extension-tarball-analyzer.ts to scan each code module once, and bump the @swamp-club/extension-scoring pin (currently 0.20261027.5).
Today scanCode calls markdownImports(file.path, content) and then, within the read caps, writtenSpecifiers(content, file.path). Each call parses the module with Babel and walks it. The package now exports:
importedSpecifiersAt(source, { path })from@swamp-club/extension-scoring/source, which returns the module's import sites, or null when it does not parsemarkdownImportsFromSites(path, sites)from@swamp-club/extension-scoring/secret-docswrittenSpecifiersFromSites(sites, sourceFile)from@swamp-club/extension-scoring/dependency-audit, which returns null for null sites, exactly aswrittenSpecifiersdoes
So the loop becomes: const sites = importedSpecifiersAt(content, { path: file.path }), then Markdown imports from sites for every module, and written specifiers from the same sites for modules within the caps. A null result still goes to unreadableModules.
Expected effect
Measured on @swamp/aws/ec2@2026.11.18.1 (253 code files, 142M chars), with identical results:
- pinned package, current loop: 14.3s per scan
- new package, current loop: 8.7s (the pruned AST walk alone)
- new package, one scan per module: 6.3s
Verification
tests/integration/extension_scoring_vectors_test.ts passes against the new package (167 tests, run locally against the swamp-club#4874 branch). Re-run it after the pin bump, together with the archive worker tests.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.