Repository navigation
Description
What happened
2026-09-03, base dev@f38d6c01a.
A task restored from a checkpoint is dated in the future, and the tasks place then drops
it off the page. A piece of work that ran for twelve minutes and finished twenty minutes
before the window was closed comes back, on the next open, stamped twelve minutes from
now — and the place's own date window reads that as tomorrow and does not draw the row
at all. The task that needed a person went missing from the tasks place entirely while its
shorter siblings sat above it saying now.
Both halves of that come from the same hole: a landing time is being derived from when a
window opened, because the record does not carry one.
The derivation, in internal/tui3/place_tasks.go's taskNodeEnded:
at := node.began
if at.IsZero() {
at = node.met
}
...
return at.Add(node.elapsed)met is the moment this terminal first heard of the node. For a node replayed out of a
checkpoint that is the moment the person sat down, so met + elapsed is a landing time in
the future. The drop is one line in internal/tui3/tasksplace.go's readTasks:
if !r.win.Holds(tasksEntryAt(item.entry, now)) {
continue
}UsageWindow.Holds (internal/session/usage_spend.go) is !at.Before(From) && at.Before(next bucket after To), so an instant past the end of today is not held and the
row is skipped — not filed under earlier, not folded: gone.
The now on the siblings is the same absence seen from the other side: tasksEntryAt
answers the moment of the reading for a row with no stamp, which is right for a window
that cannot judge an undated row and wrong for sinceAt, which then prints now over
work that nothing is doing.
This issue is the ENGINE half only
The surface half is already landing in the ui/polish-v0 wave: taskNodeEnded stops
falling back to met for a restored node, and the age field reads a stamp rather than
substituting the reading's clock, so a row with no recorded landing time draws nothing
where it used to draw now (the emptiness law). That change makes the surface honest and
makes it read the record only. It cannot make the record right, and that is what is left.
The coordinator's ruling is that a landing time is a fact of the record, carried across
the restore, and never derived from the window's open time. So this issue is the whole of
what remains, and none of it is in internal/tui3.
Where
Everything below is internal/session.
TaskNode.started(searchstarted time.Timeintask_run.go) is the only real
start, and it is set exactly once, at the transition toTaskRunningin
TaskGraph.startLocked(searchnode.started = time.Now()). It is not written to the
checkpoint.taskRecordintask_store.gocarriesElapsedMSand no stamp at all,
and the comment on the neighbouringelapsedfield concedes the consequence in so many
words: "a node rehydrated from a checkpoint has no started to measure from and this is
the age it had."TaskNode.runStart()intaskground.go(searchfunc (n *TaskNode) runStart)
already makes the same guess the surface was making —time.Now().Add(-n.elapsed)— and
says so: "its window is measured back from now, which lands LATER than the truth." It
chooses that direction deliberately for its own purpose (a ground overlap: a false alarm
costs more than a quiet miss), so it is evidence that the fact is missing rather than a
second bug, but it is a second reader that would rather have the stamp.TaskIndexEntry.EndedAtintask_index.gois the durable landing time — "when it
landed, and it is zero for a row merged in live" — and it survives a restart only for
a node whose row actually reached the project'stasks.jsonl. For a row rebuilt from
the graph,(*TaskNode).indexEntryLocked(searchA landed node's EndedAt is now minus nothing) stamps itentry.EndedAt = time.Now(), and its own comment concedes the shape:
the original stamp is "where the file's row is", which is precisely what a node whose
session died before the row was written does not have.TaskNoticeintask_contract.gocarriesElapsed time.Durationand no landing or
starting stamp — its onlytime.TimeisDeadline, a proposal field — so even where the
engine does know when the work landed, the surface has nothing to read it out of.
The fix
Three changes, all in internal/session, and the shape is one sentence: the record keeps
the stamps, and everything downstream prefers them to time.Now().
taskRecordgrows a landing stamp (and, for the same money, a start), written when the
node is snapshotted and restored ontoTaskNodewhen it is rehydrated. It is an added,
omitted-when-empty JSON field, sotaskFileVersiondoes not move and an older
checkpoint decodes exactly as it always did — the same disciplinerunRecordalready
follows forKind.(*TaskNode).indexEntryLockedprefers the node's own restored stamp overtime.Now(),
and stampstime.Now()only where it genuinely is the landing instant — the live
transition, which is what(*Agent).recordTaskIndexis for.TaskNoticegrowsEndedAt(andStartedAt) besideElapsed, so a surface drawing a
restored row has a fact to draw instead of a subtraction to perform.
TaskNode.runStart() keeps its guess as a fallback and should use the restored stamp when
there is one; the comment there should stop describing the guess as the only option.
What a person sees: a task that landed at 23:28 says it landed at 23:28 whether they are
looking at it at 23:30 or the following week, it sits in the tasks place under the day it
actually landed on, and a task whose landing time genuinely was never recorded draws no
age at all rather than now.
Replication
Deterministic (no model, no key that is ever used). Everything is in the repository.
-
make build, then make a throwaway home with a conversation in it:
make demo-home DEMO_HOME=/tmp/aforge-stampand quit the surface it opens. -
Beside any conversation's
transcript.jsonlunder
/tmp/aforge-stamp/.aforge/v3/projects/*/*/, write the checkpoint a task that ran for
twelve minutes and landed leaves behind — this is exactly whattaskRecordwrites
today, and the thing to notice is that there is nowhere in it to put when:{"type":"tasks","version":1,"seq":10, "nodes":[{"id":1,"title":"Rotate the staging certificate","state":"unverified", "elapsed_ms":720000}], "runs":[]}Leave that project's
tasks.jsonlabsent, which is what a session that died before its
index row was written looks like. -
Reopen that conversation
(cd /tmp/aforge-stamp/<project> && HOME=/tmp/aforge-stamp <repo>/bin/aforge, enter on
the card) and open the tasks place with/history.
What a developer sees today: the row is not on the page. The head sentence counts the
work the window holds and this task is not among it, because the surface has dated it
<the moment you pressed enter> + 12m and the window ends at the end of today. Widen the
window with shift+← as far as it goes and it does not come back — a future stamp is past
every window's far edge, not behind its near one. Meanwhile any row in that place with no
stamp at all reads now.
Field (real models, needs OPENROUTER_API_KEY, a few cents and a few minutes). The
product version, and the one that was actually hit: in a conversation, hand aforge a task
and let it land — one that ends needs your look is the case that hurts, because that row
is the one somebody has to come back to. Quit with ctrl+c twice. Reopen the same
conversation and open the tasks place. The task is not on it. Its shorter siblings, if any
are undated, say now.
Acceptance
- e2e: through the real surface on the deterministic home above — after reopening the
conversation, the tasks place draws the rowRotate the staging certificate, and its age
cell reads the age measured from the landing time on its own record (12mpast the
recorded landing, notnowand not a future instant). Today the string
Rotate the staging certificatedoes not appear on the page at all. - e2e: the control — a checkpoint carrying
elapsed_msand no landing stamp (every
file written before this change) still resumes, and its row draws no age cell at all:
the page must not containnowfor that row, and the row must still be on the page. That
is the emptiness law, and it is what the surface half inui/polish-v0already does once
the record stops lying to it. - Unit: a checkpoint written by
taskStoreand read back reproduces the node's landing
time exactly —restored.EndedAt == original.EndedAt— and the round trip of a
checkpoint written before this field existed still decodes attaskFileVersion1 with
a zero stamp and a preservedElapsedMS. - Unit: the structural law — every path that stamps a
TaskIndexEntry.EndedAtwith
time.Now()is the live landing transition. A rebuilt row takes the record's stamp when
it has one, so(*TaskNode).indexEntryLockedon a restored node returns the recorded
instant rather than the instant it was called. - The manual pages that describe reading a task's age
(internal/manual/chat/reading-a-task-page.md,internal/manual/chat/tasks.md) quote
the new behaviour — a landing time is what the record says, and no recorded time draws
nothing — and the change entry'sinvalidatesnames what people believed before.
Drafted with CodeAF · reviewed and owned by the author
Activity
session: a landing time is a fact of the record, carried across the r…