flower
/
All briefs
complete feedback flower
from feedback #75 · Live table rename (#116 brief_questions→decisions) b...

Feedback #75: Live table rename (#116 brief_questions→decisions) broke question-handling in all pre-rename long-running daemon MCP sessions (cached code)

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.

#96 done fresh flower · flower/167-schema-rename-daemon-reload
agent: claude 3 scratchpads
You are being dispatched from flower Brief #167: Feedback #75: Live table rename (#116 brief_questions→decisions) broke question-handling in all pre-rename long-running daemon MCP sessions (cached code)

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

Target:
- project: flower (/Users/mikeferrara/Documents/code/flower)
- branch: flower/167-schema-rename-daemon-reload
- worktree: not specified
- kind: fresh

Current brief spec:
## Ask
Prevent schema-changing migrations (especially table/column **renames** like #116 `brief_questions`→`decisions`) from silently breaking standing long-running daemon MCP sessions that cache pre-migration code. Deliver a documented procedure and, if cheap, a lightweight automated reload nudge.

## Context (Feedback #75)
After #116 renamed `brief_questions`→`decisions` and the migration ran on live MAIN, the **pre-rename** daemon MCP servers (orch 19/proc 1055, refine 1040, ops 1054) kept the OLD cached code and threw `SQLSTATE[42S02] Table flower.brief_questions doesn't exist` on `brief_open_questions` / `brief_ask` / `recall_brief`'s Q&A section. NEW workers spawned post-rename were fine (fresh code); non-question MCP calls (brief_append/create/dispatch, signal_*, recall_active/roster/search) were unaffected, so merge/dispatch orchestration kept working. It **self-heals on each daemon's next reset** (fresh MCP process).

We already ship the relevant primitives: make-before-break reset (`daemon_request_reset`/`daemon_start_reset`), `flower:horizon-reload` (#191, canonical graceful Horizon reload), daemon-checkin project resolution (#104), and the durable coordination-signal queue.

## Deliverable — keep SMALL
1. **Procedure doc (required):** add the canonical "schema-rename with standing daemons" playbook to the right home (`CLAUDE.md` Runtime & pipeline notes, and/or `_flower-playbook.md`). Rule of thumb: run schema renames in a daemon-quiet window and/or immediately follow the migration with a coordinated standing-daemon reload, leaning on the existing reset + `flower:horizon-reload` tooling. Note which MCP calls are/aren't affected and that resets self-heal.
2. **Automated post-migrate reload nudge (optional — only if genuinely low-effort):** after a schema-changing migration on MAIN, enqueue a coordination signal (reuse an existing kind, e.g. a reset/route hint, or a minimal new `schema_reload` hint) to standing non-orchestrator daemons (refine/ops) so their MCP reloads without waiting for a natural reset. MUST fail-safe/no-op when there are no standing daemons.

## Out of scope
Query-time stale-schema auto-detection or MCP self-reconnect (larger; leave a follow-up brief note if it seems warranted). Do NOT build a heavy framework.

## Acceptance
- Procedure is documented where daemons/operators will actually find it.
- If the nudge is built: a schema-changing migration enqueues reload signals for standing daemons; verified no-op with zero daemons; `php artisan test` green; `./vendor/bin/pint` clean on touched files.
- Finish with `brief_dispatch_complete` (+ `brief_append` merged note) and a `Brief: #167` trailer on every commit.

Recent/key trace events:
[1] participant_joined flower-ops: (no body)
[2] note_added flower-ops: Feedback #75
Authority: OPERATOR APPROVAL REQUIRED
Funnel: A - operator approved brief
Gate: this brief must not be dispatchable until the operator approves it.
Kind: idea
Source: flower-orchestrator

Summary:
Live table rename (#116 brief_questions→decisions) broke question-handling in all pre-rename long-running daemon MCP sessions (cached code)

Detail:
After merging #116 (rename brief_questions→decisions) and running the migration on the live MAIN DB, the long-running flower MCP servers of PRE-rename sessions (orchestrator daemon 19/proc 1055, refine 1040, ops 1054) kept the OLD code → brief_open_questions / brief_ask / recall_brief's Q&A section now throw 'SQLSTATE[42S02] Table flower.brief_questions doesn't exist'. Confirmed via probe: brief_open_questions(143) errored right after the migration. NEW workers spawned post-rename are fine (fresh code). Non-question MCP calls (brief_append/create/dispatch, signal_*, recall_active/roster/search) are unaffected, so merge/dispatch orchestration kept working. Self-heals on each daemon's next reset (fresh MCP) — this orchestrator is resetting partly to refresh it. IDEA: coordinate schema-rename migrations with a daemon-MCP reload story (e.g. detect stale schema + reconnect, or a post-migrate nudge that resets standing daemons refine/ops, or run renames during a daemon-quiet window). This was the anticipated 'blast radius' of #95 PR-0, but the live-daemon-MCP impact is worth an explicit mitigation.

Context JSON:
{
    "tool": "brief_open_questions",
    "trigger": "merged #116 rename + migrate on live MAIN DB",
    "affected": "pre-rename long-running MCP sessions (orch 19, refine 1040, ops 1054)",
    "brief_id": 143,
    "observed": "SQLSTATE[42S02] Table flower.brief_questions doesn't exist",
    "unaffected": "post-rename workers + non-question MCP calls"
}
[3] link_added flower-ops: (no body)
[4] participant_joined operator:mike: (no body)
[5] note_added operator:mike: Operator approved this feedback-born brief for dispatch.
[6] status_change operator:mike: (no body)
[7] link_added flower-ops: (no body)
[8] link_added flower-ops: (no body)
[9] link_added flower-ops: (no body)
[10] participant_joined flower-orchestrator: (no body)
[11] plan_proposed flower-orchestrator: ## Ask
Prevent schema-changing migrations (especially table/column **renames** like #116 `brief_questions`→`decisions`) from silently breaking standing long-running daemon MCP sessions that cache pre-migration code. Deliver a documented procedure and, if cheap, a lightweight automated reload nudge.

## Context (Feedback #75)
After #116 renamed `brief_questions`→`decisions` and the migration ran on live MAIN, the **pre-rename** daemon MCP servers (orch 19/proc 1055, refine 1040, ops 1054) kept the OLD cached code and threw `SQLSTATE[42S02] Table flower.brief_questions doesn't exist` on `brief_open_questions` / `brief_ask` / `recall_brief`'s Q&A section. NEW workers spawned post-rename were fine (fresh code); non-question MCP calls (brief_append/create/dispatch, signal_*, recall_active/roster/search) were unaffected, so merge/dispatch orchestration kept working. It **self-heals on each daemon's next reset** (fresh MCP process).

We already ship the relevant primitives: make-before-break reset (`daemon_request_reset`/`daemon_start_reset`), `flower:horizon-reload` (#191, canonical graceful Horizon reload), daemon-checkin project resolution (#104), and the durable coordination-signal queue.

## Deliverable — keep SMALL
1. **Procedure doc (required):** add the canonical "schema-rename with standing daemons" playbook to the right home (`CLAUDE.md` Runtime & pipeline notes, and/or `_flower-playbook.md`). Rule of thumb: run schema renames in a daemon-quiet window and/or immediately follow the migration with a coordinated standing-daemon reload, leaning on the existing reset + `flower:horizon-reload` tooling. Note which MCP calls are/aren't affected and that resets self-heal.
2. **Automated post-migrate reload nudge (optional — only if genuinely low-effort):** after a schema-changing migration on MAIN, enqueue a coordination signal (reuse an existing kind, e.g. a reset/route hint, or a minimal new `schema_reload` hint) to standing non-orchestrator daemons (refine/ops) so their MCP reloads without waiting for a natural reset. MUST fail-safe/no-op when there are no standing daemons.

## Out of scope
Query-time stale-schema auto-detection or MCP self-reconnect (larger; leave a follow-up brief note if it seems warranted). Do NOT build a heavy framework.

## Acceptance
- Procedure is documented where daemons/operators will actually find it.
- If the nudge is built: a schema-changing migration enqueues reload signals for standing daemons; verified no-op with zero daemons; `php artisan test` green; `./vendor/bin/pint` clean on touched files.
- Finish with `brief_dispatch_complete` (+ `brief_append` merged note) and a `Brief: #167` trailer on every commit.

Recommended linked context:
{
    "todos": [],
    "scratchpads": [
        {
            "id": 333,
            "solo_scratchpad_id": "1005",
            "name": "flower-ops — triage log",
            "archived": false,
            "revision": 271
        },
        {
            "id": 382,
            "solo_scratchpad_id": "1074",
            "name": "Feedback #87 fix-spec",
            "archived": false,
            "revision": 2
        },
        {
            "id": 384,
            "solo_scratchpad_id": "1076",
            "name": "ESCALATION — embed-stage OOM cluster degrading the pipeline",
            "archived": false,
            "revision": 2
        }
    ]
}

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: #167` 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 1d ago
    agent · system:commit-trailer
  2. participant joined 1d ago
    system · system:commit-trailer
  3. status change 1d ago
    agent · flower-orchestrator
  4. merged 1d ago

    Merged to master as 129fbe1 (branch commit db88855, off tip 8346129). Shipped: (1) CLAUDE.md "Schema renames vs standing daemon MCP sessions" procedure doc; (2) new `php artisan flower:daemon-schema-reload` command — enqueues a queue-only make-before-break reset for standing non-orchestrator daemons (reuses DaemonResetService::requestReset, the /roster + daemon_request_reset path), excludes the orchestrator, no-ops with zero standing daemons, idempotent via pending-signal dedupe, flags --dry-run/--project/--reason. Full suite green (1044 passed, 2 pre-existing skips, 0 failures; 8 new DaemonSchemaReloadCommandTest cases). Purely additive (3 files, no migration, no JS/CSS, no Horizon-executed code changed → no horizon-reload). Deferred follow-ups: auto-fire-on-migrate listener (too blunt — nudges on every migration), query-time stale-schema detection / MCP self-reconnect (out of scope).

    agent · flower-orchestrator
  5. status change 1d ago
    agent · flower-167-worker
  6. dispatched 1d ago

    Dispatch request #96 marked done.

    agent · flower-167-worker
  7. note added 1d ago

    Done on branch flower/167-schema-rename-daemon-reload (commit db88855, off master tip 8346129). Brief: #167 trailer on the commit. REQUIRED (procedure doc): Added the "Schema renames vs standing daemon MCP sessions" bullet to CLAUDE.md → Runtime & pipeline notes (alongside the flower:horizon-reload note — the version-controlled, merge-tracked home every flower agent reads). It documents: the narrow, self-healing blast radius (only calls touching the renamed table are affected — after #116 that was brief_open_questions/brief_ask/recall_brief Q&A; everything else + post-migration workers unaffected; heals on next reset); and the procedure (run renames in a daemon-quiet window and/or reload right after). Note: ../_flower-playbook.md is a shared symlinked operator doc OUTSIDE the flower repo, so I intentionally did NOT edit it from a worker lane (it wouldn't be in the merge and could collide with ops); the canonical home is the in-repo CLAUDE.md. Operator can mirror a line there if desired. OPTIONAL (nudge) — built, it was genuinely low-effort: new command `php artisan flower:daemon-schema-reload` (app/Console/Commands/DaemonSchemaReload.php). Enqueues a queue-only make-before-break reset (reuses DaemonResetService::requestReset — the exact path /roster + daemon_request_reset use) for every STANDING non-orchestrator daemon so its cached MCP reboots on fresh code. Excludes the orchestrator (self-manages + holds merge baton). Fail-safe no-op with zero standing daemons; skips dead/expected/retired via markStale()+livenessFor; idempotent via the pending-signal fingerprint dedupe. Flags: --dry-run, --project=<slug>, --reason=<text>. Companion to flower:horizon-reload. Deliberately NOT auto-wired to a migrate event listener: it would fire a full daemon reset on EVERY migration (incl. routine/data ones) — too blunt and surprising; the operator triggers it after a rename. Recorded as considered-and-declined. VERIFY: `MEILISEARCH_KEY=LARAVEL-HERD ANTHROPIC_API_KEY= ~/bin/php artisan test` → 1044 passed / 2 pre-existing skips / 0 failures (incl. 8 new DaemonSchemaReloadCommandTest cases). Pint clean on both touched PHP files. Out of scope (left as follow-up if warranted): query-time stale-schema auto-detection / MCP self-reconnect; fully-automatic post-migrate wiring.

    agent · flower-167-worker
  8. participant joined 1d ago
    system · flower-167-worker
  9. link added 1d ago
    agent · system:brief-autolink
  10. link added 1d ago
    agent · system:brief-autolink
  11. comment 1d ago

    Target branch flower/167-schema-rename-daemon-reload is merged to the default branch; suggest marking the brief complete.

    system · system:brief-autolink
  12. participant joined 1d ago
    system · system:brief-autolink
  13. dispatched 1d ago

    Dispatch request #96 queued for flower.

    agent · flower-orchestrator
  14. status change 1d ago
    agent · flower-orchestrator
  15. plan proposed 1d ago

    ## Ask Prevent schema-changing migrations (especially table/column **renames** like #116 `brief_questions`→`decisions`) from silently breaking standing long-running daemon MCP sessions that cache pre-migration code. Deliver a documented procedure and, if cheap, a lightweight automated reload nudge. ## Context (Feedback #75) After #116 renamed `brief_questions`→`decisions` and the migration ran on live MAIN, the **pre-rename** daemon MCP servers (orch 19/proc 1055, refine 1040, ops 1054) kept the OLD cached code and threw `SQLSTATE[42S02] Table flower.brief_questions doesn't exist` on `brief_open_questions` / `brief_ask` / `recall_brief`'s Q&A section. NEW workers spawned post-rename were fine (fresh code); non-question MCP calls (brief_append/create/dispatch, signal_*, recall_active/roster/search) were unaffected, so merge/dispatch orchestration kept working. It **self-heals on each daemon's next reset** (fresh MCP process). We already ship the relevant primitives: make-before-break reset (`daemon_request_reset`/`daemon_start_reset`), `flower:horizon-reload` (#191, canonical graceful Horizon reload), daemon-checkin project resolution (#104), and the durable coordination-signal queue. ## Deliverable — keep SMALL 1. **Procedure doc (required):** add the canonical "schema-rename with standing daemons" playbook to the right home (`CLAUDE.md` Runtime & pipeline notes, and/or `_flower-playbook.md`). Rule of thumb: run schema renames in a daemon-quiet window and/or immediately follow the migration with a coordinated standing-daemon reload, leaning on the existing reset + `flower:horizon-reload` tooling. Note which MCP calls are/aren't affected and that resets self-heal. 2. **Automated post-migrate reload nudge (optional — only if genuinely low-effort):** after a schema-changing migration on MAIN, enqueue a coordination signal (reuse an existing kind, e.g. a reset/route hint, or a minimal new `schema_reload` hint) to standing non-orchestrator daemons (refine/ops) so their MCP reloads without waiting for a natural reset. MUST fail-safe/no-op when there are no standing daemons. ## Out of scope Query-time stale-schema auto-detection or MCP self-reconnect (larger; leave a follow-up brief note if it seems warranted). Do NOT build a heavy framework. ## Acceptance - Procedure is documented where daemons/operators will actually find it. - If the nudge is built: a schema-changing migration enqueues reload signals for standing daemons; verified no-op with zero daemons; `php artisan test` green; `./vendor/bin/pint` clean on touched files. - Finish with `brief_dispatch_complete` (+ `brief_append` merged note) and a `Brief: #167` trailer on every commit.

    agent · flower-orchestrator
  16. participant joined 1d ago
    system · flower-orchestrator
  17. link added 1d ago
    agent · flower-ops
  18. link added 1d ago
    agent · flower-ops
  19. link added 1d ago
    agent · flower-ops
  20. status change 1d ago
    agent · operator:mike
  21. note added 1d ago

    Operator approved this feedback-born brief for dispatch.

    operator · operator:mike
  22. participant joined 1d ago
    system · operator:mike
  23. link added 1d ago
    agent · flower-ops
  24. note added 1d ago

    Feedback #75 Authority: OPERATOR APPROVAL REQUIRED Funnel: A - operator approved brief Gate: this brief must not be dispatchable until the operator approves it. Kind: idea Source: flower-orchestrator Summary: Live table rename (#116 brief_questions→decisions) broke question-handling in all pre-rename long-running daemon MCP sessions (cached code) Detail: After merging #116 (rename brief_questions→decisions) and running the migration on the live MAIN DB, the long-running flower MCP servers of PRE-rename sessions (orchestrator daemon 19/proc 1055, refine 1040, ops 1054) kept the OLD code → brief_open_questions / brief_ask / recall_brief's Q&A section now throw 'SQLSTATE[42S02] Table flower.brief_questions doesn't exist'. Confirmed via probe: brief_open_questions(143) errored right after the migration. NEW workers spawned post-rename are fine (fresh code). Non-question MCP calls (brief_append/create/dispatch, signal_*, recall_active/roster/search) are unaffected, so merge/dispatch orchestration kept working. Self-heals on each daemon's next reset (fresh MCP) — this orchestrator is resetting partly to refresh it. IDEA: coordinate schema-rename migrations with a daemon-MCP reload story (e.g. detect stale schema + reconnect, or a post-migrate nudge that resets standing daemons refine/ops, or run renames during a daemon-quiet window). This was the anticipated 'blast radius' of #95 PR-0, but the live-daemon-MCP impact is worth an explicit mitigation. Context JSON: { "tool": "brief_open_questions", "trigger": "merged #116 rename + migrate on live MAIN DB", "affected": "pre-rename long-running MCP sessions (orch 19, refine 1040, ops 1054)", "brief_id": 143, "observed": "SQLSTATE[42S02] Table flower.brief_questions doesn't exist", "unaffected": "post-rename workers + non-question MCP calls" }

    agent · flower-ops
  25. participant joined 1d ago
    system · flower-ops

epic · dependencies

Relationships

epic parent

depends on

No dependencies — dispatchable once planned.

agents · waves

Participants

  • flower-ops participant · active
  • operator:mike participant · active
  • flower-orchestrator participant · active
  • system:brief-autolink participant · active
  • flower-167-worker participant · active
  • system:commit-trailer participant · active

trace · graph

Links

  • Commit #4003 execution
  • Commit #3986 result
  • Commit #3987 result
  • Scratchpad #384 execution
  • Scratchpad #382 execution
  • Scratchpad #333 execution
  • Feedback #75 seed

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.