Skip to content

workstreams: a task starts by itself when what it waits on is done (E2 #7) - #2736

Merged
santoshkumarradha merged 4 commits into
santosh/workfrom
fix/x9-auto-start
Nov 17, 2026
Merged

santoshkumarradha merged 4 commits into
santosh/workfrom
fix/x9-auto-start

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Fixes E2 #7 (~/work/workstreams-v5/live2/E2-final/FINDINGS.md), engine half, per owner decision 1 (2026-11-17). Desk half: Agent-Field/codeaf-desk (fix/x9-auto-start).

Before: after the plan's Start, every Afi task a finished task released sat at "Ready to start: … is done" until someone pressed its own Start, and Afi told people the plan was "still waiting on your Start".

Now, on an organization's server (hello word org_task_starts):

  • The write that finishes the last thing an Afi task waited on starts it in that same write (startReleased, workstream_task_autostart.go), with the rights of whoever finished the work. Its thread says "Started: <title> is done".
  • Rule (factory.StartsBySelf): the task's own starts (when_ready / by_hand) wins; a plan (batch ≥ 5) nobody started waits for its Start; a started plan is consent for all of it; otherwise the owner's "Start tasks when what they wait on is done" (on unless turned off).
  • Unchanged: Asks, the spending rule and the decision check still pause; a person's task, a chat's task (woken on its machine) and a task Afi cannot take now stay "Ready to start".
  • starts is set with the ordinary task PATCH by the owner or whoever looks after the workstream (403 otherwise, 422 for an unknown word); every Afi/chat task reads back starts_when_ready.
  • GET/PUT /v1/me/work (factory.org_work, factory.org_work_set) keep each person's default in work-prefs.json.

Manual law: organization-workstream-tasks.md gains "tasks start by themselves automatically…" and its Start/plan sections are corrected; workstream-chats-and-tools.md; ws_task_create's description and the org ws_tasks brief (starts) so Afi stops saying a started plan waits on a Start; two new manual probes; PROTOCOL.md; change entry ws-tasks-start-by-themselves.md.

Tests (fail before the fix): TestAReleasedAfiTaskStartsByItselfOnTheServer, TestATaskThatWaitsForYouStaysReady, TestAnUnstartedPlanAndAPersonsTaskDoNotStartByThemselves. Existing wake/release tests unchanged and green.

Proof: flock /tmp/codeaf-prready-queue.lock make pr-ready BASE=origin/santosh/work (result posted below once the queue reaches it).

🤖 Generated with Claude Code

santoshkumarradha added a commit that referenced this pull request Nov 17, 2026
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha added a commit that referenced this pull request Nov 17, 2026
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha added a commit that referenced this pull request Nov 17, 2026
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha
santoshkumarradha force-pushed the fix/x9-auto-start branch 2 times, most recently from 7f1a83b to 2c060cf Compare November 17, 2026 18:27
santoshkumarradha added a commit that referenced this pull request Nov 17, 2026
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Local proof on head 2c060cf13 (rebased on origin/santosh/work; the conflict was manual-only, in organization-workstream-tasks.md and chat_test.go):

  • go build ./..., go vet ./internal/factory/... ./internal/appwire/ ./internal/manual/ ./internal/session/: ok
  • go test -count=1 ./internal/manual/ ./internal/factory/ ./internal/appwire/: ok
  • make test-laws: ok
  • make test-touched BASE=origin/santosh/work: factory/serve ok (one test, TestWaitingWorkerPicksUpExternalEnqueueWithinOneSecond/fallback, failed once and passed on retry, so it was marked flaky; it is not in my change), factory/store ok, manual ok. The session leg was refused by the box's heavy-suite lock (another lane's run), so:
  • make test-focus PKGS=./internal/session RUN='Workstream|Manual|Belt|Tool|Prompt': ok (my only session change is the ws_task_create description)
  • Earlier on this branch: go test -run 'Start|Task|Work' ./internal/factory/serve/ ok, including the three new auto-start tests.

santoshkumarradha added a commit that referenced this pull request Nov 17, 2026
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha and others added 4 commits November 17, 2026 13:56
…#7)

Owner decision 1 (2026-11-17). On an organization's server, the write that
finishes the last thing an Afi task waited on starts that task, with the
rights of whoever finished the work, unless the task says "Waits for you to
start", belongs to a plan nobody has started, or its owner turned "Start
tasks when what they wait on is done" off. A started plan is consent for the
whole plan. Tasks carry `starts` (owner or steward) and read back
`starts_when_ready`; /v1/me/work keeps each person's choice. Hello word
org_task_starts. Manual pages, Afi's tool docs and PROTOCOL.md updated.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF

Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Local proof (owner policy: local tests, then merge):

Full proof on 54759977b, after the rebase onto #22e150808 (conflict in workstream_task.go / workstream_tasks.go; kept Run/fillRuns beside Starts/fillStarts):

  • go build ./..., go vet ./internal/factory/... ./internal/appwire/ ./internal/manual/ ./internal/session/: ok
  • go test -count=1 ./internal/manual/ ./internal/factory/ ./internal/appwire/: ok
  • make test-laws: ok
  • make test-touched BASE=origin/santosh/work: exit 0. appwire, factory, factory/serve (432s), factory/store, manual: ok. session: all 8 shards ok.
  • make test-focus PKGS=./internal/factory/serve RUN='Autostart|StartsByItself|WaitsForYou|UnstartedPlan|Lease|Restart|Survive': ok

Clean rebase onto #2766 → head 6d3ebf819: go build ./... ok, make test-focus PKGS=./internal/factory/serve RUN='StartsByItself|WaitsForYou|UnstartedPlan' ok.

@santoshkumarradha
santoshkumarradha merged commit 9ec1d85 into santosh/work Nov 17, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the fix/x9-auto-start branch November 17, 2026 18:57
ZeroPoint95 pushed a commit that referenced this pull request Nov 24, 2026
…#7) (#2736)

Tasks start by themselves when what they wait on is done (owner decisions 2026-11-17, 1; E2 #7).

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
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