docs(planner): bring doc.go to the data-structure documentation standard#391
Conversation
Expand internal/planner/doc.go to the package data-structure documentation standard: add Type Roles, Invariants (each tagged with its guarding test or marked documented-but-unguarded), Zero-Value & Sentinel Semantics, and Concurrency & Staleness. The optimistic-lock + single-patch story previously lived only in CLAUDE.md — this resolves that doc drift by stating it at the structure's definition. Existing sections are preserved verbatim. Also wire the idiomatic-reviewer subagent into CLAUDE.md so idiom-conformance review is automatically in the loop for this repo. Produced by the Tide /idiomatic expert (sei-protocol/Tide#126) piloting on this package. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit dfd73b2. Bugbot is set up for automated code reviews on this repo. Configure here. |
What
Companion to Tide#126 (the
/idiomaticexpert). This is the pilot output applied to the package the expert reviewed.internal/planner/doc.go— expanded to the package data-structure documentation standard. Adds the four missing required sections:TaskPlan,PlannedTask, the builders, andExecutor[T]: who constructs / reads / mutates each, and where it lives (.statusvs in-memory).FailedPhase==""means retry, nil plan == steady state, terminal-plan cleanup, conditions-always-present. Each tagged with its guarding test or marked documented-but-unguarded.FailedPhase/ emptyTargetPhase/ nilSubmittedAtmean.Existing sections (Purpose, Lifecycle, Condition Ownership, Plan Types, Task Types) are preserved verbatim. gofmt-clean;
go vet ./internal/plannerpasses;go doc ./internal/plannerrenders.CLAUDE.md— wired theidiomatic-reviewersubagent into the Subagents list so idiom-conformance review is automatically in the loop here.Follow-up
The review surfaced three documented-but-unguarded invariants (persist-before-execute ordering, patch-count-per-reconcile, NodeUpdate-failure-stays-Running). Tracked separately — these are test-coverage additions, not part of this docs change.
🤖 Generated with Claude Code