Raised by @andrew-fleming in #717.
Problem
compile:integration writes into the same contracts/artifacts/ tree as src, and the compiler names each artifact directory after the source basename. Two sources sharing a basename silently overwrite each other, last compile wins.
Already happened: ConfidentialFungibleTokenPublicSupply.compact existed under both src/token/extensions and test/integration/_mocks. It surfaced as a wrong-contract arity error, invisible to lint, typecheck, and the truncated-key scan, and was worked around by renaming the mock (f453342d).
Proposed
Give the mocks their own output tree. The compiler already supports it:
-"compile:integration": "compact-compiler --src test/integration/_mocks"
+"compile:integration": "compact-compiler --src test/integration/_mocks --out artifacts/integration"
Then:
turbo.json — compile:integration outputs become artifacts/integration/**/
- the three
test/integration/fixtures/*.ts imports move under artifacts/integration/
contracts/test-utils/harness/LiveSimulatorBackend.ts:116 hardcodes contracts/artifacts/<name>/ for ZK key loading, so the root has to come from SimulatorConfig instead
emptyKeyArtifacts's variadic sourceRoots, INTEGRATION_MOCKS (scripts/live/paths.ts), and the #integration conditional in ArtifactCompiler exist only because the trees are shared, and can go
Caveats
Cheaper interim
A scripts unit test asserting no basename appears under both src/**/*.compact and test/integration/_mocks/*.compact catches the collision in CI with no live-path change. Worth doing whether or not the move happens.
Refs #716.
Raised by @andrew-fleming in #717.
Problem
compile:integrationwrites into the samecontracts/artifacts/tree assrc, and the compiler names each artifact directory after the source basename. Two sources sharing a basename silently overwrite each other, last compile wins.Already happened:
ConfidentialFungibleTokenPublicSupply.compactexisted under bothsrc/token/extensionsandtest/integration/_mocks. It surfaced as a wrong-contract arity error, invisible to lint, typecheck, and the truncated-key scan, and was worked around by renaming the mock (f453342d).Proposed
Give the mocks their own output tree. The compiler already supports it:
Then:
turbo.json—compile:integrationoutputs becomeartifacts/integration/**/test/integration/fixtures/*.tsimports move underartifacts/integration/contracts/test-utils/harness/LiveSimulatorBackend.ts:116hardcodescontracts/artifacts/<name>/for ZK key loading, so the root has to come fromSimulatorConfiginsteademptyKeyArtifacts's variadicsourceRoots,INTEGRATION_MOCKS(scripts/live/paths.ts), and the#integrationconditional inArtifactCompilerexist only because the trees are shared, and can goCaveats
outputs: ["artifacts/**/"], so the shared-tree hazard behind dev: scope turbo compile outputs per module (fix 142 GB cache + 0-byte key races) #675 is repo-wide.Composed…mock name. Siblings areComposedTokensandSharedInitCollision, so the prefix is the convention for these mocks, not a workaround for the clash.Cheaper interim
A
scriptsunit test asserting no basename appears under bothsrc/**/*.compactandtest/integration/_mocks/*.compactcatches the collision in CI with no live-path change. Worth doing whether or not the move happens.Refs #716.