Skip to content

app: workstream wire contract v0 (types, handlers, not-yet stubs) - #2263

Merged
AbirAbbas merged 3 commits into
workstreams/mainfrom
workstreams/wp0-contracts
Nov 3, 2026
Merged

AbirAbbas merged 3 commits into
workstreams/mainfrom
workstreams/wp0-contracts

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

The Workstreams plan, WP-0: the v0 wire contract for workstreams, so the engine store (WP-1) and the desktop app's bridge (WP-2) can be built in parallel against it.

  • internal/appwire/workstreams.go: Go request/result types for 25 methods (workstream.list/get/create/update/mark_done/reopen/plan_get/plan_set, page.list/get/save/create/update/move/delete/history/restore, record.list/propose/keep/drop/supersede, goahead.list/grant/revoke) and the workstream.changed event, each method registered through typed(...) and delegating to an optional Workstreamer interface. New error codes in_other_workstream (detail WorkstreamTaken) and version_conflict (detail WorkstreamVersionConflict).
  • Hello carries the workstreams feature only when the engine implements Workstreamer and ServesWorkstreams() is true.
  • cmd/codeaf/appworkstreams.go: appBackend implements every method with a stub answering unknown_method workstreams: not implemented yet; ServesWorkstreams() is false, so this build never announces the feature. WP-1 fills these in.
  • docs/design/app-v3/PROTOCOL.md: index sections for the four method groups, the event row, and a short "Workstreams (v0 proposal)" section.
  • Shared files: internal/appwire/server.go gains exactly one line (withWorkstreamsFeature); the event shape and methods register in workstreams.go's init().

The contract is a proposal until it is reviewed on 2026-11-03.

Validation contract

Item Test
A documented method the engine does not register fails a test TestEveryWorkstreamMethodIsRegistered (every WorkstreamMethods name is served, no extra workstream./page./record./goahead. method, event present) and the existing TestTheProtocolDocumentNamesEveryMethodAndEvent
Every method answers the not-yet error and hello does not claim the feature TestWorkstreamMethodsAnswerNotYet (over the wire), TestAppWorkstreamsAreNotYetServed (the real appBackend)
The feature follows the engine; an engine without workstreams answers unknown_method TestWorkstreamsFeatureFollowsTheEngine
The schema names every method and the stage enum TestWorkstreamSchemaNamesEveryMethod
No shared file gets more than its one line git diff --stat: server.go +1; collections.go, events.go, app.go untouched

Stubbed or left

  • Bounds checks, the store (collections.db v3), factory_job ref kind with factory, one-workstream-per-job, events and the feature switch: WP-1.
  • Nothing under internal/factory/** or cmd/codeaf/appfactory*.go is touched; what workstreams need from the Factory is listed as asks for its owner.

Contract changes

None: this PR is the contract.

🤖 Generated with Claude Code

AbirAbbas and others added 3 commits November 2, 2026 20:01
The Workstreams plan, WP-0: the 25 workstream, page, record and goahead
methods and the workstream.changed event, registered through typed() and
delegating to an optional Workstreamer. Hello carries the workstreams
feature only when the engine says it serves them, so a build without the
store never announces it. PROTOCOL.md indexes every method and the event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
appBackend implements Workstreamer with stubs that answer unknown_method
"workstreams: not implemented yet" and does not serve workstreams, so
the feature stays off until the store lands (WP-1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas

Copy link
Copy Markdown
Collaborator Author

CI note: every red check is a baseline failure, also red on workstreams/main's own runs before this change:

  • light gate, "The laws hold": TestNoRoadInTheTaskEngineHasMoreEndingsThanItsLedgerRow, TestNoRoadInTheMemoryEngineHasMoreEndingsThanTheCeiling (internal/session), identical in the integration branch's PR gate push run 41553209884.
  • touched codeaf: TestAppChatRowsR2SavedTurnTime, TestAppChatStartupR3QuietRelease ("directory: not found") and TestRecipeDoorWritesTheWorktreeWhenOnlyTheCheckoutIsHeld, identical in the integration branch's Full check run 41553216200 (full tests).

The packages this PR adds tests to pass: internal/appwire ok; cmd/codeaf fails only on the three above.

@AbirAbbas
AbirAbbas merged commit c767483 into workstreams/main Nov 3, 2026
5 of 11 checks passed
@AbirAbbas
AbirAbbas deleted the workstreams/wp0-contracts branch November 3, 2026 01:23
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