Skip to content

add prior-analysis search to work-on-task-assistant Phase 6 - #107

Open
bborbe wants to merge 1 commit into
masterfrom
feature/workon-prior-analysis-search
Open

add prior-analysis search to work-on-task-assistant Phase 6#107
bborbe wants to merge 1 commit into
masterfrom
feature/workon-prior-analysis-search

Conversation

@bborbe

@bborbe bborbe commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Problem

Phase 6's three semantic searches are all artifact-type-scoped:

1. search_related("{task_title}")
2. search_related("{task_title} runbook procedure")
3. search_related("{task_title} guide")

They find runbooks and guides. A prior decision — recorded on a task or KB page — matches none of those framings, so it stays invisible even when indexed and highly relevant.

Observed failure (2026-08-24)

A task to deploy 12 new per-symbol candle 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, scored 0.55 on a topic query, and was sitting on the same day's daily note. All three queries missed it because it is neither a runbook nor a guide. The conflict only surfaced when the human objected on capacity grounds — reaching, manually, the conclusion the vault already held.

Change

  • Adds query 4: search_related("{task_title} prior analysis decision design", top_k=5)
  • Hits ≥0.5 whose conclusion constrains the task (a decision to consolidate / deprecate / freeze / reduce what the task would grow) are reported under a distinct ⚠️ CONFLICTING PRIOR WORK heading — deliberately not folded into the guides list, since a guide says how to proceed while this says whether to proceed at all
  • Self-check updated: all four queries required; a clean guides result is not a pass if query 4 never ran

Docs-only change to the agent definition. make precommit PASS.

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
  "verdict": "request-changes",
  "summary": "The PR correctly specifies Phase 6 query-4 behavior (all four queries, distinct ⚠️ CONFLICTING PRIOR WORK heading) in the agent definition and the CHANGELOG is properly updated under Unreleased. However, the success_criteria enforcement at line 452 is stated as a requirement in prose — it is not backed by any runner/wrapper implementation in scope — meaning an agent that skips query 4 would still pass Phase 6 without violating anything in this PR.",
  "comments": [
    {
      "file": "agents/work-on-task-assistant.md",
      "line": 452,
      "severity": "critical",
      "message": "Phase 6 enforcement (all four queries required, query 4 included) is stated in success_criteria but has no implementation. An agent that skips query 4 would still produce a \"clean guides\" result and pass Phase 6 — contradicting the self-check text. The calling runner/wrapper must track that query 4 was actually invoked, or this requirement will never be enforced."
    },
    {
      "file": "agents/work-on-task-assistant.md",
      "line": 452,
      "severity": "major",
      "message": "No regression test covers Phase 6 query-4 enforcement. If the runner is later updated to validate query-4 execution, there is no test asserting that a missing query 4 produces a FAIL verdict — the new behavior has no automated guard."
    }
  ],
  "concerns_addressed": [
    "correctness: Phase 6 self-check enforcement — addressed: flagged as critical (no runner implementation)",
    "correctness: Query 4 conflict results reported under ⚠️ CONFLICTING PRIOR WORK heading — not an issue: confirmed unambiguous in text",
    "correctness: 'A clean guides result is not a pass if query 4 never ran' condition — addressed: same as first concern",
    "tests: No integration/smoke tests for Phase 6 query-4 behavior — addressed: flagged as major"
  ]
}

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