Skip to content

feat(session-flow): teach the transcript reader eight current record types #5931

Closed

Description

@kyle-sexton

Problem

plugins/session-flow/scripts/transcript_reader.py (#5925) does not know eight record types that appear on current Claude Code versions. Counts are from one machine's corpus, 2026-10-02:

Record type Count
atis-latch 6,331
mode 6,284
ai-title 2,525
bridge-session 1,582
relocated 1,127
file-history-delta 956
cost-state 111
fork-context-ref 53

The drift check therefore reports unknown-record-type on every real run. That is advisory and doesn't degrade a metric, but it buries any real drift.

Done when

  • The reader classifies each of the eight types, as used or deliberately ignored, with a test fixture per type.
  • A drift run over a current corpus reports no unknown-record-type.
  • If ai-title carries a usable title, it serves predecessor linkage beside custom-title in link_keys. 31 of 33 /clear successors in the spike could be linked through a carried title or agent name.

Notes

The transcript format is documented as internal and changes between versions, so the census in collect.py census|drift is how new types surface.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 2, 2026
  2. kyle-sexton commented on Oct 3, 2026

    @kyle-sexton
    MemberAuthor

    The first real audit-sessions collect (session-flow 0.46.0, Claude Code up to 2.1.288, 135 sessions) found 11 unknown record types, not 8. These three are new:

    Type Records
    frame-link 29
    artifact-comment-monitor 1
    artifact-autoreact-ledger 1

    Current counts for the original eight: atis-latch 7,537, mode 7,434, ai-title 2,550, bridge-session 1,582, file-history-delta 1,199, relocated 1,127, cost-state 145, fork-context-ref 53.

  3. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Routing: delegable (work-class: scoped, feature, priority: medium). Verified against current main: the shared reader's RECORD_TYPES set knows none of the 11 types named in the body and the 2026-10-03 comment, so record_kind returns unknown for each and the collector counts them as unknown-record-type. The title says "eight"; the live count is eleven.

    Basis: plugins/session-flow/scripts/transcript_reader.py:71-87 (RECORD_TYPES), plugins/session-flow/skills/audit-sessions/scripts/collect.py:287-291 (unknown kinds return early from the scan).

    Agent Brief

    Type: Feature
    Summary: Teach the shared transcript reader the eleven record types current Claude Code versions write, so the drift census stops reporting them as unknown.

    Current behavior:
    The shared transcript reader's known-type set (RECORD_TYPES, consulted by record_kind) omits atis-latch, mode, ai-title, bridge-session, relocated, file-history-delta, cost-state, fork-context-ref, frame-link, artifact-comment-monitor and artifact-autoreact-ledger. Every real audit-sessions collect reports each as unknown-record-type, which buries genuine drift. Unknown kinds currently return early from the collector's scan, so they feed no metric.

    Desired behavior:

    • Each of the eleven types is classified as either used (feeds a metric or a link key) or deliberately ignored (recognized, feeds nothing), and the classification is visible in the code.
    • A type marked ignored is recognized by record_kind but contributes to no metric: making it "known" must not let it fall through into token, turn, timing or other counting that unknown kinds skip today.
    • If an ai-title record carries a usable title string, the session's link keys expose it beside custom_title so /clear successors can be linked to their predecessor; any stored title is redacted and governed by the same excerpt setting as custom_title.

    Key interfaces:

    • RECORD_TYPES and record_kind() in the shared transcript reader module.
    • The collector's session record link_keys object (new optional key for the AI title, if used; absent reads as null per the store's additive-field rule).

    Acceptance criteria:

    • All eleven types are known to the reader; each is documented as used or ignored.
    • One synthetic, minimal fixture per type (eleven fixtures), hand-written, never excerpted from a real transcript. Tests show each fixture is recognized and that ignored types change no metric.
    • Existing session-flow tests (collect, sweep, census, retro, transcript reader) pass unchanged.
    • Edit the reader in the file the shared-copies registry names as its canonical (today that is session-flow's own file; if a copy registration has landed, edit the canonical and regenerate). Regenerate every registered copy with the shared-copies sync script and bump every carrying plugin's version and CHANGELOG. The sync --check passes.

    Out of scope:

    • Moving the reader's canonical location (tracked separately).
    • Migrating other session-flow readers onto the shared reader (tracked separately).
    • New metrics built on these record types beyond the optional AI-title link key.

    Operator check after merge (not a worker criterion): a drift run over a current corpus reports no unknown-record-type for these eleven types.

  4. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 4, 2026
  5. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during work-loop.

    Approve this for autonomous dispatch, or keep it for a human?

    Triage marked this delegable as a feature-shaped C3 (work-class: scoped). The work-loop admission gate human-gates feature-shaped C3 work, so the lane removed agent-ready and applied needs-human. To dispatch it, flip it back through /work-items:attend-queue.

    Lane: work-loop, instance melo-worker-1, cycle 1.

  6. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    and removed
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 4, 2026
  7. kyle-sexton commented on Oct 11, 2026

    @kyle-sexton
    MemberAuthor

    Draft PR: #7066 (branch feat/5931-transcript-reader-record-types).

    • All eleven types (the body's eight plus the three from the 2026-10-03 comment) are now known to the shared reader. ai-title feeds a new link_keys.ai_title (redacted, dropped under --excerpt-chars 0); the other ten are in IGNORED_RECORD_TYPES and the collector skips them before any metric. The performance plugin's copy was regenerated.
    • Verified locally: affected tests and the selected pytest suites pass, and a new test shows ignored records with leak-bait fields change no metric (it fails if the skip is removed). Sync, changelog and ruff checks pass.
    • Left for a human: the post-merge drift run over a real corpus. Claude Code 2.1.296 also writes types outside this issue (for example tag, summary, ended-by-model, continued-in), so a drift run may still list some of those. That would be a follow-up.
    • The needs-human label (from the work-loop admission gate) is left for Kyle to clear.

    Generated by Claude Code

  8. kyle-sexton commented on Oct 11, 2026

    @kyle-sexton
    MemberAuthor

    Handoff note for whoever picks this up next. The overnight Claude run has stopped, and Kyle is moving issue work to Cursor.

    Where a branch is listed it is pushed, so it can be taken over as is. A draft PR shows a red ci-status by design until it is marked ready.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions