Skip to content

Phase 1: scaffold packages/symphony#1

Merged
Ddell12 merged 1 commit intodevfrom
phase-1-scaffold
Apr 30, 2026
Merged

Phase 1: scaffold packages/symphony#1
Ddell12 merged 1 commit intodevfrom
phase-1-scaffold

Conversation

@Ddell12
Copy link
Copy Markdown
Owner

@Ddell12 Ddell12 commented Apr 30, 2026

Phase 1 of the archon-symphony consolidation, per docs/superpowers/plans/2026-04-30-archon-symphony-consolidation.md in Ddell12/symphoney-codex.

Summary

Empty-but-buildable @archon/symphony workspace package + the DB schema Phase 2's orchestrator will need. No runtime behavior yet.

  • packages/symphony/{package.json,tsconfig.json,src/index.ts} — new workspace package (mirrors packages/git). Deps: @archon/core, @archon/paths.
  • migrations/022_symphony_dispatches.sql — PostgreSQL migration. UUID FKs to remote_agent_codebases and remote_agent_workflow_runs. Indexes on (tracker, issue_id), identifier, workflow_run_id, codebase_id. dispatch_key UNIQUE so the same raw issue id from two trackers (Linear + GitHub) cannot collide.
  • migrations/000_combined.sql — table appended to the fresh-Postgres bootstrap snapshot.
  • packages/core/src/db/adapters/sqlite.ts — SQLite-equivalent symphony_dispatches + indexes added to createSchema(). TEXT IDs / datetime('now') per SQLite convention.
  • packages/symphony/src/db/dispatches.ts — typed CRUD. Functions accept IDatabase explicitly so tests pass a fresh SqliteAdapter against a temp file (Phase 2 will switch call sites to the pool singleton).
  • packages/symphony/src/db/dispatches.test.ts — 8 round-trip tests against real SQLite: insert/get, dispatch_key UNIQUE, multi-tracker non-collision, updateStatus mutation, attachWorkflowRun idempotency / conflict rejection / missing-id error.

Verification

```
bun install && bun run validate

check:bundled && type-check && lint --max-warnings 0 && format:check && test

```

All 11 packages green. `@archon/symphony` contributes 8 passing tests. No regressions in `@archon/core`'s SQLite adapter tests.

Out of scope (Phase 2+)

  • Tracker / orchestrator / dispatch loop port from symphoney-codex.
  • `~/.archon/symphony.yaml` config schema.
  • Workflow-bridge dispatcher (Phase 3) → connects `dispatch_key` rows to `remote_agent_workflow_runs.id`.
  • `/symphony` page in `@archon/web` (Phase 4).

Draft

Marked draft until the Phase 2 work lands and we can validate the schema against real orchestrator code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced dispatch tracking system to record per-attempt dispatches for tracker issues (Linear/GitHub) linked to workflow runs
    • Added support for tracking dispatch status (pending, running, completed, failed, cancelled), retry attempts, and error information
    • Enabled workflow run attachment and status management for dispatch records
  • Tests

    • Added comprehensive test coverage for dispatch persistence, retrieval, updates, and constraint validation

Phase 1 of the archon-symphony consolidation
(see Ddell12/symphoney-codex docs/superpowers/plans/2026-04-30-archon-symphony-consolidation.md).

Adds an empty-but-buildable @archon/symphony workspace package and the
DB schema needed for Phase 2's orchestrator port. No runtime behavior
yet — Phase 2 will land the tracker + orchestrator + dispatch loop.

What's in this commit:

* packages/symphony/{package.json,tsconfig.json,src/index.ts} — new
  workspace package mirroring packages/git's shape. Deps: @archon/core,
  @archon/paths.

* migrations/022_symphony_dispatches.sql — PostgreSQL migration adding
  symphony_dispatches table. UUID FKs to remote_agent_codebases and
  remote_agent_workflow_runs. Indexes on (tracker, issue_id), identifier,
  workflow_run_id, codebase_id. dispatch_key UNIQUE so the same raw issue
  id from two trackers (e.g. Linear + GitHub) cannot collide.

* migrations/000_combined.sql — append symphony_dispatches table to the
  fresh-postgres bootstrap snapshot.

* packages/core/src/db/adapters/sqlite.ts — add SQLite-equivalent
  symphony_dispatches table + indexes inside createSchema(). Uses TEXT
  IDs / datetime('now') per existing SQLite convention.

* packages/symphony/src/db/dispatches.ts — typed CRUD: insertDispatch,
  getDispatchByDispatchKey, getDispatchById, updateStatus,
  attachWorkflowRun. Functions accept IDatabase explicitly so tests pass
  a fresh SqliteAdapter against a temp file (Phase 2 will switch to the
  pool singleton at call sites).

* packages/symphony/src/db/dispatches.test.ts — 8 round-trip tests
  against real SQLite: insert/get, dispatch_key UNIQUE, multi-tracker
  non-collision, updateStatus mutation, attachWorkflowRun idempotency,
  conflict rejection, and missing-id error path.

Verification:
  bun install && bun run validate
    (= check:bundled && type-check && lint --max-warnings 0 && format:check && test)
  All 11 packages green. New @archon/symphony package contributes 8
  passing tests. No regressions in @archon/core's SQLite adapter tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e305bd01-2dec-4026-840d-61f8a8a9b105

📥 Commits

Reviewing files that changed from the base of the PR and between 8295ece and 6bc4eea.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • migrations/000_combined.sql
  • migrations/022_symphony_dispatches.sql
  • packages/core/src/db/adapters/sqlite.ts
  • packages/symphony/package.json
  • packages/symphony/src/db/dispatches.test.ts
  • packages/symphony/src/db/dispatches.ts
  • packages/symphony/src/index.ts
  • packages/symphony/tsconfig.json

📝 Walkthrough

Walkthrough

A new symphony_dispatches database table is introduced to track dispatch attempts from Symphony tracker issues to Archon workflow runs, along with a new @archon/symphony package that provides typed CRUD operations, database schema definitions, and comprehensive test coverage for dispatch persistence, status updates, and workflow run attachment.

Changes

Cohort / File(s) Summary
Database Schema
migrations/000_combined.sql, migrations/022_symphony_dispatches.sql, packages/core/src/db/adapters/sqlite.ts
New symphony_dispatches table with dispatch_key uniqueness constraint, tracker CHECK (linear/github), and nullable ForeignKeys to codebases and workflow runs. Includes four indexes for efficient lookups by tracker+issue, identifier, workflow run, and codebase.
Symphony Package Setup
packages/symphony/package.json, packages/symphony/tsconfig.json, packages/symphony/src/index.ts
New ESM package @archon/symphony with exports for dispatch types and a secondary export for ./db/dispatches. TypeScript configuration with root inheritance and noEmit enabled.
Dispatch CRUD Layer
packages/symphony/src/db/dispatches.ts
Exports typed interfaces (DispatchRow, InsertDispatchInput, DispatchTracker, DispatchStatus) and database functions: insertDispatch, getDispatchByDispatchKey, getDispatchById, updateStatus, and attachWorkflowRun with conflict detection and logging.
Dispatch Tests
packages/symphony/src/db/dispatches.test.ts
Comprehensive Bun test suite validating dispatch insertion, retrieval, uniqueness constraints, status mutations, and workflow run attachment with idempotency and conflict-detection assertions. Includes per-test database setup and teardown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A dispatch hops through the database, swift and bright,
Tracking issues from linear and github in flight,
With workflow runs bundled and constraints held tight,
Symphony dispatches dance through the night!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch phase-1-scaffold

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

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