Repository navigation
feat(artifacts): require every integrity reader failure to name its check - #11505
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The reviewed changes appear safe to merge; no new blocking issue was found. SummaryTightens
Reviews (4) · Last reviewed commit: "feat(artifacts): require every integrity..." · Reviewed by Greptile |
|
Correction to my thread reply: the DMG subclass is |
1d341a9 to
3674088
Compare
|
Rebased onto main (import-only conflicts after #11445; no logic change). @greptileai review |
3674088 to
7f24d55
Compare
|
Rebased onto main (7f24d55; one import conflict in ArtifactEmbeddedFormatProbes.ts, resolved by keeping main's merged @greptileai review |
…heck ArtifactReaderFailure overloads require integrityCheck for a literal "integrity" reason and an explicit (possibly undefined) check for a rebuild whose reason is not a literal; primaryFacts always carries it. The .NET bundle reader uses assertProducedEntry, and the PyInstaller cookie probe and owned lease cleanup rewrap keep the check they previously dropped.
7f24d55 to
344a3b1
Compare
…ilure (#11624) * feat(android)!: require integrity_check on a JNI library integrity failure A JNI library failure is now a tagged union: kind integrity carries a required integrity_check, and no other kind carries one. The producer builds it from the reader failure, whose integrity constructor requires the check since #11505. Also drop the stale "evidence produced before this field" clause from the electron_semantics comment; earlier Evidence revisions are refused. BREAKING CHANGE: Android JNI Evidence whose library failure has kind "integrity" must name integrity_check. Records written before #11191 that lack it no longer parse; recreate them. Refs #10510 * test(android): check the JNI failure union in its JSON Schema and the unnamed-check refusal Exclude integrity from the other failure kinds with excludedValues, so the JSON Schema conversion declares the exclusion that a bare refine dropped. The test checks the converted schema against the same valid and malformed records, and drives an integrity read failure with an explicitly undefined check: the read is refused, the reader is closed and every checkpoint parses.
Summary
Refs #10508 (Phase 6.1 follow-up from #11119/#11129). An
integrityArtifactReaderFailurecan no longer be constructed without naming the check that failed: the constructor overloads requireintegrityCheckfor a literal"integrity"reason, and a rebuild whose reason is not a literal must carry the check explicitly. The last unnamed site,DotnetBundleArtifactReader.open, now usesassertProducedEntry.Problem and expected behavior
DotnetBundleArtifactReader.openthrew anintegrityfailure with no check, so a forged or foreign entry was reported withoutdetails.integrity_check; it was the one unnamed reader site left after feat(artifacts): name the integrity check for container readers' produced entries and layouts #11119 (its adjacent-line PR fix(artifacts): cancel idle .NET bundle member streams #11065 was closed without merging).ArtifactEmbeddedFormatProbes.pyInstaller) rebuilt aPyInstallerFailurefrom reason and message only, andOwnedLeaseCleanupFailurekept only cause and cleanup.Change and scope
ArtifactReaderFailure(src/resources/ArtifactReader.ts): three constructor overloads:"integrity"requiresintegrityCheck; other literal reasons unchanged; a non-literalArtifactReaderFailureReasonrequires theintegrityCheckkey (value may beundefined).primaryFacts()always returnsintegrityCheck, so existing...primary.primaryFacts()rebuilds keep compiling and keep the check.DotnetBundleArtifactReader.open:assertProducedEntry(foreign-entry/entry-metadata).pyInstallerReaderFailure(PyInstallerFailure.ts) is the one adapter from parser failures; the reader's private copy is removed and the embedded-format probe uses it.OwnedLeaseCleanupFailurecarriesintegrityCheck. Directory traversal, SQLite journal, DMG and Mach-O verification sites state the check (orundefined) explicitly.ArtifactResourceRetryFailuretakesArtifactReaderFailureOptionsinstead ofConstructorParameters(which resolves to the last overload).container-identity.Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
ArtifactReaderFailureconstructor owns the rule;assertProducedEntryowns the produced-entry check;pyInstallerReaderFailureowns the parser-failure adaptation (duplicate removed)details.integrity_check(foreign-entryorentry-metadata) where it had nonedocs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): noneExpected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/resources/ArtifactReader.test.ts(new:@ts-expect-errorfor an unnamed integrity failure and for a non-literal rebuild without the check; aprimaryFacts()rebuild keeps the check);tests/boundary/filesystem/dotnetBundleArtifacts.test.tsassertsentry-metadatafor forged metadata andforeign-entryfor an unknown key; 13 test fixtures name their check.integritywith nointegrityCheck, so the two newtoMatchObjectassertions cannot match; not run against base.tests/process-global/stableArtifactConsumers.test.ts(fixture-only change) was typechecked but not run.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
npm run check:fast(typecheck, lint, architecture guards): passed. Pre-push hook passed.npm run test:focused --the 19 files below: 19 passed, 648 tests passed, 5 skipped: dotnetBundleArtifacts, ArtifactReader, ArtifactResourceScope, OwnedLease, ArtifactEmbeddedFormatProbes, NativeMachoSource, PyInstallerArtifactReader, PyInstallerBoundaries, SqliteDatabaseSnapshotLimits, environmentBundleWrite, FitArtifactReader, ReleaseExposureReader, InterfaceBuilderFinalization, CaptureFailures, AppleDispatchMetadata.failure, artifactInventorySnapshot, assetCatalogFinalization, interfaceBuilderBundle, artifactFileOutcomes.npx oxfmton changed files: clean.abortIfNeeded/ArtifactFileSourceto resources):npm run check:fastpassed;npm run test:focused --dotnetBundleArtifacts, ArtifactReader, ArtifactEmbeddedFormatProbes, PyInstallerArtifactReader, OwnedLease: 5 files, 115 passed.Compatibility, safety, and release
integrityArtifactReaderFailuremust nameintegrityCheck.Author readiness
Human owner:
Before merge
type(scope): outcome.