Repository navigation
Description
Part of #141. The highest-leverage fix; sequence first alongside the handoff contract.
What happened
A parent task carved five sub-task worktrees for its parts. The machinery grounds a repository task with git worktree add off HEAD (internal/session/standingtree.go:13 states this as law). The parent's entire implementation was uncommitted, so every child got a world without the change its brief described. All four test lanes were doomed at birth: one looped for $7.99 and died out-of-steps, one failed, two were rejected by their checkers. ~$14 and an hour of wall time spent proving the ground was stale.
The codebase already names the defect — standingtree.go exists "for the gap a worktree's HEAD leaves" — and already carries the cure: internal/furrow/furrow.go documents furrow as copy-on-write forking of a whole workspace ("files, dependencies, .env, the dev database, git's own mutable state — into byte-exact universes in about a second"), embedded in every binary via go:embed. It was not engaged because the folder had never seen furrow watch, and by the capability-absent law the rest of aforge then behaves as if furrow does not exist.
The law
A handoff hands the parent's world as it is, never a ref to history. The ground of a child task is the parent's state at handoff time — uncommitted edits, untracked files, environment, data — by construction, in every domain. A research task inherits the notes gathered so far; a media task the assets; a coding task the tree. "The world" is a directory in every domain, and the machinery that forks directories exists.
The mechanism: one ground ladder, furrow-first
- furrow fork of the parent's universe when the workspace is watched — byte-exact, sealed, manifest included.
- auto-snapshot fallback when it is not: the engine commits the parent's tree (a machine commit on the task branch, including untracked files the parent created) and carves the child worktree from that commit — never from HEAD, never from a remote ref.
- folder copy for non-repositories (already exists in standingtree.go — same law, lowest rung).
And since every aforge carries furrow, aforge should start the watch itself on a workspace it works in (with the same consent posture as any other write) rather than waiting for a person to remember furrow watch. A capability the binary carries but never engages is absent by our own law — in the bad direction.
Where
internal/session (taskGroundDir and the carve path in standingtree.go/place.go), internal/furrow (the seam is ready), divide machinery in task_run.go.
Acceptance
- A child task spawned while its parent holds uncommitted work sees that work, on all three ladder rungs.
- A test pins it: parent writes an uncommitted file, divides; the child's ground contains it.
- The child's ground records which rung grounded it (furrow seal id / snapshot commit / copy), so a report can say what world it worked in.
- Non-repo tasks (plain folders) inherit the parent's folder state the same way.
Drafted with CodeAF · reviewed and owned by the author
Activity
santoshkumarradha commentedon Sep 1, 2026
More evidence from the same run's shutdown: when the dogfood tasks closed, the machinery de-registered the task worktrees while hours of work sat uncommitted in them —
git worktree listno longer shows them, the.gitpointer file is gone, and the kept branch (task/continue-your-previous-turn-was-6a192a) points at the BASE commit, not the work. The implementation survived only as loose files in the orphaned directory and had to be rescued by rsync into a fresh worktree (feat/chat-chrome-glm, 58 files, +3627/−3164). 'Branch kept' currently keeps a name, not the state. The ground law's snapshot rung fixes this end too: if grounds are always commits, a close can never orphan uncommitted state.tasks: a task inherits its parent's world as it is (#142)
tasks: a task inherits its parent's world as it is (#142)
tasks: a task inherits its parent's world as it is (#142)
tasks: a task inherits its parent's world as it is (#142)
tasks: a task inherits its parent's world as it is (#142)
The ground law and the handoff contract: a task inherits its parent's…
a repository task inherits the whole universe, and still comes home a…
a repository task inherits the whole universe, and still comes home a…
a repository task inherits the whole universe, and still comes home a…