|
AWK Minifier
Conservative AWK source minification
|
Accepted
ADR-019 established a deliberate bootstrap rule for the first usable AWK Minifier release: until a trustworthy previous release existed, the stable awk-minifier.min.awk release slot was an exact copy of the development artifact. It also defined the steady-state transition: once a trusted release existed, that release would be pinned through Bashdeps and used to produce later production minified artifacts.
Version v0.1.0 has now completed that bootstrap cycle. The release was produced from reviewed source, passed the repository behavior and portability checks, and published the three governed artifact flavors and checksum companions. Its ordinary awk-minifier.awk artifact is therefore available as the first independent previous-release transformer.
The v0.1.0 transformer removes ordinary comments by design. Current generated build metadata is represented as comments at the start of each artifact. Piping the complete ordinary artifact through v0.1.0 would therefore remove the human-inspectable version, build date, and build commit metadata that the three-artifact model intends to preserve.
make build after dependency preparation.AWK Minifier v0.1.0 SHALL be the production transformer for subsequent .min.awk builds until another accepted decision changes that pin.
The following v0.1.0 release asset SHALL be declared in dependencies.txt:
The manifest entry remains one physical line in the actual Bashdeps manifest.
make deps MAY acquire the pinned release artifact. make deps-check SHALL verify the prepared bytes offline. make build SHALL NOT acquire or repair the dependency and SHALL fail with an actionable diagnostic when vendor/awk-minifier.awk is absent.
The development artifact SHALL continue to contain the complete assembled source plus generated provenance metadata.
The ordinary artifact SHALL continue to derive from the development artifact by removing project-governed Doxygen documentation lines. Its generated artifact label SHALL identify it as the ordinary representation.
The minified artifact SHALL be constructed in two explicit parts:
The generated header SHALL terminate with the exact marker:
The ordinary artifact body is the content after that marker. That body SHALL be piped through:
using the configured AWK_BIN command.
The resulting transformed body SHALL be placed after a newly generated minified artifact header. That header SHALL identify the artifact as minified and record the current version, build date, build commit, and the fact that AWK Minifier v0.1.0 performed the body transformation.
Keeping the generated header outside the transformer input is intentional. The v0.1.0 transformer correctly removes ordinary comments, while the generated header is build provenance rather than product source to be minified.
The current candidate version MUST NOT be substituted for the pinned v0.1.0 transformer. The build MUST NOT silently fall back to copying .dev.awk, self-minification, or an unpinned executable when the dependency is unavailable or fails.
CI SHALL verify all of the following:
make build without prepared dependencies fails and does not create vendor/;make deps followed by make deps-check prepares and verifies vendor/awk-minifier.awk;awk-minifier.min.awk exactly matches a fresh v0.1.0 transformation of the body of awk-minifier.awk;Release validation SHALL perform the same previous-release lineage check before tagging and publication.
The v0.1.0 artifact is executable build-time code and therefore expands the trusted computing base as described by ADR-015. It receives the current ordinary AWK source body on STDIN, executes with the permissions of the build process, and can influence the bytes later published as the minified release artifact.
The dependency is constrained by the following mitigations:
dependencies.txt;Residual risk remains: a digest proves expected identity, not behavioral correctness, and passing fixtures cannot prove equivalence for every valid AWK program. The project accepts that residual risk because the transformer is the project's own previously reviewed release, transformation remains conservative, and release verification exercises both lineage and observable behavior.
make build remains network-free and consumes only prepared dependency state.make build on an unprepared checkout does not acquire missing dependencies.Rejected because the bootstrap condition has been satisfied. Continuing the copy would preserve a filename without exercising the product's intended production role.
Rejected by ADR-019. Candidate self-minification would collapse the independent previous-release trust boundary that the bootstrap strategy was created to establish.
Rejected because v0.1.0 removes ordinary comments, including the generated provenance header. The body is the correct transformation surface; the header is build metadata and remains under Makefile control.
Rejected because ADR-020 establishes Bashdeps as the repository-managed executable dependency lifecycle. A committed vendor copy would create a second acquisition and update model.
Rejected because build must remain offline and dependency acquisition must stay explicit. make deps owns network convergence.
Rejected because the ordinary v0.1.0 artifact is more inspectable while providing the same public transformer behavior. The dependency is a build trust anchor, so the readable release representation is preferred.
Fresh checkouts must prepare repository dependencies before make build. The higher-level make all target continues to provide the convenience lifecycle that runs dependency convergence and then builds.
The .min.awk artifact now becomes genuinely transformed rather than occupying a bootstrap placeholder slot. Its body has explicit previous-release lineage while its generated header continues to provide inspectable current-build provenance.
CI and release workflows must no longer assert that .dev.awk and .min.awk are identical. They instead verify the pinned-transformer lineage directly.
Advancing the production minifier beyond v0.1.0 is a consequential dependency and release-provenance change. A future change should evaluate the new release, update the manifest digest, update the governed minifier version, and record the decision rather than silently following latest.
This ADR completes ADR-019's bootstrap transition and governs steady-state production minification beginning after v0.1.0. ADR-019 remains the historical record explaining why v0.1.0 itself shipped with .min.awk equal to .dev.awk.
This ADR refines ADR-020 by selecting the previously anticipated AWK Minifier dependency and making it required prepared state for production builds.
This ADR preserves ADR-006's three-artifact, metadata, checksum, and behavior-equivalence principles while replacing the inherited Bash-Minifier mechanism with the governed AWK Minifier pipeline.