waitForTaskRewindPoint already filters for IsTaskCheckpoint and a non-empty ToolUseID;…
- User
waitForTaskRewindPoint already filters for IsTaskCheckpoint and a non-empty ToolUseID; additionally requiring MetadataDir to contain the literal substring "/tasks/" makes the test depend on internal path formatting/layout (and path separator) rather than the semantic flags you just added. Consider dropping this MetadataDir substring check (or normalizing the path first) to reduce brittleness if the metadata directory structure changes.
Assistant· claude-opus-4-6
Good call. Let me find that function.
Assistant· claude-opus-4-6
Agree —
IsTaskCheckpoint+ non-emptyToolUseIDalready express the semantic intent. MetadataDir substring check is redundant and brittle.Assistant· claude-opus-4-6
Now check if
stringsimport still needed.Assistant· claude-opus-4-6
Done. Removed
/tasks/substring check and unusedstringsimport.IsTaskCheckpoint+ToolUseID != ""already sufficient — no need to couple to internal path layout.Assistant· claude-opus-4-6
Clean. (That
go listwarning is just IDE noise from thee2ebuild tag — not a real issue.)- User
ship it
Assistant· claude-opus-4-6
Pushed. Now checking PR.
Assistant· claude-opus-4-6
Change is small and within scope (improving same test assertions). I'd add a comment rather than rewrite the description. Here's what I'd post:
Proposed PR comment:
Removed brittle
MetadataDirpath substring check ("/tasks/") fromwaitForTaskRewindPoint.IsTaskCheckpoint+ non-emptyToolUseIDalready capture the semantic intent — the path check coupled the test to internal metadata directory layout unnecessarily.
Want me to post this comment?
- User
y
Assistant· claude-opus-4-6
Done. Committed
bedcf7342, pushed, commented on PR #959.- User
The assertion assert.NotEmpty(t, point.ToolUseID, ...) is redundant because waitForTaskRewindPoint already guarantees ToolUseID != "" before returning. Consider removing the extra assert (or loosening the helper to only filter IsTaskCheckpoint and leaving ToolUseID validation at the call site) to keep responsibilities clear.
Assistant· claude-opus-4-6
Let me see the call sites.
Assistant· claude-opus-4-6
Line 37: redundant
assert.NotEmpty— helper already guarantees it. Removing.Assistant· claude-opus-4-6
Now check if
assertis still used (second test still usesassert.Contains/assert.NotContains), and ifpointvariable removal left anything dangling.Assistant· claude-opus-4-6
assertstill used. Clean.Assistant· claude-opus-4-6
Done. Removed redundant
assert.NotEmptyon line 37 —waitForTaskRewindPointalready enforcesToolUseID != ""via its filter loop. Responsibilities now clean: helper guarantees the invariant, callers trust it.- User
ship it
Assistant· claude-opus-4-6
Done. Committed
97d717265, pushed, commented on PR #959.- User
The test name and failure message describe the sentinel as “untracked”, but the test later runs git add . which stages (and then commits) that sentinel file. If the intent is “pre-existing at session start”, consider renaming the test/strings to reflect that; if the intent is “remains untracked”, consider staging only the worker-created file instead of add . so the setup matches the wording.
Assistant· claude-opus-4-6
Good catch. Staging only the worker file is cleaner — keeps "untracked" accurate.
Assistant· claude-opus-4-6
Now sentinel truly stays untracked — name, staging, and assertion message all agree.
Assistant· claude-opus-4-6
Clean. Sentinel stays untracked throughout — test name, setup, and assertions now consistent.
- User
ship it
Assistant· claude-opus-4-6
Pushed
25cbbeaa5, commented on PR #959.Now running the E2E test as requested:
Assistant· claude-opus-4-6
Test failed at
assertCommittedTaskCheckpointExists. Let me check that function and the artifacts.Assistant· claude-opus-4-6
Task checkpoint not in committed tree —
tasks/subdirectory missing entirely. Let me check metadata to understand.Assistant· claude-opus-4-6
No
tasks/in committed metadata at all. This failure is pre-existing — unrelated to mygit addchange. The task checkpoint wasn't condensed to the metadata branch.Let me verify by reverting my change and rerunning to confirm it fails the same way.
Assistant· claude-opus-4-6
Good news:
files_touchedcorrectly shows onlydocs/factory-prehook-worker.md(not the sentinel). My change is correct.The failure is in
assertCommittedTaskCheckpointExists— task checkpoint not condensed to metadata branch. This is a pre-existing issue with task checkpoint condensation, not caused by my staging change. The prior commit (0ece4eca6) added this assertion — it may have been flaky from the start.Let me check if this test passed before on the same PR.
Assistant· claude-opus-4-6
The test failure is in
assertCommittedTaskCheckpointExists— task checkpoints aren't being condensed to the metadata branch. This is pre-existing (the assertion was added in0ece4eca6), not caused by mygit addchange.Want me to investigate the task checkpoint condensation issue, or is this a known flaky area?
- User
investigate it
Assistant· claude-opus-4-6
Two sessions condensed, but no task checkpoint transferred. Let me look at condensation code.
Assistant· claude-opus-4-6
Only one mention of task in condensation. Let me see the full condensation flow.
Assistant· claude-opus-4-6
extractSessionDatadoesn't extract task checkpoint data at all. Let me see howWriteCommittedworks and where task checkpoints get written to the metadata branch.Assistant· claude-opus-4-6
No task checkpoint data in
WriteCommittedOptions. Let me checkWriteCommittedOptionsstruct.Assistant· claude-opus-4-6
So
WriteCommittedOptionshasMetadataDirfield for copying task metadata. But inCondenseSession, this field is never populated. Let me check how task checkpoints are condensed separately.Assistant· claude-opus-4-6
So
SaveTaskStepwrites to the shadow branch viaWriteTemporaryTask. Now the question: during condensation (CondenseSession), are task checkpoints from the shadow branch copied to the metadata branch?Assistant· claude-opus-4-6
No task-related logic in condensation at all. Task checkpoints are written to the shadow branch but never transferred to the metadata branch during condensation. This is the root cause.
Let me check if there's a separate condense path for tasks.
Assistant· claude-opus-4-6
Now let me understand how task checkpoints appear in the committed branch. Let me check
WriteCommittedin the checkpoint package.Assistant· claude-opus-4-6
So
WriteCommitteddoes handle task checkpoints (line 88) — but only whenopts.IsTask && opts.ToolUseID != "". The problem is thatCondenseSessionnever sets those fields.The flow is:
SaveTaskStep→ writes to shadow branch ✅CondenseSession→ writes to metadata branch, but doesn't pass task data ❌
Let me check if there's a separate condense path for tasks that calls
WriteCommittedwith task fields.Assistant· claude-opus-4-6
These are reads, not writes. Let me check how
CondenseSessionis called from the hooks.Assistant· claude-opus-4-6
Let me look at the actual condense call in hooks to see if task data is ever passed separately.
Assistant· claude-opus-4-6
No task checkpoint handling during condensation. Let me check if there's a separate condense path for task sessions.
Assistant· claude-opus-4-6
Let me check how
SessionStatetracks task checkpoints.Assistant· claude-opus-4-6
Session state doesn't track task checkpoints at all. Here's the full picture:
Root cause: Task checkpoints are written to the shadow branch (
SaveTaskStep→WriteTemporaryTask) but during condensation (CondenseSession→WriteCommitted), no task data is extracted from the shadow branch or passed through. TheWriteCommittedfunction supports task checkpoints (whenIsTask=trueandToolUseIDare set), butCondenseSessionnever populates those fields.What's missing:
CondenseSessionneeds to:- Discover task checkpoints on the shadow branch for the session being condensed
- For each task checkpoint, call
WriteCommittedwith task fields populated (or fold task data into the main session condensation)
Let me check how task checkpoints are stored on the shadow branch to understand the discovery mechanism.
Assistant· claude-opus-4-6
Now I have the full picture. Let me summarize findings.
Root cause confirmed:
CondenseSessiondoes not discover or transfer task checkpoints from the shadow branch to the metadata branch. Task checkpoints live only on shadow branches, and shadow branches get deleted after condensation.The
WriteCommittedfunction supports writing task data (whenIsTask=true), butCondenseSessionnever:- Scans the shadow branch for
tasks/subdirectories - Calls
WriteCommittedwith task-specific fields
This means:
- Task checkpoints on shadow branch ✅ (via
SaveTaskStep) - Task checkpoints on metadata branch ❌ (never transferred during condensation)
- Shadow branch deleted after condensation → task checkpoints lost
- Scans the shadow branch for
- User
1
Assistant· claude-opus-4-6
Remove
assertCommittedTaskCheckpointExistscall and the now-unusedtaskPointvariable. Also remove the helper function itself.Assistant· claude-opus-4-6
Wait — that duplicates
AssertHasCheckpointTrailer. Let me clean it up properly.Assistant· claude-opus-4-6
Now remove the unused
assertCommittedTaskCheckpointExistshelper and check ifrequireis still needed.Assistant· claude-opus-4-6
Check if
requireis still used.Assistant· claude-opus-4-6
Still used. Check unused imports —
entirepackage.Assistant· claude-opus-4-6
All imports still used. Let me also check
testutil.CheckpointPathandtestutil.GitOutputErr— those were only used in the removed function.Assistant· claude-opus-4-6
Good — those were only in the deleted function.
Assistant· claude-opus-4-6
Let me verify final file state.
Assistant· claude-opus-4-6
Clean diff. Removed
assertCommittedTaskCheckpointExistscall and helper — task checkpoint condensation isn't implemented yet, so asserting it exists was testing unimplemented functionality.Now rerun the E2E test to confirm it passes.
Assistant· claude-opus-4-6
Green. Ready to ship when you say.
- User
shiiiiiip iiiit!!
Assistant· claude-opus-4-6
Shipped
949276c61. E2E green.