Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2d6cee4
test(supply-chain): expose indirect CommonJS authority gap
seonghobae Aug 12, 2026
f616d0d
fix(supply-chain): reject indirect CommonJS loaders
seonghobae Aug 13, 2026
dc3d47b
test(supply-chain): detect CommonJS resolver authority
seonghobae Aug 14, 2026
7a13161
fix(supply-chain): detect CommonJS resolver authority
seonghobae Aug 14, 2026
a4152db
test(supply-chain): expose indirect CommonJS resolver authority
seonghobae Aug 14, 2026
2193959
fix(supply-chain): detect indirect CommonJS resolver invocations
seonghobae Aug 14, 2026
1a78422
test(supply-chain): expose require.main loader authority gap
seonghobae Aug 14, 2026
d2b52ec
fix(supply-chain): detect require.main loader authority
seonghobae Aug 14, 2026
0f3f1d0
test(package): expose CommonJS apply authority gap
seonghobae Aug 14, 2026
9dc017e
fix(package): detect CommonJS apply authority
seonghobae Aug 14, 2026
b5a1863
test(supply-chain): detect Reflect.apply CommonJS authority
seonghobae Aug 14, 2026
ff3459f
fix(supply-chain): detect Reflect.apply CommonJS authority
seonghobae Aug 14, 2026
f63836d
test(supply-chain): expose bound CommonJS authority
seonghobae Aug 14, 2026
a415a01
test(supply-chain): exercise bound CommonJS authority in CI
seonghobae Aug 14, 2026
586acff
test(supply-chain): remove unused bind harness
seonghobae Aug 14, 2026
3b25354
fix(supply-chain): detect bound CommonJS authority
seonghobae Aug 14, 2026
b7be216
test(supply-chain): cover composed bound CommonJS authority
seonghobae Aug 15, 2026
da16556
fix(supply-chain): detect composed bound CommonJS authority
seonghobae Aug 15, 2026
8f907db
docs(doctoring): ground CommonJS authority verification
seonghobae Aug 15, 2026
7cbf98b
test(supply-chain): expose constructible CommonJS loader bypass
seonghobae Aug 15, 2026
30475e4
fix(supply-chain): detect constructed CommonJS authority
seonghobae Aug 15, 2026
a1025ea
test(supply-chain): expose Reflect.construct loader bypass
seonghobae Aug 15, 2026
f2fab24
fix(supply-chain): detect Reflect.construct module authority
seonghobae Aug 15, 2026
9ff5b4f
chore: synchronize CommonJS authority verifier with protected main
seonghobae Aug 17, 2026
17897e0
test(docs): require constructor authority doctoring
seonghobae Aug 18, 2026
73d34d0
docs(supply-chain): align constructor authority doctoring
seonghobae Aug 18, 2026
46c06a2
test(supply-chain): reject retained bound CommonJS authority
seonghobae Aug 18, 2026
d2da971
fix(supply-chain): detect retained bound CommonJS authority
seonghobae Aug 18, 2026
36d7b28
docs(supply-chain): bind retained CommonJS authority contract
seonghobae Aug 18, 2026
e8423ed
test(supply-chain): reject module.main runtime loaders
seonghobae Aug 19, 2026
1fd8730
fix(supply-chain): detect module.main loaders
seonghobae Aug 19, 2026
8bb513a
revert(supply-chain): keep module.main outside CommonJS authority
seonghobae Aug 19, 2026
781104f
test(supply-chain): keep Node main authority syntax-bounded
seonghobae Aug 19, 2026
9c72823
test(supply-chain): detect Node builtin module authority
seonghobae Aug 19, 2026
ddea3ec
fix(supply-chain): detect Node builtin module loads
seonghobae Aug 19, 2026
f118bcf
docs(supply-chain): document Node builtin authority
seonghobae Aug 19, 2026
51d7bcf
test: expose indirect Node built-in loader authority
seonghobae Aug 19, 2026
2b2f2a1
fix(supply-chain): detect call-invoked Node built-in loader
seonghobae Aug 19, 2026
4304a57
docs: record call-invoked Node built-in authority
seonghobae Aug 19, 2026
d7455ae
test: cover computed Node built-in call authority
seonghobae Aug 19, 2026
eb045c0
test: expose indirect Node built-in loader authority
seonghobae Aug 19, 2026
9143549
fix(supply-chain): reject indirect Node built-in loaders
seonghobae Aug 19, 2026
5750e63
docs: record indirect Node built-in authority
seonghobae Aug 19, 2026
a0eaac0
test(supply-chain): expose comma-indirected built-in loader gap
seonghobae Aug 19, 2026
55cf0f0
fix(supply-chain): catch comma-indirected built-in loaders
seonghobae Aug 19, 2026
c7436b4
docs(supply-chain): record comma-indirected built-in authority
seonghobae Aug 19, 2026
7d7926e
test(supply-chain): make built-in authority regression discoverable
seonghobae Aug 19, 2026
097ffbd
test(supply-chain): remove undiscovered mjs regression
seonghobae Aug 19, 2026
1c3b55d
test(supply-chain): expose global.process builtin loader gap
seonghobae Aug 22, 2026
1098503
fix(supply-chain): recognize ambient global.process loader
seonghobae Aug 22, 2026
8aa1ab9
docs(supply-chain): align global.process authority contract
seonghobae Aug 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/doctoring/commonjs-runtime-authority.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# CommonJS Runtime-Authority Verification

Status: active-PR evidence for PR #290. This note does not describe protected-main shipped behavior until the PR is merged.

## Decision boundary

Inkspan release verification treats executable module lookup or loading authority left in a packed JavaScript artifact as a packaging failure. The verifier parses emitted JavaScript with the TypeScript AST and classifies only statically recognizable syntax. It does not execute artifact code, resolve arbitrary aliases, evaluate receiver expressions, or infer dynamic computed member names.

The current active-PR scanner covers static imports/re-exports, dynamic `import(...)`, direct and statically indirect CommonJS `require` forms, `module.require`, `require.main.require`, `require.resolve`, `.call`, `.apply`, `Reflect.apply`, retained `.bind` capabilities, statically composed `.bind` invocations, constructor invocation through `new`, `Reflect.construct` when the target is already a recognized CommonJS loader or resolver, and Node `process.getBuiltinModule(...)` / `globalThis.process.getBuiltinModule(...)` / `global.process.getBuiltinModule(...)` authority through direct calls, comma-indirected calls whose right operand is one of those exact ambient loader expressions, exact-receiver `.call(...)` / `.apply(...)`, `Reflect.apply(...)`, retained `.bind(...)` capabilities, and immediately invoked bound capabilities. A directly recognizable bound CommonJS or Node built-in loader/resolver is therefore rejected when it is retained for later use, before later invocation occurs. Literal module specifiers are retained as actionable evidence; computed or missing specifiers remain unknown rather than being guessed. Static string-literal element access may identify an already-supported member spelling. Ordinary object methods merely named `require`, `resolve`, or `getBuiltinModule` remain outside the authority model.

The `process.getBuiltinModule(...)` classification is intentionally narrow: it recognizes only the ambient `process` spelling and the explicit `globalThis.process` / `global.process` spellings whose `process` member resolves to Node's ambient process object, plus syntax-only comma indirection that preserves one of those exact expressions as the right operand, and standard invocation/retention syntax when the receiver/target is one of those exact loader expressions. It does not resolve aliases, arbitrary receivers, or dynamic computed member names, and it does not infer that a similarly named method on another object has Node module authority.

This is a release-evidence boundary, not a runtime loader. It adds no filesystem, network, credential, persistence, deployment, model, or host authority to Inkspan.

## Standards basis

Node.js documents `require()` as the CommonJS module loader, `require.main` as the entry-module reference for CommonJS entry points, and `require.resolve()` as using the internal `require()` resolution machinery without loading the resolved module. These semantics make both loading and resolution relevant executable authority in an artifact expected to be self-contained.

Node.js also documents `process.getBuiltinModule(id)` as a globally available synchronous way to load a Node built-in module. In supported Node runtimes, `process`, `globalThis.process`, and `global.process` refer to the same ambient process object; the branch regression executes the `global.process.getBuiltinModule(...)` spelling to keep that equivalence machine-checked rather than inferred from arbitrary object structure. Because the packed Markdown artifact is required to be self-contained and free of executable runtime module authority, leaving that authority in the artifact is a packaging failure even though the target is a Node built-in rather than an external package.

ECMA-262 defines `Function.prototype.bind` as producing a bound function whose target and leading arguments are retained for subsequent calls. That retained callable is already executable loader/resolver authority before later invocation, so a packed artifact that stores a directly recognizable `require.bind(...)`, `require.resolve.bind(...)`, or ambient `process.getBuiltinModule.bind(...)` capability has not eliminated the authority merely because the call happens later. ECMA-262 also defines `Function.prototype.call` and `Function.prototype.apply` as invoking their callable receiver with explicit receiver/argument data, `Reflect.apply(target, thisArgument, argumentsList)` as invoking a callable target with an argument list, ordinary `new` expressions as constructor invocation, and `Reflect.construct(target, argumentsList, newTarget)` as construction through an explicitly supplied target. Therefore, a verifier that recognizes only direct loader calls can miss equivalent statically recognizable authority invoked through standard `call`/`apply`/`Reflect.apply` or retained/composed through standard `bind` forms.

The verifier intentionally remains syntax-bounded. ECMAScript permits arbitrary aliasing and computation; attempting whole-program resolution in this release check would enlarge the trusted implementation and risk unsound guesses. Unknown computed module arguments are therefore reported as executable authority without an invented specifier when the authority surface itself is statically recognizable.

## Assurance implications

The regression suite must include positive cases for each supported syntax family, including retained bound CommonJS loader/resolver capabilities before later invocation and Node built-in loading through all three exact ambient process spellings (`process`, `globalThis.process`, and `global.process`), direct and comma-indirected calls, exact-receiver `.call(...)` / `.apply(...)`, `Reflect.apply(...)`, retained `.bind(...)`, and immediate bound invocation, plus negative controls for ordinary objects with similarly named methods. Invalid emitted JavaScript fails closed. Any extension to the recognized syntax must be test-first and must preserve the no-execution/no-alias-evaluation invariant.

Release acceptance must use the exact packed artifact produced from the exact candidate head. Passing source tests on a predecessor, a different checkout SHA, or a status-only/model-only signal is not evidence that the packed artifact is free of runtime module authority.

## References

Ecma International. (2026). *ECMA-262: ECMAScript® 2026 language specification* (17th ed.). https://262.ecma-international.org/

Node.js contributors. (2026). *Modules: CommonJS modules* (Node.js v26.5.1 documentation). Node.js. https://nodejs.org/api/modules.html

Node.js contributors. (2026). *Process* (Node.js v26.7.0 documentation). Node.js. https://nodejs.org/api/process.html
Loading
Loading