build: persist compile evidence beside emitted files (#619 step 4) - #638
Merged
Conversation
🦋 Changeset detectedLatest commit: 3d377b4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This was referenced Sep 5, 2026
ScriptedAlchemy
marked this pull request as ready for review
September 5, 2026 18:23
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…out of the generic JSON check
…ode bundles load only node bundles
ScriptedAlchemy
enabled auto-merge (squash)
September 5, 2026 19:05
ScriptedAlchemy
added a commit
that referenced
this pull request
Sep 5, 2026
…) into feat/592-authoritative-manifest
This was referenced Sep 5, 2026
Closed
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.
Part of #619 — step (a) of the reordered PR 3 (owner audit, comment 17:11): persist compile evidence bound to the emitted files before any generated-JS scanner is deleted. Lands ahead of #634, which rebases onto it.
What
agent-bundle buildnow writesagent-bundle.compile-evidence.jsonat the artifact root, listed in the manifest as ageneratedfile. For every compiled file it records:builtinorartifact-relative), with its external type, request, user request and issuer modules; an artifact-relative edge names the emitted sibling it loads (relative-file relationship);ModuleIR.packagevalues the compiler bundled into the file;producer(agent-bundleversion, Rspack version) andpolicy(closed-world-externals@1, bumped whenexternal-policy.tschanges what it permits);coverage.rewritable(atools.rspack/tools.rsbuildhatch ran, so emitted bytes may differ from the module graph) andcoverage.unobserved, the load forms Rslib's profile leaves verbatim (import(<expression>),require(<expression>),require.resolve(…),createRequire(…)(…),import.meta.resolve(…)), which the compiler neither bundles nor records.agent-bundle validate --artifactre-checks the record against the manifest file table (AB6039): unreadable or non-strict record, policy mismatch, a compiled file the record does not cover, asha256that does not match the manifest, a recorded file the manifest does not list as a bundle, abuiltinrequest that is not one, or an artifact-relative target the artifact lacks.buildPackageOutputsreturns the same record in process (PackageBuildResult.evidence, paths as a consumer sees them,dist/bin/<name>.js) —disthas no manifest to bind it to, and #634's AB7014 re-derivation reads it directly.Plumbing
RslibSurfacePlan.finishreceives the fullCompileResult(externals and modules included), not justassets;compileRslibSurfacesreturns{ compileResults, results }. This closes gap (1) of the audit: the external/module report now reaches the emitted artifact record.compileMcpAppslowers each App view'sCompilationEvidenceto aCompileResultthrough the samecompileResultOfhelperrslib.tsuses for surfaces, and exposes them ascompileResults.BuildResult.compileEvidencecarries the record for in-process callers.Not in this PR
Scanner deletion, the AB7014 re-derivation and the coverage matrix (steps b–d) stay in #634. The manifest itself is unchanged: the record is a separate root file the manifest lists, so #604's manifest work is not inflated.
Docs / changeset
docs/diagnostics.md(AB6039),docs/entry-conventions.md, website en+zh validation, architecture, targets-artifacts. Onepatchchangeset.Deslop
Fable-5.1-high, 7 edits: shared
compileResultOfinstead of a copied evidence→IR lowering inmcp-apps.ts;pathPrefixderived from the sametoPosixRelative(projectRoot, outputRoot)the diagnostics use instead of a literaldist; import order inemit.ts/build.ts; redundantAB6039message prefix removed;PackageBuildResult.evidencedocblock; stray blank line;build-composeroot listings and the epoch tamper test updated for the new root file.Self-review
Reviewer: GPT-5.6 Sol (medium), full diff vs
origin/main.compileEvidenceDiagnosticstrusted the recordedkind/target: a bare request such asleft-padcould claim an existing bundle as itstargetand passAB6039. Fixed: every recorded external is re-judged with the build's ownclassifyExternalover the manifest's compiled files, and an artifact-relativetargetmust equal the path the request resolves to from the asset. Spoofing tests added (compile-evidence.test.ts: bare request with a borrowed target, wrong target, non-compiled sibling, non-module-loading external type).AB6039+ the genericAB6006JSON check), hidden by anarrayContainingassertion. Fixed:validateGeneratedFilesskips the record (it has its own strict reader); the test asserts the exact diagnostic list.prepack" overstated what this PR wires. Fixed:docs/diagnostics.mdand website en+zh now say the package build returns the record in process (PackageBuildResult.evidence); build: AB7014 from consumer-runtime evidence (option A); gate the generated-JS walk on the compile evidence record (#619 steps b–d) #634 is the PR that reads it.Breaking changes, changeset: none found.
Second pass — 4. High — one policy for two compilation boundaries: the re-judging accepted a built-in external on an MCP App view (views keep no externals at all) and let a node bundle claim a view as its sibling target. Fixed: an
.htmlasset is a view and any recorded external isAB6039; node bundles are judged against the manifest's non-view compiled files. Regression tests for both; docs list the new message form.Third pass: no remaining findings (bugs, breaking changes, tests, docs, changeset, parser/producer compatibility, manifest validation, MCP App boundary, sibling externals, API callers).