Skip to content

a run's own scratch note no longer fails the delivery gate - #1096

Merged
santoshkumarradha merged 3 commits into
devfrom
fix/do-scratch-note-gate
Sep 17, 2026
Merged

santoshkumarradha merged 3 commits into
devfrom
fix/do-scratch-note-gate

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

codeaf do works in the person's own directory, so its job root's workspace is
OwnedByPerson. leafOutputHint offered that root the overflow-document
address exec.SuggestPathFor(node.ID, title) — a workspace-relative
task-<n>-<slug>.md — while every intermediate leaf was already pointed at the
run's scratch. A root that took the offer left an untracked file at the root of
the person's tree. Workspace.RecordChanges observed it, Workspace.Artifacts
filed it, jobArtifacts joined it into the record the delivery gate is held to,
and the gate read a file the request never named as part of what was handed
over and refused the delivery; the run then ended incomplete over work that was
complete and committed.

There is no separate mechanical clean-tree check to exempt, so the fix is the
writer's, not the reader's: where the workspace belongs to the person, the job
root's file invitation is resolved through Workspace.ScratchPath, the same
address an intermediate leaf gets, and the withdrawal for a directory already
standing at that name is measured at the scratch spelling. The final message
still carries the deliverable.

Nothing is excluded by name. Workspace.record drops any path outside the root,
so a note written at the offered scratch address is never in the record; a file
that turns up in the person's tree while the leaf runs is still observed and
still lands in that record, whatever it is called.

Tests beside the touched package cover the three halves: a personal root is
offered a path under the run's scratch and the tree it was judged in is left
empty; a file appearing in the person's tree at a name wearing the same shape
still joins the record; a directory at the offered scratch path still withdraws
the invitation.

🤖 Generated with Claude Code

@santoshkumarradha santoshkumarradha changed the title WIP: a run's own scratch note no longer fails the delivery gate a run's own scratch note no longer fails the delivery gate Sep 17, 2026
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Pre-merge run on the exact head e6c0b6a: Spark job 20260917-080738-000544, go build ./... ok, go vet ok, go test -count=1 ./cmd/codeaf/... ok. Earlier job 20260917-080149-000543 on 9ba0faa (same code, before the change note) also green. Live check: a scratch do run finished with exit 0 and left no note in the tree.

@santoshkumarradha
santoshkumarradha marked this pull request as ready for review September 17, 2026 08:09
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Hi @AbirAbbas, please review as high priority.

santoshkumarradha and others added 3 commits September 17, 2026 09:01
leafOutputHint invited a job root to write its overflow document at a
workspace-relative name (exec.SuggestPathFor's task-2-x1-toolchain-checks.md
shape), so a run working in a person's directory left that note untracked at
the root of their working tree. The delivery gate holds the run's record —
the artifact registry, joined by jobArtifacts, plus the delivered tree —
against the request, read the note as part of what was handed over, and
refused the delivery; the run then ended incomplete over complete work.
There is no separate mechanical clean-tree check to exempt, so the fix is
the writer's: where the workspace belongs to the person, the root's file
invitation points at the run's scratch beside its recorders and job logs,
and the message keeps carrying the deliverable.
TestARootLeafInAPersonsDirectoryPutsItsNotesInScratch baselined the tree
after the note was already written, so its landing read could never have
observed anything: the record stayed empty because of the ordering, not
because of the address. The baseline now happens first, in the executor's
own order, and a hint that ever points into the tree again fails on the
observation, not only on the spelling.

And the other half of the law is pinned down: a file that turns up in the
person's tree while the leaf runs — even at a name wearing the run's own
task-<n>-<slug>.md shape — is still observed and still lands in the record
the delivery gate is held to. Only the run's own note moved; nothing else
about what the tree says was loosened.

Co-Authored-By: codeaf <[email protected]>
@santoshkumarradha
santoshkumarradha changed the base branch from santos/dev to dev September 17, 2026 13:04
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Retargeted to dev at Santosh's request: the branch was rebased from santos/dev onto origin/dev (09299019b), same diff, and builds clean. Spark make pr-ready on this head is fleet job 20260917-130548-000567; result follows.

@santoshkumarradha

Copy link
Copy Markdown
Member Author

Correction: the Spark job for this head is 20260917-132058-000568 (cpu lane); 000567 was queued behind a stuck gpu-lane job and dropped.

@santoshkumarradha

Copy link
Copy Markdown
Member Author

Spark make pr-ready on head 3189c4091 against origin/dev 09299019b: exit 0 (light gate + touched-package suites, fleet job 20260917-132058-000568, finished 13:37Z).

@santoshkumarradha

Copy link
Copy Markdown
Member Author

Re-tested against the current dev (36f169244, after #1095, #1104, #1076): merged 3189c4091 onto it cleanly and make test-touched passed on Spark over ssh (log spark:/tmp/mergecheck2-1096.log).

@santoshkumarradha
santoshkumarradha merged commit a5af991 into dev Sep 17, 2026
4 checks passed
@santoshkumarradha
santoshkumarradha deleted the fix/do-scratch-note-gate branch September 17, 2026 15:51
@santoshkumarradha santoshkumarradha added the bug Something the code does that it should not label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something the code does that it should not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant