Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

patch: provide real file transformation workflows - #72

Merged
brandonpayton merged 1 commit into
mainfrom
migrate/patch-cli-main
Jul 17, 2026
Merged

patch: provide real file transformation workflows#72
brandonpayton merged 1 commit into
mainfrom
migrate/patch-cli-main

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 12, 2026

Copy link
Copy Markdown
Member

Why

Kandelo users and package builds need GNU Patch as a first-class Homebrew Formula instead of the registry-only command. The normal patch -e workflow also starts a POSIX shell and GNU Ed, so the Formula must describe and test that real process chain rather than making the top-level executable appear self-contained.

What changed

  • Build GNU Patch 2.8 from its verified official source through Kandelo's SDK, configure, and sysroot path.
  • Declare Dash and Ed as direct target runtime Formula dependencies.
  • Resolve Ed through the guest PATH instead of embedding a builder or Cellar path.
  • Preserve Patch's truthful fork-free contract. For patch -e, Patch starts one /bin/sh descendant through system(), and Dash executes Ed in that descendant.
  • Exercise unified create, modify, and delete; reverse application; dry run; reject-file behavior; and real patch -e execution.
  • Stage the exact installed Dash keg as guest /bin/sh and the exact installed Ed keg on the guest PATH, then require the editor child to be observed and exit successfully.

GNU Patch implements its editor workflow with system("ed - ..."). Patch itself does not import kernel_fork, so adding a continuation surface to that executable would misrepresent the program. This Formula validates Patch as fork-free while explicitly supplying the complete required dependency path for the tested patch -e workflow. Upstream's optional integrations with other version-control tools are outside this Formula's declared required closure.

This PR contains no bottle block, archive, sidecar, receipt, provenance metadata, generated Wasm artifact, platform change, or Kandelo ABI change.

Exact source state

  • Tap base: 1b4a07b88691e293a100223bc6325bcb0d6f23d0
  • Exact PR head: 3a3fb86dc8177e21af99ac6e912ad8d1a5a86653
  • Exact PR tree: 1e1bc86750de7ba085714cb1c58e704e432f177b
  • Stable patch ID, unchanged from the prior reviewed branch: f43a9200d7dcb22707849dff0da8d835e805b75e
  • Formula SHA-256, unchanged: f12bb07241a28f8ac126997188022367e9e8e0898f5aa2987ba902ab10690b5f
  • Declared required runtime dependency closure: exactly Dash and Ed
  • Binaryen and WABT are native build tools only
  • Current Dash and Ed Formula blobs are identical to the prior reviewed inputs

The former seven-commit branch was folded into one purpose-led commit without changing the Formula behavior or bytes.

Historical runtime evidence

These exact Formula bytes were previously built twice on Kandelo ABI 18. Both builds produced the same fork-free executable and the full installed-keg Formula test passed, including exact-keg Dash at /bin/sh, exact-keg Ed on the guest PATH, file-content assertions, and one successfully observed child.

That run is recipe behavior evidence, not current artifact evidence. The shared support tree and Kandelo ABI have advanced, so the old executable must not be published or treated as ABI 41 proof.

The trusted publisher will rebuild this exact merged Formula against the current ABI 41 platform before any bottle, pour, VFS, Node.js, or Chromium acceptance claim.

Fresh source validation

  • Current tap trust checks passed locally.
  • Ruby syntax passed.
  • Homebrew style passed with no offenses.
  • The canonical Formula source-closure validator accepted the exact head.
  • Direct runtime closure and declaration audits returned exactly Dash and Ed.
  • Formula support passed: 48 tests / 380 assertions.
  • TypeScript runner support passed: 15 / 15 tests.
  • git diff --check passed.
  • Independent exact-head review accepted the source Formula after verifying the upstream archive, Dash-to-Ed process semantics, dependency closure, fork-free artifact contract, historical-evidence scope, and live checks.

All former platform dependency gates are present in merged Kandelo platform batch #967: SDK target facts, truthful musl Autoconf identity, authoritative ABI inspection, and kernel-authoritative posix_spawn parentage.

Scope and remaining gates

This is a source Formula review. Publication-shaped closure currently stops truthfully because Dash does not yet have its canonical public bottle block. That is expected before dependency-first bottle publication and is not hidden by a source fallback.

This PR does not claim a current ABI 41 build, public bottle, GHCR readback, stock Homebrew pour, composed VFS image, in-guest install, or browser result. Those remain post-#968 publisher gates.

@brandonpayton

Copy link
Copy Markdown
Member Author

Devil's-advocate review: ACCEPT for source merge after the declared #882 gate at 98b016956bdbb0657283ae9de14fb4514cb17fe7. I reviewed the complete current-main diff, not the closed stacked PR. Installed-tap support loading now matches every merged Formula; Binaryen/WABT are explicit and correctly ordered build dependencies; the instrumented output is fail-closed validated as fork-required before installation; and the real Ed dependency remains declared and exercised. The official GNU archive independently re-downloaded with SHA-256 f87cee69eec2b4fcbf60a396b030ad6aa3415f192aa5f7ee84cad5e11f7f5ae3. Fresh dev-shell evidence: Ruby syntax passed, Homebrew style found no offenses, shared support passed 29/216, and diff-check passed. No current source build, bottle, or pour is claimed; #882 and the publication gates in the body remain binding.

@brandonpayton
brandonpayton force-pushed the migrate/patch-cli-main branch from 98b0169 to bd2066d Compare July 12, 2026 19:03
@brandonpayton

Copy link
Copy Markdown
Member Author

Exact-head devil review: APPROVE bd2066df0c5c1330c2e73a390e46310c3c20bbec against tap main at 14a76fc9a140a4c8898a70c7cec91a106afd2076.

I independently rebuilt the corrected formula against the #874 + #882 integration. The installed raw executable is SHA-256 9636f25921a26ee71ae6e8d36249b1a602f3f26f417590944cd27d60e7956ab3, mode 0755, ABI 18, and passes the authoritative validator with fork: :forbidden: no kernel_fork import, fork-continuation surface, legacy Asyncify, or forbidden host path. This corrects the prior head's false fork requirement.

The full unchanged Formula test passes when the integration image contains its normal validated Dash base shell, including real patch -e execution through the exact tap Ed artifact (SHA-256 af260328845095e708bbaec2ee5d2ff451d164515acd8b1548df06df7c3dba5c) and the asserted ONE\nthree\nfour\n result. Without /bin/sh, the same test truthfully fails because Ed cannot start; that is an integration-image fixture gap, not evidence that Patch needs fork instrumentation.

Source/license/dependency/install-surface review is clean. Formula SHA-256 is c3a1f105c47205c876eefd46af40b903558625a48fc7e4e26f98560a898a3eba; Ruby syntax, Homebrew style, and git diff --check pass. Scope is only Formula/patch.rb and its README inventory entry.

Hard merge gates remain Automattic/kandelo#874 and #882. No bottle or cross-host pour claim is made here.

@brandonpayton
brandonpayton force-pushed the migrate/patch-cli-main branch from bd2066d to 6194f13 Compare July 12, 2026 23:26
@brandonpayton

Copy link
Copy Markdown
Member Author

Independent exact-head devil's-advocate review: ACCEPT for 6194f138db9f377f6976e6ae9854eab332947203.

The review independently proved the complete Dash/Ed process closure, exact-keg staging, real patch -e file modification, and one parented descendant on a synthetic platform containing a stable patch-id match to main PR #905. The installed artifact is ABI 18, fork-free, free of Asyncify and host paths, and two fresh #883-inclusive builds reproduce 56bd618e.... Support, syntax, style, strict audit, readall, and diff checks pass.

The first body review correctly rejected an omitted #883 gate: a minimal build without #883 produced different bytes and host_os=none. The corrected body now names #883 in both the validation stack and merge gates and explains its musl-identity role. No source blocker remains; do not merge until all listed platform/publication gates land.

@brandonpayton
brandonpayton force-pushed the migrate/patch-cli-main branch from 6194f13 to db3b4c7 Compare July 17, 2026 05:02
@brandonpayton brandonpayton changed the title patch: add real file transformation workflows patch: provide real file transformation workflows Jul 17, 2026
Kandelo users and package builds need GNU Patch as a first-class Homebrew formula, including its real shell-and-editor process chain, instead of relying on the registry-only command.

Build upstream GNU Patch through the Kandelo SDK, declare Dash and Ed as its target runtime closure, retain Patch itself as fork-free, and exercise create, modify, delete, reverse, reject, dry-run, and external-editor behavior.
@brandonpayton
brandonpayton force-pushed the migrate/patch-cli-main branch from db3b4c7 to 3a3fb86 Compare July 17, 2026 05:05
@brandonpayton
brandonpayton merged commit cb77ba4 into main Jul 17, 2026
2 checks passed
@brandonpayton
brandonpayton deleted the migrate/patch-cli-main branch July 17, 2026 05:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant