Skip to content

chore: migrate cloudflare-docs-bot to Flue 2.0#32226

Draft
mvvmm wants to merge 2 commits into
productionfrom
flue/2.0-migration
Draft

chore: migrate cloudflare-docs-bot to Flue 2.0#32226
mvvmm wants to merge 2 commits into
productionfrom
flue/2.0-migration

Conversation

@mvvmm

@mvvmm mvvmm commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the .flue/ PR-review bot (cloudflare-docs-flue) from Flue 0.11 to Flue 2.0.

Flue 2.0 replaces the 0.11 "workflow-per-Durable-Object + internal HTTP routing" model with Cloudflare WorkflowEntrypoints that drive per-agent Durable Objects. Trusted TypeScript owns all control flow and every GitHub/R2 side effect; each AI step is a Flue agent that only reasons and returns structured data through a single Valibot-typed submit_* tool.

Behavior is preserved — the same code review / conventions / style-guide sections in one PR comment, the spam gate, the Dependabot path, the /rebase command, codeowner slash commands, and log/comment review modes.

Key changes:

  • Ingress — one HMAC-verified POST /webhooks/github; pure, unit-tested classifyWebhook + startReviewPipeline. No internal HTTP routes or internal-auth.
  • WorkflowsReviewOrchestrator, IngestWorkflow (spam gate), DependabotReviewWorkflow, RebaseWorkflow.
  • Agents (7)code-review-file, style-guide-file, conventions-reviewer, reconcile-reviewer, spam-filter, dependabot-reviewer, rebase-conflict-resolver; per-file fan-out is one Durable Object instance per changed file.
  • Build — now vite build / vite dev (@flue/cli 2.0 dropped build/dev); wrangler.jsonc gains a v10 DO migration that creates the 7 SQLite agent classes.
  • Roles — re-homed via an explicit useBotRole() hook, since 2.0 has no role auto-discovery.
  • Removes the 0.11 workflows/ and superseded lib/ modules.

Validated locally: tsc (0 errors), vite build, wrangler deploy --dry-run, and the Vitest suite all pass; the full INGEST spam-gate → review pipeline was exercised end to end in log mode. Not yet deployed — the first deploy applies the v10 Durable Object migration.

Rework the .flue/ PR-review bot (cloudflare-docs-flue) from Flue 0.11 to
Flue 2.0. The 0.11 "workflow-per-Durable-Object + internal HTTP routing"
model is replaced by Cloudflare WorkflowEntrypoints that drive per-agent
Durable Objects. Trusted TypeScript owns all control flow and every
GitHub/R2 side effect; each AI step is a Flue agent that only reasons and
returns structured data through a single Valibot-typed submit_* tool.

Behavior is preserved: the same code review / conventions / style-guide
sections in one PR comment, the spam gate, the Dependabot path, the
/rebase command, codeowner slash commands, and log/comment review modes.

- Ingress: one HMAC-verified POST /webhooks/github; pure, unit-tested
  classifyWebhook + startReviewPipeline. No internal HTTP routes.
- Workflows: ReviewOrchestrator, IngestWorkflow (spam gate),
  DependabotReviewWorkflow, RebaseWorkflow.
- Agents (7): code-review-file, style-guide-file, conventions-reviewer,
  reconcile-reviewer, spam-filter, dependabot-reviewer,
  rebase-conflict-resolver. Per-file fan-out is one DO instance per file.
- Build moves to Vite (vite build / vite dev); @flue/cli 2.0 dropped
  build/dev. wrangler.jsonc gains a v10 DO migration (7 SQLite agent
  classes).
- Roles are re-homed via an explicit useBotRole() hook (2.0 has no role
  auto-discovery).
- Removes the 0.11 workflows/ and superseded lib/ modules.

Validated locally: tsc (0 errors), vite build, wrangler deploy --dry-run,
and the Vitest suite all pass; the INGEST spam-gate to review pipeline was
exercised end to end in log mode.
@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
* @cloudflare/product-owners
*.ts @cloudflare/content-engineering, @kodster28
package.json @cloudflare/content-engineering

Clean up leftovers from the Flue 2.0 migration's deleted shell sandbox.
No agent uses a shell sandbox anymore, so these are dead:

- Drop @cloudflare/shell and @cloudflare/codemode dependencies (imported
  nowhere in the code, the generated entry, or @flue). pnpm prunes 32
  packages.
- Remove the unused worker_loaders/LOADER binding from wrangler.jsonc
  (no env.LOADER reference in code).
- Drop the LOADER bullet from .flue/AGENTS.md.

Re-validated: tsc (0 errors), vite build, wrangler deploy --dry-run
(13 bindings, no LOADER, v10 migration intact), and the Vitest suite
(141 tests) all pass.
@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants