Files
Kigi-CLI/crates/codegen/kigi-tui/tests/scenarios/folder_trust_prompt.yaml
T
ZacharyZhang-NY 6f31415ed6 §9 acceptance: grep-zero sweep — every internal x.ai/grok identifier renamed
The PRD's first acceptance gate now holds: grep -RinE '\bx\.ai\b|grok'
crates/ --include='*.rs' → 0 matches (exempt: NOTICE and third-party
license archives, README provenance, and the required 'Based on Grok
Build Open Source' attribution, now sourced from version_attribution.txt).

Wire-visible renames (both sides in this repo, changed in lockstep):
- Auth method id 'grok.com' → 'kimi-code' (AuthMethodKind::KimiCode).
- Every x.ai/* and _x.ai/* ACP ext method and meta key → kigi/* /
  _kigi/* (~200 names; grokShell → kigiShell). Session-file replay keeps
  a read-side alias for the legacy '_x.ai/session/update' method so
  existing updates.jsonl histories load; writes emit only the new name
  (both directions test-pinned).
- Agent types grok-build* → kigi* with a documented legacy-prefix alias
  at resolution time so persisted sessions keep resolving.
- ToolNamespace/BuiltinAgentName GrokBuild* → Kigi* (wire snake_case
  kigi/kigi_concise/kigi_hashline; schema regenerated); grok_build
  implementation dirs renamed to kigi*.
- x-grok-* headers → x-kigi-*, __GROK_* sentinels → __KIGI_*, themes
  grokday/groknight → kigiday/kiginight (old persisted values fall back
  to the default theme), web_fetch allowlist xAI hosts → kimi.com +
  moonshot platforms, changelog CDN → this repo, grok-build changelog
  archives deleted.
- BYOK default endpoint removed: [endpoints] api_base_url is now truly
  optional with NO default — consumers fail fast with the flag name when
  unset (no silent x.ai egress). Mock harnesses inject it explicitly.
- System-prompt identity fixed: 'released by xAI' → 'an unofficial
  community CLI for Kimi' (template + regenerated encrypted form).

Also repaired pre-existing grok-era test debt found by the sweep: the
stale trace_classify default-model pin, the grok-pager UA label test,
pty-harness stale-binary reuse and non-hermetic moonshot routing (a PTY
test could previously reach the real api.moonshot.cn), and the outdated
oauth fixture scope key.

Gates: §9 grep 0; fmt clean; workspace check/clippy 0/0 (-D warnings);
FULL cargo test --workspace: 234 suites, 21,961 passed, 0 failed;
deny advisories ok.
2026-07-18 02:48:46 -04:00

62 lines
2.2 KiB
YAML

name: folder-trust-prompt
description: >
Full session e2e for the client-side folder-trust prompt. With the feature on
(`KIGI_FOLDER_TRUST=1`) and the pager running in a git repo that ships a
repo-local `.mcp.json`, `decide` returns `Prompt` so the trust question renders
BEFORE any session starts. Accepting it (`y`) persists the grant, lets the
session proceed, and a submitted prompt streams the mock assistant response —
proving repo-local loading was gated until the user answered.
terminal:
rows: 50
cols: 120
environment:
env:
- key: KIGI_FOLDER_TRUST
value: "1"
# A self-built (unstamped) kigi auto-trusts and never prompts; simulate a
# release build so the folder-trust prompt is actually evaluated.
- key: KIGI_TEST_VERSION
value: "0.0.0-sim"
workspace:
git_init: true
files:
".mcp.json": "{\"mcpServers\": {}}"
mock:
response: "FOLDER_TRUST_SESSION_OK assistant reply streamed after the folder was trusted."
steps:
# 1. The trust question renders before any session exists.
- action: wait_for_text
text: "Do you trust the contents of this directory"
timeout_ms: 20000
- action: assert_not_contains
text: panicked
# The decline affordance is on screen (keyboard-driven y/N answer; n = quit).
- action: assert_contains
text: "No, quit"
# 2. Accept the folder.
- action: keys
keys: "y"
# 3. The question is gone and the normal welcome / prompt is ready.
- action: wait_for_text
text: Quit
timeout_ms: 20000
- action: assert_not_contains
text: "Do you trust the contents of this directory"
# 4. Submit a prompt — the session must now start (gate answered).
- action: type_text
text: "summarize the trusted repo"
- action: keys
keys: "<Enter>"
# 5. The mock assistant response renders ⇒ the session actually started and
# repo-local loading proceeded ungated.
- action: wait_for_text
text: FOLDER_TRUST_SESSION_OK
timeout_ms: 30000
- action: assert_chat_completion
- action: assert_not_contains
text: panicked
- action: assert_running
- action: screenshot
name: folder-trust-session
note: "Trust prompt accepted; prompt submitted; mock assistant response rendered."