do, run, session: codeaf do edits in place, commits nothing, and stops at a price - #1416
Merged
Merged
Conversation
…eck seat and the fallback receipt These are written against the unfixed tree first: codeaf do committing the person's own work on the run engine, running unbounded without --yes-spend, dropping --db and --keep without a word; a belt landing leaving project lockfiles behind; CODEAF_CHECK_MODEL never reaching a chat's run; and an approved hand-off falling back to the older engine with an identical receipt.
…s at a price The run engine is the road every codeaf do takes, and it swept the directory's whole status into a commit on the checked-out branch, the person's own uncommitted edits and untracked files included. It now keeps the contract --dir states and the older road keeps: edited in place, nothing committed. The folder is read before the run and after, and the files the run names are the ones it changed (session.RunTreeSnapshot). Without --yes-spend a run is bounded again: at the plan-price figure and at what is left of today's limit, whichever is nearer, ending with exit 3. --db is refused in words on this road, and --keep says where the run's store is. A belt landing no longer drops paths by a name project files share: the .lock suffix and the bench-results folder are gone, and what the harness writes is answered in one place (harnessWrote). CODEAF_CHECK_MODEL now seats a chat run's checks. An approved hand-off the run engine could not start says so on its receipt. The wave 6 change entry is rewritten to say what is true.
… answered, and the status check reads git's own columns
…ugh the one asker
…ixes # Conflicts: # docs/changes/unreleased/1109-worker-harness-wave6.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
codeaf dodoor and the harness landing onsantos/dev2: defects a reviewer verified at3f46952d4. With the bash belt now the default, everycodeaf doruns on the run engine, so these reach everyone.What changed
Finding 2 (blocker):
codeaf docommitted the person's own uncommitted work. The run road calledrunengine.Landon the person's own--dir, which staged the wholegit statusand committed it on the checked-out branch, including the person's edits and untracked files. The run road now keeps the contract--dirdocuments ("the directory to work in, edited in place") and the older road keeps: it edits in place and commits nothing. The folder is read before the run starts and again after it (session.SnapshotRunTree), so the files the envelope names are the ones the run changed: a file it wrote, a file it edited further, and anything it committed itself. The person's own edits and untracked files are never named and never touched.run.Landis no longer called fromdo.--dirpromises in-place editing, the older road never commits, and scripts that runcodeaf doread the result in the directory they handed it. Working in a copy and landing it would bring back a commit on the person's branch, which neither the help text nor the older road ever promised.TestDoOnTheRunEngineNeverCommitsThePersonsOwnWork,TestARunTreeSnapshotNamesOnlyTheRunsChanges,TestARunTreeSnapshotOutsideARepositoryNamesNothing. The e2e laneTestDoOnTheRunEnginenow asserts HELLO.md is in the working tree, listed infiles, and that HEAD did not move.Finding 3: changes to
*.lockfiles never landed.beltTreeWorkdropped every path ending in.lock, and everybench-results/path, by name. What the harness itself writes is now answered in one place,harnessWrote: its own.codeaffolder, its plan store and the files the store's engine keeps beside it, and the shim it arms. Project lockfiles and project folders land. Test:TestABeltLandingCarriesTheProjectsOwnLockfiles, which also found thatplandb.db-walwas being staged as work.Finding 4: no spending control on the default road.
runSpendBound: without--yes-spend(orCODEAF_PREAUTHORIZE_SPEND=1), a run is capped at the nearer of the plan-price figure (PlanConsentUSD) and what is left of today's limit. Reaching the plan-price cap exits 3 withstop: price, and reaching the daily cap exits 3 withstop: budget. In both casesblocked_ongives the figure and says to rerun with--yes-spend. A day whose limit is already spent starts nothing.--dbis refused with exit 1 and a sentence that points to the older engine.--keepprintsrecord kept at <dir>/.codeaf/plandb.db. The stale comment claiming the older errand is the default is fixed, and so is the--db/--keephelp text.TestDoOnTheRunEngineStopsAtThePlanPriceWithoutYesSpend,TestDoOnTheRunEngineStopsAtTodaysLimitWithoutYesSpend,TestDoOnTheRunEngineYesSpendRunsPastThePlanPrice,TestDoOnTheRunEngineRefusesDbInWords,TestDoOnTheRunEngineKeepSaysWhereTheRecordIs.Finding 11 (minor): an approved hand-off fell back to the older engine with no word about it. The fix is in
task.goonly. WhenstartKnownTaskRunfails with anything other than the different-ground refusal, the work still starts on the older engine, and the receipt now saysIt runs on the older task engine, because the run engine could not start it: <reason>.Test:TestAnApprovedHandoffTheRunEngineCouldNotStartSaysSo. The typed/taskpath (startTaskRunintask_run_belt.go) falls back the same silent way. That file belongs to the run-lifecycle work, so I left it alone.Finding 14 (minor):
CODEAF_CHECK_MODELdid not reach chat/taskruns. The chat's engine (run/enginewire.go) now seats checks throughconfig.CheckSeatwith no flag, so the environment value reaches them. Test:TestTheChatDoorsCheckRidesTheCheckModelVariable.Wave 6 change entry: by the time this branch merged dev2,
c084b60d7(#1381) had rolled the entry up intoCHANGELOG.mdv0.4.0 and deleted it fromdocs/changes/unreleased/. The merge takes the deletion. The false claims now sit in the released v0.4.0 record: the node engine deleted,CODEAF_TASK_BELTgone, the four node-engine tools gone. So this PR's own change entry carries aninvalidatesline that corrects each of them. The released record is left untouched.Manual:
worker-harness.mdgets three new sections: do edits in place and commits nothing, how much a do run can spend, and--dbplus where the store lives. It also covers the check seat for/taskand the fallback receipt. Theadaptive-runs.mdflag table and store section are updated, two probes are added, and the plan-price figure is quoted through the truth table.Evidence (the shared test box, fresh clones)
RED on the tests-only commit
167df7ef7(on top of dev23f46952d4), log~/src/trees/do-door-red-167df7ef7/red.log:TestDoOnTheRunEngineNeverCommitsThePersonsOwnWorkFAIL:the run committed on the person's branch: HEAD moved ...(author codeaf)....StopsAtThePlanPriceWithoutYesSpendand...StopsAtTodaysLimitWithoutYesSpendFAIL: exit 2, want 3....RefusesDbInWordsFAIL: exit 2, want 1....KeepSaysWhereTheRecordIsFAIL: norecord kept at.TestTheChatDoorsCheckRidesTheCheckModelVariableFAIL: seated on[vendor/chat-plan vendor/profile-careful].TestABeltLandingCarriesTheProjectsOwnLockfilesFAIL: yarn.lock, Cargo.lock, poetry.lock, flake.lock and bench-results left behind, and plandb.db-wal staged.TestAnApprovedHandoffTheRunEngineCouldNotStartSaysSoFAIL: the receipt hides the fallback.GREEN on the merged head
db90b1b20, all with-count=1, log~/src/trees/do-door-db90b1b20/green.log: every test above passes, alongside the existingTestDoOnTheRunEngine*tests and the session lawTestOnlyRepositoryRootAsksGitWhereTheRepositoryIs. The snapshot asks for the repository throughrepositoryRoot, so a scratch folder inside somebody else's checkout never reads as theirs.Gate on the merged head
db90b1b20(this branch merged withorigin/santos/dev2at525b77fde), in a fresh clone:go build ./...EXIT 0,go vet ./...EXIT 0,go vet -tags e2e ./internal/e2e/EXIT 0,gofmt -l cmd internalempty,go test -count=1 ./internal/manual/EXIT 0.make test-touched BASE=origin/santos/dev2EXIT 0. That covered./cmd/codeaf ./internal/e2e ./internal/manual ./internal/run ./internal/sessionwith-count=1, and all five came backok.make checkEXIT 0, with 119 packagesok. Log:~/src/trees/do-door-db90b1b20/gate-check2.log.make checkattempts on the same head failed on tests outside this change, both while the box was under heavy load:TestAnAcceptedFolderFamilyRefusesAFolderThatMovedUnderItfailed with aTempDir RemoveAll cleanup: ... directory not emptyrace. It is node-engine mirror mode and none of its files are touched here. It passes 10 of 10 alone on both the base and the head.internal/resident'sTestRunnerPreemptsPracticeWhenUserWorkArrivesfailed withuser dispatch = 2.gate-check.logandgate-check-run2.login the same folder. Both tests look load-dependent and should be reported as bugs of their own.After the gate, the only commit is
77d00f2c5, which renames this PR's change entry to 1416 and changes no Go. On that head,make changelog-check(30 entries, all well formed) andgo build ./...are both EXIT 0. Log:~/src/trees/do-door-77d00f2c5/proof.log.