Skip to content

[RFC] Support Antigravity transcript attribution in views #990

Done

Description

@SamitHuang

State: Proposed
Owner: @SamitHuang
Next: Review design and verify initial implementation PR.

Problem

InferRSI now ships a standalone Antigravity plugin (#751 / #890), documented in docs/guides/plugins/antigravity-plugin.md. However, transcript-based knowledge retrieval attribution (src/inferrsi/apps/views/codex_search.py and search_attribution.py) currently only parses Codex rollout JSONL files (session_meta / response_item / event_msg).

As a result, optimization rounds executed inside Antigravity cannot automatically attribute knowledge retrieval, CLI invocations, or assistant decisions from Antigravity's transcript.jsonl / transcript_full.jsonl logs.

Antigravity Transcript Format

Antigravity writes line-delimited JSON steps (transcript.jsonl and transcript_full.jsonl) under <appDataDir>/brain/<conversation-id>/.system_generated/logs/:

  • USER_INPUT: user prompt step (step_index, source, type, status, created_at, content)
  • PLANNER_RESPONSE: model turn with optional visible assistant content (decision text) and tool_calls: [{"name": ..., "args": {...}}] (where string argument values may be JSON-encoded strings)
  • GENERIC: 1-to-1 ordered tool result steps immediately following a PLANNER_RESPONSE, carrying content (with Created At: / Completed At: headers, Command exited with code <N>. + Command output: for run_command, or Showing lines <start>-<end> of <total> + numbered lines for read_file) and optional truncated_fields

Proposed Design

  1. Add an Antigravity transcript reader module (src/inferrsi/apps/views/antigravity_search.py) that:
    • Detects Antigravity transcripts by their step-envelope schema (step_index + type in {"USER_INPUT", "PLANNER_RESPONSE", "GENERIC"}) without breaking Codex session_meta validation.
    • Derives the session identifier from the conversation directory (when under <conversation-id>/.system_generated/logs/) or falls back to a sanitized trace stem.
    • Extracts assistant decision text from PLANNER_RESPONSE.content rows within the requested [first, last] line window.
    • Pairs each PLANNER_RESPONSE.tool_calls entry in order with its corresponding GENERIC result row:
      • run_command: decodes CommandLine, parses exit code and Command output: body, detects truncation (truncated_fields or Antigravity's truncation notice), and synthesizes a command item compatible with codex_search._command and _delivery.
      • read_file: decodes Path (and optional StartLine / EndLine), strips the line-number prefix from the returned body, detects partial/truncated reads, and synthesizes a read command item (cat or sed -n '<start>,<end>p') so corpus-relative reads reuse the exact same knowledge attribution and passage/selection verification pipeline.
    • Builds exact joins entries (state: "visible", runtime_truncated, line_indexes, aggregate_lines, call_line, return_line) directly from the 1-to-1 PLANNER_RESPONSE -> GENERIC pairing.
  2. Dispatch automatically in codex_search.read_window:
    • When the first line of trace matches the Antigravity step schema, delegate to antigravity_search.read_window(...) with the same signature and return contract (window, events, decisions, uncertain, unresolved_details).
    • Preserve existing Codex behavior and error messages for non-Antigravity traces.
  3. Update docs and tests:
    • Add unit tests covering run_command (knowledge CLI, rg, truncation, non-zero exit), read_file (full & ranged reads inside corpus), assistant decision extraction, and end-to-end read_window dispatch.
    • Update docs/guides/plugins/antigravity-plugin.md to document supported Antigravity transcript attribution and remaining boundaries.

Non-goals (this slice)

  • Automatic discovery of Antigravity brain directories outside explicitly provided trace paths.
  • Codex-specific round_citations submission-matching heuristics (_batch_launch_spec, PowerShell JS wrappers).

Acceptance Criteria

  • read_window() transparently attributes run_command and read_file knowledge observations and assistant decisions from Antigravity transcript.jsonl / transcript_full.jsonl files.
  • Truncated Antigravity tool outputs are marked runtime_truncated: True and placed in uncertain (never falsely marked complete).
  • Existing Codex tests remain 100% green, and new unit tests cover Antigravity transcript attribution.
  • ruff check src tests tools and pytest pass.

Activity

  1. Bounty-hunter commented on Dec 3, 2026

    @Bounty-hunter
    Collaborator

    Claude Code agent, acting for @Bounty-hunter. Design discussion only; @SamitHuang owns this RFC and its decision.

    I read the RFC against main (src/inferrsi/apps/views/codex_search.py, search_attribution.py, capture_delivery.py, round_citations.py). The reader design looks sound to me. Four questions that I think change the outcome of the first PR:

    1. read_window is not the only Codex parser on this path. search_attribution.import_search passes the same trace, lines to capture_delivery.managed_return_lines / capture_return_texts (they match row.get("type") == "response_item" with function_call_output) and to round_citations.retained_round_citations (matches event_msg). With an Antigravity trace and capture inputs or a review, those would find no rows, not raise. Should this slice make those calls fail closed for Antigravity traces (clear error, or coverage: "partial" with a reason), and say so under Non-goals? Otherwise managed captures could quietly lose their return lines.

    2. Which file is the model-facing record? read_window documents that "Each selected line must be present in the model-facing tool return". If transcript.jsonl truncates where transcript_full.jsonl does not, which one counts as model-facing? If a caller passes transcript_full.jsonl, could content the model never saw count as delivered? I'd suggest the RFC names one authoritative file, or records which file was read in window.

    3. Session identity fallback. The fallback "sanitized trace stem" is transcript / transcript_full for every file with the standard names, so two conversations copied out of their <conversation-id>/ directory would get the same session. _prepare_record compares windows across records. Would it be safer to fail when the conversation ID can't be derived than to fall back to the stem?

    4. Pairing when the 1-to-1 assumption breaks. What happens when a PLANNER_RESPONSE has N tool calls but fewer than N GENERIC rows follow (cancelled call, crash, window end), or a USER_INPUT comes in between? Pairing by order would then attach the wrong result to a call. I'd suggest checking step_index contiguity and marking each unmatched call state: "unknown" and putting it in uncertain, as Codex joins do for missing returns.

    On evidence: the format section isn't backed by a public spec, so a redacted real transcript.jsonl / transcript_full.jsonl pair as a test fixture (with a truncated run_command and a ranged read_file) would make the acceptance criteria checkable against real output, not just synthetic rows.

    Not checked: I haven't seen an Antigravity transcript myself, and no implementation PR is linked yet. These questions only cover what the RFC text says against current main.

  2. added
    area:apps
    kind:rfc
    status:proposed
    on Dec 3, 2026
  3. zengchuang-hw commented on Dec 3, 2026

    @zengchuang-hw
    Contributor

    NO PASS
    dot, acting for zengchuang-hw.

    首次范围核对:本单正文与 #991 相同,作者已把 #992 的认领与交付记录放在 #991。我把设计问题集中在 #991,建议作者确认唯一跟踪入口,避免分开收敛与确认范围;这里不重复技术检视,也不关闭任何 Issue。

  4. SamitHuang commented on Dec 3, 2026

    @SamitHuang
    Author

    Duplicate of #991 (created unintentionally when the initial issue creation errored on assignee). Tracking in #991.

  5. Dong1017 commented on Dec 3, 2026

    @Dong1017
    Collaborator

    Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

    Dong-bot (authorized delegate): the direction is sound, but #990 is not accepted yet. It needs an accountable owner and a scope decision from @Dong1017, plus a sanitized real transcript before implementation starts.

    Ask: attribute run_command / read_file knowledge retrieval and assistant decisions from Antigravity transcripts, via a new antigravity_search.py dispatched from codex_search.read_window. It follows merged #751 / #890, which left this out of scope.

    Top gaps

    1. No accountable owner, implementer, or goal-acceptance owner. Only the author, @SamitHuang, is named.
    2. The transcript format is described only in prose. No sample transcript is attached.
    3. The pairing rule (each tool_calls entry matches the next GENERIC row) does not cover parallel calls, missing results, or interrupted runs.
    4. The truncation notice is not quoted, so a wrong match could mark cut output as complete.
    5. Acceptance is unit tests only. task: add Antigravity plugin packaging and documentation #751 needed a recorded host run; this needs an end-to-end run on a real transcript.

    Questions: who owns and implements the slice? Only explicit trace paths, or whole conversations?

    Next step: the author adds sanitized fixtures, the exact truncation text, and the pairing rules to the body. Then @Dong1017 accepts or narrows scope and names the implementer, or the scope goes to the PR pool. Nothing is authorized yet.

    Details

    Checked: issue/meta.json, issue/body.md, decisions.md (no entry for #990), the review-pr skill and its two references, #751 and #890 (both merged; #751 closed after goal acceptance), docs/guides/plugins/antigravity-plugin.md lines 1-75 (transcript attribution is explicitly not enabled for Antigravity in this slice, lines 73-75), the src/inferrsi/apps/views/ listing (codex_search.py and search_attribution.py exist as named), and codex_search.py lines 1-120 of 1046.

    Not checked: the body of read_window, search_attribution.py, and the existing Codex tests. Nothing was run.

    Consistency: no decision is recorded for #990. Treating transcript attribution as a follow-up matches the closure of #751.

    Further questions:

    • What will Antigravity rounds show in round_citations, given submission matching is out of scope?

    Suggested additions to the acceptance criteria:

    • Record the Antigravity client version, agy version (if used), and OS, as task: add Antigravity plugin packaging and documentation #751 did.
    • Redaction: tool output can contain secrets or local paths. Decide whether attributed text is copied into evidence artifacts.
    • State how a missing or out-of-order GENERIC row is reported, since the pairing is exact.
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

    area:appskind:rfcstatus:proposed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions