flower
/
All briefs
complete draft note flower
epic · Let's figure out we can turn your "waiting on your a...

#95 PR-9 — Standalone decision search (buildDecisionChunks) + link-aware indexing

canonical · plan

Spec

markdown

hand-off · dispatch

Dispatch

Auto-dispatch

when it reaches planned

Design-loop

design pass before build

This brief is complete — dispatch is closed.

#120 done fresh flower · flower/125-decision-search
agent: claude 5 scratchpads
You are being dispatched from flower Brief #125: #95 PR-9 — Standalone decision search (buildDecisionChunks) + link-aware indexing

Recall pointer:
- Use recall_brief with id 125 for the full folder if you need provenance.

Target:
- project: flower (/Users/mikeferrara/Documents/code/flower)
- branch: flower/125-decision-search
- worktree: not specified
- kind: fresh

Current brief spec:
## PR-9 — Standalone decision search (buildDecisionChunks) + link-aware indexing (child of #95)
Include **standalone** decisions (no brief subject) in `recall_search` — they're durable signals of
intent/direction/context and should be findable like briefs/commits/sessions. (Brief-attached decisions
are already discoverable via their brief; this closes the standalone gap — #95 §5.8.1, **reversed per
operator Q24**.)

## Scope
1. **Make `Decision` a chunkable type.** A `buildDecisionChunks` seam (mirror `buildCommitChunks` / the
   brief chunk builder in `EmbedChunks`) → one Chunk per **standalone** decision, `decision` source/tag,
   re-embeds on change; indexed into Meilisearch + surfaced in `recall_search`, with the recall hit
   carrying the decision + its relations. (Brief-attached decisions need not be double-indexed — already
   covered via their brief.)
2. **Link-aware chunk text (operator ask).** Weave the decision's context into the chunk so associations
   surface in recall: the resolved **question + answer**, the **subject** (if any), and the
   **`decision_links`** — a linked brief's **title + spec excerpt**, plus linked session / scratchpad /
   commits / files. If a brief is linked on the decision, its title/ref is in the chunk text AND the
   recall hit exposes the link, so "what/why is this about" is answerable from search alone.
3. Keep it bounded like other chunk builders (in-scope decisions only; skip unchanged).

## Acceptance
- A standalone decision (question + answer) is found by `recall_search`; its hit exposes linked context
  (linked brief title/excerpt + other decision_links).
- Brief-attached decisions remain discoverable via their brief (no regression / no double-index).
- `php artisan test` green + pint. `Brief: #125` trailer.

## Provenance
Operator #95 Q24 (confirmed 2026-07-03) + link-weaving ask. Deps: PR-1 (#117, Decision model + service) +
PR-2 (#118, `decision_links` + auto-link). Design ref: #95 §5.8.1 (reversed) + Q24. Speced by
flower-refine.

Recent/key trace events:
[6] dependency_added flower-refine: Now depends on #118 (#95 PR-2 — Events, broadcasts, auto-participant + auto-link (decision_links)).
[7] status_change flower-refine: (no body)
[8] link_added flower-refine: (no body)
[9] link_added flower-refine: (no body)
[10] participant_joined flower-118: (no body)
[11] unblocked flower-118: Unblocked — #118 reached complete.
[12] link_added flower-refine: (no body)
[13] participant_joined flower-orchestrator: (no body)
[14] dependency_added flower-orchestrator: Now depends on #122 (#95 PR-6 — Follow-up chains (decision_answers + parent_answer_id)).
[15] link_added flower-orchestrator: (no body)
[16] unblocked flower-orchestrator: Unblocked — #122 reached complete.
[17] link_added flower-orchestrator: (no body)

Recommended linked context:
{
    "todos": [],
    "scratchpads": [
        {
            "id": 364,
            "solo_scratchpad_id": "1055",
            "name": "flower-refine — reset handoff (2026-07-03)",
            "archived": false,
            "revision": 1
        },
        {
            "id": 375,
            "solo_scratchpad_id": "1067",
            "name": "flower-refine — reset handoff (2026-07-03 #2)",
            "archived": false,
            "revision": 2
        },
        {
            "id": 378,
            "solo_scratchpad_id": "1070",
            "name": "flower-refine — reset handoff (2026-07-04)",
            "archived": false,
            "revision": 2
        },
        {
            "id": 381,
            "solo_scratchpad_id": "1073",
            "name": "flower-orchestrator — reset handoff (2026-07-04)",
            "archived": false,
            "revision": 1
        },
        {
            "id": 386,
            "solo_scratchpad_id": "1078",
            "name": "flower-orchestrator (daemon 25) — reset handoff (2026-07-04 #3)",
            "archived": false,
            "revision": 1
        }
    ]
}

Execution notes:
- Treat the brief as the source of truth.
- Keep work scoped to this dispatch request.
- Use brief_append / brief_update_status when reporting material progress; as your final dispatched-worker step, call brief_dispatch_complete with dispatch_request_id (or brief_id) and actor_ref.
- Codex workers should verify mutating Flower tools with tool_search query `brief_append brief_dispatch_complete flower_feedback` (limit 20) when tool availability is in doubt; report raw SEE/LOAD vs NOT visible instead of silently using local fallbacks.
- Add a git commit trailer `Brief: #125` to every commit for this brief so flower can exact-link commits back to the brief.

provenance · append-only

Trace

live
or paste a screenshot uploading…
  1. link added 21h ago
    agent · system:commit-trailer
  2. participant joined 21h ago
    system · system:commit-trailer
  3. merged 21h ago

    Merged flower/125-decision-search (#95 PR-9 — Decision as searchable chunkable type via buildDecisionChunks + recall_search hit enrichment + link-aware indexing) to master by flower-orchestrator (daemon 40). Suite green 1211. EmbedChunks job changed → flower:horizon-reload run post-merge so standalone decisions index.

    agent · flower-orchestrator
  4. status change 21h ago
    agent · flower-125-worker
  5. dispatched 21h ago

    Dispatch request #120 marked done.

    agent · flower-125-worker
  6. note added 21h ago

    BUILT — branch `flower/125-decision-search` (commit 3984ad6, trailer `Brief: #125`). Standalone decisions are now a searchable chunkable type via buildDecisionChunks. Landed: - **EmbedChunks::reconcileDecisionChunks()** — mirrors the bounded, project-scoped reconcile seams (paged, whereIn project_id, re-embed on text change). One chunk per STANDALONE decision (brief_id IS NULL); brief-attached decisions are NOT double-indexed (their Q&A rides the brief's event trace via briefText), and a decision that IS/BECOMES brief-attached has its stale chunk pruned (mirrors empty-brief pruning). - **Link-aware chunk text** — weaves resolved question + offered options + answer (answerLines) + a Context block: any subject/decision_links brief expanded with title + spec excerpt, plus session/commit/scratchpad reference lines; linked-commit files surface on the file_paths facet so file-scoped recall finds the decision. - **recall_search hit enrichment** (RecallService::enrichHit + decisionHitSummary + decisionLinkedBriefs) — a decision hit exposes the resolved call + answer_lines, flattened decision_links, and linked_briefs (title + spec_excerpt). "What/why is this about" is answerable from the hit alone. - **Wiring** — Decision::class in MeiliIndexManager::SOURCE_TYPES + RecallService::SOURCE_MODELS (both search paths), recall_search `sources` enum/validation, /search console facet (kept in lockstep with SOURCE_TYPES per SearchConsoleTest), Decision::chunks() morphMany. No migrations / no schema or Meili index changes (Decision is an existing table; chunks.chunkable_type is already filterable) — purely additive code, nothing to land in the shared DB/Meili. Tests: 3 new EmbedChunks tests (link-aware searchable build + hit exposes linked brief/links; brief-attached no-double-index; standalone→attached prune) + decisions row added to the reconcile paging-shape guard. `php artisan test` green (1193 passed, 1 pre-existing skip), pint clean. Did NOT merge — orchestrator owns the merge.

    agent · flower-125-worker
  7. participant joined 21h ago
    system · flower-125-worker
  8. dispatched 22h ago

    Dispatch request #120 queued for flower.

    agent · flower-orchestrator
  9. status change 22h ago
    agent · flower-orchestrator
  10. link added 1d ago
    agent · flower-orchestrator
  11. unblocked 1d ago

    Unblocked — #122 reached complete.

    system · flower-orchestrator
  12. link added 1d ago
    agent · flower-orchestrator
  13. dependency added 1d ago

    Now depends on #122 (#95 PR-6 — Follow-up chains (decision_answers + parent_answer_id)).

    agent · flower-orchestrator
  14. participant joined 1d ago
    system · flower-orchestrator
  15. link added 1d ago
    agent · flower-refine
  16. unblocked 1d ago

    Unblocked — #118 reached complete.

    system · flower-118
  17. participant joined 1d ago
    system · flower-118
  18. link added 2d ago
    agent · flower-refine
  19. link added 2d ago
    agent · flower-refine
  20. status change 2d ago
    agent · flower-refine
  21. dependency added 2d ago

    Now depends on #118 (#95 PR-2 — Events, broadcasts, auto-participant + auto-link (decision_links)).

    agent · flower-refine
  22. dependency added 2d ago

    Now depends on #117 (#95 PR-1 — Tracer: decisions spine (standalone confirm: ask→board→answer→pull→ack)).

    agent · flower-refine
  23. parent set 2d ago

    Grouped under epic #95.

    agent · flower-refine
  24. plan proposed 2d ago

    ## PR-9 — Standalone decision search (buildDecisionChunks) + link-aware indexing (child of #95) Include **standalone** decisions (no brief subject) in `recall_search` — they're durable signals of intent/direction/context and should be findable like briefs/commits/sessions. (Brief-attached decisions are already discoverable via their brief; this closes the standalone gap — #95 §5.8.1, **reversed per operator Q24**.) ## Scope 1. **Make `Decision` a chunkable type.** A `buildDecisionChunks` seam (mirror `buildCommitChunks` / the brief chunk builder in `EmbedChunks`) → one Chunk per **standalone** decision, `decision` source/tag, re-embeds on change; indexed into Meilisearch + surfaced in `recall_search`, with the recall hit carrying the decision + its relations. (Brief-attached decisions need not be double-indexed — already covered via their brief.) 2. **Link-aware chunk text (operator ask).** Weave the decision's context into the chunk so associations surface in recall: the resolved **question + answer**, the **subject** (if any), and the **`decision_links`** — a linked brief's **title + spec excerpt**, plus linked session / scratchpad / commits / files. If a brief is linked on the decision, its title/ref is in the chunk text AND the recall hit exposes the link, so "what/why is this about" is answerable from search alone. 3. Keep it bounded like other chunk builders (in-scope decisions only; skip unchanged). ## Acceptance - A standalone decision (question + answer) is found by `recall_search`; its hit exposes linked context (linked brief title/excerpt + other decision_links). - Brief-attached decisions remain discoverable via their brief (no regression / no double-index). - `php artisan test` green + pint. `Brief: #125` trailer. ## Provenance Operator #95 Q24 (confirmed 2026-07-03) + link-weaving ask. Deps: PR-1 (#117, Decision model + service) + PR-2 (#118, `decision_links` + auto-link). Design ref: #95 §5.8.1 (reversed) + Q24. Speced by flower-refine.

    agent · flower-refine
  25. note added 2d ago

    Child of #95. PR-9 — include STANDALONE decisions in recall_search via a buildDecisionChunks seam, with decision_links woven into the chunk so linked context (e.g. a linked brief's title/excerpt) is exposed in recall. Operator (#95 Q24, confirmed 2026-07-03 + link-weaving ask). Depends on PR-1 (#117) + PR-2 (#118, decision_links). Full spec via brief_update_spec.

    agent · flower-refine
  26. participant joined 2d ago
    system · flower-refine

epic · dependencies

Relationships

depends on

agents · waves

Participants

  • flower-refine participant · active
  • flower-118 participant · active
  • flower-orchestrator participant · active
  • flower-125-worker participant · active
  • system:commit-trailer participant · active

trace · graph

Links

  • Commit #4042 execution
  • Scratchpad #386 execution
  • Scratchpad #381 execution
  • Scratchpad #378 execution
  • Scratchpad #375 execution
  • Scratchpad #364 execution

scope

Projects

  • flower · primary

dogfood · read-only

Agent’s-eye view

The literal recall_brief payload an agent gets — same service path as the MCP tool.