Skip to content

app: workstream pages read by version, restorable delete, Spec/Decisions read by jobs - #2290

Merged
AbirAbbas merged 4 commits into
workstreams/mainfrom
workstreams/wpf1-pages
Nov 3, 2026
Merged

AbirAbbas merged 4 commits into
workstreams/mainfrom
workstreams/wpf1-pages

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Page follow-ups from the Workstreams plan (WP-F1), engine side of the wire contract's v0.1 page additions:

  • page.get with version: reads a saved version, read only. Title, doc, version and attribution are that version's; other fields are the page's current ones; markdown renders that version's doc. The current version reads the same as no version. A version the page never had is not_found; version 0 is bad_params.
  • Restorable delete: page.delete marks the page and its live subtree deleted (one delete) instead of destroying rows. Deleted pages leave page.list's pages; include_deleted: true adds deleted (each delete root, newest first, with deleted_at). page.get still reads them; other writes and page.history answer not_found. page.restore with only id brings a deleted page back with its last title, doc and version plus the pages that same delete removed under it, placed last under its live old parent or at the root. Version restore of a live page is unchanged (both version and base_version); other combinations are bad_params.
  • Read by jobs default: page.create without read_by_jobs turns it on for a title of Spec or Decisions (trimmed, any case), off otherwise. Applied in the wire handler; workstream.PageCreate is unchanged.
  • Storage: schema 3 has not shipped (it exists only on this integration branch), so workstream_pages gains deleted_at and the deleting page's id in place, with no migration. A collections.db written by an earlier build of this branch must be removed.

Validation contract

  • (a) version reads: internal/workstream/pages_test.go, cmd/codeaf/appworkstreams_pages_test.go
  • (b) deleted pages listed and restored with their last doc: same files, plus the updated TestPartAPageTreePlacementCyclesAndDelete
  • (c) Spec/Decisions default on, others off, explicit wins: cmd/codeaf/appworkstreams_pages_test.go, internal/workstream/pages_test.go
  • (g) conformance covers the new params: testdata regenerated from the contract; appworkstreams_conformance_test.go prepares the three new example pairs and the new error doors

Left / follow-ups

  • The agent's own page creation (in flight separately) should use workstream.ReadByJobsDefault when it leaves read_by_jobs unset.
  • Factory's plan step must skip deleted pages when it reads pages for jobs (Factory owner).

CI

Red only on baseline failures, all also red on workstreams/main's own push run for 1870bce:

  • light gate: the complexity laws ratchet in internal/session (TestNoRoadInTheTaskEngineHasMoreEndingsThanItsLedgerRow, TestNoRoadInTheMemoryEngineHasMoreEndingsThanTheCeiling).
  • touched codeaf: TestAppChatRowsR2SavedTurnTime, TestAppChatStartupR3QuietRelease, TestRecipeDoorWritesTheWorktreeWhenOnlyTheCheckoutIsHeld, and the package-level 15-minute timeout (cmd/codeaf now runs at or past 900 s on the integration branch too). The new workstream tests in cmd/codeaf run before the timeout point and report no failure.
  • touched rest (internal/appwire, internal/workspace, internal/workstream): pass.

Contract

Contract change (additive, v0.1): page.get.version, page.list.include_deleted / deleted, deleted_at on page nodes and pages, page.restore version/base_version now optional (only id restores a deleted page), the read_by_jobs creation default.

🤖 Generated with Claude Code

AbirAbbas and others added 4 commits November 3, 2026 02:32
Schema 3 (unreleased) gains deleted_at and the delete that removed each page.
Delete marks a subtree; restore brings back what that delete removed, placed
last under a live parent or at the root. A page reads any saved version.
Read-by-jobs defaults on for pages titled Spec or Decisions at creation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a deleted page

The wire handlers serve the wire contract's v0.1 page additions and apply the
Spec/Decisions read-by-jobs default when page.create leaves it unset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas force-pushed the workstreams/wpf1-pages branch from 1cbc814 to 1bcd3fe Compare November 3, 2026 07:32
@AbirAbbas
AbirAbbas merged commit dd749e1 into workstreams/main Nov 3, 2026
3 of 7 checks passed
@AbirAbbas
AbirAbbas deleted the workstreams/wpf1-pages branch November 3, 2026 07:50
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