Skip to content

docs: trim the User Steering section to what a reader needs - #307

Merged
cboos merged 2 commits into
mainfrom
dev/trim-steering-docs
Jul 31, 2026
Merged

docs: trim the User Steering section to what a reader needs#307
cboos merged 2 commits into
mainfrom
dev/trim-steering-docs

Conversation

@cboos

@cboos cboos commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

What this does

Trims ### User Steering (Queue Remove / queued_command) in dev-docs/messages.md
from 132 lines to 77, keeping every measured claim byte-identical and cutting
the investigation narrative that accumulated while the behaviour was being worked
out.

At 132 lines it was the largest behavioural section in the file — the next is
### Tool Result Rendering Wrapper at 87 — and second overall only to
### Tool Use Message Structure (294 lines), which is a reference table covering
every tool rather than one message type. dev-docs/ is as-built reference: the
code is the authority, and prose earns its place by telling a reader something the
code cannot.

What is preserved, deliberately byte-for-byte

Every measured statement, because none of it is re-derivable from the code — it
came from counting real archives:

  • the version interval (2.1.202, 2.1.205] in which the behaviour changed;
  • 2.1.203 absent from the sample, and 2.1.204 present with no removes at all —
    the two observations that narrow the interval to that shape;
  • the sampling floor (2.0.55, 2.0.73), so a reader knows what the interval does
    not establish;
  • the 5606-file measurement;
  • the paragraph recording that an earlier >=~2.1.187 claim was backwards.
    That one is kept precisely because it is a correction: without it the next
    reader re-derives the same wrong direction from the same data.

What went is the reasoning that produced those numbers, the alternatives
considered and rejected, and the step-by-step account of how the pairing was
reverse-engineered. Useful while the behaviour was unknown; noise once it is
documented.

Why this closes #294

#294 reported a warning from a real archive:

WARNING: steering suppression imbalance ... a 'remove' op has no matching
queued_command card ... The remove<->queued_command 1:1 pairing appears violated

The pairing was not violated. Image-bearing steering prompts were being
dropped, so the paired legacy remove rendered its text alone and looked
orphaned — and the warning's own diagnosis pointed at the wrong thing, which is
what made it hard to see. Two changes resolved it:

The detector itself is deliberately retained and scoped, not deleted: it still
fires for a genuine pairing violation, and tests pin both that it fires when the
pairing really breaks and that it stays silent otherwise. What changed is that it
no longer accuses the archive of something our own renderer was doing.

This PR is the documentation tail of that arc — the section had grown while the
behaviour was being established, and it is the last piece still carrying the
investigation. Neither #305 nor #306 used a closing keyword, so the issue stayed
open after the code was fixed; it closes here.

Closes #294

Summary by CodeRabbit

  • Documentation
    • Expanded User Steering guidance on dual-record delivery, content-keyed suppression, fallback rendering, and null-content handling.
    • Clarified prompt normalization for strings and content-block lists, including transformer behavior.
    • Documented when unmatched-remove warnings appear and that they are emitted once per session/version.
    • Added corpus-based version observations and sampling limitations.
    • Simplified the guidance by removing implementation-level details.

The section was 133 lines — three times the next largest in the file, and
12% of it, for one message type among many. Most of the excess was the
mechanics of the two-pass suppression budget, which are now commented at
the code that implements them: the reason each part of the
`(session, version, prompt-text)` key is needed, how a `remove`'s version
is inferred, why the pre-pass shares the factory's predicate rather than
mirroring it, what the imbalance warning does and does not claim, and
which prompt shapes can be paired.

Those comments were added alongside the code they describe, several of
them recently, so the doc had become a second copy that loses on drift —
the comment is next to the mechanism and moves with it.

What stays is what a reader of a message-type reference wants: the two
record shapes and their eras, that one delivery writes both and only one
card renders, that nothing is dropped when pairing fails, the prompt
shapes, and the measured null-content boundary with its two sampling
limits. The content moved rather than vanished.

78 lines, from 133.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 43c74844-1fc0-4334-ae98-325ba9adffed

📥 Commits

Reviewing files that changed from the base of the PR and between 96511eb and b4eb986.

📒 Files selected for processing (1)
  • dev-docs/messages.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • dev-docs/messages.md

📝 Walkthrough

Walkthrough

Expanded User Steering documentation to cover paired and unmatched records, prompt normalization, transformer behavior, fallback warnings, legacy null-content removes, version observations, and sampling limitations.

Changes

Steering behavior documentation

Layer / File(s) Summary
Document observable steering behavior
dev-docs/messages.md
Documents paired attachment/remove rendering, lossless fallback behavior, warning conditions, prompt-shape normalization, transformer classification, null-content suppression, and corpus-based version observations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR documents the warning behavior but does not itself implement the fix requested by issue #294. Either link the implementation PRs that resolve #294 or clarify that this documentation-only change is separate from the issue fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documented change to trim the User Steering section.
Out of Scope Changes check ✅ Passed All changes are confined to the User Steering documentation and align with the stated objective to remove investigation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/trim-steering-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dev-docs/messages.md`:
- Around line 286-290: Update the warning-behavior description in the pairing
documentation to state that legacy remove warnings occur only when the (session,
version) exists in qc_versions; do not claim that every unmatched legacy remove
logs a warning. Retain the statement that rendered but non-pairable cards leave
remove visible and emit a warning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c41cf3ee-ba10-4627-8bc2-ff7cc1ff707e

📥 Commits

Reviewing files that changed from the base of the PR and between 0e46b38 and 96511eb.

📒 Files selected for processing (1)
  • dev-docs/messages.md

Comment thread dev-docs/messages.md Outdated
"Both paths log a warning" was too broad. The two sites are asymmetric:

* a non-pairable prompt shape warns unconditionally
  (`attachment_factory.queued_command_prompt_items`);
* an unmatched legacy `remove` warns only when its `(session, version)` is in
  `qc_versions` — i.e. only where that version did produce a counted card —
  and then at most once per key.

So an ordinary legacy-only transcript renders its `remove` as legacy steering
in silence, which is correct: with no card there is nothing for it to be
imbalanced against. The old sentence would have had a reader hunting for a
warning that cannot fire.

Raised in review on #307.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cboos
cboos merged commit 6744db7 into main Jul 31, 2026
17 checks passed
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.

Fix "steering suppression imbalance"

1 participant