Skip to content

feat(task-board): task-based flow behind taskBasedFlow flag - #5938

Open
guitavano wants to merge 5 commits into
mainfrom
guitavano/task-based-branch-ui
Open

feat(task-board): task-based flow behind taskBasedFlow flag#5938
guitavano wants to merge 5 commits into
mainfrom
guitavano/task-based-branch-ui

Conversation

@guitavano

@guitavano guitavano commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Operate a repo-bound site entirely in terms of Tasks, hiding Git (branches, PRs, sync). All gated behind the org flag taskBasedFlow (off by default), toggleable in Settings → Organization → Experimental.

Web

  • Task pill replaces the branch picker in the workspace header, with the task board as source of truth: names the current task, filters by column (Backlog / A Fazer / … / Concluído, defaulting to the current task's column), switches tasks, and creates new ones. Only renders for repo-bound agents.
  • New-task dialog (describe → agent runs it, or edit manually → fresh CMS branch). Each task gets its own branch (generateBranchName); "edit manually" opens a fresh branch straight in the CMS (chat closed, ?cms=1 auto-opens the editor).
  • Hides Git surfaces under the flag: branch picker, "Sincronizar", open-in-board button.
  • Repo selector in the task dialog's Properties.

API

  • task_board_items gains repo_owner/repo_name (migration 169) so a task is scoped to its site; threaded through storage, create/update tools, and schemas.
  • Review lifecycle fix: repo-backed tasks advance to In Review only via the PR-open hook, never on thread-finish (In Review with no PR is the wrong state). Keyed on the task's repoOwner, since CMS threads carry no repo metadata of their own.
  • TASK_BOARD_ITEM_UPDATE gains linkPr (mirrors linkThreadId) so the CMS submit-for-review flow — which opens PRs outside an agent run — links the PR and advances the task to In Review.

Testing

  • Unit: review-advance gate (repo-backed / repo-named vs repo-less), repo helpers. All green.
  • Real-Postgres (CI): repo round-trip through create/update, repo-named no-advance-on-finish, PR link + advance (idempotent).
  • bun run fmt clean; tsc clean in apps/api, apps/web, packages/shared; lint clean on touched files.

Notes / follow-ups

  • packages/shared/src/tools/tool-io.ts was hand-patched (the contract generator is degraded in this dev env). Re-run bun run --cwd=apps/api generate:tool-contracts in a full env to confirm output matches.
  • linkPr on TASK_BOARD_ITEM_UPDATE mirrors the existing linkThreadId; open to moving it to a dedicated un-gated TASK_BOARD_ITEM_PR_LINK if preferred (discussed).
  • Two pre-existing tasks created before the branch-isolation fix share a branch (data, not code).

🤖 Generated with Claude Code


Summary by cubic

Task-based flow behind the taskBasedFlow org flag: the workspace operates in Tasks (not branches), each task gets its own branch and optional repo scope, and the CMS submit-for-review path links the PR and moves the task to In Review. All Git surfaces stay hidden under the flag.

  • Adds taskBasedFlow toggle in Settings → Organization → Experimental.

  • Replaces the branch picker with a task pill for repo-bound agents: shows the current task, filters by column, switches tasks, and creates new tasks via prompt (agent run) or manual edit (fresh CMS branch; chat closed; ?cms=1 opens the editor). Each task starts on a fresh branch.

  • Hides Git surfaces under the flag (branch picker, Sync, open-in-board).

  • Task dialog includes a repo selector; tasks store a single repo slug (owner/name) for scoping.

  • TASK_BOARD_ITEM_UPDATE accepts linkPr to associate a PR and set status to In Review; the publish dialog calls this when it opens a PR (idempotent).

  • Migration

    • DB: add repo (owner/name) to task_board_items (migration 170).
    • Regenerate tool contracts if needed: run bun run --cwd=apps/api generate:tool-contracts.
    • Flag is off by default; enable per org.

Written for commit c12fafc. Summary will update on new commits.

Review in cubic

guitavano and others added 4 commits August 11, 2026 19:49
Operate a repo-bound site entirely in terms of Tasks, hiding Git
(branches/PRs/sync). All gated behind the org flag `taskBasedFlow`
(off by default), toggleable in Settings → Organization → Experimental.

Web
- Task pill replaces the branch picker in the workspace header, with the
  task board as source of truth: names the current task, filters by
  column, switches tasks, and creates new ones (describe → agent, or
  edit manually → fresh CMS branch). Each task gets its own branch.
- New-task dialog (describe / edit manually); manual edit opens a fresh
  branch straight in the CMS (chat closed, `?cms=1` auto-opens the editor).
- Hides Git surfaces under the flag: branch picker, Sync, open-in-board.
- Repo selector in the task dialog properties.

API
- `task_board_items` gains `repo_owner`/`repo_name` (migration 169) so a
  task is scoped to its site; threaded through storage, create/update
  tools, schemas.
- Repo-backed tasks advance to In Review only via the PR-open hook, never
  on thread-finish (In Review with no PR is the wrong state) — keyed on
  the task's `repoOwner` (CMS threads carry no repo metadata).
- `TASK_BOARD_ITEM_UPDATE` gains `linkPr` (mirrors `linkThreadId`) so the
  CMS submit-for-review flow — which opens PRs outside a run — links the
  PR and advances the task to In Review.

Tests: unit for the review-advance gate + repo helpers; real-Postgres for
repo round-trip, repo-named no-advance-on-finish, and PR link+advance.

Note: `tool-io.ts` was hand-patched (contract generator is degraded in
this env) — re-run `generate:tool-contracts` in a full env to confirm.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Conflicts resolved:
- migrations: renumbered task-board-item-repo 169 → 170 (main added its own
  169-task-board-merge-failed-activity); both registered.
- shouldAdvanceToReview (semantic): main kept the thread-finish backstop that
  advances agent-run tasks to In Review (so a missed PR-open detection doesn't
  strand them In Progress). Reconciled: only `repoOwner`-named (CMS/site) tasks
  are held back from advancing on finish — the CMS flow opens the PR and
  advances the card itself, and a finished CMS edit may have no PR. Agent-run
  tasks keep main's backstop. Dropped the earlier `hasPreview` gate (which
  would have removed the backstop for Super Agent tasks) and its tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sync after #5970 merged (repo-as-task-property + selector). Reconciled to
main's convention:
- Task's repo scope is a single `repo` column ("owner/name"), not the
  repoOwner/repoName pair — adopted main's version everywhere, incl. the task
  pill (filter + create now use the `owner/name` slug).
- Kept #5938's `linkPr` on TASK_BOARD_ITEM_UPDATE (CMS submit-for-review) —
  its repoOwner/repoName is the PR's identity (task_board_item_prs), untouched
  by the `repo` change.
- Dropped the orphaned shouldAdvanceToReview repo-gate tests: main's merge of
  #5970 did NOT include the review-gate change, so #5938 no longer carries it
  (see PR note — needs a decision).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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