fix(claude): keep IDE-context envelopes out of first_message previews - #1265
fix(claude): keep IDE-context envelopes out of first_message previews#1265adammw wants to merge 1 commit into
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
58dabd8 to
5193f4a
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
26c1417 to
af011ba
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
|
The pin reattachment parts look a bit overwrought here? |
|
Agreed... this has grown beyond the original bug. I’m going to keep the prompt as one message and remove the leading IDE wrapper in place. That avoids shifting message ordinals, so the pin reattachment changes can come out of this PR. |
|
looking |
Squash of follow-up work on this branch: - fix(claude): give split IDE envelopes a distinct source identity - fix(db): drop orphaned pins instead of ordinal-matching unrelated rows - fix(db): require pin uuid uniqueness in the old DB as well - fix(claude): preprocess the prompt revealed by an IDE-envelope split - fix(db): harden duplicate UUID pin fallback - test(recall): model IDE-envelope digest revocation - fix(db): require role/content identity for uuid-less pin fallback - fix(db): avoid duplicate orphaned-session pins - fix(db): guard pins during in-place reparses - fix(db): fall back when pin UUID becomes ambiguous - fix(db): guard pins across diff updates - fix(postgres): restore pins by prior message identity - fix(postgres): preserve pins created during sync - fix(postgres): serialize pin mutations with sync - fix(postgres): follow shifted pin UUID anchors - fix(db): avoid pinning hidden upload metadata - fix(db): guard upload pins from hidden row shifts - fix(postgres): snapshot resolved pin ordinals - fix(postgres): separate pin anchor ordinals - fix(db): require matching pin source UUIDs - fix(postgres): use portable pin session locks - fix(server): preserve uploaded message provenance - fix(server): preserve uploaded compact boundaries - fix(claude): align fork scoring with extraction - fix(server): preserve uploaded sidechain state Co-authored-by: Matthew Jacobs <mjacobs@apache.org>
3a98e81 to
202295a
Compare
roborev: Combined Review (
|
Fixes #1238.
Claude IDE-context wrappers prepended to real prompts are now split into hidden
system metadata and a visible user prompt in both parser paths. The revealed
prompt goes through the normal user-text preprocessing, while the synthetic
envelope receives a distinct source identity. This keeps raw IDE markup out of
first_messageand the visible transcript without aliasing the prompt'sidentity. Data version 86 reparses existing sessions, and the Claude format
provenance records the observed mixed-envelope shape.
Because that reparse can rebuild message rows, SQLite and PostgreSQL pin
restoration now follow only unambiguous prior message identities. UUID-less and
duplicated-UUID rows may use a guarded ordinal, role, and content fallback;
vanished or ambiguous targets are dropped instead of moving or multiplying
pins. Explicit re-uploads preserve edited legacy pins by ordinal only while the
hidden-row layout through that ordinal is unchanged. In-place SQLite updates
fall back to guarded remapping when a pinned identity changes, orphan recovery
maps pins by the verbatim-copied ordinal, and PostgreSQL serializes pin
mutations with transcript replacement while keeping recorded and resolved
anchor ordinals distinct. Changed visible prompt digests also revoke stale
Recall provenance.
The parser intentionally handles only well-formed leading
ide_opened_fileandide_selectionwrappers with a non-empty remainder; malformed or mid-messagemarkup remains untouched. The main review areas are the split logic in
internal/parser/claude.go, conservative pin remapping ininternal/db/messages.go,internal/db/orphaned.go, andinternal/postgres/push.go, and the explicit upload adapter ininternal/server/upload.go.