Skip to content

session: stop drawing the skills block as part of a message - #1713

Open
ZeroPoint95 wants to merge 5 commits into
devfrom
fix/skills-block-display
Open

ZeroPoint95 wants to merge 5 commits into
devfrom
fix/skills-block-display

Conversation

@ZeroPoint95

@ZeroPoint95 ZeroPoint95 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Head: 8501fad6e9663cdfefbf73e1a60bc24104d20ead — fix/skills-block-display → dev

What prints, and why

  • Skills suited to this message: is per-turn skill selection — context for the model, spliced by attachTurnSkillsLocked onto the copy the provider reads.
  • That copy lives in a.messages, which shapeEntries also walks to build every DisplayEntry — so Transcript, AttachReplay, and any reopen drew the block as though the person had typed it: top of new conversations, and after nearly every message whose words overlap the shelf.
  • Skill-suitability block leaks into the visible transcript — keep it model-context only #1504 covered only the durable half: the journal and store always kept the typed words. The in-memory transcript is the half that was missed.

The fix: strip by injection provenance, never by text

  • attachTurnSkillsLocked marks the one message it splices with the exact bytes it appended — a memory-only messagePresentation.SkillsBlock field riding the existing presentation index into shapeEntries.
  • The mark is never journaled; a restored message carries no mark and needs none, because the journal keeps only the typed words.
  • shapeEntries removes exactly those bytes from exactly that message. The model-bound copy is untouched.

What survives

  • A person who pastes a whole skills block into a message of their own keeps every word — suffix matching (this PR's first cut, caught in review) could not tell the two apart; provenance can.
  • Pinned cases: pasted complete block with no shelf; pasted block beside an injected one (only the injected copy comes off); marker/closing-line fragments; end-to-end Submit → Transcript shows the typed words while the provider copy keeps the block and the dim skills carried: notice is unchanged.
  • Review follow-up: AttachReplay's own mid-turn slice is now exercised (it draws the running turn's opening message off a.messages[:floor]), and the provenance mark's pointer-identity assumption is pinned as a tripwire — recordUserLocked appends user.message without re-allocating Content (unlike recordPresentedAssistant, which deep-copies), so a deep copy on the user path would silently drop the mark and this test would go red.
  • stripTurnSkillsBlock and plan's SkillsBlockConflictLine are deleted; plan/contract.go is back to dev's text.

Checks

  • Build ✓, vet ✓, manual gate ✓; targeted skill/transcript/display/AttachReplay/provenance tests green. GitHub CI is the authoritative gate.
  • Full internal/session suite on this branch fails 5 tests: TestHeldBeltRunStopsWithoutPreparingRepository, TestHeldRecoveryRetainsTheAcceptedCrew, TestHeldRunReopensOnTheSameAdmissionWithoutPreparingFiles, TestNewAdmissionReadsSettingsChangedBeforeItsCreation, TestStandingIsolationRecordsItsCopyBeforeWorkerInitialization. Failure classification: environmental, pre-existing — all five fail identically on a clean origin/dev checkout on this machine (macOS /var vs /private/var temp-path symlink in StandingIsolation, and held-run/admission timing timeouts under load in the rest). This PR touches none of them or their paths.

Known, out of scope (noted, not changed)

  • questionconversation.go:117 builds the clarify child's model-facing context with displayEntries(a.snapshot()) — the index-less variant — so the injected block rides into that prompt. Pre-existing and model-facing (not a person-visible door), left as-is per review; noted here as an inconsistency with the display doors, which do strip.

—

Drafted with CodeAF · reviewed and owned by the author

ZeroPoint95 added a commit that referenced this pull request Oct 1, 2026
Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
ZeroPoint95 added a commit that referenced this pull request Oct 1, 2026
Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
agentfield-bot and others added 4 commits October 1, 2026 00:17
`Skills suited to this message:` is per-turn skill selection for the model.
attachTurnSkillsLocked splices it onto the copy the provider reads in
a.messages, and that same array is what shapeEntries walks to build every
DisplayEntry — so Transcript and AttachReplay drew the block as though the
person had typed it, at the top of every reopened conversation and after
every message.

Strip the block in shapeEntries, the one place a message becomes a displayed
row. The remover matches only a whole trailing render the producer itself
would have appended: the lead, "- " entry lines, and the closing conflict
line, as a suffix. It shares the lead and the conflict line with the
producer so the two cannot drift. The model-bound copy is untouched, and a
person who pastes the marker or the closing sentence into their own message
keeps every word.

#1504 was believed to have fixed this but only proved the journal and store
thread clean; the display half was never changed.

Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Review of #1713 found the suffix match could not tell an injected block
from one a person pasted whole into a message of their own — the pasted
text was silently truncated on display, most surely on a journal-restored
message, which never had an injection at all. attachTurnSkillsLocked now
marks the one message it splices with the exact bytes it appended (a
memory-only messagePresentation field; the journal keeps only the typed
words), and shapeEntries removes exactly those bytes from exactly that
message. stripTurnSkillsBlock and plan's SkillsBlockConflictLine go away;
the pasted-complete-block regression cases are pinned.

Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
@ZeroPoint95
ZeroPoint95 force-pushed the fix/skills-block-display branch from 9ebfee6 to 87fe990 Compare October 1, 2026 04:26
…entity

Review of #1713 asked for the two regressions it could not see from the
settled record: AttachReplay's own mid-turn slice must keep the strip
(nothing exercised that door), and the provenance mark's pointer-identity
assumption — recordUserLocked appends user.message without re-allocating
Content, unlike recordPresentedAssistant — must be a tripwire, since a
deep copy on the user path would drop the mark silently and draw the
model's skills block back as the person's own words.

Assisted-by: CodeAF (ember-1)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
@ZeroPoint95
ZeroPoint95 marked this pull request as ready for review October 1, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants