Skip to content

feat(ai): F009 chat UI, session continuity & project picker - #10

Merged
nimat-dev merged 1 commit into
mainfrom
feat/F009
Oct 8, 2026
Merged

nimat-dev merged 1 commit into
mainfrom
feat/F009

Conversation

@nimat-dev

Copy link
Copy Markdown
Owner

Summary

This PR implements F009: Chat UI (streaming) + session continuity (reconnect resumes) + project picker, completing Phase 03 (AI — Claude Code bridge).

Changes Included:

  1. Wire Protocol (@shellmind/protocol):
    • ChatTurn schema & types (id, role, text, toolEvents, timestamp, status).
    • chat.history.req: Client history query ({ projectCwd?: string; limit?: number }).
    • chat.history.resp: Agent history response ({ currentCwd: string; turns: ChatTurn[] }).
    • Registered in KnownMessage union, registry, and codec.
  2. Pure Core Interfaces (@shellmind/agent):
    • ITranscriptStore, TranscriptFilter in src/core/transcript.ts (0 Node builtins or I/O imports).
    • Manages chronological turns, ID updates, size cap pruning, and project isolation.
  3. Storage Adapter & Daemon Integration (@shellmind/agent):
    • FileTranscriptStore in src/adapters/storage/file-transcript.ts:
      • Local JSON persistence under ~/.shellmind/transcripts/ with file mode 0600 and dir mode 0700.
      • Bounded storage capped at max N turns (default 100).
      • Isolated per project working directory path via sanitized slug + SHA-256 hash.
      • Resilient error recovery: gracefully recovers with empty transcript on corrupt JSON files.
    • AgentDaemon:
      • Records user turns on agent.prompt.
      • Accumulates assistant text deltas and tool events into completed assistant turn in transcript.
      • Handles chat.history.req and replies with chat.history.resp.
      • Automatically switches transcript context when project.set changes cwd.
  4. Mobile Client, Tool Renderers & UI (@shellmind/mobile):
    • AgentClient methods: requestChatHistory(projectCwd?, limit?) and onChatHistory().
    • Tool Renderer Registry (packages/mobile/src/renderers/registry.ts):
      • BashRenderer: terminal execution card with command, running/success/error status pill, and collapsible output.
      • FileRenderer: file modification card showing path, READ/WRITE/EDIT action badges, diffs, and results.
      • SearchRenderer: search query card with pattern, directory, and matches preview.
      • DefaultRenderer: safe fallback card for unrecognized tools.
    • ChatScreen.tsx:
      • Interactive project picker dropdown driving project.list and project.set.
      • Live streaming feed showing user bubbles, assistant streaming text, tool cards, and embedded PermissionCard.
      • Prompt input field with Send and Abort buttons.
      • Seamless session continuity: requests transcript on connect/reconnect and deduplicates by turn ID.
  5. E2E & Verification:
    • Maestro flow specification .maestro/chat_flow.yaml and trace in .harness/evidence/F009/e2e-trace.txt.
    • 113/113 tests passing monorepo-wide (29 protocol, 52 agent, 32 mobile).
    • Clean architecture verified with dependency-cruiser (70 modules, 209 dependencies cruised, 0 violations).
    • Full suite passing (pnpm verify).

@nimat-dev

Copy link
Copy Markdown
Owner Author

Maker-Checker Review: F009 (Chat UI + session continuity + project picker)

1. Acceptance Criteria Verification

  • Wire protocol messages (chat.history.req, chat.history.resp, ChatTurn) defined and registered in @shellmind/protocol.
  • Pure core interface ITranscriptStore in @shellmind/agent/src/core/transcript.ts has 0 Node builtins or I/O imports.
  • Concrete adapter FileTranscriptStore persists turns with file mode 0600, project isolation, maxTurns pruning, and corrupt JSON resilience.
  • AgentDaemon records turns upon prompt/completion, serves chat.history.req, and respects project.set.
  • Mobile AgentClient implements requestChatHistory and onChatHistory.
  • ToolRenderer registry handles Bash, File, Search, and safely falls back to DefaultRenderer.
  • ChatScreen.tsx provides streaming message timeline, project picker dropdown, abort button, permission card embed, and deduplication on reconnect.
  • Clean architecture verified via dependency-cruiser (0 violations across 70 modules).
  • 113/113 tests passing monorepo-wide across all packages.
  • Maestro E2E specification in .maestro/chat_flow.yaml.

2. Evaluation Scores

  • Acceptance: 5/5
  • Correctness: 5/5
  • Boundaries: 5/5
  • Modularity: 5/5
  • Evidence: 5/5
  • Average: 5.0 (PASS)

3. Decision

APPROVE. Ready for squash merge to main.

@nimat-dev
nimat-dev merged commit 2bb738b into main Oct 8, 2026
2 checks passed
@nimat-dev
nimat-dev deleted the feat/F009 branch October 8, 2026 05:07
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