feat: Enhance memory management and promotion rules for Mattermost context and user prompts

This commit is contained in:
2026-04-09 15:11:43 -06:00
parent 060f6dfc00
commit 22198a6c6f
11 changed files with 277 additions and 16 deletions

View File

@@ -27,9 +27,17 @@ These are also loaded through `opencode.json`.
- Assume the workspace may contain stale context until checked.
- Before answering questions that depend on current work state, inspect `ai/state/current.md` and the latest relevant log under `ai/logs/`.
- If `ai/inbox/mattermost-latest.md` exists, inspect it for fresher communication context before answering standup, status, or manager-message prompts.
- For any meaningful prompt, decide whether the interaction introduces or corrects project memory.
- If a sync command, extraction script, or inbox refresh fails, do not update logs, state, or context files from that failed attempt.
- Treat sync failures as operational errors, not project context.
- `mattermost-sync` should refresh inbox context only. It must not update `ai/logs/`, `ai/state/`, or stable context files unless the user explicitly asks to promote confirmed project facts.
- `mattermost-sync` should automatically promote high-confidence project facts without asking what to promote.
- Prefer `ai/logs/` as the default destination for new Mattermost-derived facts.
- Promote to `ai/state/current.md` only when the fact materially changes active work over the next few days.
- Promote to `ai/context/project.md` only when the fact changes durable project understanding.
- Never promote tooling chatter, sync status, or generic conversation noise.
- Direct user prompts are also memory sources. Do not limit memory updates to explicit sync commands.
- If a new prompt corrects prior understanding, update the canonical file directly instead of keeping both versions alive.
- Do not ask what should be saved when the correct destination is already clear.
- If the user provides durable new facts, update the appropriate context files instead of leaving the new information only in chat history.
- If a previous context file is now stale or inaccurate, update that file directly.
- Prefer correcting canonical context over appending contradictory notes.