✨ Add workflow control token syntax#55
Conversation
There was a problem hiding this comment.
This PR is marked... FOUL BALL. 👉
Warnings
- Duplicate Documentation:
docs/team.md:66contains a duplicate H2 section "## How a team run works". - Logic Coupling:
internal/digest/chunkbuf.go:80uses a sharedlastStatusKeyfor bothScanStatusAngleandScanStatusMarker, risking incorrect suppression. - Code Duplication:
internal/digest/loopmarker.go:15duplicatesphaseconfig.LoopDirectiveSeveritylogic. - Test Duplication:
internal/digest/chunkbuf_test.go:163contains a test case nearly identical toTestChunkBufferLoopMarkerHighestSeverityWins.
Nits
- Missing Test Case:
internal/digest/chunkbuf_test.go:201lacks a test for accumulating multiple angle tokens in the buffer.
Prior Findings Review
Fixed (2)
Prior findings that have been resolved.
internal/teamrunner/runner.go:631— The use of `strings.TrimSpace(line)` is redundant because `teamSkipRe` is already anchored with `^\s*` and `\s*$`.internal/digest/loopmarker.go:42— The `continue` on a legacy `[loop: ...]` match makes the angle-token branch unreachable if both syntaxes appear on the same line. Add a comment to make this intentional precedence explicit.
Uncertain (1)
These prior findings could not be confidently classified against the current code.
A human should decide whether they remain relevant.
internal/digest/loopmarker.go:13
|
Addressed 4 inline comments across 2 files:
Review loop: 1 iteration. Tests passed:
|
|
@umpire-bot review |
| // ScanStatusAngle runs ExtractStatusAngle over the accumulated buffer. | ||
| // It returns ok=false for a status angle token that was already returned by | ||
| // a previous call, preventing duplicate emissions. | ||
| func (cb *ChunkBuffer) ScanStatusAngle() (phase, label string, ok bool) { |
There was a problem hiding this comment.
ScanStatusAngle and ScanStatusMarker share the lastStatusKey field in ChunkBuffer. This shared state could cause ScanStatusAngle to incorrectly suppress a valid marker if a ScanStatusMarker call was previously made with the same phase and label.
There was a problem hiding this comment.
👾 AI Agent
Dismissed: this shared key is intentional. The canonical and legacy status syntaxes represent the same status update when phase+label match, so suppressing the duplicate is desired compatibility behavior. I also tightened ScanStatusAngle in 91eaa25 so it emits the first non-duplicate angle marker in stream order when multiple tokens are buffered.
| } | ||
| } | ||
|
|
||
| func TestChunkBufferAngleTokenLoopMarker(t *testing.T) { |
There was a problem hiding this comment.
TestChunkBufferAngleTokenLoopMarker is structurally identical to TestChunkBufferLoopMarkerHighestSeverityWins. Consolidate these into a parameterized table test to reduce duplication.
There was a problem hiding this comment.
👾 AI Agent
Dismissed: the tests are intentionally parallel, one protecting legacy [loop: ...] scanning and one protecting canonical <|workflow: ...|> scanning through the same streaming scanner. Consolidating them would make the canonical coverage less obvious for little gain.
|
Addressed 5 new comments across 3 files:
Review loop: 1 iteration. Tests passed:
|
Summary
Closes #41
Tests