feat(sequencing): focus marker derives critical path to a goal, surfaces it atop ready (links-sequencing-21sy.2)#200
Merged
Conversation
…ces it atop ready (links-sequencing-21sy.2) Marking a goal ticket with the reserved label `focus` makes ready/queue/next surface its unfinished prerequisite chain at the top, auto-advancing as items close. The fact is stored on the one goal ticket only; path membership is derived from the dependency DAG on every gather (explicit deps, container children, earlier same-lane siblings — the lane gate's rule, shared via the extracted isEarlierSameLaneSibling predicate). FocusPath is a neutral ordering annotation, deliberately absent from readyBlockingKinds: blocked path items stay blocked. sortByFocusPath layers last in the shared gather so focus outranks standing urgent priority, which still never propagates.
There was a problem hiding this comment.
Z.ai Coding Agent Review
The focus-path feature is well-structured and law-abiding. Key strengths:
- [LAW:single-enforcer]
isEarlierSameLaneSiblingandisUnfinishedare extracted as shared predicates used by both the membership gate and the focus-path BFS, eliminating the drift risk that would exist if each consumer defined its own "earlier sibling" or "unfinished" check. - [LAW:one-source-of-truth] The focus label is stored on the single goal ticket only; chain membership is derived from the DAG on every gather, never persisted.
- [LAW:dataflow-not-control-flow] The annotator is a pure map lookup for every issue; the sort comparator runs uniformly over every pair. No mode flags gate whether the operation runs.
- [LAW:behavior-not-structure] The tests assert ordering and annotation contracts, not internal wiring.
No must-change items found. One pre-existing pattern worth noting: the layered stable-sort calls (sortByCompositeRank → sortByPriority → sortByFocusPath) rely on call order for correct precedence. This is explicitly documented and is the established pattern in the codebase, so it's not introduced by this diff — but it is ambient temporal coupling that a future refactor could make structural (e.g., a sort-spec slice).
✅ Approved
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.
Summary
Implements links-sequencing-21sy.2 — the focus marker ("temporarily urgent"): marking a (possibly-blocked) goal ticket with the reserved label
focussurfaces its unfinished critical path at the top ofready/queue/next, so work flows toward the goal.Design (per the epic's law-forced shape)
[LAW:one-source-of-truth]: thefocuslabel lives on the ONE goal ticket (theneeds-designreserved-label pattern). Path membership is never written onto chain members — it is re-derived from the dependency DAG on every gather, so the path auto-advances as items close with zero state to sync.fetchFocusPathGoalsBFSes the prerequisite closure: unfinished explicit deps ∪ unfinished children of containers ∪ earlier same-lane unfinished siblings. The intra-epic edge is the lane gate's exact rule, shared via the newly extractedisEarlierSameLaneSiblingpredicate[LAW:single-enforcer]— membership gate and ordering derivation cannot drift.focus_path(message = goal ID). Deliberately not inreadyBlockingKinds: ordering only, never membership — a blocked path item stays blocked[LAW:one-type-per-behavior].[LAW:dataflow-not-control-flow]:sortByFocusPathis one more stable-sort layer, placed last in the shared gather so focus-path items sort above standing urgent (the ticket's chosen precedence; flipping it is a one-line reorder). No conditionals in dependency resolution;sortByPriorityuntouched.Verification
go test ./...clean.lit label add <goal> focus→ Step 1 on top,lit nextreturns it; close Step 1 → next returns Step 2;lit label rm→ urgent back on top.Closes links-sequencing-21sy.2.