feat: reconcile externally managed channels - #126
Conversation
|
Codex review: found issues before merge. Reviewed August 2, 2026, 3:13 AM ET / 07:13 UTC. ClawSweeper reviewWhat this changesThis branch adds an idempotent API that maps a workspace, external-provider, and external-reference identity to one durable managed channel across SQLite, PostgreSQL, HTTP, OpenAPI, and the TypeScript SDK. Merge readiness⛔ Blocked by patch quality or review findings - 8 items remain This PR is still necessary for the requested provider-identity reconciliation capability, but it is not merge-ready. The two previously reported permanent name-collision defects remain at the unchanged head, and the branch has concrete conflicts with current Priority: P2 Review scores
Verification
How this fits togetherExternal integrations provision ClickClack workspace channels through the HTTP API, while SQLite and PostgreSQL persist the channel and its durable events. The proposed reconciliation endpoint would make one provider-owned external work item converge on one channel and return its create, update, or unchanged result to SDK and realtime clients. flowchart LR
A[External integration] --> B[Managed-channel reconcile API]
B --> C[Scope and workspace authorization]
C --> D[Provider identity lookup]
D --> E[SQLite or PostgreSQL transaction]
E --> F[Channel record and durable event]
F --> G[SDK and realtime clients]
Decision needed
Why: The patch is not a repair of an established contract: it creates a new public endpoint and immutable stored identity with upgrade and compatibility obligations. Source review cannot determine whether that product boundary is intended. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current Do we have a high-confidence way to reproduce the issue? Yes for the review defect: create an unrelated channel with the requested slug, then reconcile a new provider identity using that name; source shows both backends retry the permanent uniqueness failure five times instead of returning it. The broader requested capability is a feature, not an existing bug report. Is this the best way to solve the issue? No: the current branch needs a rebase for the current channel model and must distinguish retryable identity races from permanent name conflicts; core adoption also requires maintainer product sponsorship. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b8293987baa5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (24 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The actionable TypeScript optionality mismatch is fixed at exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing after maintainer review because this branch no longer matches the repository's current channel display-title schema and migration sequence. Its naming contract is now stale, and collision retries eventually surface as a generic concurrency error instead of a stable user-facing uniqueness contract. This needs one reconciled public naming API, not a second compatibility path layered over the current display-title work. The product decision remains tracked in #125; a successor should start from current |
Closes #125
What Problem This Solves
External integrations cannot safely ensure that one durable ClickClack channel
exists for one external work item. Retried webhooks or concurrent workers can
create duplicates, while later lifecycle changes have no stable provider
identity to target.
Why This Change Was Made
This adds full desired-state reconciliation by immutable
(workspace, external_provider, external_ref)identity across SQLite andPostgres, with matching HTTP, OpenAPI, and TypeScript SDK support. Exact replays
return the existing channel without another durable event; changed state emits
one normal channel update. Provider adapters, credentials, and external
workflow authority remain outside ClickClack core.
This is the first infrastructure step toward the project goal: an integration
can keep one dedicated ClickClack channel per work item—such as a pull
request—synchronized while ClickClack owns the durable collaboration record.
User Impact
Bots and integrations with
channels:writecan now create, update, archive,and reopen one managed channel idempotently. Concurrent requests converge on
one channel, provider namespaces remain isolated, and ordinary channel PATCH
requests cannot detach or retarget reconciled identity.
Evidence
Exact proof head:
5c0f2629aa623884d22225229138bcb29ee946b0pnpm checkpasses: Go, web, SDK, desktop, FakeCo, builds, typechecks, lint,and formatting.
defaulted-but-optional request fields remain optional. Compile-time contract
assertions cover channel creation, message creation, and managed-channel
reconciliation.
httptestserver with a migrated temporarySQLite database—no mocked store—and covers create/replay/update/defaulting,
archive/reopen, immutable identity, bot scope, and workspace binding.
real local PostgreSQL 17 server.
migration in each dialect, insert a legacy managed channel, run the current
migrator, verify the legacy row is preserved without a provider, and verify a
namespaced reconciliation creates its own identity.
correctness issues.
Redacted command transcript:
The earlier proof narrative remains available in
docs/proof/managed-channel-reconciliation-proof.md.