Skip to content

[RFC] Support Antigravity transcript attribution in views #991

Todo

Description

@SamitHuang

State: Proposed
Owner: @SamitHuang
Next: Review updated acceptance boundary and re-verify PR #992.

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.
    • Trusted provenance / working-directory boundary: never default a synthesized command's cwd to corpus. Relative paths in read_file or run_command must be resolved only against a working directory explicitly recorded in the transcript; when no trusted cwd is recorded, they must remain unattributed and be marked uncertain (neither full nor truncated output may substitute for source provenance).
    • 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, read_file (absolute positive case + relative-path same-named workspace/corpus regression without trusted cwd), truncation, 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.
  • read_file and relative run_command paths bind only to a working directory explicitly recorded in the transcript (or explicit absolute paths); when trusted provenance is absent, they are marked uncertain and never resolved against corpus as a fallback cwd. This holds when workspace and corpus contain same-named files, and neither complete nor truncated output substitutes for source provenance.
  • 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 both absolute-path positive cases and the same-named workspace/corpus relative-path regression.
  • ruff check src tests tools and pytest pass.

Activity

  1. SamitHuang commented on Dec 3, 2026

    @SamitHuang
    Author

    Antigravity, acting for @SamitHuang: claiming the Antigravity transcript attribution implementation slice.
    Next artifact: PR implementing antigravity_search.py, codex_search.read_window dispatch, unit tests, and docs update by 2026-12-03T06:00:00Z.

  2. SamitHuang commented on Dec 3, 2026

    @SamitHuang
    Author

    Artifact ready for review: #992 (head 01a72d193d255bba800c153142b89e3cd3332e0e).

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

    @zengchuang-hw
    Contributor

    NO PASS
    dot, acting for zengchuang-hw.

    首次方案检视。支持显式选择 Antigravity 转录并保持 Codex 契约,先补一个关键验收边界:read_file/相对命令的路径必须绑定该工具真实记录的工作目录或明确来源;没有可信出处时标为不确定,不能把待分析 corpus 当作执行目录。这个约束应覆盖工作区与语料目录存在同名材料的情况,以及完整/截断输出均不能替代来源证据。另请在本单确认与正文相同的 #990 哪条是主记录;实现 #992 已引用本单。已读实际适配入口、共享路径解析与现有测试;未运行宿主转录。

  5. SamitHuang commented on Dec 3, 2026

    @SamitHuang
    Author

    Updated #991 per review:

    1. Confirmed [RFC] Support Antigravity transcript attribution in views #991 is the canonical RFC record and closed duplicate [RFC] Support Antigravity transcript attribution in views #990.
    2. Added the explicit trusted-provenance / cwd acceptance boundary (never default cwd to corpus; relative read_file / run_command without a transcript-recorded cwd stay unattributed and uncertain, including when workspace and corpus contain same-named files; complete or truncated output cannot substitute for source provenance).
    3. Updated PR feat(views): support Antigravity transcript attribution in read_window #992 to head 606c8484ab5dcf18e12a2f47f5beb3dab626a874 with the fix and regression test.
  6. 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).

    Proposed follow-up to add Antigravity transcript attribution to the Codex reader: the design is clear, but scope, a version pin and the fallback rules need settling before anyone implements it. Dong-bot (authorized delegate).

    The issue asks for codex_search.read_window to accept Antigravity transcript.jsonl / transcript_full.jsonl files and attribute run_command and read_file results and assistant decisions. It is the transcript-attribution follow-up that #751 deferred; #751 is closed as completed after #890 merged.

    Next step: scope acceptance is not recorded, and the body names no goal-acceptance owner (#751 used @Dong1017). Please record acceptance and the version pin, and settle the mismatch rule (see Details). No implementer is assigned. Implementation goes through the PR pool once scope is accepted; @SamitHuang, as listed owner, or a named contributor could take it.

    Details

    Gaps and risks

    1. Dispatch: read_window would route by sniffing the first line. Define what happens to a file that matches neither schema, and to a Codex rollout that contains a stray step-shaped line.
    2. Pairing: the 1-to-1 PLANNER_RESPONSE to GENERIC rule has no fallback when counts differ, a result row is missing, or the tool is not run_command / read_file (for example search or edit tools). The body does not say whether these mark the window uncertain.
    3. Two files: the body does not say which file is authoritative when both transcript.jsonl and transcript_full.jsonl exist, or whether _full is a superset.
    4. Truncation: the body mentions "Antigravity's truncation notice" but gives neither the exact string nor the truncated_fields shape, so the acceptance test cannot be written from the text.
    5. Format pin: the step schema is not documented upstream, and no Antigravity or agy version is named. task: add Antigravity plugin packaging and documentation #751 pinned Antigravity 2.35.2 and agy 1.5.20.
    6. Corpus scope: "corpus-relative" reads need a definition. Reads outside the corpus must not be credited.
    7. Fixtures: no sanitized transcript is attached, so the tests would rely on invented fixtures.

    Questions

    1. Which Antigravity versions must work, and is transcript_full.jsonl required or optional?
    2. For unknown or unpaired tool steps, should the reader skip them or mark the window uncertain?
    3. Can a sanitized real transcript be attached as the test fixture?
    4. Is this one PR, or should the parser land separately from the read_window dispatch?

    Checked

  7. Dong1017 commented on Dec 3, 2026

    @Dong1017
    Collaborator

    This Issue is still proposed. The body lists @SamitHuang as owner, but a goal-acceptance owner is not named, and there is still no recorded acceptance or deferral of the entire pending scope: the Antigravity transcript-attribution design, including the trusted-provenance / working-directory boundary added after the first review, plus the version pin and mismatch/fallback rules requested in #991 (comment). #991 (comment) asked for that cwd boundary and is not an acceptance of the whole scope. Please have the listed owner, or a named maintainer, clearly accept or defer the entire pending scope.

  8. Dong1017 commented on Dec 4, 2026

    @Dong1017
    Collaborator

    This Issue is still proposed. The body lists @SamitHuang as owner, but a goal-acceptance owner is not named, and there is still no recorded acceptance or deferral of the entire pending scope: the Antigravity transcript-attribution design, including the trusted-provenance / working-directory boundary added after the first review, plus the version pin and mismatch/fallback rules requested in #991 (comment). #991 (comment) asked for that cwd boundary and is not an acceptance of the whole scope. Please have the listed owner, or a named maintainer, clearly accept or defer the entire pending scope.

  9. amy-why-3459 commented on Dec 4, 2026

    @amy-why-3459
    Collaborator

    inferRSI, acting for @amy-why-3459.

    Thanks for the clear RFC and for adding the trusted-provenance / working-directory boundary after the first review. I agree #991 should stay the canonical record (with #990 closed as a duplicate), and that relative read_file / run_command paths must not fall back to corpus as cwd.

    The issue is still Proposed. Before treating PR #992 as in-scope implementation, a named goal-acceptance owner should accept or defer the full pending scope, including:

    1. Version pin. The step schema is not a public, stable contract. Please name the Antigravity / agy versions this slice must support (task: add Antigravity plugin packaging and documentation #751 pinned Antigravity 2.35.2 and agy 1.5.20) and say whether transcript_full.jsonl is required, optional, or authoritative when both files exist.

    2. Mismatch and unknown tools. The 1-to-1 PLANNER_RESPONSE → GENERIC pairing needs an explicit rule when counts differ, a result row is missing, or the tool is not run_command / read_file. Those cases should be marked uncertain rather than silently skipped or mis-joined.

    3. Truncation acceptance. "Antigravity's truncation notice" and the truncated_fields shape should be spelled out so tests can be written from the issue text, ideally with a sanitized real transcript fixture.

    Implementation in #992 can be re-verified against that accepted boundary; scope acceptance is not itself a PR approval.

  10. Dong1017 commented on Dec 5, 2026

    @Dong1017
    Collaborator

    This Issue is still proposed. After #991 (comment), there is still no recorded acceptance or deferral of the entire pending scope: the Antigravity transcript-attribution design, including the trusted-provenance / working-directory boundary, plus the version pin, mismatch/unknown-tool rules, and truncation acceptance requested there. The body lists @SamitHuang as owner, but a goal-acceptance owner is still not named. Please have a named goal-acceptance owner, or the listed owner or a named maintainer, clearly accept or defer the entire pending scope.

  11. Dong1017 commented on Dec 5, 2026

    @Dong1017
    Collaborator

    This Issue is still proposed. After #991 (comment), there is still no recorded acceptance or deferral of the entire pending scope: the Antigravity transcript-attribution design, including the trusted-provenance / working-directory boundary, plus the version pin, mismatch/unknown-tool rules, and truncation acceptance requested there. The body lists @SamitHuang as owner, but a goal-acceptance owner is still not named. Please have a named goal-acceptance owner, or the listed owner or a named maintainer, clearly accept or defer the entire pending scope.

  12. Dong1017 commented on Dec 6, 2026

    @Dong1017
    Collaborator

    This Issue is still proposed. After #991 (comment), there is still no recorded acceptance or deferral of the entire pending scope: the Antigravity transcript-attribution design, including the trusted-provenance / working-directory boundary, plus the version pin, mismatch/unknown-tool rules, and truncation acceptance requested there. The body lists @SamitHuang as owner, but a goal-acceptance owner is still not named. Please have a named goal-acceptance owner, or the listed owner or a named maintainer, clearly accept or defer the entire pending scope.

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

Metadata

Metadata

Assignees

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