Skip to content

app: the engine keeps only the generic pieces of the Workstreams plan (schema 7) - #2336

Merged
AbirAbbas merged 5 commits into
workstreams/mainfrom
workstreams/e2-strip
Nov 3, 2026
Merged

AbirAbbas merged 5 commits into
workstreams/mainfrom
workstreams/e2-strip

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Workstreams move into the app (the Workstreams plan, E2). The engine keeps only the generic pieces it gained on this branch and drops everything that existed only for workstreams:

  • Removed: internal/workstream/** (store, page renderer), cmd/codeaf/appworkstreams*.go (wire handlers, agent door, sources, morning-wake scheduler, the WorkstreamJobEvent hook), internal/appwire/workstreams*.go and the workstreams / workstream_sources hello features, internal/session/workstream_*.go and the agent's built-in workstream tools and prompt section, the conformance fixtures, the workstream-wake replay purpose and spend-owner row, the old launch-cleanup hook (v3WorkstreamKeeps), and the agent door that Fresh/Open copied from the launch config (removing the field removes that bug). 139 files.
  • Kept (generic): collections hold Factory jobs (factory_job refs, --factory, resolved targets; the resolver moves to cmd/codeaf/appcollections_factory.go under generic names, with its own tests), client tools (Client tools: a client attaches tools to a conversation; collection-held conversations are kept #2334), collection-held conversations survive cleanup and reopen after a restart (Client tools: a client attaches tools to a conversation; collection-held conversations are kept #2334), the cmd/codeaf 25-minute CI timeout and this branch's CI triggers.
  • Data: schema 7. The store writes user_version = 7: collections and memberships in the generic shape, nothing else. Versions 1–7 are read as they stand; the first write migrates inside its own transaction. 1/2 are copied into the generic tables; 3–6 (development builds only) lose their 12 extra tables, 10 indexes and 4 triggers while every collection, membership and ref stays; a former workstream becomes a plain, deletable collection. A failed first write leaves the file as it was; 8+ and foreign files are refused unmodified.
  • Docs: protocol and collections manual keep factory_job and client tools; the 13 unreleased workstream and client-tools entries become one added entry.

Validation contract

Item Covered by
(a) no workstream symbol, method, tool, feature or table remains git grep -n -i workstream -- . ':!internal/head/toolbelt.go' → only the two workstreams/main CI trigger lines, the legacy cleanup statement in internal/workspace/schema7.go, and the frozen schema-6 fixture SQL in schema7_test.go (internal/head/toolbelt.go is older code using the English word)
(b) generic pieces still work both collections_factory_job_test.go, appcollections_factory_test.go (batching, cache, nesting, fallback bounds, target states, panic waiters), the client-tools and collection-keep suites from #2334, schema3_test.go generic rebuild tests
(c) schema 7 migrates version-6 and version-2 files keeping every collection, membership and ref; idempotent schema7_test.go: realistic v6 file (every legacy table populated, nested collections, same job in two collections, sequence gaps) read-before-write unchanged, first write → 7 with rows/seq/times/factory/high-water marks kept and legacy objects gone, second write runs no DDL; v2 file; v3–5 shapes; failed first write rolls back; v8 and foreign id refused
(d) only baseline reds run 41736774861: touched codeaf and touched rest (workspace, appwire, codeaf-replay) green; session and light gate red only on TestALandStartsNoAutomaticMaintenance, the two TestNoRoad… complexity laws, TestProgramHoldClassifiesEveryRegisteredChatTool, the fixed/lean prefix budgets (same byte counts as app/v3), and the flaky TestRenderAdmissionIsBoundedAndReleasedOnSettle; codeaf's TestRecipeDoorWritesTheWorktreeWhenOnlyTheCheckoutIsHeld is marked already failing on the base. A fresh app/v3 Full check (run 41735053886) fails the same six plus TestRetireWaitsForTheSaveOfTheHostItAskedToGo
(e) diff against app/v3 shrinks to the generic pieces three-dot diff against app/v3: before 192 files, +32,820 / −304; after 51 files, +4,602 / −290 (client tools and their tests are about 2.9k of that)

Compatibility

app/v3 refuses a version-7 file, as it refuses 3–6 today: its gate accepts only 1 and 2, its ON CONFLICT(collection_id,kind,ref_id,session_id) does not match the five-column UNIQUE, its duplicate copies memberships without factory, and it does not know the factory_job kind. Version 7 support therefore needs the Factory-ref code itself and goes in when this branch merges into app/v3.

Known flake, not from this branch

TestKnowledgeCapturesSavedTurnsOnlyAfterOptIn (seen failing on #2334): a race in base code. StartBuild enables the memory setting before the transaction that commits created_at; in that window consent reads "enabled since epoch", so a queued journal wake can admit the pre-opt-in turn (4 sources instead of 2). No file on this branch touches that path; the fix belongs with the knowledge owners.

🤖 Generated with Claude Code

AbirAbbas and others added 5 commits November 3, 2026 17:55
…ps development tables

The collections store now writes schema 7: collections and memberships in the
generic shape (factory_job refs with their factory, five-column UNIQUE), and
nothing else. Versions 1-7 are read as they stand; the first write migrates
inside its own transaction. Schemas 1 and 2 are copied into the generic
tables; schemas 3-6, written only by development builds, lose their extra
tables, indexes and triggers while every collection, membership and ref
stays. A failed first write leaves the file as it was; 8+ is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workstreams move into the app, so the engine drops everything that existed
only for them: the workstream store and page renderer, the wire methods and
hello features, the agent's built-in tools and prompt section, the morning
wake scheduler and its replay purpose, the conformance fixtures, and the old
launch-cleanup hook. Removing the agent door also removes the copy of it that
Fresh and Open carried.

What stays is generic: collections hold Factory jobs (the resolver moves to
appcollections_factory.go under generic names, with its own tests), client
tools, and collection-held conversations that survive cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eam entries go

The protocol and the collections manual lose the workstream methods, events,
features and schemas, and keep the factory_job and client-tools sections. The
unreleased workstream entries described features that will not ship from the
engine; one entry for the generic pieces replaces them and the client-tools
entry. The CI-timeout entry no longer mentions the deleted conformance case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kept conversations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as added

The first version reused the client-tools entry's wording, so git paired the
two files as a rename and the change-entry gate found no added entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit fe68c7d into workstreams/main Nov 3, 2026
4 of 8 checks passed
@AbirAbbas
AbirAbbas deleted the workstreams/e2-strip branch November 3, 2026 23:47
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