refactor: unify record/payload naming + ContentBlock.Source field#14
Closed
yanmxa wants to merge 1 commit into
Closed
refactor: unify record/payload naming + ContentBlock.Source field#14yanmxa wants to merge 1 commit into
yanmxa wants to merge 1 commit into
Conversation
Naming convention (see docs/tracing.md): every record type follows
<entity>[.<sub-entity>].<past-tense-verb>, lowercase, dot-separated.
Payload key matches the first segment of `type`.
Renames:
RecordStarted/Forked/Compacted → SessionStarted/Forked/Compacted
RecordMessageAppended → MessageAppended
RecordStatePatched → StatePatched
transcript.started/forked/.compacted (JSON value) → session.*
SystemRecord (lifecycle payload) → SessionRecord (name now matches
intent — that struct never held system-prompt data anyway)
Record.System field → Record.Session, JSON tag "system"→"session"
Record.TranscriptID → Record.SessionID, JSON tag
"transcriptId"→"sessionId"
*Command.TranscriptID → SessionID (all five commands)
ForkCommand.Source/NewTranscriptID → Source/NewSessionID
ListItem.TranscriptID, fileIndexEntry.TranscriptID → SessionID
ContentBlock gains a Source field for provenance attribution
(populated in a later commit). The existing inline-image data field,
which used the json tag "source", is renamed to ImageSource with tag
"imageSource" to free up the namespace.
applyStatePatch now ignores unknown patch paths (default: continue)
instead of returning an error — keeps the projector forward-compatible
with patch paths added by later schema iterations.
5 tasks
Member
Author
|
Closing — the file-level split produced commits that don't compile standalone. Reopening as a proper hunk-aware re-split. See follow-ups. |
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.
PR 2 of 5 — stacked on #13.
Cleanup pass on the transcript schema. No new behavior.
Naming rule: every record type follows
<entity>.<verb>past tense.transcript.*→session.*(record type values and Go constants)TranscriptID→SessionIDeverywhere (struct field + JSON tag), including all*Commandtypes andListItem/fileIndexEntrySystemRecord→SessionRecord(the struct holds lifecycle metadata, not system-prompt data — name now matches intent)Record.System→Record.Session, JSON tag"system"→"session"ContentBlockgains aSource stringfield for content provenance (populated in PR 6's predecessor). The existing image-data field, which previously used JSON tag"source", is renamed toImageSource/"imageSource"to free up the namespace.Projector's
applyStatePatchnow ignores unknown patch paths (default: continue) instead of returning an error, for forward compatibility with future patch types.Test
go test ./internal/session/...passes — all rename callers updated🤖 Generated with Claude Code