Skip to content

审查产物 (Reviewing Artifacts)

在将编辑应用到本地文件系统之前,审核生成的代码、检查实施方案、添加行级反馈意见并验证视觉媒体资产。

协作与共同引导 (Collaboration and co-steering)

产物 (Artifact) 是由 Agent 创建的结构化交付物,用于完成其任务并向您传达其进度和思考。产物包括富文本 Markdown 提纲(如实施计划)、代码 Diff、架构图以及视觉媒体文件。

随着 Agent 在更长的时间跨度内以更高的自主权工作,产物使得异步协作成为可能。您无需同步、仔细地监控每一次具体的工具执行;相反,您只需在关键里程碑阶段审查高层级的交付物。

由于自主 Agent 有时可能会偏离轨道或产生幻觉方案,产物工作流作为一个至关重要的交互式共同引导 (co-steering) 机制。根据您的配置,Agent 会在中间里程碑处暂停,允许您检查提议的计划或代码修改、提供行内批注,并在任何更改实际写入您本地文件系统之前对 Agent 进行重新引导。

TUI(终端用户界面)将这些资产划分为两个交互层:

  1. 产物选择器浮层 (The Artifact Picker Overlay):一个高层级的清单菜单,包含审查状态标记、快速预览切换和可折叠的文件夹。
  2. 产物详情查看器 (The Artifact Detail Viewer):一个全屏代码审计接口,支持行内评论、语法高亮和图表缩放。

/artifact 概览 (Overview of /artifact)

当 Agent 生成或修改文件时,您的 TUI 状态栏会更新通知(如 /artifact to review)。在提示框内按 ctrl+r 即可打开全屏的产物选择器面板。

text
                                                                                                    10 artifacts · /artifact to review
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Action required (10 left)
› □ new release_notes.md   open  approve reject
  utils.py
  □ new performance_report.md
  api_client.py
  config_manager.py
  □ new user_guide.md
  run_tests.py
  data_processor.py
  □ new system_architecture.md
  □ new project_overview.md

Keyboard: ↑/↓ Navigate  y/n Approve/reject  shift+a Approve all  p Preview  esc Done

交互按键绑定

使用以下专用的面板控制键来审计文件清单:

按键TUI 命令动作行为
↑ / ↓nav.scroll_line在条目列表中上下滚动高亮的选择项。
h / lnav.switch_button聚焦并在行内按钮 openapprovereject 之间进行切换(也支持左右方向键)。
pconfirm.preview切换快速行内文件预览。这会在所选行下方直接打开一个 12 行的、缩进且截断的代码块预览。
yconfirm.approve立即批准高亮的文件。状态标记将更新为绿色对勾 (✓ approved)。
nconfirm.reject立即拒绝高亮的文件。状态标记将更新为红色叉号 (✗ rejected)。
Shift+Aconfirm.approve_all一键批量批准所有待处理的待执行文件。
Shift+Rconfirm.reject_all一键批量拒绝所有待处理的待执行文件。
Enternav.confirm执行当前聚焦的按钮。如果聚焦了 open 按钮,则会启动全屏详情查看器。
Escnav.escape保存您当前的审查状态,将批准/拒绝提交回 Agent 线程,并将焦点返回至提示框。

代码文件 vs 视觉媒体

为了整理工作空间资产,选择器按格式类型对文件进行了分类:

  • 待处理的代码文件:需要明确批准的标准程序代码、配置和计划 Markdown。
  • 可折叠的媒体抽屉:视觉资产文件(如 PNG、JPG、WebP、SVG、MP4 或 WebM 媒体)被分组到一个专用的“媒体 (Media)”抽屉标题下。 高亮“媒体”标题行并按 Enter 键可展开或折叠抽屉列表。 高亮特定的媒体项并按 Enter 键可在您操作系统的原生媒体查看器中打开该文件。

查看产物 (Viewing an artifact)

要对文件的代码结构或提议逻辑进行仔细审计,请选择 open(或在聚焦的代码行上直接按 Enter 键)以打开产物详情查看器。

text
implementation_plan.md
>   1      Implementation Plan: Alpha-Centauri Telemetry Scaling Engine
    2
    3     This document provides a highly detailed, step-by-step engineering implementation plan to upgrade the Alpha-Centauri
    4     telemetry ingestion pipeline. It outlines current gaps, proposed architecture improvements, execution timelines, risks,
    5     and verification procedures.
    6     ──────
    7     ## 1. Executive Summary
    8
    9     As sensor deployments scale from 100 to 10,000 active nodes, the existing synchronous Python-based ingestion system (
   10     data_processor.py ) faces critical CPU and write latency bottlenecks.
   11
   12     This implementation plan details the migration to an asynchronous, remote-buffered pipeline utilizing distributed
   13     message
   14     queues, multi-threaded worker pools, and an optimized column-oriented storage layer.
   15     ──────
   16     ## 2. Current Architecture vs. Target Architecture
   17
   18     ### Gap Analysis
   19
   20      Feature    | Existing (v1.2)   | Target (v2.0)     | Gap to Resolve
   21     ------------|-------------------|-------------------|---------------------------
   22      Concurrency| Sync, 1-thread    | Async, concurrent | Cannot scale peak bursts
   23      Buffer     | None (direct API) | Message Queue     | Outage data loss
   24      Storage    | Flat JSON         | Columnar CNS      | Slow queries, high consumption
   25      Config     | Load on launch    | Dynamic polling   | Requires restarts to update
   26
   27     ### Architectural Schema
   28
   29         Ingestion Layer │ Buffering Layer │ Processing Layer │ Storage Layer
   30
   31         ┌────────────┐    ┌────────────┐
   32         │ "Sensor 1" │    │ "Sensor 2" │
   33         └────────────┘    └────────────┘
   34                │ HTTP POST           │ HTTP POST
   35                ▼                 ▼
   36         ┌─────────────────┐
   37         │ "Load Balancer" │
   38         └─────────────────┘
   39                  │
   40                  ▼
   41         ┌───────────────────────┐    ┌───────────────────────┐
   42         │ "Ingestion Gateway A" │    │ "Ingestion Gateway B" │
   43         └───────────────────────┘    └───────────────────────┘
   44                     │ Publish                    │ Publish
   45                     ▼                            ▼
   46         ┌─────────────────────────────┐
   47         │ "Distributed Message Queue" │
   48         └─────────────────────────────┘
   49                        │ Stream Consume
   50                        ▼
   51         ┌────────────────────┐    ┌────────────────────┐
   52         │ "Worker Process 1" │    │ "Worker Process 2" │
   53         └────────────────────┘    └────────────────────┘
   54                    │ Read Config               │ Read Config
   55                    ▼                         ▼
   56         ┌──────────────────────────┐    ┌──────────────────────────┐
   57         │ "Dynamic Config Service" │    │ "Columnar Storage (CNS)" │
  [0%  L1  1-57/135]

  ↑/↓ scroll · pgup/pgdown page · shift+g bottom · g top · c comment · m raw mermaid · ctrl+=/ctrl+- zoom 100%
  l hide lines · esc close

审计与导航

  • 滚动:使用 j/k(或标准方向键)逐页或逐行滚动。
  • 边界跳转:按 g 跳转到文件顶部,按 Shift+G 直接跳转到文件底部。
  • 切换侧栏行号:按 l 切换行号栏的开启和关闭,以获得更干净的原始代码呈现。

细粒度行级评论

如果某段特定的代码需要修改:

  1. 导航并将光标定位到目标行。
  2. c 打开一个内嵌的多行文本编辑器缓冲区,该缓冲区直接关联到该行。
  3. 起草您的描述性反馈,然后按 Esc 保存并提交评论。该行将更新并显示一个视觉上的评论指示器 (💬)。
  4. 要删除您当前已添加的反馈,请将光标定位在被评论的行上并按 d

自定义 Mermaid 图表渲染

如果当前文档包含结构化的系统流程图、数据库关系或架构设计图:

  • 循环切换渲染模式 (m):按 m 循环切换视觉渲染模式:
    • Kitty 图像渲染 (Kitty Graphics Image):在 Kitty 兼容的终端模拟器中将图表渲染为原生的内联图形。
    • ASCII 框形图 (Default):将图表渲染为与所有 Shell 兼容的、干净且高性能的文本艺术图。
    • 原始代码 (Raw Code):显示原始的 Markdown 代码块。
  • 缩放图形:当 Kitty 图像渲染模式处于活动状态时,按 ctrl+= 放大并放大图像,按 ctrl+- 缩小。

Esc 关闭详情查看器并返回主选择器清单。

下一步 (Next Steps)

配置设置偏好并审查 Agent 的自主性参数:

  • 管理对话 (Managing Conversations):恢复先前的对话会话和分支 (Fork) 线程。
  • 设置、渲染与键绑定 (Settings, Rendering & Keybindings):自定义键盘快捷键和视觉缓冲区。
  • 权限与沙箱 (Permissions & Sandbox):配置安全参数与限制列表。

Gemini中文文档