Files
curriculum-project-hub/docs/adr/0003-on-demand-feishu-context.md
T
sjfhsjfh 3a22669f0a chore: scaffold monorepo with spec/ Lean project and governance docs
- spec/: freshly initialized Lean library project (lake init, v4.31.0), no deps
- .gitea/workflows/spec-check.yml: CI running lake build on spec/ (well-formedness gate, not a spec-to-impl gate)
- README.md: monorepo overview + the 5 "constitution" rules positioning spec/ as upstream semantic master
- CLAUDE.md: global agent manual
- spec/README.md: contract writing conventions (prose+type, PINNED/OPEN/ADR tags, no sorry)
- docs/adr/0001-0004: system-level decision records (retrieved from main)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 22:00:18 +08:00

30 lines
1.2 KiB
Markdown

# ADR 0003: Read Feishu Context On Demand
## Status
Proposed.
## Context
The system needs to give Claude enough context when a teacher invokes it from a project group. Storing full Feishu group history in the Hub adds retention and privacy concerns, while fixed time windows such as "recent 24 hours" are brittle.
Feishu provides message history APIs, so the Hub can keep stable anchors and read nearby context when needed.
## Decision
For the first architecture, the Hub stores minimal anchors and project memory instead of full Feishu message history:
- chat id and project binding;
- trigger message id;
- run id and status card id;
- reply/thread anchors;
- project memory, decisions and artifact references.
Claude gets seed context from the current trigger message, project memory and recent anchors. If more context is needed, Claude calls MCP tools to read current message, reply chain, thread history or recent group messages through Feishu APIs.
## Consequences
- The Hub avoids becoming a full chat history store.
- Search over old vague discussions is limited until we add summary or indexing.
- MCP tools must authorize by run/project context; Claude cannot pass arbitrary chat ids.