Skip to content

session, prompt, tui3: a wrong completion check is answered with [no change], and the answer stands (#1065 round 1) - #1067

Merged
AbirAbbas merged 10 commits into
devfrom
fix/1065-answer-shape
Sep 16, 2026
Merged

AbirAbbas merged 10 commits into
devfrom
fix/1065-answer-shape

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Round 1 (initial cleanup) of #1065; round 2 follows.

Scope is sections A–D of the issue, plus what the repository rules or review required.

Taken over

The review fixes are four commits on top of c8346300:

  • prompt: the messages-from-codeaf list names every note codeaf writes
  • session: no change skips judgment only when it answers the reader
  • test: the model stub replays the no-change fold
  • prompt: the standing-news tag stays with the event, not on the page

The third commit adds a deterministic replay through the real binary: eleven read
rounds, a 30-row answer, one rejecting completion-reader call, and one exact
[no change] reply. The headless and tmux runs both reached that complete path.

What changed

A. Harness

  • The completion check sees more of the answer. checkpointSaidBytes goes from 600 to 8 * 1024 bytes, or less when the person's request already fills most of the digest. checkpointClipSaid takes the room that is left. If it still has to cut, the text ends with [clipped by codeaf: N of M bytes] instead of a bare …, and the marker counts toward the limit.
  • New reply token. session.NoChangeReply = "[no change]", read in one place by IsNoChangeReply.
  • When the token counts. In checkpointReopen, answeredNoteUnchanged reads the transcript. The token counts only as the very next reply to the check's own [carry on] note; a volatile session note in between is skipped over. It does not count after tool calls, after the person's own message, after a load or ask nudge, or with other words beside it. When it counts, the turn ends with no further check call.
  • After a token reply. Only a token that answered the reader's note suppresses the route judge and gives memory learning the answer before the token. In every other context, the token is judged and learned from as an ordinary reply, and another completion check can run.
  • Where the token is hidden. Display remains deliberately context-free. The transcript keeps the token for the model, while entryRows gives every tool-less exact-token reply 0 rows and the live feed empties every such reply at its response boundary (feed.confirmResponse), whether or not it counted for the completion check. Either way, deriveWorkfolds leaves the settled answer before it in view. workfold.go is unchanged.
  • Old journals. The previous carry-on note is kept as explainingCheckpointCarryOnLead, so journals that contain it still hide it.

B. Prompt text. checkpointCarryOnLead uses the issue's four lines. checkpointRemainsAsk adds that text marked as clipped is never evidence the person saw a cut-off answer.

C/D. internal/session/prompts/system.md

# Tone and # Delivery are replaced by four sections, and the five rules they carried are restored inside them.

  • # The answer
    • Once a turn ends, only its last message stays in view. The plan and the one-sentence status before each tool batch are still shown while the turn runs.
    • The deliverable goes in that last message. Evidence and blocking details stay complete.
    • Restored: match the person's task and vocabulary; state uncertainty at the claim it affects and choose the safe option.
    • "Done" is never a compiling scaffold or a narrowed test, and half-solved work is never handed back.
  • # Answer or change
    • Questions, options, comparisons and tables are answered in the reply itself, not in a file, unless the person asks for a file.
    • No edits until the person asks for a change.
    • Renamed from # Words or work, which collided with the existing ## Work or words.
  • # When corrected, as the issue wrote it.
  • # Messages from codeaf
    • Names the user-role tags codeaf writes into the conversation: [carry on], [taking stock], [silent], [stuck], [folded …], [context compacted]. It no longer claims that any other opening is the person's; [image #N] is identified only as the person's attachment.
    • Does not name the tool result's [held], the private reader's [still asked], or standing news's [something you set up fired]: that line carries its own instruction under the event, and TestTheSteeringLineReadsAsNewsAndNotAsARequest refuses a second copy on the page (the prompt diet's WITH THE EVENT class).

Other prompt changes:

  • …act and offer to unwind it now continues when the person asked for a change.
  • NEVER yield while actionable work remains becomes Don't end the turn while work the person asked for remains.
  • promptprofile.go: all four sections survive the lean profile. Messages from codeaf also has an explicit keeps: true row.

Prompt budget raised, on purpose. Against origin/dev, fixed grows from 53,276 to 55,280 bytes and lean from 45,051 to 47,055: 2,004 bytes on both arms. Each arm already had 15 bytes spare, so each waiver rises by 1,989: fixedPrefixWaiver 5,291 → 7,280 and leanPrefixWaiver 13,566 → 15,555. Both sit exactly on the new measurement, with the original dated note extended by the review measurement. The owner signed off on the raise by taking the PR over; the page's overall length stays round 2.

Manual. New section in internal/manual/chat/starting-codeaf.md, "It said my answer was cut off when it was not · … · [no change]". It covers the 8 KB limit, the clip marker, when [no change] counts, the fact that a lone token is never drawn even when it did not count, and the --once caveat.

Tests

  • internal/session/nochange_test.go:
    • the table reaches the check whole;
    • a long request still leaves the answer cut with the marker, never a bare …;
    • the UTF-8 cut is exact at both byte parities;
    • [no change] ends the turn and the table is the last replayed answer;
    • a token without a carry-on does not suppress another check;
    • a token after tool calls is checked again;
    • the memory reflex gets the settled answer for a valid rejection and the token itself when it did not answer the reader;
    • a table of shapes for which replies the token counts on.
  • internal/session/messagesfromcodeaf_test.go: follows the production constants and fails by source name when the prompt omits a session-authored user-role tag or names one of the voices the page must not carry: [held], [still asked], and the standing-news frame.
  • internal/tui3/nochange_test.go: the fold's answer is the table, and text that merely mentions the token is kept.
  • The carry-on, clip and gate tests fail against the earlier code. The new provenance test also failed against the reviewed page before that page was corrected.
  • Updated:
    • promptprofile_test.go (kept headings)
    • prefixbudget_test.go (waivers and the extended dated measurement)
    • a stale comment in carryonwait_test.go
    • task_ending_e2e_test.go, which now uses childWasHanded so the system page's tag list isn't mistaken for a note sent to the worker

Test evidence

Original evidence on tested commit c8346300, on the Spark:

Command Result
make pr-ready exit 0 (session ok 180.9s, tui3 ok 312.3s)
make test-report PKGS=./internal/session 4156 passed, 0 failed, 7 skipped
make test-report PKGS=./internal/tui3 5245 passed, 0 failed, 9 skipped

Takeover verification on the review worktree, all with GOFLAGS=-buildvcs=false:

Command Result
make build exit 0
make test-focus PKGS=./internal/session RUN='NoChange|ClipSaid|ReaderSees|CarryOn|Prefix|PromptProfile|Manual|MessagesFrom' exit 0
make test-focus PKGS=./internal/tui3 RUN='NoChange|Manual' exit 0
go test ./internal/manual/ ./internal/e2e/ exit 0
make test-quick exit 0
make pr-ready (laptop, 8ece6760) see the comment below: light gate green; touched packages internal/session, internal/tui3, internal/config, internal/e2e, internal/manual, cmd/codeaf-demo-home, test/remote/stub

Nothing red was already on origin/dev.

Live check (current head c8346300)

Setup: real TUI in tmux, deepseek/deepseek-v4.1-flash only, --one-model, throwaway HOME for each run, make build at c8346300. The fixture is 12 seat files in a git repo. Evidence is in ~/1065-live-evidence/c8346300/ on the Spark (transcripts, screen captures, the check's call).

  1. Table ask, run twice (read the 12 files one per step, then one side-by-side table of about 2.5 KB, no file edits):
    • 14 tool calls each (ls plus 13 read), 0 edits.
    • The completion check ran once per run. It saw the whole table (last row present, no clip marker) and answered NOTHING LEFT TO DO both times.
    • 0 [carry on] messages, so the model never had to reply [no change].
    • The final fold shows ▸ worked … 14 tool calls with the 12-row table under it as the visible answer.
    • [no change] never appeared on screen.
  2. Questions-only ask ("What are the options for merging them into a single machine-readable config file, and how do they compare in a table? Don't change anything yet."):
    • 13 tool calls (ls plus 12 read), 0 write, edit or bash calls; git status clean.
    • Answered in the reply with an options table and a recommendation.
    • Only two tool rounds, below the 10 needed before the check runs, so no check ran.

The [no change] reply itself was last seen with a real model on 44f38508: one false note, the model replied exactly [no change], no second carry-on, and the table stayed in view.

Deterministic live replay (takeover worktree)

test/remote/stub drove the built binary through eleven distinct reads of ./go.mod, a 30-row table, one reader rejection, and one exact-token answer. The headless --once run logged exactly one [carry on], one reader 1, and one no change branch; as documented, stdout included the token. Two independent tmux runs of the real TUI (ports 18080 and 18081; 8080 was taken on the laptop) logged the same three counts, kept | seat 30 | on screen under 11 tool calls after the fold, and showed [no change] nowhere on screen. The screen capture and stub log from the second run are attached in the comment below.

Round 2 follow-ups (not done here)

  • A correctly placed [no change] can still reject a real gap. The issue asks for this. Whether a second check should confirm the token is a round 2 decision.
  • The display hides a lone token regardless of context, but whether the token counts depends on context. A token reply to a person's steer is hidden even though the turn doesn't end on it. The token also shows briefly while streaming, --once prints it, and feed.growSettledAnswer does not filter it.
  • DELIVERABLES ARE FILES, born on disk in Session facts is only qualified from # Answer or change, not rewritten.
  • Overall prompt length, including the budget room this PR used, and the rest of the issue's round 2 list.
  • The live check showed the check complaining about process ("one read per step was not followed"). Whether checkpointRemainsAsk should judge how the work was done, not just what it produced, is open.

Refs #1065

🤖 Generated with Claude Code

santoshkumarradha and others added 4 commits September 16, 2026 14:41
…], and the answer stands (#1065 round 1)

The end-of-turn reader saw 600 bytes of the last message, so a long table read
as cut off; the carry-on told the model to explain itself, and the explanation
became the only answer left in view under the fold.

The reader now sees up to 8 KB of the last words, and a cut it still has to
make ends with `[clipped by codeaf: N of M bytes]`, which its ask says is never
evidence of a cut-off answer. The carry-on lead says who wrote the note and
offers one exact reply, `[no change]`: it ends carrying on for the ask without
another reading, the transcript keeps it for the model, and neither replay nor
the live feed draws it — so the settled answer before it is what the fold finds.

system.md trades `# Tone` and `# Delivery` for `# The answer`, `# Words or
work`, `# When corrected` and `# Messages from codeaf`, and the two lines that
pushed action on questions are qualified. The lean page keeps all four; the
prefix waivers rise by the 1,705 bytes that cost, dated and named.

Co-Authored-By: Claude Opus 5 <[email protected]>
…the page that names them

The worker's system page now names [silent] and [stuck] under
`# Messages from codeaf`, so a search of the whole request found the tag on
the page. childWasHanded reads the conversation and leaves the page out.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ask leaves the last words cut by name (#1065 round 1)

Self-review of #1067 found the token honoured on the wrong replies. The gate
read the turn's carry-on count, so a model that made calls in answer to the
note and then said [no change] ended the turn unread on an answer those calls
may have made stale, and a token after a load or ask nudge counted too. It now
reads the transcript: the token must be the very next reply to the reader's
own lead (answeredNoteUnchanged), and the dead declined flag is gone.

An ask up to the whole digest rides in its head, so eight kilobytes of last
words behind a long ask reached the backstop clip and ended in a bare `…`.
checkpointClipSaid takes the room that is left. A turn that ends on the token
no longer starts the route judge or hands the token to the memory reflex, and
a later reading's last words skip it.

`# Messages from codeaf` named `[still asked]`, which only the reader ever
receives, and left out `[stuck]` and `[held]`, which the conversation does; it
now names the tags that arrive and says any other opening, such as
`[image #1]`, is the person's. The waivers sit on the measured 1,779 bytes, and
the manual and the change entry say what the gate actually honours.

Co-Authored-By: Claude Opus 5 <[email protected]>
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Self-review

I read the diff and the code around it again. Fixes are in 7c9e1c78, which is also the tested commit.

Fixed

  1. [no change] was accepted after tool calls made in reply to the note. The check was "carried on at least once this turn". So a model could make calls after the note, then send the token, and the turn ended without another read, leaving an answer those calls may have made stale. The check now reads the transcript (answeredNoteUnchanged): the token counts only as the very next reply to the reader's own [carry on] lead. Evidence: TestNoChangeAfterCallsMadeForTheNoteIsReadAgain fails with the old check ("reader was spent 1 times, want twice") and passes now.

  2. The token was also accepted as a reply to a load or ask nudge, once any earlier carry-on had happened this turn. Now only the reader's note counts; a person's steer or a load nudge in between does not. Evidence: TestNoChangeAnswersOnlyTheReadersNote, a table of six shapes.

  3. Dead checkpointMeter.declined flag. It was only set on the path that ends the turn, so nothing ever read it. Removed; the change entry no longer names it.

  4. A long request pushed the reader's last-words section into the digest's final … cut. A request of about 12–20 KB rides at the top of the digest, so 8 KB of last words then went over the 20 KB limit. The final cut removes text from the end and leaves a bare …, the marker this PR set out to replace. checkpointClipSaid now takes the room left after the request. Evidence: the new case in TestTheReaderSeesALongAnswerWholeAndACutNamesItself fails with the old room ("page ends … why this …") and passes now.

  5. The route judge and the memory reflex read [no change] as the turn's answer. A turn that ends on the token no longer starts the judge, and the reflex gets the answer before it. checkpointLastSaid skips the token for any later read. No dedicated test for the judge or reflex paths; the judge only runs on tool-free turns, and a carry-on on such a turn needs a wake.

  6. The prompt's tag list was wrong.

    • # Messages from codeaf listed [still asked], which only the reader ever receives.
    • It left out [stuck] and [held], which the conversation model does receive.
    • It read as "any bracketed opening is codeaf's", but a person's message can open with [image #1].

    It now lists the five tags that actually arrive and says any other opening is the person's.

  7. The budget numbers were wrong. The comment said the text cost 1,705 bytes; 1,705 was only how far over budget it went, because both arms already had 15 bytes spare. After fix 6 the measured cost is 1,779 bytes (fixed 53,276 → 55,055, lean 45,051 → 46,830, measured on origin/dev and on this head). The waivers are now 7,055 and 15,330, exactly on the measurement, and the comment gives the real figures.

  8. Manual and change entry overstated things.

    • They said the token "ends carrying on for this request" without saying when it counts.
    • They said --once output can show the token without saying a check has to run there.
    • They named the removed flag.

    All three now describe what the check actually accepts.

  9. Weak tests.

    • The UTF-8 cut was not guaranteed to land inside a character. It now runs over both byte parities of a two-byte run and checks utf8.ValidString and the exact marker.
    • checkpointCarriedOnNote(nil)[:20] sliced a sentence. The test now asserts exactly one carry-on notice.

Not a defect

  • Live feed dropping real text: IsNoChangeReply requires the whole trimmed reply to equal the token. TestWordsThatOnlyMentionNoChangeStayTheAnswer keeps a reply that starts with the token and one that quotes it.
  • checkpointClipSaid byte math: the marker's room is measured at its widest (the kept count can never exceed the room). The walk back to a character start cannot split one, and room too small for the marker keeps nothing. Pinned by the tests in fix 9.
  • Replaying old journals: the previous lead is still hidden (explainingCheckpointCarryOnLead), and the token did not exist before this PR.
  • Tasks and rooms: a task never runs the completion check (InTask). Rooms draw through the same feed, and Transcript() uses the same shaped entries, so both hide the token.
  • Interrupts: a reply cut mid-token is never equal to the token, so it is drawn as the cut text it is.
  • [taking stock]: a note that lands between the carry-on and the reply means the token no longer counts, so the turn is read again. That is the safe direction.

Deferred to round 2

  • A correctly placed [no change] can still reject a real gap. That is what the issue asks for ("end carry-ons for that ask"). Before, the reader would re-read up to the cap. Whether a second read should confirm the token is a round 2 decision.
  • The display hides the token without context, but the check needs context. A lone [no change] reply to a person's steer is hidden even though it does not end the turn. The token also shows briefly while streaming, --once prints it, and feed.growSettledAnswer (text arriving after the turn ends) does not filter it.
  • Contradictions elsewhere on the page, outside section D's two lines:
    • DELIVERABLES ARE FILES, born on disk (Session facts) pulls against # The answer and # Words or work, which say tables are answered in words with no edits.
    • The new # Words or work has a near-twin, ## Work or words, whose WORDS includes "anything one edit … finishes".
  • Overall prompt length, including the budget room this PR used.

Scope

Beyond sections A–D, this PR only adds what the repository rules or the protocol require: the manual section (manual law), the judge/reflex guard (protocol correctness), and the childWasHanded test helper (the new section names [silent]).

Tests (7c9e1c78, on the Spark)

Command Result
make pr-ready exit 0 (session ok 182.1s, tui3 ok 311.9s)
make test-report PKGS=./internal/session 4156 passed, 0 failed, 7 skipped
make test-report PKGS=./internal/tui3 5245 passed, 0 failed, 9 skipped

…what stays in view (#1065 round 1)

Owner review of #1067. Replacing `# Tone` and `# Delivery` had dropped five
rules; each is back inside the new sections: match the person's task and
vocabulary, choose the safe option under uncertainty, evidence and blocking
details complete, never a compiling scaffold or a narrowed test, never
half-solved work.

`# The answer` said only the last message reaches the person, which `# Planning`
contradicts: the plan and the per-batch sentence are shown while a turn runs. It
now says that once a turn ends only its last message stays in view.

`# Words or work` sat beside `## Work or words`, which spends the same two words
on hand-off sizing; it is `# Answer or change`, and it says an answer asked for
in chat is written in the reply, not a file, unless the person asks for one.

The waivers sit on the new measurement, 2,035 bytes over dev on both arms.

Co-Authored-By: Claude Opus 5 <[email protected]>
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Owner review fixes

Fixed in c8346300.

  1. Dropped rules restored, inside the new sections: match the person's task and vocabulary; choose the safe option under uncertainty; evidence and blocking details stay complete; "Done" is never a compiling scaffold or a narrowed test; half-solved work is never handed back.
  2. "Only your last message reaches the person" reworded. It now says that once a turn ends, only its last message stays in view, and everything before it folds into the closed "worked" line. This no longer contradicts # Planning.
  3. # Words or work renamed to # Answer or change in system.md, promptprofile_test.go, the prefixbudget_test.go note, the change entry and the PR body. The manual never named the heading.
  4. DELIVERABLES ARE FILES conflict: # Answer or change now says an answer asked for in chat is written in the reply, not a file, unless the person asks for a file. Session facts is unchanged.

Waivers, from measurement: the prompt now costs 2,035 bytes more than origin/dev (fixed 53,276 → 55,311, lean 45,051 → 47,086). fixedPrefixWaiver is 7,311 and leanPrefixWaiver is 15,586. The dated note is updated.

Tests (c8346300, Spark):

  • make pr-ready: exit 0 (session 180.9s, tui3 312.3s)
  • make test-report PKGS=./internal/session: 4156 passed, 0 failed, 7 skipped
  • make test-report PKGS=./internal/tui3: 5245 passed, 0 failed, 9 skipped

@santoshkumarradha

Copy link
Copy Markdown
Member Author

Live check on c834630

Setup: real TUI in tmux, deepseek/deepseek-v4.1-flash only, --one-model, throwaway HOME for each run. Evidence is in ~/1065-live-evidence/c8346300/ on the Spark.

  • Table ask, run twice (12 reads, then a table of about 2.5 KB, no file edits):
    • 14 tool calls each, 0 edits.
    • The completion check ran once per run, saw the whole table (no clip marker) and answered NOTHING LEFT TO DO.
    • 0 [carry on] messages and 0 [no change] replies.
    • The final fold is ▸ worked … 14 tool calls with the 12-row table as the visible answer.
    • [no change] never appeared on screen.
  • Questions-only ask ("options for merging them into one config file… don't change anything yet"):
    • 13 read-only calls, 0 write, edit or bash calls; git status clean.
    • Answered in the reply with an options table.
    • Two tool rounds, below the check's 10-round threshold, so no check ran.
  • Not exercised at this sha: a live [no change] reply, because no carry-on happened. It was last seen live on 44f38508. The stricter rule for when it counts is covered by unit tests only.

@santoshkumarradha

Copy link
Copy Markdown
Member Author

@AbirAbbas this is ready for your review. If it looks good to go, please merge it.

  • Scope: round 1 of session, prompt: answers argue with the completion check and hide the deliverable (round 1: initial cleanup) #1065, the initial cleanup. @ZeroPoint95 has round 2.
  • Tests on Spark at c8346300: make pr-ready passed; internal/session 4156 passed and internal/tui3 5245 passed, 0 failed in both.
  • Live check with deepseek/deepseek-v4.1-flash on the same commit: passed. Details are in the PR body.
  • CI: light gate passed; touched packages was still running when I posted this.
  • Needs sign-off: the prompt-size waivers went up by 2,035 bytes on both profiles (to 7,311 and 15,586), because the new system.md sections are longer.

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Taking this over to get it merged — I'll push the fixes onto this branch and merge it myself. @santoshkumarradha @ZeroPoint95 for visibility.

Reviewed against the code with an independent audit. The protocol works and CI is green on c8346300; the tests drive a real Agent turn and the carry-on test fails when the guard is removed. What I'm fixing before merge:

  1. # Messages from codeaf is not an exact list. It says the five tags are the whole set and "any other opening … is the person's", but codeaf also writes user-role [folded …] (compaction), [context compacted] (older journals) and [something you set up fired] (standing news), and [held] arrives as a tool result. As written, the rule tells the model that standing news is the person's request. Rewriting the section so it is true, remeasuring the waivers, and correcting the change entry and PR body that repeat the claim.
  2. The judge and memory skip is context-free. withdrawn := IsNoChangeReply(answer) in loop.go fires on every exact token, not only one that answered the reader's note (answeredNoteUnchanged). Making it use the same check. The display side (replay and live feed hide any lone token) stays as you described it, as round 2.
  3. Noting in the change entry that the waivers now sit exactly on the measurement.

Not changing: the clip, the lead, the four sections and the restored rules all check out; the waiver figures reproduce (fixed 55,311, lean 47,086).

Will run make pr-ready here plus a live tmux check on the real binary before merging, and post the evidence.

AbirAbbas and others added 4 commits September 16, 2026 17:46
The system prompt now distinguishes conversation user-role notes from private reader and tool-result markers. A structural test follows the production constants, and the byte waivers record the exact fixed and lean measurements.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The completion loop now uses the transcript context before suppressing the route judge or substituting the prior answer for memory. Tests cover the withdrawn and ordinary-token memory paths, and the manual separates counting from display.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The OpenAI-compatible stub can now drive the real binary through eleven read rounds, a long table, a rejecting reader, and the exact token reply. The recipe records the tmux setup and the expected log and screen evidence.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The messages-from-codeaf list had named [something you set up fired], and
TestTheSteeringLineReadsAsNewsAndNotAsARequest refused it: that line says
under the news itself what it is and what not to do about it, so the page's
copy is one law bought on every request of every turn for a turn most
sessions never have. The list keeps the compaction tags, the structural test
now files the standing frame with the private voices the page must not name,
and the waivers fall to the new measurement (fixed 55,280, lean 47,055).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@AbirAbbas

AbirAbbas commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Pushed the takeover fixes: four commits on top of c8346300, head 8ece6760. The PR body is rewritten to match.

What changed since your head

  1. # Messages from codeaf no longer claims five tags are the whole set or that any other opening is the person's. It names the compaction tags too ([folded …], [context compacted]), drops [held] (a tool result), and a structural test (messagesfromcodeaf_test.go) follows the production constants so the list cannot drift again. It failed against your page text before the edit, naming the three missing tags.
  2. [something you set up fired] is not on the page: TestTheSteeringLineReadsAsNewsAndNotAsARequest refuses it, because the standing-news line carries its own instruction under the event and a second copy on the page is one law bought on every request (prompt diet, WITH THE EVENT). The structural test files it with the voices the page must not name.
  3. withdrawn in loop.go now requires answeredNoteUnchanged, so the judge and memory skip only when the token answered the reader's note. Both real-Agent tests now also assert what the memory reflex was handed (the table in the honoured case, the token in the after-calls case). Display stays context-free, as your round-2 list says, and the manual says so in one sentence.
  4. test/remote/stub gained PROBE-NOCHANGE, a deterministic replay of session, prompt: answers argue with the completion check and hide the deliverable (round 1: initial cleanup) #1065 against the real binary, with the tmux recipe in test/remote/stub/PROBE-NOCHANGE.md.

Budget. Fixed 55,280 and lean 47,055, 2,004 bytes over origin/dev on both arms; waivers 7,280 / 15,555, exactly on the measurement.

Gates on 8ece6760, this laptop, make pr-ready: light gate green; touched packages green: internal/session 297s, internal/tui3 360s, plus internal/config, internal/e2e, internal/exec, internal/manual, cmd/codeaf-demo-home. (A first run had TestTheCeilingCarriesTheLastSketchIntoTheBrief hit its 60 s deadline while tui3 and a tmux replay ran beside it; alone it passes in 0.06 s, which is the shape its own message describes.)

Live replay in the real TUI (stub on 127.0.0.1:18081, fresh CODEAF_HOME, --model stub/scripted --one-model, typed PROBE-NOCHANGE ./go.mod):

carry-on requests: 1
no-change branches: 1
reader branches: 1
[no change] on screen: 0

Screen after the turn settled, bottom of the pane:

  seat 25  stub/scripted  deterministic replay row 25                                                         
  seat 26  stub/scripted  deterministic replay row 26                                                         
  seat 27  stub/scripted  deterministic replay row 27                                                         
  seat 28  stub/scripted  deterministic replay row 28                                                         
  seat 29  stub/scripted  deterministic replay row 29                                                         
  seat 30  stub/scripted  deterministic replay row 30                                                         
                                                                                                              
    · the ask is not finished · carrying on rather than stopping here                                       
                                                                                                  · 17:46 · 

@santoshkumarradha @ZeroPoint95 — ready to merge once CI is green on this head.

@CLAassistant

CLAassistant commented Sep 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@AbirAbbas
AbirAbbas merged commit 40427b2 into dev Sep 16, 2026
2 of 3 checks passed
@AbirAbbas
AbirAbbas deleted the fix/1065-answer-shape branch September 16, 2026 22:39
@santoshkumarradha santoshkumarradha added the bug Something the code does that it should not label Oct 3, 2026
santoshkumarradha added a commit that referenced this pull request Oct 25, 2026
* tui3, config: the gate row lands on the conversation you are in, and /status names the gate (#1063)

The three Safety rows — `ask before running`, the tool exceptions and the shell
command rules — wrote the profile and left the running gate alone, while the
YOLO badge read that profile live. So the badge and the gate disagreed in both
directions: `allow` lit the badge over a gate that kept asking, and `prompt` put
it out over a gate that was still wide open, which is the false-safety claim
#322 and #325 exist to prevent.

`applySetting` now pushes those three rows through `ApplyApprovals` — the seam
/permissions already drops a banked rule through — and refreshes the badge on
the same keystroke, on the branch where the push landed. A rebuild that could
not be done is said out loud on the panel's foot line in /permissions' own
words, `saved · from the next session`, and the badge stays with the gate in
force rather than following the file.

And /status carries the posture it never carried: `approvals prompt`, `allow` or
`deny`, in the `ask before running` row's own words, in the note, in --json and
on the phone's status sheet, from the one posture reading the badge uses. The
status row keeps its negative-space badge and the segment is no longer written
into the page twice.

The note's label column is measured from the widest label it carries, so three
crew assertions that spelled `"\ncrew"` plus exactly five spaces were
assertions about every other row on the page. They read the crew line by its
label now.

Co-authored-by: Claude Fable 5.1 <[email protected]>

* attribution: the footer names CodeAF, and still links to agentfield.ai (#1075)

* attribution: the footer names CodeAF, and still links to agentfield.ai

The pull request, issue and comment footers read "Drafted with agentfield ai".
They now read "Drafted with CodeAF"; the link, its utm parameters and the
"reviewed and owned by the author" tail are unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GNBScbyNAbbEQ5jn9G6auy

* docs: the change entry for the CodeAF footer

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GNBScbyNAbbEQ5jn9G6auy

---------

Co-authored-by: Claude Opus 5 <[email protected]>

* session, prompt, tui3: a wrong completion check is answered with [no change], and the answer stands (#1065 round 1) (#1067)

* session, prompt: a wrong completion check is answered with [no change], and the answer stands (#1065 round 1)

The end-of-turn reader saw 600 bytes of the last message, so a long table read
as cut off; the carry-on told the model to explain itself, and the explanation
became the only answer left in view under the fold.

The reader now sees up to 8 KB of the last words, and a cut it still has to
make ends with `[clipped by codeaf: N of M bytes]`, which its ask says is never
evidence of a cut-off answer. The carry-on lead says who wrote the note and
offers one exact reply, `[no change]`: it ends carrying on for the ask without
another reading, the transcript keeps it for the model, and neither replay nor
the live feed draws it — so the settled answer before it is what the fold finds.

system.md trades `# Tone` and `# Delivery` for `# The answer`, `# Words or
work`, `# When corrected` and `# Messages from codeaf`, and the two lines that
pushed action on questions are qualified. The lean page keeps all four; the
prefix waivers rise by the 1,705 bytes that cost, dated and named.

Co-Authored-By: Claude Opus 5 <[email protected]>

* docs: the change entry takes the pull request's own number

Co-Authored-By: Claude Opus 5 <[email protected]>

* session: a quiet landing is asked about the notes it was handed, not the page that names them

The worker's system page now names [silent] and [stuck] under
`# Messages from codeaf`, so a search of the whole request found the tag on
the page. childWasHanded reads the conversation and leaves the page out.

Co-Authored-By: Claude Opus 5 <[email protected]>

* session, prompt: [no change] answers the note it follows, and a long ask leaves the last words cut by name (#1065 round 1)

Self-review of #1067 found the token honoured on the wrong replies. The gate
read the turn's carry-on count, so a model that made calls in answer to the
note and then said [no change] ended the turn unread on an answer those calls
may have made stale, and a token after a load or ask nudge counted too. It now
reads the transcript: the token must be the very next reply to the reader's
own lead (answeredNoteUnchanged), and the dead declined flag is gone.

An ask up to the whole digest rides in its head, so eight kilobytes of last
words behind a long ask reached the backstop clip and ended in a bare `…`.
checkpointClipSaid takes the room that is left. A turn that ends on the token
no longer starts the route judge or hands the token to the memory reflex, and
a later reading's last words skip it.

`# Messages from codeaf` named `[still asked]`, which only the reader ever
receives, and left out `[stuck]` and `[held]`, which the conversation does; it
now names the tags that arrive and says any other opening, such as
`[image #1]`, is the person's. The waivers sit on the measured 1,779 bytes, and
the manual and the change entry say what the gate actually honours.

Co-Authored-By: Claude Opus 5 <[email protected]>

* prompt: the new sections keep the rules the old two carried, and say what stays in view (#1065 round 1)

Owner review of #1067. Replacing `# Tone` and `# Delivery` had dropped five
rules; each is back inside the new sections: match the person's task and
vocabulary, choose the safe option under uncertainty, evidence and blocking
details complete, never a compiling scaffold or a narrowed test, never
half-solved work.

`# The answer` said only the last message reaches the person, which `# Planning`
contradicts: the plan and the per-batch sentence are shown while a turn runs. It
now says that once a turn ends only its last message stays in view.

`# Words or work` sat beside `## Work or words`, which spends the same two words
on hand-off sizing; it is `# Answer or change`, and it says an answer asked for
in chat is written in the reply, not a file, unless the person asks for one.

The waivers sit on the new measurement, 2,035 bytes over dev on both arms.

Co-Authored-By: Claude Opus 5 <[email protected]>

* prompt: the messages-from-codeaf list names every note codeaf writes

The system prompt now distinguishes conversation user-role notes from private reader and tool-result markers. A structural test follows the production constants, and the byte waivers record the exact fixed and lean measurements.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* session: no change skips judgment only when it answers the reader

The completion loop now uses the transcript context before suppressing the route judge or substituting the prior answer for memory. Tests cover the withdrawn and ordinary-token memory paths, and the manual separates counting from display.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test: the model stub replays the no-change fold

The OpenAI-compatible stub can now drive the real binary through eleven read rounds, a long table, a rejecting reader, and the exact token reply. The recipe records the tmux setup and the expected log and screen evidence.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* prompt: the standing-news tag stays with the event, not on the page

The messages-from-codeaf list had named [something you set up fired], and
TestTheSteeringLineReadsAsNewsAndNotAsARequest refused it: that line says
under the news itself what it is and what not to do about it, so the page's
copy is one law bought on every request of every turn for a turn most
sessions never have. The list keeps the compaction tags, the structural test
now files the standing frame with the private voices the page must not name,
and the waivers fall to the new measurement (fixed 55,280, lean 47,055).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Abir Abbas <[email protected]>

* Clean internal experiment records and revive test/ux for codeaf (#1068)

* chore: clean internal experiment records and revive test/ux for codeaf

Public-repository cleanup ahead of opening the docs to outside readers.

- Remove four internal DOE/experiment record directories that reference
  private issue and pull-request numbers and are not current-product
  documentation: docs/design/pin-doe, plan-gate-doe, turn-wall-share-doe,
  and workspace-foundation.
- Neutralize internal machine references in benchmark and design docs:
  the bench host ("spark"), its secrets.env path, and a personal working
  branch name, all now generic placeholders.
- Revive test/ux/, the user-facing journey suite, for the renamed product:
  collapse the removed v1/v2 dual-surface logic into the single v3 surface,
  repoint the binary to cmd/codeaf and state to ~/.codeaf/CODEAF_*, and
  delete gate.sh whose premise was the v1-vs-v2 parity table.

Co-Authored-By: codeaf <[email protected]>

* chore: drop internal conversation-runtime wave records, keep the measurement contract

The conversation-runtime directory was a local development wave: day-by-day
status, /private/tmp paths, "owner authorized" process notes, draft PR numbers,
and local change logs. None of it is current-product documentation a public
reader needs. Keep PARETO.md, which is the benchmark's cited measurement
contract, trimmed of its dangling calibration link and owner language.

Co-Authored-By: codeaf <[email protected]>

* chore: neutralize the remaining bench-host and work-machine references

A wider sweep found the internal bench host ("Spark"), its secrets path
(fleet/secrets.env), and a scratch ops directory still named in live docs,
bench READMEs and bench scripts that the earlier redaction had not touched.
Rename the host to "benchhost"/"the bench host", drop the secrets path, and
replace "the laptop" as the owner's own machine with a neutral "work machine"
where it meant the internal one. The manual's first-person "the laptop you are
sitting at" is public-facing and left alone.

Co-Authored-By: codeaf <[email protected]>

* chore: fix review findings in the public-cleanup diff

- PERF.md: drop a private tracker issue reference (#846).
- PARETO.md: restore a complete sentence dropped when the calibration link was
  removed, and align tense with the remaining present-tense claim.
- home-mission-control/DESIGN.md: drop the internal "fleet" system name and
  an owner-framing phrase, consistent with the secrets-path scrub elsewhere.

Co-Authored-By: codeaf <[email protected]>

* docs/design: the two records live code still cites stay in the tree

plan-gate-doe/REPORT.md is the measured evidence behind the plan-gate default
that twelve comments in cmd/codeaf, internal/config, internal/session and
internal/splitgate point at, and turn-wall-share-doe is the run
internal/session/turnwall.go says it was added from. CLAUDE.md keeps the
record on purpose for exactly this reason, and neither folder names a machine,
a secret or a private address.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test/ux: the revived journey suite goes back out

#991 removed it because it drove the v1 and v2 surfaces, and the revival did
not change that: its journal verb reads graph.db tables (messages, nodes,
usage, commands) that the v3 chat never writes, lib.sh still waits for the
resident, nothing runs it from the Makefile or a workflow, and its only
evidence was bash -n. docs/JOURNEY.md says internal/e2e is the one suite that
drives the binary, and that stays true. A suite that has been run green
against bin/codeaf can come back on its own pull request with a target that
runs it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs/changes: entry for #1068

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs/changes: the #1068 entry says why the journey suite is out, correctly

The first draft said the v3 chat never writes the graph.db tables the suite
reads. Running the suite showed both message rows landing, so that sentence
was wrong; what is true is that nothing runs the suite, it had never been run,
and its first journey fails on its first screen check (#1072).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: codeaf <[email protected]>
Co-authored-by: Abir Abbas <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>

* session: task commits are authored by the bot account, not codeaf@localhost

The author codeaf stamped on the commits it lands was `codeaf <codeaf@localhost>`, which no GitHub account can link, so every branch codeaf landed failed the CLA check. It now writes `codeaf <[email protected]>` - the identity the Co-Authored-By trailer already used - and keeps `codeaf@localhost` and `aforge@localhost` recognised as legacy by taskCommitIdentity.

GLM 5.3's review caught an unmarked retired name in permissions.md that reddened the namelaw gate, and seven stale test fixtures; both fixed. Laws gate, session, exec and cmd are green.

Co-Authored-By: codeaf <[email protected]>

* README: show the pinned-version install line the release test requires (#1103)

* README: show the pinned-version install line the release test requires

The Install rewrite dropped the VERSION=<tag> pin example, and
TestPublishedPinExamplesGiveVersionToBash reads every published install
surface for `| VERSION=` because `VERSION=<tag> curl ...` is an easy
mistake to copy — it sets the variable for curl instead of the install
script. The pin goes back inline on the same host the section already
uses, with the releases page still linked for tags.

Co-Authored-By: codeaf <[email protected]>

* docs: the change entry for the README pin example

Co-Authored-By: codeaf <[email protected]>

---------

Co-authored-by: codeaf <[email protected]>

* telemetry: anonymous usage counts, off with CODEAF_TELEMETRY=off (#1095)

* telemetry: the package behind anonymous usage counting, per the wire contract

Four typed events (first_run, session_started, session_ended, fault) with the
contract's allowlisted, bucketed props; the opt-out ladder with its off
reasons; a hashed install identity at 0700/0600; a fault fingerprint over
codeaf function names only; a JSON-lines spool with a deadline-bounded flush
of up to 50 events per POST, 7-day age drops and a 1000-line cap; the notice
constant with NoticeShown/MarkNoticeShown gating the flush; and Show() for a
future codeaf telemetry show.

A library only: nothing in cmd/codeaf, internal/session or internal/config
reads it yet.

Co-Authored-By: codeaf <[email protected]>

* telemetry: tests, doc, and contract fixes for the usage-count package

Adds the package's tests — bucketing edges, the opt-out ladder, install
identity, the notice, fingerprinting, the spool against an httptest relay
(cap, age drop, 50-per-POST splitting, a hard deadline against a hanging
server, silence on failure) and the privacy law that no sentinel string
reaches the wire. docs/TELEMETRY.md documents the notice, what is sent and
how to turn it off, with a test that fails if the doc's property table
drifts from the Go allowlist.

Fixes four drifts from the wire contract found running those tests: the
<1m duration bucket was missing, the fingerprint's argument stripping cut
too much, the rc channel suffix must be a single integer, and under go
test a config-off rung outranks the test rung in the reason reported.

Co-Authored-By: codeaf <[email protected]>

* telemetry: fix review defects 1-8 with tests

Fingerprint stability (last-( cut, .go:/main./created-by frame rules),
counted-batch flush, guarded and multi-process-safe spool, BucketDuration
edges, Configure-gated write paths, O_EXCL install id, install.json
preservation, buildinfo.Dirty accessor.

Co-Authored-By: codeaf <[email protected]>

* installer: record the install locally and print the telemetry notice

Following the telemetry wire contract: a successful install now writes
telemetry/install.json under the state root (dir 0700, file 0600) with
the install method, channel and UTC timestamp, leaves any existing
install_id alone, and makes no request the download steps did not
already make. At the very end the installer prints the contract's
notice to stderr after one blank line, or one line saying telemetry is
off when CODEAF_TELEMETRY/DO_NOT_TRACK opts out. README gains a plain
Telemetry section pointing at docs/TELEMETRY.md, and a new
test/installer-telemetry.sh proves the marker, the notice and the
opt-out without a network.

Co-Authored-By: codeaf <[email protected]>

* installer: four review corrections to the telemetry commit

The review of 71ff95a6b found four things. Revert the one line that
changed `if [[ -z "${TAG:-}" ]]; then` back to `${TAG:-}`: under
set -u an unset TAG must reach api_problem, not crash. In
write_install_marker the channel lands in JSON verbatim and CHANNEL
can come from the environment, so only stable, rc, staging or dev is
recorded and anything else becomes "unknown" — with test cases for a
valid channel and for we"ird, both asserting the marker parses
(python3 -m json.tool, or jq, else a strict channel check). Fence the
README Telemetry notice in a ```text block so Markdown keeps its
alignment, wording byte for byte. Clear the two shellcheck findings in
test/installer-telemetry.sh with one block disable for SC2016/SC2034 —
ok() evals those strings, so the quoting is deliberate — and export
CODEAF_TELEMETRY/DO_NOT_TRACK where a subshell needs them, without
weakening any assertion.

Co-Authored-By: codeaf <[email protected]>

* release-downloads: daily PostHog report of public GitHub release download counts

A scheduled workflow reads the repository's releases from the public GitHub
API and sends one codeaf:release_downloads event per binary asset
(codeaf-<os>-<arch>[.exe]) — sidecars like checksums.txt are not reported.
Each event carries release_tag, channel (stable or the prerelease suffix),
prerelease, os, arch, the cumulative download_count and the UTC
snapshot_date; the event id is derived from tag, asset and date, so a
same-day rerun deduplicates instead of counting twice. No code in the
binary; counts come only from public release data.

Co-Authored-By: codeaf <[email protected]>

* release-downloads: tests cover the workflow, docs and pagination

The dry-run unittests now also assert the identifiers the wire spec spells
out where the script and the workflow spell them: the schedule, dispatch,
contents-read permissions, built-in token, project-key secret and host
variable in .github/workflows/release-downloads.yml, the public-data
paragraph in docs/rules/promotion.md, stdlib-only imports, pagination
across API pages, the host override and the /batch/ endpoint, sidecar
skipping, draft skipping, and the channel words stable, rc, dev and
staging.

Co-Authored-By: codeaf <[email protected]>

* release-downloads: four review corrections to the script

Channel detection now follows the tag grammar in
cmd/codeaf-release/version.go: stable, rc, dev and staging tags match
their four patterns and anything else reports "unknown", so
dev-20260917-09299019bcdc is no longer mislabelled "stable".

--dry-run works without CODEAF_POSTHOG_PROJECT_KEY, the local and test
path: the batch prints with api_key "<unset>" and exits 0, and only the
sending path stops with the notice.

Every event carries "$geoip_disable": true next to
"$process_person_profile": false, since the sender is a CI runner whose
location is meaningless. The module docstring now names
release-downloads.yml, the file that exists.

The fixture holds one tag of each shape plus an unrecognised one, and
the tests assert the channel for each, including the two real dev and
staging tags.

Co-Authored-By: codeaf <[email protected]>

* release-downloads: test runs on Python 3.9 too

ScriptSourceTest read sys.stdlib_module_names unguarded; the attribute
arrived in Python 3.10, so the suite errored on macOS stock python3
(3.9.6). Guarded with getattr so the pinned import-set check stands on
its own where the attribute is absent; 32 tests pass on 3.9, 3.10 and
3.14.

Co-Authored-By: codeaf <[email protected]>

* installer telemetry: the notice is read from docs/TELEMETRY.md

The test read .telemetry-contract.md, a working note that is not in the
repository and never will be, so it aborted with "telemetry contract is
missing" in a clean checkout. It now extracts the fenced block under
"## The notice" in docs/TELEMETRY.md — the same bytes as the Notice
constant in internal/telemetry/notice.go — and holds the installer's
TELEMETRY_NOTICE to it as before; a new assertion holds the README's
telemetry fence to it too, byte for byte, so the invariant the suite
existed to guard now has its third leg.

Comments in scripts/install.sh, internal/telemetry/telemetry.go and this
test now name docs/TELEMETRY.md as the source of the notice.

No Go code changed and no Go tests were run. shellcheck is clean; the
suite's 33 passing assertions include the two new notice checks, and the
same two stat(1)-related assertions that already failed on this GNU
machine before the change still fail with identical output.

Co-Authored-By: codeaf <[email protected]>

* release-downloads: the download-counts paragraph lives in docs/TELEMETRY.md

docs/rules/promotion.md was the only home the paragraph had, and it came
with a fallback pinning the branch to the state before the telemetry
doc existed. The paragraph moves, byte for byte, into docs/TELEMETRY.md
as a final "## Download counts" section beside the rest of the telemetry
story, and promotion.md returns to its origin/dev content, so this
branch now touches no release docs.

test_no_telemetry_doc_on_this_branch asserted docs/TELEMETRY.md did not
exist and is deleted. The two tests that read the paragraph read it
where it now lives: both require a "## Download counts" section in
docs/TELEMETRY.md naming .github/workflows/release-downloads.yml,
scripts/release_downloads.py and the checksums.txt sidecar, and the
promotion.md fallback is gone.

No Go code changed and no Go tests were run; the property table in
docs/TELEMETRY.md is untouched. The suite passes: 31 tests, OK.

Co-Authored-By: codeaf <[email protected]>

* installer telemetry: the mode check asks GNU stat first

On Linux `stat -f` succeeds and reports the filesystem, so the BSD-first
order never reached the GNU form and both permission checks failed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CqfhxLrrBNQxwPNvEgoBGR

* telemetry: refuse to send to the production relay from a test binary

Co-Authored-By: codeaf <[email protected]>

* telemetry: testHome points the endpoint at a dead loopback

Co-Authored-By: codeaf <[email protected]>

* telemetry: the orphan-adoption test names the dead relay it now gets

Co-Authored-By: codeaf <[email protected]>

* telemetry: a test pins that no test binary reaches the production relay

Co-Authored-By: codeaf <[email protected]>

* telemetry: three tests pin the test-binary relay refusal

Each asserts through real calls, not a re-implemented effect: the
newRelay override lands after testHome and a flush reaches that
recorder; a default-endpoint flush is refused like a dead relay
(zero round trips, event still spooled); forcing the ladder on
cannot reopen the path.

Co-Authored-By: codeaf <[email protected]>

* telemetry: allocation-free session counters

Snapshot returns the SessionStats fields the SessionEnded constructor
takes, so the wiring hands the struct straight over. Cost is stored as
integer micro-dollars and divided back once, in Snapshot. Count* never
ask whether telemetry is enabled and never allocate.

Co-Authored-By: codeaf <[email protected]>

* telemetry: gofmt the counters test

One alignment fix in the many-goroutine test; no behaviour change.

Co-Authored-By: codeaf <[email protected]>

* config: telemetry setting row (CODEAF_TELEMETRY)

Key "telemetry", on|off, default on, env pin CODEAF_TELEMETRY, in the
interface group beside the history row. TelemetryAtIn walks the ladder —
pin, project file, profile config, default — and TelemetryOffReason
answers whether config turned the pipe off and names which rung did.
The row sits in ProjectKeys so a repository may answer for itself.

Co-Authored-By: codeaf <[email protected]>

* cmd/codeaf: the telemetry command, and the setting it writes

Co-Authored-By: codeaf <[email protected]>

* cmd/codeaf: session li