Skip to content

refactor(release): stop distributing bundled Git - #3457

Merged
jackwener merged 11 commits into
apache:mainfrom
zhiiw:codex/remove-bundled-git-asf
Aug 22, 2026
Merged

refactor(release): stop distributing bundled Git#3457
jackwener merged 11 commits into
apache:mainfrom
zhiiw:codex/remove-bundled-git-asf

Conversation

@zhiiw

@zhiiw zhiiw commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove Dugite and the bundled Git preparation/download pipeline from ASF release inputs
  • stop packaging a Git runtime, bundled-Git manifest, GPL notices, and source-offer artifacts in ASF Desktop releases
  • remove the Runtime Host's Git-CLI injection path entirely; a future Gitoxide broker must introduce its own narrow process protocol and verifiable artifact admission
  • keep the dormant Storage Git adapter and all of its durable v1 schemas unchanged from main
  • keep attached execution unchanged; managed-workspace admission is unavailable before T1 and never falls back to a system Git executable

Context: #3411

Primary invariant

Official ASF convenience artifacts must not distribute or implicitly discover a Git CLI. Its absence is explicit and safe: ordinary Host/attached execution remains available, while managed-workspace execution is unavailable before durable admission/T1 and cannot silently fall back to PATH or a caller-injected executable.

The future Gitoxide integration is deliberately outside this PR. Because Gitoxide is a Rust library, that integration will use a thin Maka-owned Rust broker with a versioned protocol and its own artifact/provenance authority rather than reuse the retired Git-CLI-shaped Host seam.

Scope boundary

Runtime Host, Desktop, and CLI have no production path to ManagedWorkspaceOwner. The dormant Storage Git adapter, its executable/distribution identity behavior, and its binding, repository, epoch, receipt, and quarantine schemas remain byte-for-byte identical to current main. Replacing or deleting that subsystem belongs in a later PR with a real Gitoxide production consumer and production-shaped crash tests.

Verification

  • rebuilt from upstream/main@2e8cd03ba
  • Core, Storage, MCP, Runtime, and Runtime Host builds pass
  • real Runtime Host composition starts without a Git runtime while git is present on PATH, then rejects a managed profile with managed_workspace_profile_unavailable
  • packaged-resource verifier: 15/15 pass
  • dormant bundled-environment adapter tests: 2/2 pass, unchanged from main
  • current Desktop and CLI third-party notice checks: pass
  • current notice-truncation regression: pass
  • product release identity and changed-file formatting/diff checks: pass
中文说明

变更摘要

  • 从 ASF release inputs 中删除 Dugite 依赖以及 bundled Git 下载、准备流程。
  • ASF Desktop 发布物不再携带 Git runtime、bundled-Git manifest、GPL notice 或 source offer。
  • 完全删除 Runtime Host 的 Git CLI 注入路径;未来 Gitoxide broker 必须建立自己的窄进程协议和可验证 artifact admission。
  • 保持 dormant Storage Git adapter 及其全部 durable v1 schema 与 main 完全一致。
  • attached execution 不受影响;managed workspace 在 T1 前明确不可用,也不会回退系统 Git executable。

背景讨论:#3411

主要不变量

ASF 官方 convenience artifact 不分发、也不隐式发现 Git CLI。Git CLI 缺失是明确且安全的状态:普通 Host/attached execution 继续可用;managed workspace 在 durable admission/T1 前不可用,并且不能静默回退 PATH 或 caller 注入的 executable。

未来 Gitoxide 集成不属于本 PR。Gitoxide 是 Rust library,因此后续会使用一层 Maka 自有的薄 Rust broker,提供带版本协议和独立 artifact/provenance authority,而不是复用已经删除的 Git CLI 形状 Host seam。

范围边界

Runtime Host、Desktop 和 CLI 已经没有通往 ManagedWorkspaceOwner 的生产路径。Dormant Storage Git adapter、executable/distribution identity 语义,以及 binding、repository、epoch、receipt 和 quarantine schema 均与当前 main 字节级一致。替换或删除该子系统,应放到后续具备真实 Gitoxide 生产消费者和 production-shaped crash tests 的独立 PR。

验证

  • upstream/main@2e8cd03ba 重建。
  • Core、Storage、MCP、Runtime、Runtime Host 构建通过。
  • 真实 Runtime Host composition 在 PATH 中存在 git 时仍能无 Git runtime 启动,并以 managed_workspace_profile_unavailable 拒绝 managed profile。
  • packaged-resource verifier:15/15 通过。
  • dormant bundled-environment adapter 原有测试:2/2 通过,且与 main 保持一致。
  • 当前 Desktop/CLI third-party notice checks 通过。
  • 当前 notice 截断回归测试通过。
  • release identity、变更文件格式和 diff 检查通过。

@zhiiw
zhiiw marked this pull request as ready for review August 22, 2026 03:29

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for moving the product to a single external Git-runtime contract and removing the bundled distribution, licenses, and preparation paths together. The current Windows package check exposed one deterministic verifier contradiction, and I noted one persisted-identity compatibility point inline.

AI-assisted review disclosure: OpenAI Codex performed an independent exact-head packaging and compatibility review. I verified the failed Windows check, the corresponding macOS path, the persisted runtime identity change, and the live PR state, and I made the final review decision.

Comment thread scripts/verify-packaged-app.mjs Outdated
Comment thread packages/storage/src/git-workspace-service.ts Outdated

@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.

Summary

This PR correctly stops ASF convenience artifacts from shipping a Git runtime: Dugite, prepare:bundled-git*, extraResources git/ / bundled-git.json / GPL notices, and the Runtime Host bundled-Git resolver are gone, and packaged-app verification now forbids those paths. Ordinary Host/attached startup no longer depends on Git; managed-workspace owner composition is skipped unless an explicit VerifiedGitRuntimeInput is injected, and managed profiles fail closed instead of falling back to PATH Git. The remaining risks are merge onto current main (notices/ci-test-plan overlap), a license-agnostic injection seam, and a Host-without-Git test that mocks composition rather than exercising admission.

Issue counts by severity

  • bugs: 1
  • suggestions: 2
  • nits: 0

Comment thread apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Comment thread packages/storage/src/git-workspace-service.ts Outdated
@zhiiw
zhiiw force-pushed the codex/remove-bundled-git-asf branch from 54999ac to b61437c Compare August 22, 2026 09:23
@zhiiw
zhiiw force-pushed the codex/remove-bundled-git-asf branch from e48e927 to fce583b Compare August 22, 2026 09:50
@zhiiw

zhiiw commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in the rebuilt head fce583b1f.

I accepted the owner/scope finding and resolved both comments with one simplification:

  • the Storage Git adapter, its runtime/distribution identity behavior, and its durable binding/repository/epoch/receipt/quarantine schemas now match current main byte-for-byte;
  • the v2 binding/schema rewrite and its compatibility regression have been removed from this PR;
  • because the binding remains v1, the enclosing baseline receipt and quarantine envelopes remain consistently v1 as well, so there is no mixed-version durable shape;
  • the Runtime Host Git CLI injection seam remains deleted, so the dormant Storage adapter has no Desktop/CLI/Host production consumer;
  • the branch was rebuilt from upstream/main@2e8cd03ba.

Future Gitoxide work will introduce its own broker protocol and artifact authority in a PR that includes a real production consumer and production-shaped crash tests. This release PR now proves only the package/Host absence invariant.

Verification after the rebuild:

  • Core, Storage, MCP, Runtime, and Runtime Host builds pass;
  • real Host-without-Git/PATH-non-discovery tests pass;
  • packaged-resource tests pass 15/15;
  • Desktop and CLI notice checks plus the current notice-truncation regression pass;
  • the unchanged dormant environment adapter tests pass 2/2;
  • git diff upstream/main -- packages/storage/src/git-workspace-service.ts packages/storage/src/managed-workspace-owner.ts is empty.
中文说明

已在重建后的 head fce583b1f 中处理。

我接受 owner/scope 结论,并用一次收缩同时解决两个问题:

  • Storage Git adapter、runtime/distribution identity 语义,以及 binding/repository/epoch/receipt/quarantine durable schema 均与当前 main 字节级一致;
  • 本 PR 已撤回 v2 binding/schema 改写及其兼容性回归测试;
  • binding 保持 v1 后,外层 baseline receipt 和 quarantine envelope 也继续保持一致的 v1,不再存在混合版本 durable shape;
  • Runtime Host Git CLI 注入 seam 仍然删除,因此 dormant Storage adapter 没有 Desktop/CLI/Host 生产消费者;
  • 分支已从 upstream/main@2e8cd03ba 重建。

未来 Gitoxide 会在带真实生产消费者与 production-shaped crash tests 的独立 PR 中建立自己的 broker protocol 和 artifact authority。本 release PR 现在只证明 package/Host 的 Git absence 不变量。

重建后验证结果:

  • Core、Storage、MCP、Runtime、Runtime Host 构建通过;
  • 真实 Host-without-Git/PATH 不发现测试通过;
  • packaged-resource 测试 15/15 通过;
  • Desktop/CLI notice checks 与当前 notice 截断回归测试通过;
  • 未修改的 dormant environment adapter 测试 2/2 通过;
  • git diff upstream/main -- packages/storage/src/git-workspace-service.ts packages/storage/src/managed-workspace-owner.ts 为空。

@jackwener
jackwener requested a review from Astro-Han August 22, 2026 11:43

@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.

Approved on exact head 0fd800a after the Windows legacy-upgrade verifier fix, latest-main integration, and the /transcript mid-turn declaration repair. CI remains the merge gate.

@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.

Approved on exact head d4a8ac8 after integrating current main and updating the packaged Windows sandbox smoke to pass the required target identity. CI and Windows packaging remain the merge gates.

@jackwener
jackwener merged commit 29d026e into apache:main Aug 22, 2026
3 checks passed
Astro-Han added a commit that referenced this pull request Aug 22, 2026
The rebase conflict on verify-windows-sandbox-e2e.mjs was resolved with
the branch's own 'unchecked' variant, which would have reverted the #3457
hardening (the script now captures a real T0 identity via stat and passes
it). Restore the main version: the script verifies relay AND the packaged
CAS path; 'unchecked' would silently skip the identity comparison on the
release lane.

Generated-by: DSv4F-AstroHan
Astro-Han added a commit that referenced this pull request Aug 22, 2026
…he filesystem worker (#3487)

* fix(runtime): distinguish unchecked writes from T0-missing races in the filesystem worker

Fixes #3484.

expectedIdentity was optional, so a caller without a T0 snapshot was
indistinguishable from a T0-missing target that appeared while queued;
every write to an existing file without an identity failed with
path_changed, breaking verify-windows-sandbox-e2e and blocking the
Release Windows check on four PRs.

- FilesystemWorkerExpectedIdentity is now required: {dev,ino} |
  'missing' | 'unchecked'. Every caller must decide explicitly which
  CAS contract it participates in.
- The wire request carries the T0 marker explicitly (protocol v7) so
  the worker can tell 'created while queued' from 'no CAS snapshot'.
- Worker: t0 'missing' + existing target fails path_changed; t0
  'existing' without identity fails invalid_request (buggy caller);
  t0 'unchecked' skips CAS. Identity-present targets still CAS.
- openStableTarget opens an existing target without an identity when
  the caller is 'unchecked' (no comparison), keeping the create path
  exclusive (wx) unchanged.
- Callers: FilesystemExecutor passes its captured identity or
  'missing' for mutations and 'unchecked' for reads; the runtime-host
  read-only adapter and verify-windows-sandbox-e2e pass 'unchecked'.
- Tests: unchecked write to an existing target passes and carries no
  identity; 'missing' with an existing target still fails path_changed;
  CAS mismatch still fails; T0-missing marker is preserved on the wire.

Generated-by: DSv4F-AstroHan

* fix(runtime): forward the apply_patch identity through the executor's worker branch

The T0 marker computation in the executor aligned with `mutates`
(write/edit/format_json) instead of the worker client's `operationAccess`
(write/apply_patch/edit/format_json). apply_patch therefore fell into the
'unchecked' branch, silently dropping the identity captured by
applyPatch() and disabling the queue-window CAS on the main editing
channel (create/update/delete). Add apply_patch to the mutation list,
point the comment at operationAccess as the authority, and cover the
forwarding with an executor-level regression test.

Generated-by: DSv4F-AstroHan

* refactor(runtime): collapse the wire identity contract to one required three-state field

Review finding (P2, Opus5 + Muse converged): the previous wire carried a
required `t0` enum plus an optional `identity` plus two cross-field
superRefines — two models for one concept, with the looser wire able to
express illegal combinations that only runtime constraints rejected.

The wire now carries a single required three-state `identity`
({dev,ino} | 'missing' | 'unchecked') mirroring the client input, so an
illegal state cannot be expressed on the wire at all. The worker treats
'missing' with an existing target as created-while-queued (path_changed),
CASes objects, and skips everything for 'unchecked'. The "buggy caller
omitted identity" invalid_request guard disappears because the wire can
no longer express that state.

Generated-by: DSv4F-AstroHan

* fix(runtime): single-source the write-kind set and add apply_patch CAS behavior tests

Review follow-ups (#3487, Opus5/Luna):

- `operationAccess` (write | apply_patch | edit | format_json) now lives
  once in the shared protocol module; the client, the worker and the
  executor's T0-marker decision all call it, so the set cannot drift —
  the executor previously hand-copied a third list that silently dropped
  apply_patch onto 'unchecked'.
- Worker-level behavior tests: an apply_patch update against a swapped
  inode fails path_changed and leaves the replacement content untouched
  (delete and edit already had such tests; update was the gap).
- Format the smoke-test fixtures so the exact-head format check passes.

Generated-by: DSv4F-AstroHan

* fix(release): keep the sandbox e2e participating in CAS after rebase

The rebase conflict on verify-windows-sandbox-e2e.mjs was resolved with
the branch's own 'unchecked' variant, which would have reverted the #3457
hardening (the script now captures a real T0 identity via stat and passes
it). Restore the main version: the script verifies relay AND the packaged
CAS path; 'unchecked' would silently skip the identity comparison on the
release lane.

Generated-by: DSv4F-AstroHan

* fix(runtime): close the maintainer-review gaps on the identity contract (#3487)

Three findings from the external maintainer review:

1. JavaScript callers were not migrated and the required-field argument
   gave them no protection. The client now auto-generates the wire
   'unchecked' identity for reads (callers cannot get reads wrong, even
   from plain .mjs that bypass TypeScript) and enforces at runtime that
   write operations carry an explicit identity contract — a JS caller
   that omits it fails loudly instead of silently skipping the
   queue-window CAS. verify-macos-arm64-dmg.mjs's raw v7 write request
   gains the required identity: 'missing'.

2. Creation diff was lost: the truthy 'missing' string made the old
   `!expectedTarget?.identity` test fail, collapsing new-file writes
   into unknown and hiding the `--- /dev/null` diff. The worker now
   derives "approved missing" from targetType, with a behavior test
   asserting a missing-target write reports a creation diff.

3. mutates() removed; the executor's mutation gate and the T0-marker
   decision now use the single operationAccess authority.

Verification: runtime+runtime-host typecheck clean; focused suites
71/71; full @maka/runtime test:dist 3080 pass / 0 fail; format:check
clean; request shapes for both verifier scripts validated against the
worker's schema (write/'missing' and read/'unchecked' parse; the
pre-fix no-identity shape is rejected). The packaged Release Windows
verifier and the macOS DMG verifier cannot run on this machine (no
Windows runner, no packaged artifacts); their request construction is
covered by the schema checks above.

Generated-by: DSv4F-AstroHan

* fix(release): give the sandbox e2e negative cases a truthful T0 identity

The client now rejects a write without an explicit expectedIdentity at
runtime (#3487). Two intentionally-failing cases in
verify-windows-sandbox-e2e.mjs wrote without one, so they were rejected
by the parameter validation with invalid_request instead of reaching the
sandbox path they were meant to exercise (parent-entry fail-closed, and
the workspace-boundary path_denied). Pass 'missing' — the truthful T0
state for targets that do not exist — so the intended checks run again.

Generated-by: DSv4F-AstroHan
@zhiiw
zhiiw deleted the codex/remove-bundled-git-asf branch August 22, 2026 15:20
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.

3 participants