Skip to content

legal: synchronize standalone artifact inspection - #55

Merged
eXPerience83 merged 12 commits into
mainfrom
agent/sync-standalone-inspection
Aug 1, 2026
Merged

legal: synchronize standalone artifact inspection#55
eXPerience83 merged 12 commits into
mainfrom
agent/sync-standalone-inspection

Conversation

@eXPerience83

@eXPerience83 eXPerience83 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What changed

  • repairs the uv 0.12.1 standalone-inspection evidence left stale by the concurrent merge of chore: update stable upstream versions and runtime lock #52 and legal: reject stale standalone artifact inspection #54;
  • adds a bounded synchronizer for exactly five supported standalone components: GitHub CLI, Codex CLI, ttyd, mise and uv;
  • downloads only components whose pinned version, URL, SHA-256 or preserved notice changed;
  • verifies the repository-controlled SHA-256 before inspecting an asset;
  • supports only the known tar.gz and raw-binary packaging forms and never extracts archives;
  • records exact asset size, archive member count and license-like members for AMD64 and ARM64;
  • regenerates the JSON and Markdown evidence in the same automated update PR;
  • keeps ordinary Build AMD64 validation offline and adds focused unit tests;
  • documents the bounded maintenance contract and explicit non-goal of a general parser/scanner.

Repaired evidence

For uv 0.12.1, the verified pinned assets contain three archive members and no separate license-like file:

  • AMD64: 21,930,665 bytes;
  • ARM64: 20,377,441 bytes.

The preserved Apache-2.0 and MIT license texts remain the authoritative notices shipped with the image.

Race prevention inside the repository

Check upstream versions now refreshes the standalone report after updating pins and mise.lock, tracks both generated report files and validates them before committing. Future GitHub CLI, Codex CLI, ttyd, mise or uv update PRs therefore carry their exact packaging evidence instead of starting with a stale report.

Repository branch protection remains a separate GitHub setting; this PR does not weaken or bypass required checks.

Validation

  • bounded synchronizer unit tests;
  • existing standalone-report validator tests;
  • declarative inventory and version-pin validation;
  • AMD64 image build and smoke tests;
  • bundled-notice checks;
  • SPDX SBOM generation;
  • Trivy scans and the no-fixable-critical gate.

This remains intentionally narrow: it does not parse Dockerfiles or arbitrary shell/package-manager syntax and is not a general dependency-license scanner.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eXPerience83, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8f8168ce-92d4-4e20-9c9b-c6bab056c78f

📥 Commits

Reviewing files that changed from the base of the PR and between cb7ea07 and d81525e.

📒 Files selected for processing (2)
  • scripts/sync-standalone-artifact-inspection.py
  • scripts/test_sync_standalone_artifact_inspection.py

Summary by CodeRabbit

  • New Features
    • Added automated inspection of standalone AMD64 and ARM64 artifacts, including checksum, packaging, architecture, and legal-file verification.
    • Added generated JSON and Markdown evidence reports for inspected artifacts.
  • Documentation
    • Documented supported components, verification requirements, offline validation, and failure conditions.
  • Maintenance
    • Updated the inspected uv artifact from version 0.12.0 to 0.12.1.
    • Integrated artifact inspection into build and upstream validation workflows.

Walkthrough

The pull request adds standalone artifact inspection for pinned third-party assets. It verifies downloads and checksums, inspects legal files across AMD64 and ARM64 assets, generates JSON and Markdown evidence, and integrates synchronization into CI workflows.

Changes

Standalone artifact inspection

Layer / File(s) Summary
Inspection inputs and report validation
scripts/sync-standalone-artifact-inspection.py
The script parses pinned versions and checksums, builds component metadata, fingerprints repository notices, and validates report freshness.
Asset inspection and evidence generation
scripts/sync-standalone-artifact-inspection.py, scripts/test_sync_standalone_artifact_inspection.py
The script downloads verified assets, inspects raw binaries and tar.gz archives, compares architecture findings, renders reports, and exposes a refresh CLI. Tests cover archive handling, normalization, pin drift, and deterministic Markdown output.
Workflow integration and pinned evidence
.github/workflows/*.yml, third_party/README.md, third_party/standalone-artifact-inspection.*
CI validates and runs inspection synchronization. Upstream update automation tracks generated evidence. Documentation defines the maintenance contract. The uv evidence updates to version 0.12.1.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant UpstreamWorkflow
  participant InspectionScript
  participant GitHubAssets
  participant EvidenceFiles
  UpstreamWorkflow->>InspectionScript: refresh standalone inspection
  InspectionScript->>GitHubAssets: download pinned AMD64 and ARM64 assets
  GitHubAssets-->>InspectionScript: asset contents
  InspectionScript->>InspectionScript: verify checksums and compare legal files
  InspectionScript->>EvidenceFiles: write changed JSON and Markdown reports
  EvidenceFiles-->>UpstreamWorkflow: tracked inspection changes
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the primary change: synchronizing standalone artifact inspection evidence.
Description check ✅ Passed The description clearly explains the changes and validation, but it omits the template's explicit Impact, Safety and release checks, and Follow-up sections.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/sync-standalone-inspection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@eXPerience83
eXPerience83 marked this pull request as ready for review August 1, 2026 11:37

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb7ea07b07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/sync-standalone-artifact-inspection.py Outdated

Copy link
Copy Markdown
Owner Author

@codex address that feedback

Apply only the concrete P1 review fix: public standalone asset downloads must never read or send GH_TOKEN/GITHUB_TOKEN or any Authorization header, including across redirects. Remove the authentication handling from download_verified, add a focused regression test that proves the request uses only the fixed User-Agent, and do not change any other behavior or scope.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/sync-standalone-artifact-inspection.py`:
- Around line 276-301: Update download_verified to remove the GH_TOKEN lookup
and Authorization header from the release-asset download request, leaving only
the non-sensitive headers needed for urllib.request.Request. Preserve the
existing GitHub URL validation, retry behavior, checksum verification, and
destination cleanup.
- Around line 76-109: Validate TOML parser support for the quoted dotted
platform keys used by mise.lock during dependency/version setup, before calling
load_uv_assets(). Fail with a clear dependency/version error when the runtime
cannot parse those keys, rather than allowing load_uv_assets() to proceed or
fail later during platform lookup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1b7158b7-0afe-459a-b3a6-9032c46e0990

📥 Commits

Reviewing files that changed from the base of the PR and between 951b1d5 and cb7ea07.

📒 Files selected for processing (7)
  • .github/workflows/build-amd64.yml
  • .github/workflows/check-upstream.yml
  • scripts/sync-standalone-artifact-inspection.py
  • scripts/test_sync_standalone_artifact_inspection.py
  • third_party/README.md
  • third_party/standalone-artifact-inspection.json
  • third_party/standalone-artifact-inspection.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

⚙️ CodeRabbit configuration file

**/*.md: Check that documentation matches the implemented behavior and clearly distinguishes experimental edge builds
from stable releases. Flag outdated versions, unsafe deployment guidance and claims not proven by CI or testing.

Files:

  • third_party/standalone-artifact-inspection.md
  • third_party/README.md
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: Review GitHub Actions for least-privilege permissions, safe event triggers, untrusted input handling,
accidental publication, tag-channel correctness, secret exposure, reproducible builds, SBOM/provenance
generation and appropriate validation before pushing images.

Files:

  • .github/workflows/check-upstream.yml
  • .github/workflows/build-amd64.yml
🪛 ast-grep (0.45.0)
scripts/sync-standalone-artifact-inspection.py

[warning] 287-287: Request-controlled URL passed to urlopen; validate against an allowlist to prevent SSRF.
Context: urllib.request.urlopen(request, timeout=300)
Note: [CWE-918] Server-Side Request Forgery (SSRF).

(urlopen-unsanitized-data)


[info] 494-494: use jsonify instead of json.dumps for JSON output
Context: json.dumps(new_report, indent=2, ensure_ascii=False)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)

🪛 Ruff (0.16.0)
scripts/test_sync_standalone_artifact_inspection.py

[warning] 16-16: Assertion should be broken down into multiple parts

Break down assertion into multiple parts

(PT018)

scripts/sync-standalone-artifact-inspection.py

[warning] 45-45: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 240-240: Too many return statements (13 > 6)

(PLR0911)


[warning] 240-240: Too many branches (13 > 12)

(PLR0912)


[error] 287-287: Audit URL open for permitted schemes. Allowing use of file: or custom schemes is often unexpected.

(S310)


[error] 288-288: Audit URL open for permitted schemes. Allowing use of file: or custom schemes is often unexpected.

(S310)


[warning] 295-295: Consider moving this statement to an else block

(TRY300)


[warning] 359-366: Use a list comprehension to create a transformed list

(PERF401)

🔇 Additional comments (9)
scripts/sync-standalone-artifact-inspection.py (3)

1-45: LGTM!


112-274: LGTM!


304-528: LGTM!

scripts/test_sync_standalone_artifact_inspection.py (1)

1-139: LGTM!

.github/workflows/build-amd64.yml (1)

38-46: LGTM!

.github/workflows/check-upstream.yml (1)

267-268: LGTM!

Also applies to: 278-285, 309-309

third_party/README.md (1)

24-47: LGTM!

third_party/standalone-artifact-inspection.json (1)

142-169: LGTM!

third_party/standalone-artifact-inspection.md (1)

11-11: LGTM!

Comment thread scripts/sync-standalone-artifact-inspection.py
Comment thread scripts/sync-standalone-artifact-inspection.py

Copy link
Copy Markdown
Owner Author

Review follow-up:

  • The credential-forwarding finding is fixed in 824aa52 and covered by a regression test in d81525e: public asset requests carry only the fixed User-Agent even when both GH_TOKEN and GITHUB_TOKEN exist in the environment.
  • The TOML-version suggestion is not applicable. The script imports the Python 3.11+ standard-library tomllib; quoted dotted table keys are valid TOML and are parsed successfully from the repository's exact mise.lock by the required CI. Any parser incompatibility or malformed lock already raises TOMLDecodeError, which load_uv_assets() converts into the explicit cannot read valid mise.lock failure. Adding another version gate would duplicate the existing dependency and error boundary without improving behavior.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d81525ec9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if actual != expected_sha256:
fail(f"SHA-256 mismatch for {url}: {actual} != {expected_sha256}")
return
except (OSError, urllib.error.URLError) as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retry incomplete asset responses

When GitHub or its release-asset host closes one of these large downloads before the advertised Content-Length, response.read() raises http.client.IncompleteRead, which is neither an OSError nor a URLError. That exception therefore bypasses the intended three-attempt loop and fails the daily upstream workflow immediately; include the relevant http.client transport exceptions in the retry handling (and similarly retry a premature clean EOF before treating its digest mismatch as final).

Useful? React with 👍 / 👎.

@eXPerience83
eXPerience83 merged commit 849d4d9 into main Aug 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant