flower
/
All briefs
complete draft note flower

Project-level primary branch / primary checkout config + "make primary" on /projects checkouts card

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.

#48 done fresh flower · flower/130-primary-branch-config
agent: claude 2 scratchpads
You are being dispatched from flower Brief #130: Project-level primary branch / primary checkout config + "make primary" on /projects checkouts card

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

Target:
- project: flower (/Users/mikeferrara/Documents/code/flower)
- branch: flower/130-primary-branch-config
- worktree: not specified
- kind: fresh

Current brief spec:
## Ask
Give each project an explicit, operator-settable **primary (deployed/canonical) checkout** — and
therefore a **primary branch** — instead of inferring it from whatever happens to be checked out. Surface
and control it on the `/projects/{slug}` checkouts/worktrees card.

## Motivation
The primary branch varies per project (master / main / something else) and is currently env-inferred.
Several features want a definitive "what is the primary/deployed branch + checkout": e.g. **#128**
(commits-since-ping), "what's deployed" indicators, and merge-target awareness. Make it explicit +
operator-controllable.

## Scope
### Data
- Designate exactly **one primary checkout/worktree** per project — `is_primary` on the worktree/checkout
  row (or `projects.primary_worktree_id`); the **primary branch** derives from that checkout's current
  branch. (Optionally also persist a `projects.primary_branch` string fallback for projects with no live
  checkout.)
- **Default on discovery/import:** the checkout at the project `root_path` (the MAIN/served env), else
  inferred from worktrees (the non-feature / root checkout); final fallback = the branch checked out at
  first-found.
- Enforce a single primary per project (switching moves the designation).

### UI — `/projects/{slug}` checkouts/worktrees card (operator's ask)
- Show a **"primary" badge/indicator** on the current primary checkout.
- Add a **"Make primary" button** on each non-primary checkout to switch the designation (badge moves;
  optional FluxUI confirm on switch).
- bloom + Flux where it fits.

### Consumers / API
- Expose `Project::primaryCheckout()` / `primaryBranch()` for features to consume.
- **#128** (commits-since-ping) can later prefer the configured primary branch over env-inference
  (coordinate; #128 v1 intentionally stays env-inferred, so this is an enhancement, not a blocker).

## Acceptance
- Each project resolves a primary checkout + primary branch, sensibly defaulted on import; exactly one
  primary enforced.
- `/projects/{slug}` checkouts card shows the primary indicator + a working "Make primary" toggle.
- `php artisan test` green + pint. `Brief: #130` trailer.

## Provenance
Operator (2026-07-03), surfaced alongside #128 (which env-infers the branch for now). UI direction
(primary badge + "Make primary" on the checkouts card) per operator. Speced by flower-refine.
Related: #128.

Recent/key trace events:
[1] participant_joined flower-refine: (no body)
[2] note_added flower-refine: Operator (2026-07-03), surfaced alongside #128 (which env-infers the branch for now). Give each project an explicit, operator-settable PRIMARY (deployed/canonical) checkout → primary branch, instead of env-inferring it. UI (operator's ask): on the /projects/{slug} checkouts/worktrees card, show a 'primary' badge/indicator + a 'Make primary' button to switch designation. Default from the root/import checkout. Consumers: #128 commits digest + 'what's deployed' indicators + merge-target awareness. Full spec via brief_update_spec. Related: #128.
[3] plan_proposed flower-refine: ## Ask
Give each project an explicit, operator-settable **primary (deployed/canonical) checkout** — and
therefore a **primary branch** — instead of inferring it from whatever happens to be checked out. Surface
and control it on the `/projects/{slug}` checkouts/worktrees card.

## Motivation
The primary branch varies per project (master / main / something else) and is currently env-inferred.
Several features want a definitive "what is the primary/deployed branch + checkout": e.g. **#128**
(commits-since-ping), "what's deployed" indicators, and merge-target awareness. Make it explicit +
operator-controllable.

## Scope
### Data
- Designate exactly **one primary checkout/worktree** per project — `is_primary` on the worktree/checkout
  row (or `projects.primary_worktree_id`); the **primary branch** derives from that checkout's current
  branch. (Optionally also persist a `projects.primary_branch` string fallback for projects with no live
  checkout.)
- **Default on discovery/import:** the checkout at the project `root_path` (the MAIN/served env), else
  inferred from worktrees (the non-feature / root checkout); final fallback = the branch checked out at
  first-found.
- Enforce a single primary per project (switching moves the designation).

### UI — `/projects/{slug}` checkouts/worktrees card (operator's ask)
- Show a **"primary" badge/indicator** on the current primary checkout.
- Add a **"Make primary" button** on each non-primary checkout to switch the designation (badge moves;
  optional FluxUI confirm on switch).
- bloom + Flux where it fits.

### Consumers / API
- Expose `Project::primaryCheckout()` / `primaryBranch()` for features to consume.
- **#128** (commits-since-ping) can later prefer the configured primary branch over env-inference
  (coordinate; #128 v1 intentionally stays env-inferred, so this is an enhancement, not a blocker).

## Acceptance
- Each project resolves a primary checkout + primary branch, sensibly defaulted on import; exactly one
  primary enforced.
- `/projects/{slug}` checkouts card shows the primary indicator + a working "Make primary" toggle.
- `php artisan test` green + pint. `Brief: #130` trailer.

## Provenance
Operator (2026-07-03), surfaced alongside #128 (which env-infers the branch for now). UI direction
(primary badge + "Make primary" on the checkouts card) per operator. Speced by flower-refine.
Related: #128.
[4] status_change flower-refine: (no body)
[5] link_added flower-refine: (no body)
[6] link_added flower-refine: (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
        }
    ]
}

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: #130` 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 2d ago
    agent · system:commit-trailer
  2. participant joined 2d ago
    system · system:commit-trailer
  3. merged 2d ago

    Merged flower/130-primary-branch-config → master as merge commit 10408c0 (worker commit 9d0d8a5). Post-merge on MAIN: migration 2026_07_03_000001_add_primary_branch_to_projects_table applied; full suite green (741 tests, 739 passed, 2 skipped, 4976 assertions); pint clean. Shipped: PrimaryCheckoutService (makePrimary/ensurePrimary, single-primary enforcement), rescan-safe operator-owned is_primary, projects.primary_branch fallback column, Project::primaryCheckout()/primaryBranch(), and /projects checkouts card "primary" badge + "Make primary" button (wire:confirm). #128 left env-inferred per spec. No Horizon reload needed (UI/config, not job code). Merged by flower-orchestrator (daemon 16).

    agent · flower-orchestrator
  4. status change 2d ago
    agent · flower-130-primary-branch
  5. dispatched 2d ago

    Dispatch request #48 marked done.

    agent · flower-130-primary-branch
  6. note added 2d ago

    Built on branch flower/130-primary-branch-config (commit 9d0d8a5). DATA: kept the existing worktrees.is_primary flag as the source of truth (already wired across the app). New PrimaryCheckoutService (app/Services/Discovery): makePrimary() moves the designation to a single checkout + enforces single-primary + syncs the fallback; ensurePrimary() reconciles to exactly one, defaulting on discovery to the root/served checkout → else the default-branch (non-feature) checkout → else first-found. ScanProjects no longer clobbers is_primary on rescan (now operator-owned, like is_indexed/is_searchable) and calls ensurePrimary(), so an operator's "Make primary" choice survives re-scans. Added projects.primary_branch nullable fallback column for checkout-less resolution. CONSUMERS: Project::primaryCheckout() and Project::primaryBranch() (checkout branch → primary_branch → default_branch). UI (/projects/{slug} checkouts card): relabeled the primary indicator to a "primary" badge; added a "Make primary" button (bloom styling + wire:confirm) on each non-primary checkout — Show::makePrimary() moves the designation and the badge follows on re-render. TESTS: PrimaryCheckoutServiceTest (default cascade, single-primary enforcement, collapse-multiples, detached-head fallback, primaryBranch resolution), a rescan-preserves-operator-primary test in ScanProjectsCommandTest, and two ShowTest cases (badge/button present + makePrimary toggle end-to-end). Full suite green (739 passed, 2 pre-existing skips), pint clean. #128 left env-inferred per spec.

    agent · flower-130-primary-branch
  7. participant joined 2d ago
    system · flower-130-primary-branch
  8. dispatched 2d ago

    Dispatch request #48 queued for flower.

    agent · flower-orchestrator
  9. status change 2d ago
    agent · flower-orchestrator
  10. participant joined 2d ago
    system · flower-orchestrator
  11. link added 2d ago
    agent · flower-refine
  12. link added 2d ago
    agent · flower-refine
  13. status change 2d ago
    agent · flower-refine
  14. plan proposed 2d ago

    ## Ask Give each project an explicit, operator-settable **primary (deployed/canonical) checkout** — and therefore a **primary branch** — instead of inferring it from whatever happens to be checked out. Surface and control it on the `/projects/{slug}` checkouts/worktrees card. ## Motivation The primary branch varies per project (master / main / something else) and is currently env-inferred. Several features want a definitive "what is the primary/deployed branch + checkout": e.g. **#128** (commits-since-ping), "what's deployed" indicators, and merge-target awareness. Make it explicit + operator-controllable. ## Scope ### Data - Designate exactly **one primary checkout/worktree** per project — `is_primary` on the worktree/checkout row (or `projects.primary_worktree_id`); the **primary branch** derives from that checkout's current branch. (Optionally also persist a `projects.primary_branch` string fallback for projects with no live checkout.) - **Default on discovery/import:** the checkout at the project `root_path` (the MAIN/served env), else inferred from worktrees (the non-feature / root checkout); final fallback = the branch checked out at first-found. - Enforce a single primary per project (switching moves the designation). ### UI — `/projects/{slug}` checkouts/worktrees card (operator's ask) - Show a **"primary" badge/indicator** on the current primary checkout. - Add a **"Make primary" button** on each non-primary checkout to switch the designation (badge moves; optional FluxUI confirm on switch). - bloom + Flux where it fits. ### Consumers / API - Expose `Project::primaryCheckout()` / `primaryBranch()` for features to consume. - **#128** (commits-since-ping) can later prefer the configured primary branch over env-inference (coordinate; #128 v1 intentionally stays env-inferred, so this is an enhancement, not a blocker). ## Acceptance - Each project resolves a primary checkout + primary branch, sensibly defaulted on import; exactly one primary enforced. - `/projects/{slug}` checkouts card shows the primary indicator + a working "Make primary" toggle. - `php artisan test` green + pint. `Brief: #130` trailer. ## Provenance Operator (2026-07-03), surfaced alongside #128 (which env-infers the branch for now). UI direction (primary badge + "Make primary" on the checkouts card) per operator. Speced by flower-refine. Related: #128.

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

    Operator (2026-07-03), surfaced alongside #128 (which env-infers the branch for now). Give each project an explicit, operator-settable PRIMARY (deployed/canonical) checkout → primary branch, instead of env-inferring it. UI (operator's ask): on the /projects/{slug} checkouts/worktrees card, show a 'primary' badge/indicator + a 'Make primary' button to switch designation. Default from the root/import checkout. Consumers: #128 commits digest + 'what's deployed' indicators + merge-target awareness. Full spec via brief_update_spec. Related: #128.

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

epic · dependencies

Relationships

epic parent

depends on

No dependencies — dispatchable once planned.

agents · waves

Participants

  • flower-refine participant · active
  • flower-orchestrator participant · active
  • flower-130-primary-branch participant · active
  • system:commit-trailer participant · active

trace · graph

Links

  • Commit #1716 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.