Repository navigation
fix(platform): hash daemon inputs for static checks - #4280
Conversation
Two platform suites import the sandbox daemon's file-ops.ts, which imports its protocol.ts. Only the test task hashed the two files, so an edit to either alone replayed the cached lint and typecheck verdicts, although tsc and oxlint's type-aware rules both type them as part of the platform's program. The lint and typecheck tasks now list both files after $TURBO_EXTENDS$ and $TURBO_DEFAULT$. The turbo inputs guard asks turbo's dry run whether both tasks hash them and still hash their own workspace.
ACCEPT — independent source/local review of PR #4280 (TALE-619)Exact head: Independently observed
Unrun proof / remaining gate
Root's 08:15Z rule is preserved: a later blocking finding overrides ACCEPT until independently closed at the exact source with proof. No earlier PR review/comment blocker was present at readback. Evidence in TALE-632 delivery: |
What changed
services/platform/turbo.jsonnow gives@tale/platform#lintand@tale/platform#typecheckaninputslist:$TURBO_EXTENDS$,$TURBO_DEFAULT$, then the sandbox daemon'sfile-ops.tsandprotocol.ts.stageFilesfromservices/sandbox-runtime/daemon/src/file-ops.ts:backend/domains/files/sandbox-blob-routes.test.tsandbackend/domains/tasks/agent-review-files.integration.ts.file-ops.tsimportsWORKSPACE_ROOTfrom./protocol.ts. Its other imports arenode:builtins, andprotocol.tsimports nothing. No further daemon file is in the closure.tsc --noEmit(the platform'sincludecovers both importers) andoxlint --type-awaretype both files as part of the platform's program.testhashed them. An edit to either file alone kept thelintandtypecheckhashes, so CI replayed their cached verdicts.tests/guards/turbo-inputs.guard.test.tsgains adescribe.eachoverlintandtypecheck.turbo run <task> --filter=@tale/platform --dry=jsonwhether each task hashes both files, and whether it still hashes its own workspace ($TURBO_DEFAULT$).inputslist, so it now also holds the two new lists to$TURBO_EXTENDS$,$TURBO_DEFAULT$.testinputs, every task name and the task settings are unchanged..agents/repo.mddescribes the two new lists next to the platform'stestinputs.How I verified it
Reproduction on
main(ffa15e019):turbo --dry=json --cache=local:,remote:runs in my own worktree, which is not shared.git statusis clean.linttypechecktest89c1de98e90016a5d90aff31a0a52a5cae0fcbe2ed6788e7file-ops.ts89c1de98e90016a5(stale)d90aff31a0a52a5c(stale)6eb40a0b77879725protocol.ts89c1de98e90016a5(stale)d90aff31a0a52a5c(stale)188b9e7d8710841003da3d51b1605bb7854d8552c1680c08930a6f48758cf659file-ops.tsa81b90d036b01669a719fb313f74eecac11ee2744f211021protocol.ts2e0940d40b616c27f3456551c9cee35e7ffd79017fc2900403da3d51b1605bb7854d8552c1680c08930a6f48758cf659Dry-run diff, main versus this branch (
lint typecheck test test:ui test:browser):lintandtypecheckgo from 4,520 to 4,522 inputs: exactly the two daemon files are added, and none is dropped.test(5,991),test:uiandtest:browser(5,492 each) andsetupkeep identical input sets.inputsis equal:dependsOn: ["setup"],outputs: [], cache on.The consuming tasks (not only the JSON):
tsc --listFilesOnlywith the platform's owntsconfig.jsonoptions takes both daemon files into the program when it is rooted atbackend/domains/files/sandbox-blob-routes.test.ts.tsc --noEmiton that program passes on the head. A probe type error appended todaemon/src/protocol.tsordaemon/src/file-ops.tsfails it, withTS2322reported inside the daemon file. So the platformtypecheckverdict depends on both files.oxlint --type-aware backend/domains/files/sandbox-blob-routes.test.ts, run fromservices/platform, passes on the head. A probe that leavesstageFiles's parameters alone but makes its result non-thenable (infile-ops.tsonly) fails the platform file withtypescript(await-thenable)at line 234. So the platformlintverdict depends onfile-ops.ts.protocol.tsreaches the lint verdict only through the types it lends that same program. Today that isWORKSPACE_ROOT, plus any global declaration it might add. It is hashed because it is a member of the program, not because of a flip I produced..turbocache exists in the worktree.Guard:
bunx vitest run tests/guards/turbo-inputs.guard.test.tspasses 41 of 41 (35 before).turbo.jsonalone and then restored:main'sturbo.json: 4 failures, the two files for each oflintandtypecheck.lintwithout$TURBO_DEFAULT$: 2 failures, the prefix case and the lint self-hash case.typecheckwithoutprotocol.ts: 1 failure.Static checks on the changed files:
oxfmt --checkpasses, and the JSON parses.oxlint --type-awareon the guard passes.tsc --noEmitpasses on a temporary config holding only the guard file, which I deleted afterwards.Left out on purpose
lintandtypecheckstill don't hash. Fixing them is out of this change's scope, so they are recorded on TALE-619 for routing:knip.config.ts, imported bytests/guards/frontend-entry-discovery.guard.test.ts. It in turn importspackages/{ui,shared,marketing-ui}/package.json.services/sandbox-runtime/build-gemini-settings.ts, imported bylib/harnesses/gemini-settings-build.test.ts.^dependency gap that.agents/repo.mdalready records.daemon/src/exec-journal.tsto thetestinputs, becausebackend/core/chat/external_turn_shared.test.tsimports it. Whichever of the two lands second should list it inlintandtypecheckas well, along with aSTATIC_IMPORTSentry.Follow-up from #4101 (the "turbo inputs" LOW).