From 3e017079ede5fb0656374ee68d64d336bbd98f83 Mon Sep 17 00:00:00 2001 From: Benjamin Borbe Date: Mon, 24 Aug 2026 21:57:04 +0200 Subject: [PATCH] add prior-analysis search to work-on-task-assistant Phase 6 --- CHANGELOG.md | 4 ++++ agents/work-on-task-assistant.md | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 653e5a1..97852d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Please choose versions by [Semantic Versioning](http://semver.org/). * MINOR version when you add functionality in a backwards-compatible manner, and * PATCH version when you make backwards-compatible bug fixes. +## Unreleased + +- feat: work-on-task-assistant Phase 6 adds a 4th search for prior analysis/decisions on the same system, reported separately as `âš ī¸ CONFLICTING PRIOR WORK` — queries 1-3 are artifact-type-scoped (runbook/guide) and silently miss a prior decision recorded on a task or KB page + ## v0.115.0 - feat: post-compact re-anchors on conventions after re-arm — emits a one-line `📌 Conventions: run /recall if you feel drifted` pointer (full doc re-read skipped; CLAUDE.md re-injects each turn), skipped when drift risk is low diff --git a/agents/work-on-task-assistant.md b/agents/work-on-task-assistant.md index 2ead374..fd2ee36 100644 --- a/agents/work-on-task-assistant.md +++ b/agents/work-on-task-assistant.md @@ -220,10 +220,22 @@ the command; this line makes the switch that lets the agent actually do it. Use the **task title verbatim** as the primary search seed. Don't paraphrase or generalise. -If `SEMANTIC_SEARCH_AVAIL` — run ALL three queries (no early-out): +If `SEMANTIC_SEARCH_AVAIL` — run ALL four queries (no early-out): 1. `search_related(query="{task_title}", top_k=5)` → primary topic match (catches runbooks named after the task) 2. `search_related(query="{task_title} runbook procedure", top_k=3)` → Runbooks 3. `search_related(query="{task_title} guide", top_k=3)` → Operational guides +4. `search_related(query="{task_title} prior analysis decision design", top_k=5)` → **Prior work on the same system** + +Query 4 exists because queries 1–3 are artifact-type-scoped — they find runbooks and guides, so a prior *decision* recorded on a task or KB page matches none of their framings and stays invisible. Report any hit â‰Ĩ 0.5 whose conclusion **constrains** this task — a decision to consolidate, deprecate, freeze, or reduce the very thing this task would grow — under a distinct heading: + +``` +âš ī¸ CONFLICTING PRIOR WORK +- [[]] () — → +``` + +Do NOT fold these into the guides list; a guide tells you *how* to proceed, this tells you whether to proceed at all. Surface it even when the task looks routine — especially then. + +Observed 2026-08-24: a task to deploy 12 new per-symbol handlers passed Phase 6 clean and shipped a merged PR before anyone noticed [[Review candle-command-handler per-symbol design]], a five-week-old analysis that had already identified that exact fleet as the cluster's top pod-count offender and decided to consolidate it. The page was indexed and sitting on the same day's daily note; all three queries missed it because it is neither a runbook nor a guide. Examples (make sure haiku doesn't paraphrase): - Task `Review MoneyMoney` → `search_related("MoneyMoney")` NOT `search_related("trading review process")` @@ -233,7 +245,7 @@ Else fall back: `Glob: 65 Runbooks/*{keyword}*.md`, `Glob: 50*Knowledge*/*{keywo For each result with score â‰Ĩ 0.5: read first ~100 lines and extract slash commands, quick checks, fix procedures. **List ALL hits â‰Ĩ 0.5 in the report** — don't filter to one. -If zero hits â‰Ĩ 0.5 across all queries, report `â„šī¸ No matching runbooks/guides found` — but only after running all three searches. +If zero hits â‰Ĩ 0.5 across all queries, report `â„šī¸ No matching runbooks/guides found` — but only after running all four searches. **Wikilink cross-vault resolution (MANDATORY)**: @@ -437,7 +449,7 @@ Suggested task name: