Files
Kigi-CLI/crates/codegen/kigi-tui/tests/scenarios/inline_edit_resubmit.yaml
T
ZacharyZhang-NY d6c20fc13f M0: compilable skeleton — Kigi 0.1.0 fork surgery
Hard fork of xai-org/grok-build (Apache-2.0) re-targeted as Kigi, an
unofficial Kimi Code CLI community build.

Rename & identity
- 72 xai-*/xai-grok-* crates -> kigi-* (explicit: xai-grok-pager-bin ->
  kigi-bin [binary `kigi`], xai-grok-pager -> kigi-tui; rest mechanical);
  ptyctl, ptyctl-cli, third_party/ unchanged; proto package
  xai.grok.tools.v1 -> kigi.tools.v1
- Config home ~/.kigi (KIGI_SHARE_DIR override), env prefix GROK_* ->
  KIGI_*, `kigi --version` carries the unofficial-community-build notice
- clap identity, help text, startup banner, prompt templates rebranded
  (templates re-encrypted)

Deletions (PRD removal list #5/#6/#7/#9/#10)
- voice input (xai-grok-voice) and all TUI wiring
- telemetry: Mixpanel client, external OTel stream, Sentry, OTLP layers,
  trace/GCS/S3 upload queues (kigi-file-utils halved), workspace upload
  module & dc_log, heap-profile uploader, auth-diagnostics uploader,
  session-analytics halves of feedback; local zero-egress observability
  preserved in new kigi-log crate (unified log, --debug firehose,
  subsystem file logs, opt-in instrumentation)
- announcements (crate, remote-settings fields, TUI surfaces)
- plugin marketplace (crate, sources/browse/CTA/extensions-modal tab);
  direct plugin install/uninstall/update via kigi-agent git_install kept
- relay/gateway/assets endpoints and features (agent relay, headless
  relay transport, gateway bridge, LeaderEnvUrls); leader IPC socket now
  ~/.kigi/leader.sock + KIGI_LEADER_SOCKET, no ws-url derivation
- functional types rehomed instead of deleted: PermissionMode ->
  kigi-config-types, McpInitStrategy -> kigi-mcp, PrCreationSource ->
  session signals, TerminalDiagnostics -> kigi-pager-render, agent_id ->
  shell util

Endpoints
- kigi-env rewritten: single production KigiEndpoints {coding_api_base_url
  https://api.kimi.com/coding/v1 (KIGI_CODE_BASE_URL), oauth_host
  https://auth.kimi.com (KIGI_OAUTH_HOST), update_base_url (GitHub
  Releases API), upgrade_page_url}; GrokBuildEnvironment enum deleted

Toolchain & workspace hygiene
- Rust 1.97.0 pinned; edition 2024; full cargo update; git2 hoisted to
  workspace at 0.21 (Option->Result API migration), quick-xml 0.41
- Root Cargo.toml hand-maintained (PRD §8.1): version 0.1.0 inherited by
  all members, members sorted, unused deps pruned
- cargo-deny advisories gate (deny.toml with documented transitive
  exceptions); CI workflow (check/clippy/fmt/deny/test, macOS+Linux)
- cross-crate test seams re-gated behind `test-support` cargo feature;
  insta snapshot baselines renamed to the kigi_tui prefix
- clippy --workspace --all-targets: zero warnings; fmt clean

Fixes surfaced by the port
- updater probe/installer divergence (bin/kigi vs bin/grok symlink set)
- idle model-metadata refresh dead under KIGI_CODE_BASE_URL override
  (new is_effective_coding_endpoint_url, loopback+override aware)
- macOS symlinked-TMPDIR fixture canonicalization (foreign_sessions,
  fast-worktree); RSS measurement tests serialized via serial_test

Docs & legal (Apache §4)
- NOTICE added (upstream attribution + change statement); THIRD-PARTY
  notices sustained; kigi-tools ported-code notices extended; README,
  CONTRIBUTING, SECURITY, AGENTS.md rewritten

Out of scope for M0 (tracked): Kimi auth/inference (M1), search/fetch,
command parity, config import (M2), Computer Hub excision & final
brand-token sweep (M2), distribution & self-update rewrite (M3).
2026-07-17 05:31:01 -04:00

101 lines
3.6 KiB
YAML

name: inline-edit-resubmit
description: >-
Inline edit-and-resubmit happy path: select a previous user prompt in the
scrollback (Tab, k), Enter opens the in-place editor, append text, Enter
raises the inline rewind popup ("Resubmit from here", files-only row
hidden), `b` (conversation only) + `y` (last-prompt confirm) rewinds the
conversation and resubmits the EDITED text as a fresh turn. Distinct
per-turn mock sentinels prove the old tail was truncated and a new turn
streamed; no "Reverted conversation" note is shown.
terminal:
rows: 40
cols: 110
mock:
response: "FALLBACK_MOCK_RESPONSE"
turns:
- "FIRST_TURN_ANSWER from the mock server before any edit."
- "SECOND_TURN_ANSWER streamed after the inline resubmit."
steps:
- action: wait_for_text
text: Quit
timeout_ms: 20000
- action: type_text
text: "fix the bug INLINE_BASE"
- action: keys
keys: "<Enter>"
- action: wait_for_text
text: FIRST_TURN_ANSWER
timeout_ms: 30000
# Let the turn-end chrome (completion marker) settle before navigating.
- action: wait
millis: 500
# Tab focuses the scrollback; k clamps the selection upward onto the
# first selectable entry — the user prompt.
# Tab focuses the scrollback (raw byte: ptyctl's <Tab> notation is not
# encodable by the Xterm key encoder and would be silently skipped).
- action: type_text
text: "\t"
# Footer swaps to the scrollback hint set once the pane owns keys.
- action: wait_for_text
text: "Space:prompt"
timeout_ms: 10000
# Up-arrow clamps the selection onto the first selectable entry — the
# user prompt (bare `k` needs vim mode; in the default mode a letter
# bounces focus back to the composer and types itself).
- action: keys
keys: "<Up><Up><Up><Up><Up><Up>"
- action: keys
keys: "<Enter>"
# The in-place editor is live: typed text mutates the entry on screen.
- action: type_text
text: " EDITED_RESUBMIT"
- action: wait_for_text
text: "INLINE_BASE EDITED_RESUBMIT"
timeout_ms: 10000
- action: keys
keys: "<Enter>"
# Inline variant of the rewind mode-select: retitled, files-only hidden.
- action: wait_for_text
text: "Resubmit from here"
timeout_ms: 15000
- action: assert_not_contains
text: "File changes only"
- action: screenshot
name: inline-mode-select
note: Inline resubmit popup with a/b rows and no files-only option.
# b = Conversation only; target is the first prompt, so the classic
# last-prompt confirm popup follows.
- action: keys
keys: "b"
- action: wait_for_text
text: "Confirm rewind"
timeout_ms: 15000
- action: keys
keys: "y"
# The rewind lands and the EDITED prompt is resubmitted: the second
# scripted turn streams its own sentinel.
- action: wait_for_text
text: SECOND_TURN_ANSWER
timeout_ms: 30000
# Old tail is gone (truncated at the edited prompt) ...
- action: assert_not_contains
text: FIRST_TURN_ANSWER
# ... without the classic rewind's system note ...
- action: assert_not_contains
text: "Reverted conversation"
# ... and the popup is gone while the edited text stands as the prompt.
- action: assert_not_contains
text: "Resubmit from here"
- action: assert_contains
text: "INLINE_BASE EDITED_RESUBMIT"
# The resubmitted request carried the edited text to the model.
- action: assert_request_contains
text: EDITED_RESUBMIT
- action: assert_chat_completion
- action: assert_not_contains
text: panicked
- action: assert_running
- action: screenshot
name: resubmitted
note: Transcript truncated at the prompt and regenerated from the edit.