Skip to content

feat(tui v2): plan card + done annotation + /cost + /review wiring#411

Open
shenhao-stu wants to merge 1 commit into
lsdefine:mainfrom
shenhao-stu:feat/tui-v2-quality-pack
Open

feat(tui v2): plan card + done annotation + /cost + /review wiring#411
shenhao-stu wants to merge 1 commit into
lsdefine:mainfrom
shenhao-stu:feat/tui-v2-quality-pack

Conversation

@shenhao-stu
Copy link
Copy Markdown
Contributor

  • Plan card (📋): per-session message-scan with plan_scan_baseline so /continue of a finished session doesn't auto-resurrect old plan cards; prefers <summary>当前步骤: over the long plan-item echo; placeholder while enter_plan_mode is armed but plan.md hasn't been written yet.
  • Done annotation (⠿ {Verb} for Xm Ys · ↑ N · ↓ M): post-turn elapsed
    • per-call token deltas, frozen at done so the line stays put across re-mounts. Spinner annotation gated on cumulative deltas past stream-start baselines — fixes ↓ 16 showing immediately on prompt submit.
  • fold_turns regex anchored to line-start (^ + MULTILINE) so embedded backticks in tool output (e.g. N|\```` gutter from file_read) don't pair with later real fences. ~100x faster on long /continue sessions.
  • /cost: per-session card + /cost all; Context window line now reads GA's actual char cap via cost_tracker.context_window_chars(backend) = backend.context_win * 3 (the trim_messages_history trigger threshold in llmcore.py), so the percentage reflects real budget and respects mykey.py overrides. Unit changes from token to character. Dropped the model-theoretical _CTX_LIMITS table (never actually constrained anything). Subagent log scan via cost_tracker.scan_subagent_logs aggregates temp/*/stdout.log since TUI start.
  • /review: standalone in-session reviewer; reuses review_cmd.handle to render the inline prompt and submits as a normal user task.
  • llmcore: emit [Output] tokens=N for chat_completions / responses modes (already emitted for messages SSE) so cost_tracker scopes output tokens uniformly across all three API modes.
  • review_inline_prompt.{txt,en.txt}: filled out the in-session review discipline — Three Iron Rules, Q1-Q4 framing, severity examples, 8 false-positive rules expanded, 8 wording rules expanded, 8-item self-check. ZH/EN both grow ~80 lines.
  • memory/review_sop.md: rewrite 52 → 191 lines, 11 sections covering quick-start, entry files, Three Iron Rules, 5-step workflow, severity, output protocol, relationship to plan_sop / verify_sop. Style mirrors plan_sop.md + autonomous_operation_sop.md.

Files: frontends/{tuiapp_v2,tuiapp,cost_tracker,plan_state}.py, llmcore.py, memory/review_sop.md, memory/review_sop/review_inline_prompt.{txt,en.txt}, .gitignore (allowlist new SOP).

- Plan card (📋): per-session message-scan with `plan_scan_baseline` so
  `/continue` of a finished session doesn't auto-resurrect old plan cards;
  prefers `<summary>当前步骤:` over the long plan-item echo; placeholder
  while enter_plan_mode is armed but plan.md hasn't been written yet.
- Done annotation (⠿ {Verb} for Xm Ys · ↑ N · ↓ M): post-turn elapsed
  + per-call token deltas, frozen at done so the line stays put across
  re-mounts. Spinner annotation gated on cumulative deltas past stream-start
  baselines — fixes `↓ 16` showing immediately on prompt submit.
- fold_turns regex anchored to line-start (`^` + MULTILINE) so embedded
  backticks in tool output (e.g. `N|\`\`\`\`` gutter from file_read) don't
  pair with later real fences. ~100x faster on long /continue sessions.
- /cost: per-session card + `/cost all`; `Context window` line now reads
  GA's actual char cap via `cost_tracker.context_window_chars(backend)` =
  `backend.context_win * 3` (the `trim_messages_history` trigger threshold
  in llmcore.py), so the percentage reflects real budget and respects
  `mykey.py` overrides. Unit changes from token to character. Dropped the
  model-theoretical `_CTX_LIMITS` table (never actually constrained anything).
  Subagent log scan via `cost_tracker.scan_subagent_logs` aggregates
  `temp/*/stdout.log` since TUI start.
- /review: standalone in-session reviewer; reuses `review_cmd.handle`
  to render the inline prompt and submits as a normal user task.
- llmcore: emit `[Output] tokens=N` for chat_completions / responses modes
  (already emitted for `messages` SSE) so cost_tracker scopes output
  tokens uniformly across all three API modes.
- review_inline_prompt.{txt,en.txt}: filled out the in-session review
  discipline — Three Iron Rules, Q1-Q4 framing, severity examples,
  8 false-positive rules expanded, 8 wording rules expanded, 8-item
  self-check. ZH/EN both grow ~80 lines.
- memory/review_sop.md: rewrite 52 → 191 lines, 11 sections covering
  quick-start, entry files, Three Iron Rules, 5-step workflow, severity,
  output protocol, relationship to plan_sop / verify_sop. Style mirrors
  plan_sop.md + autonomous_operation_sop.md.

Files: frontends/{tuiapp_v2,tuiapp,cost_tracker,plan_state}.py, llmcore.py,
memory/review_sop.md, memory/review_sop/review_inline_prompt.{txt,en.txt},
.gitignore (allowlist new SOP).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant