You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
backend bindings remain available during incremental generation;
component assets can be emitted incrementally;
stale page output is removed after a route change;
generated output is deterministic for clean builds.
These tests validate important individual cases, but they do not establish the strongest invariant expected from an incremental compiler:
For the same final project state and configuration, an incremental build must produce the same committed artifact tree as a clean build.
Problem
Incremental systems can pass focused unit tests while still accumulating state-dependent errors, including:
stale files after rename, removal, render-lane changes, or feature removal;
manifests that include old records or omit unchanged records;
asset hashes and references that depend on edit order;
component/layout reverse-dependency gaps;
CSS or generated client runtime that is not invalidated by the right source;
incremental output that differs depending on the sequence of edits;
different file modes or line endings;
generated app output that uses stale endpoint, guard, contract, or import metadata;
output directories that look valid during dev but differ from release builds.
Because gowdk dev serves the incremental result, equivalence is a user-visible correctness guarantee, not only a test optimization.
Goal
Add a reusable equivalence harness and CI matrix proving that supported incremental edit sequences converge to the exact artifact set produced by a clean build of the final source snapshot.
Core invariant
For a project state S0, an edit sequence E, and final state Sn:
Comparison should include all compiler-owned output relevant to the selected target:
relative paths;
file bytes;
executable/file modes where meaningful;
symlink policy, if generated symlinks ever become supported;
absence of stale files;
route, asset, build, OpenAPI, AsyncAPI, audit, and other manifests/reports;
generated Go application files;
frontend/backend split metadata;
WASM and generated browser assets when selected.
Nondeterministic fields should be eliminated from generated output rather than broadly ignored. Any intentional exception must be narrow, documented, and normalized by the comparison helper.
Proposed test harness
Create a package-level test utility that can:
Materialize an initial project fixture.
Run a clean build into initial/.
Apply one or more explicit filesystem/config mutations.
Run incremental rebuilds into incremental/ using the real invalidation path.
Materialize the final project state separately.
Run a clean build into clean-final/.
Compare complete output trees and produce a useful diff.
guard, CSRF, body-limit, rate-limit, and error-page changes;
Go binding ABI changes;
command/query/event/job registration changes;
realtime subscription/invalidation changes;
OpenAPI/AsyncAPI output changes.
Configuration and targets
addon/feature enable and disable;
output-affecting config changes;
selected module changes;
target addition/removal/rename;
static, app, binary, backend, Docker, recipe, and WASM target changes;
environment declaration changes that affect generated code shape but not runtime values.
Assets and reports
stylesheet add/remove/rename/content change;
content-hashed filename turnover and stale-hash removal;
generated client runtime change;
SEO/sitemap/robots/JSON-LD changes;
audit policy addition/removal;
report and manifest ordering stability.
Filesystem and platform behavior
non-ASCII paths;
spaces in project paths;
case-sensitive platform scenarios, plus portable-path diagnostics once supported;
Windows path separators and executable naming in the Windows lane.
Randomized/state-machine testing
After the deterministic matrix is stable, add a bounded property/state-machine test:
generate a small valid project;
choose a seeded sequence of supported edits;
run incremental builds after each step;
compare the final result with a clean build;
print and retain the seed on failure;
minimize failing sequences where practical.
This need not run with a large search space on every pull request. A short deterministic seed set can run in merge CI, with broader scheduled coverage.
Relationship to transactional publication
#669 should guarantee that only successful generations become visible. This issue verifies that the successfully committed incremental generation is semantically identical to a clean generation. The two guarantees are complementary:
[Testing] Add incremental-versus-clean build equivalence testing
Priority
High — generated-output correctness and dev-loop trust
Context
GOWDK has meaningful incremental-build coverage already. Existing tests verify behaviors such as:
These tests validate important individual cases, but they do not establish the strongest invariant expected from an incremental compiler:
Problem
Incremental systems can pass focused unit tests while still accumulating state-dependent errors, including:
Because
gowdk devserves the incremental result, equivalence is a user-visible correctness guarantee, not only a test optimization.Goal
Add a reusable equivalence harness and CI matrix proving that supported incremental edit sequences converge to the exact artifact set produced by a clean build of the final source snapshot.
Core invariant
For a project state
S0, an edit sequenceE, and final stateSn:must be equivalent to:
Comparison should include all compiler-owned output relevant to the selected target:
Nondeterministic fields should be eliminated from generated output rather than broadly ignored. Any intentional exception must be narrow, documented, and normalized by the comparison helper.
Proposed test harness
Create a package-level test utility that can:
initial/.incremental/using the real invalidation path.clean-final/.Example API:
The comparison report should identify:
Required scenario matrix
Pages and routes
paths {}record addition/removal/reordering;Components and layouts
Backend and contracts
Configuration and targets
Assets and reports
Filesystem and platform behavior
Randomized/state-machine testing
After the deterministic matrix is stable, add a bounded property/state-machine test:
This need not run with a large search space on every pull request. A short deterministic seed set can run in merge CI, with broader scheduled coverage.
Relationship to transactional publication
#669 should guarantee that only successful generations become visible. This issue verifies that the successfully committed incremental generation is semantically identical to a clean generation. The two guarantees are complementary:
Non-goals
Acceptance criteria
Related
gwdkir.Programinto semantic IR and target-specific plans #668 — validated program and target-plan boundaries