Commit Graph

2 Commits

Author SHA1 Message Date
DaiChaoXiong f695acc845 refactor(test): move all unit tests from src/ into tests/<module>_tests.rs
Per AGENTS.md §5.1 every test must live under crates/<name>/tests/, so the
inline #[cfg(test)] modules in harness/tools/providers/transport are gone:

- harness: session_tests / compaction_tests / prompt_tests (days_to_ymd made pub)
- tools: read / write / edit / shell tests (Tool trait imported explicitly)
- providers: config_tests; request-body and stop-reason coverage folded into
  integration tests via mock-recorded requests and SSE events (private builders
  no longer tested directly)
- transport: ChunkedDecoder made pub (with Default), decoder tests moved into
  transport_tests.rs

The only #[cfg(test)] left in src/ is the test-only TLS infra in tls.rs.
2026-08-09 21:09:01 +08:00
DaiChaoXiong 647cf1ba83 feat(harness): session tree, compaction plans, system prompt templates
- SessionStore/SessionTree: JSONL append-only tree (id + parentId) under
  ~/.focus/sessions, branching and continuation queries
- compaction: lightweight token estimation; scheme D+E plans (summary +
  key-facts, keep recent messages, tool_call/tool_result pairs kept intact);
  auto-trigger threshold (default 80%, configurable); apply_summary writes back
- prompts: system template with cwd/os/date/shell + context occupancy and
  last-turn usage (scheme E); pure-std date formatting
2026-08-09 20:59:59 +08:00