From e6efa35ae1b23373c8215eb77f042cff27eb809d Mon Sep 17 00:00:00 2001 From: "david.delagneau" Date: Thu, 9 Apr 2026 14:51:06 -0600 Subject: [PATCH] feat: Update Mattermost sync command to fetch context into inbox only and add promote project context command --- .opencode/commands/mattermost-sync.md | 11 ++--- .opencode/commands/promote-project-context.md | 43 +++++++++++++++++++ AGENTS.md | 1 + ai/AGENTS.md | 6 ++- 4 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 .opencode/commands/promote-project-context.md diff --git a/.opencode/commands/mattermost-sync.md b/.opencode/commands/mattermost-sync.md index c26cda1..d5e95ac 100644 --- a/.opencode/commands/mattermost-sync.md +++ b/.opencode/commands/mattermost-sync.md @@ -2,7 +2,7 @@ description: Force a Mattermost sync using the configured local script --- -Use the configured Mattermost sync command to fetch fresh communication context. +Use the configured Mattermost sync command to fetch fresh communication context into the inbox only. Preferred command sources: @@ -16,13 +16,14 @@ Run the command and use its output as fresh communication context: Then: - if the command fails, stop there and do not edit any workspace files -- if no `ai/inbox/mattermost-latest.md` exists after the sync attempt, do not update logs or stable context +- if no `ai/inbox/mattermost-latest.md` exists after the sync attempt, do not update project memory - inspect `ai/inbox/mattermost-latest.md` if it exists -- decide whether the new information belongs in today's log, current state, or stable project context -- update the workspace only if the sync succeeded and durable facts were learned +- extract only project-relevant candidate facts +- do not update `ai/logs/`, `ai/state/`, or `ai/context/` in this command +- if important candidate facts are found, summarize them as promotion candidates for a later explicit command Return: 1. What was synchronized -2. Which files were updated +2. Candidate project facts worth promoting 3. What still needs human confirmation diff --git a/.opencode/commands/promote-project-context.md b/.opencode/commands/promote-project-context.md new file mode 100644 index 0000000..bef7f2f --- /dev/null +++ b/.opencode/commands/promote-project-context.md @@ -0,0 +1,43 @@ +--- +description: Promote confirmed project facts from the inbox into Fidelity workspace memory +--- + +Promote confirmed Fidelity project context into the workspace. + +Read: + +@ai/AGENTS.md +@ai/context/project.md +@ai/state/current.md +@knowledge/workspace-model.md +@knowledge/communication-rules.md + +Today's log, if present: + +!`if [ -f ai/logs/$(date +%F).md ]; then cat ai/logs/$(date +%F).md; else echo "No log exists for today yet."; fi` + +Current Mattermost inbox, if present: + +!`if [ -f ai/inbox/mattermost-latest.md ]; then cat ai/inbox/mattermost-latest.md; else echo "No Mattermost inbox file is available."; fi` + +User direction or facts to promote: + +$ARGUMENTS + +Instructions: + +- Promote only confirmed project-relevant facts +- Ignore tooling noise and sync status +- Update the smallest correct set of files among: + - `ai/logs/$(date +%F).md` + - `ai/state/current.md` + - `ai/context/project.md` + - `ai/context/decisions/*.md` +- Prefer concrete project updates over broad summaries +- If a fact is still ambiguous, do not promote it + +Return: + +1. Updated files +2. Promoted project facts +3. Remaining uncertainty diff --git a/AGENTS.md b/AGENTS.md index e12fafe..6291b64 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,6 +29,7 @@ These are also loaded through `opencode.json`. - If `ai/inbox/mattermost-latest.md` exists, inspect it for fresher communication context before answering standup, status, or manager-message prompts. - 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. - 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. diff --git a/ai/AGENTS.md b/ai/AGENTS.md index 138f564..919dd53 100644 --- a/ai/AGENTS.md +++ b/ai/AGENTS.md @@ -65,6 +65,10 @@ When drafting messages for Jeff: - If `ai/inbox/mattermost-latest.md` exists, check it before answering prompts about current status, standups, or supervisor communication - If a Mattermost sync or other context-ingestion step fails, do not update `ai/logs/`, `ai/state/`, or stable context files based on that failure - Do not record missing dependencies, failed sync attempts, or missing inbox files as project facts unless the user explicitly asks to track the operational issue +- Treat `mattermost-sync` as inbox refresh only. Do not automatically promote synced content into project memory +- Promote Mattermost content only when it is clearly project-relevant, confirmed enough to keep, and the user explicitly asks to sync or promote project context +- Prefer updating stable project context over appending generic operational summaries +- Do not create daily log entries for tooling activity, sync status, or generic chat noise - When the user shares relevant new information, update today's log if the information belongs to the daily record - When the user corrects or changes stable context, update the canonical file directly: - `ai/state/current.md` for current focus or active concerns @@ -82,7 +86,7 @@ For day-to-day prompts in this workspace: 1. Verify the latest relevant context. 2. Decide whether the prompt introduces new durable information. -3. Update the workspace when needed, but never from a failed sync or failed tool run. +3. Update the workspace when needed, but never from a failed sync or failed tool run, and never auto-promote Mattermost sync results. 4. Then answer using the refreshed context. ---