fix(boatstack): stop shipped features re-registering as ambiguous plan candidates - #135
Merged
Merged
Conversation
…n candidates featurePlanCandidates counted a feature dir as an open plan when it had plan.md but no delivery state.json. Delivery state.json is stored per-worktree, and workspace.cleanup_after=merge deletes the feature's worktree on ship, destroying the state.json while the committed plan.md/plan.lock.json/pr.md survive. From a fresh build worktree every shipped feature then re-registered as an open candidate, so next-status returned BLOCKED/AMBIGUOUS. Skip any feature carrying plan.lock.json (locked/built) or pr.md (shipped) before the state.json check, mirroring orphanedFeatureArtifacts. The candidate check now relies on durable committed artifacts, so the loss of an ephemeral state.json on cleanup is harmless. Delivery-state locality and cross-worktree push-denial are unchanged (Part A rejected). Adds unit, ResolveNext reproduction, and linked-worktree conformance tests.
bigboateng
force-pushed
the
boatstack/fix-shipped-candidate-ambiguity
branch
from
July 23, 2026 14:40
738bd64 to
c288814
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In a repo that has shipped more than one feature and uses worktree delivery mode,
next-statusfrom a fresh build worktree returnsBLOCKED / AMBIGUOUS "More than one saved feature plan is available", listing every historically shipped feature as a candidate (taxweave: 22 shipped + 1 active = 23). This blocks all forward progress.Root cause
featurePlanCandidates(next.go) counted a feature dir as an open plan when it hadplan.mdbut no deliverystate.json. Deliverystate.jsonis stored per-worktree (deliveryStateDirectoryusesgit rev-parse --git-dir), andworkspace.cleanup_after = mergedeletes the feature's worktree on ship — destroying thestate.jsonwhile the committedplan.md/plan.lock.json/pr.mdsurvive. So every shipped feature matched "planned + no state" and re-registered as an open candidate.ignored_deliveriesfilters the active-delivery path, not this candidate path.Fix (Part B only)
The candidate check now skips any feature carrying
plan.lock.json(locked/built) orpr.md(shipped) before thestate.jsontest, mirroringorphanedFeatureArtifacts. It relies on the durable committed artifacts, so the loss of an ephemeralstate.jsonon cleanup is harmless. A dir withplan.mdonly correctly remains the single open candidate.Part A rejected: relocating delivery state to
--git-common-dirwould make every active delivery visible in all worktrees, breaking intentional per-worktree isolation (TestManagedDeliveryStateDoesNotBlockUnrelatedWorktrees) and changing cross-worktree push-denial (ActiveManagedDeliveries→ClassifyCommand). No delivery-state locality change is made.Tests
TestFeaturePlanCandidatesExcludesLockedAndShippedFeatures— unit.TestResolveNextIgnoresShippedFeatureCandidates— reproduction of the taxweave scenario.TestResolveNextIgnoresShippedFeaturesFromLinkedWorktree— worktree conformance (the exact reported symptom).TestManagedDeliveryStateDoesNotBlockUnrelatedWorktrees— unchanged, still green (isolation not touched).Verification
From
product-engineering-loop:go build ./...,go vet ./...,go test ./...all pass. Fromlabs/12-product-engineering-loop:python3 -m unittest tests.test_product_loop(18 tests) passes.Rollout (taxweave, after merge)
next-statusresolvesfirm-status-finance-aestheticas the single candidate.