Repository navigation
Conversation
Member
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
ursasi
pushed a commit
to ursasi/CodeAF
that referenced
this pull request
Oct 11, 2026
ursasi
force-pushed
the
fence-aware-outcome-reader
branch
from
October 11, 2026 14:14
e07b5e5 to
c7e11de
Compare
ursasi
added a commit
to ursasi/CodeAF
that referenced
this pull request
Oct 11, 2026
…ps a leading fence (Agent-Field#931) A report that opens with a code fence used to draw three backticks on the tasks table, the home panels and the task record, while the landed card (fixed in Agent-Field#889) already quoted the sentence. The cause was two readers: the surface skipped the fence through firstProseLine, but the engine wrote TaskIndexEntry.Outcome through taskOutcome, which read the literal first line. Lift the fence-marker detection and the first-prose-line reading into one leaf package, internal/reportline, that both the surface and the engine import. taskOutcome, taskFirstSentence, switcherFirstLine and the renderer's mdFenceOpen all route through it; firstProseLine becomes a thin wrapper. A structural law pins that every path quoting a report's first line goes through the one reader, so a future hand cannot reach for firstLine and put the fence back.
ursasi
force-pushed
the
fence-aware-outcome-reader
branch
from
October 11, 2026 14:17
c7e11de to
580545f
Compare
…gent-Field#1807) firstProseLine is now a one-line delegate to reportline.FirstProse, so the Agent-Field#889 table in tui3 re-tested the same logic the reportline table already pins; keep the two card tests that prove the surface is wired to the reader. Fold the law's bodyCallsSanctionedReader and bodyCallsFirstProse into one bodyCallsAny(names...).
Author
|
Signed! Looking forward to contributing to CodeAF. |
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.
Closes #931.
The bug
A task whose report opens with a code fence (a diff, a command's output, a JSON block) landed with a correct card — #889 taught the card to skip the fence — but the
/taskstable, the home panels and the task record still drew three backticks, because the card was not the only path that quotes a report's first line.Two readers were the cause:
firstProseLine(internal/tui3), whileTaskIndexEntry.OutcomethroughtaskOutcome(internal/session), which read the literal first line withfirstLine.mdFenceOpen, the fence detectorfirstProseLineleaned on, is private to internal/tui3, andtaskOutcomelives in internal/session, so neither could reach the other. Copying the loop into internal/session was explicitly the wrong fix — two opinions about what a fence is drift.The fix — one reader, not two
A new leaf package
internal/reportlineholds both the fence-marker detection (Fence) and the first-prose-line reading (FirstProse), and both the surface and the engine import it:internal/sessiontaskOutcome→reportline.FirstProseinternal/tui3taskFirstSentence,switcherFirstLine→reportline.FirstProseinternal/tui3firstProseLine→ thin wrapper overreportline.FirstProseinternal/tui3mdFenceOpen→ thin wrapper overreportline.Fence, so the renderer and the readers share one fence opinionNo user-facing wording changes: rows that quoted a sentence still do, and rows with nothing to quote still render nothing (not empty quotes).
Tests
internal/reportline— a table pinning the rule (leading fence, language word, tilde fence, blank lines, fence-only report, empty report) and a table pinningFence.go/ast) asserting every path that quotes a report's first line —taskOutcome,taskFirstSentence,switcherFirstLine,landedCard— routes through the one reader, so a future addition cannot silently usefirstLineand put the fence back.internal/sessionTestTaskOutcomeSkipsAFence— the deterministic repro from the issue.firstProseLine.Manual
internal/manual/chat/reading-a-task-page.md, under "The card quotes three backticks instead of a sentence", now applies to every surface that quotes a report, not only the card.