Skip to content

workstreams: size limits on plans, pages and records; agent Spec/Decisions pages read by jobs - #2310

Merged
AbirAbbas merged 5 commits into
workstreams/mainfrom
workstreams/minors
Nov 3, 2026
Merged

AbirAbbas merged 5 commits into
workstreams/mainfrom
workstreams/minors

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

Two follow-ups from the Workstreams stability review (the Workstreams plan, MINORS):

  • Read by jobs for agent pages. A page the workstream agent creates titled Spec or Decisions now gets Read by jobs on, the same default page.create applies (workstream.ReadByJobsDefault). Updates keep the flag. The agent manual says so.
  • Size limits (wire v0.2.1). Nothing bounded draft text, plan counts or a workstream's pages and records, so a large plan was stored whole and every list read materialized everything. The store now refuses, in its write transaction and before anything is written, with the existing too_large code and no workstream.changed event:
    • draft text over 80,000 bytes (any Factory job text fits);
    • a plan over 500 milestones, 500 waves, 5,000 items, or 4 MiB of encoded milestones and waves;
    • a 5,001st page in a workstream (deleted pages included) or a 5,001st record (every kind and state).
      workstream.plan_set's check refuses the counts and draft text early; control characters stay bad_params. A new workstream.ErrLimit names the bound; the agent receives that message. The conformance testdata is regenerated from the contract (too_large added to plan_set, record.propose, record.supersede).

Validation contract

item test
m1-a agent Spec / Decisions (any case, spaces) read by jobs; Notes not TestStabEm1AgentSpecAndDecisionsPagesAreReadByJobs
m1-b agent updates keep the flag same
M4-a/b draft text and plan counts/size: bound accepted, one past too_large, nothing stored, no event TestStabEM4PlanWireBoundsAreAtomic (real wire), TestStabEM4PlanLimitsAreAtomic (store)
M4-c page count incl. deleted refuses wire and agent creation TestStabEM4PageCountIncludesDeleted
M4-d record count refuses propose, supersede and agent proposals; old record untouched TestStabEM4RecordCountBounds
M4-e conformance error cases plan_too_large, records_too_large in TestAppWorkstreamWireConformance
M4-f early wire refusals; control characters stay bad_params TestStabEM4PlanBoundsBeforeDelegation, TestStabEM4DraftControlCharactersRemainInvalid

Contract change

Wire v0.2.1: size limits only, no shape change; too_large is now listed for workstream.plan_set, record.propose and record.supersede.

Left out

Bounding the shared wire reader's request size and paging page/record lists; with the write-time caps every list is bounded.

🤖 Generated with Claude Code

AbirAbbas and others added 5 commits November 3, 2026 06:03
Draft text was bounded only by its own length, plans had no count or
encoded-size bound, and a workstream could accumulate pages and records
without limit, so every list read materialized all of them. The store now
refuses, inside its write transaction and before anything is written:
draft text over 80,000 bytes; a plan over 500 milestones, 500 waves,
5,000 items or 4 MiB of encoded milestones and waves; a 5,001st page
(deleted pages included) or record. The new ErrLimit names the bound and
answers too_large on the wire; the plan_set check refuses the counts and
draft text early. The conformance testdata is regenerated from the
contract (too_large on plan_set, record.propose, record.supersede).

The agent manual states the limits and that new agent pages titled Spec
or Decisions are read by jobs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s page.create makes them

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ound; the manual separates the tool's draft limit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…efault

TestStabEm1AgentSpecAndDecisionsPagesAreReadByJobs: agent pages titled
Spec or Decisions (any case, surrounding space) are read by jobs, others
not; updates keep the flag. TestStabEM4*: plan bounds through the real
wire and the store, exact bounds accepted and one past refused with
too_large and no event; page and record counts (deleted pages included)
refuse wire and agent writes; plan_set and record.propose too_large
conformance cases; early wire refusals keep bad_params for control
characters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AbirAbbas

Copy link
Copy Markdown
Collaborator Author

CI: every red is a known baseline, also red on the integration branch's own run and app/v3: the laws ratchet in internal/session (light gate), TestAppChatRowsR2SavedTurnTime, TestAppChatStartupR3QuietRelease, TestRecipeDoorWritesTheWorktreeWhenOnlyTheCheckoutIsHeld (the gate reports it already failing on the base). The first run's two extra timing failures (TestAQuitAtTheMoveQuestionLeavesTheOtherWindowsChatSendable, TestM1M2M5M9M10AppPairRealHomes, temp-dir cleanup races) passed on the re-run; TestDoTimesOutWithALimitCode and TestL4HostedTakeBack…/auxiliary_usage were flaky and passed on retry. All new TestStab* tests and the conformance cases pass.

@AbirAbbas
AbirAbbas merged commit 5cc5a28 into workstreams/main Nov 3, 2026
5 of 13 checks passed
@AbirAbbas
AbirAbbas deleted the workstreams/minors branch November 3, 2026 11:56
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