Skip to content

fix(release): enforce ASF source candidate compliance - #3999

Merged
Astro-Han merged 4 commits into
mainfrom
fix/2974-asf-source-compliance
Aug 27, 2026
Merged

Astro-Han merged 4 commits into
mainfrom
fix/2974-asf-source-compliance

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make apache-maka-0.2.0-incubating-src.tar.gz the enforcement boundary for source-candidate compliance.

  • exclude only the DeepSeek Harness runtime dependency manifests from the ASF source archive; retain the profile, patcher, preparation script, eval/benchmark source, and repository development path, while documenting that the optional toolchain build requires a complete Git checkout
  • recursively audit archived npm manifests, npm v3 lockfiles, shrinkwraps, direct dependency closure, and workspace links; reject Category X GPL/LGPL/AGPL licenses, unknown metadata, unsupported schemas, and inputs without matching lock/generated-notice provenance
  • inspect every archived path and file fail-closed; reject cross-platform path collisions, compiled/archive magic including ELF, Mach-O/fat Mach-O, PE, WASM, ZIP/JAR/polyglots, and regular/thin ar, and require non-text inputs to match the existing provenance inventory
  • keep scripts/asf-source-release.mjs, the release workflow, legal documents, generated notices, and docs/code-origin-audit.md as the existing authorities rather than adding a parallel scanner
  • route provenance-inventory changes through the ASF source CI gate

Refs #2974

Verification

TDD red/green coverage includes:

  • nested manifests, package locks, shrinkwraps, unsupported lock formats, Category X and unknown licenses
  • private manifests with empty dependency declarations, classified dependency closure, missing lock provenance, workspace links, and generated-notice authority
  • cross-platform archive path collisions
  • ELF, Mach-O/fat Mach-O, PE, WASM, ZIP/JAR at non-zero offsets, regular/thin ar, printable unknown binary inputs, and scoped provenance globs
  • inventoried images, raw-control fixtures, and unknown non-text inputs
  • DSH runtime manifests excluded while the preparation script and profile materialization inputs remain byte-identical to the Git source
  • provenance-only changes selecting the ASF source CI gate

Ran on Node 24 with the repository npm toolchain:

  • npm run check:asf-source — 92 passed
  • node --test scripts/ci-test-plan.test.mjs — 44 passed
  • generated and verified apache-maka-0.2.0-incubating-src.tar.gz from commit ddf34fa2bbb31c185297f5dfe103b8c4fa76b033
  • SHA-512: 141c2350e924f492ba3af6683628c88a6b284afe8c112a3665f141373c631e60b264b7ea24b5e6e90bc9ac31895b99119362c1a19afa70119595ef2d0305263c
  • from a fresh extraction of that exact archive: source-header audit, npm ci, generated npm/CLI notice checks, full workspace build/typecheck, and check:asf-source passed
  • from the same extraction: npm --workspace @maka/eval run test:dist passed 75 Node tests and 74 Python tests; 6 environment-specific Python tests skipped
  • from the same extraction: npm run lint checked 2,829 files and npm run format:check checked 1,703 files

Not run: the full repository npm test; CI owns the full test matrix.

Review focus

This PR is ready for review. Its finite license and text-source allowlists intentionally fail closed: a new valid SPDX expression or source format requires an explicit reviewed update rather than being accepted implicitly. The provenance inventory is itself part of the signed candidate, while compiled/archive magic is rejected before that inventory can authorize a path.

The current automated approval covers the implementation but is not an independent human committer review and does not approve the release/legal judgments. A human committer still needs to review the archive boundary, the finite non-Category-X classification, npm lock/workspace assumptions, and the provenance inventory. Human maintainers retain sole authority to approve, merge, select an RC, sign, stage, or vote on a release.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex authored the implementation, tests, documentation/provenance updates, adversarial-review fixes, and this PR description; it also ran the local candidate-bound verification described above. A human contributor must review the code and release/legal judgments and is solely responsible for approval and merge.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Aug 27, 2026
@Astro-Han
Astro-Han marked this pull request as ready for review August 27, 2026 11:06
@Astro-Han
Astro-Han requested a review from M4n5ter August 27, 2026 11:06

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the implementation. Here is what I checked, and what I deliberately did not.

Verified

  • Path handling is safe before extraction. validateArchiveEntries rejects absolute paths, backslashes, and ./.. segments, and it runs before validateArchiveContents unpacks anything. So the new full-archive extraction cannot be steered outside its temporary directory. Entry types are then restricted to regular files and directories, which refuses symlinks and device nodes.
  • The text allowlist is fitted to this repository rather than guessed. Across all 3,167 tracked files, only two groups fall outside textSourceExtensions / textSourceBasenames: 64 .png files and one .sqlite fixture. Every one of those that can reach an archive is matched by a pattern in the new inventory. The 14 .png files the inventory does not match all live under .maka-shots/, which is both export-ignored and listed in forbiddenSegments, so they cannot enter a candidate.
  • The whole-file scan for ZIP magic produces no false positives on the current tree. I ran it across all 65 binary files; none contains PK\x03\x04, PK\x05\x06, or PK\x07\x08.
  • Gate routing behaves as the description claims. planTests selects asfSource for this diff, and a change to docs/code-origin-audit.md on its own selects the ASF source gate without pulling in the full code lane.
  • Tests pass. node --test scripts/asf-source-release.test.mjs gives 32 of 33 passing on my machine. The one failure is creates reproducible candidates from committed files only, and it fails only because gpg is not installed here, not because of anything in this change. CI is green on 85f8f2da3.

Two things that will trip later — neither blocks this PR

1. Both allowlists are finite and compared as exact strings. knownNonCategoryXLicenses matches license text literally, so MIT OR Apache-2.0 passes but Apache-2.0 OR MIT does not, and (MPL-2.0 OR Apache-2.0) is listed with parentheses while MIT OR Apache-2.0 is listed without them. The first dependency that arrives with a well-formed but unlisted SPDX expression will stop a release until someone edits that set. The same is true of textSourceExtensions: adding an ordinary Makefile, .xml, or .editorconfig will fail the verifier. Both fail closed and fail loudly, which is the right direction. I would only ask that docs/code-origin-audit.md say where to add the new value when this happens, so whoever hits it at release time is not left guessing.

2. The verifier reads its own allowlist out of the candidate it is verifying. docs/code-origin-audit.md is both the inventory and an archived file. That is self-referential, and I think it holds up: archive integrity comes from the detached signature and the SHA-512, not from the inventory, and the magic-byte checks run before the inventory and independently of it, so listing a path cannot be used to smuggle an executable. I raise it so the property is written down rather than rediscovered later.

One inconsistency worth resolving

The description says "This is intentionally a draft until a human contributor reviews the archive boundary...", but this pull request is not marked as a draft. Please either restore draft status or update that paragraph, so the stated intent and the actual state agree.

What this approval does not cover

I reviewed the code. I am not signing off on the release and legal judgments your description asks a human to make: the archive boundary, the finite non-Category-X classification, the npm lock and workspace assumptions, and the contents of the provenance inventory. Those still need a human committer.


Posted by an automated review agent operated by @jackwener. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.

简体中文

本条评论由 @jackwener 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。

@github-actions github-actions Bot added effort/XL Under 2500 readable lines and removed effort/M Under 500 readable lines labels Aug 27, 2026
@Astro-Han
Astro-Han force-pushed the fix/2974-asf-source-compliance branch 6 times, most recently from 8f5a8c5 to 3dc6c04 Compare August 27, 2026 13:29
Exclude the DeepSeek Harness runtime toolchain from ASF source archives and make candidate verification fail closed over nested npm licensing and non-text inputs.

Generated-by: Codex
Document that the optional DeepSeek Harness runtime toolchain can only be built from a complete Git checkout, and bind the retained profile inputs to the source archive contract.

Generated-by: Codex
Allow unlicensed private source configurations only when they declare no dependencies or their direct dependency closure is backed by a classified sibling npm lockfile.

Generated-by: Codex
Bind manifest dependencies and workspace links to npm lock provenance, trust only the generated notice inventory, reject ambiguous archive paths and binary formats, and route provenance edits through the ASF source gate.

Generated-by: Codex
@Astro-Han
Astro-Han force-pushed the fix/2974-asf-source-compliance branch from 3dc6c04 to ddf34fa Compare August 27, 2026 13:37
@Astro-Han
Astro-Han merged commit d27c02a into main Aug 27, 2026
2 checks passed
@Astro-Han
Astro-Han deleted the fix/2974-asf-source-compliance branch August 27, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Under 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants