Skip to content

feat(session): plan-born task worker briefs carry standing project orders (#1549) - #1598

Open
santoshkumarradha wants to merge 5 commits into
devfrom
feat/1549-plan-task-standing-orders
Open

santoshkumarradha wants to merge 5 commits into
devfrom
feat/1549-plan-task-standing-orders

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Summary

Fixes issue #1549: plan-born task worker briefs omit standing project orders.

Changes

  • Thread standing project orders into node.brief for plan-born task worker nodes.
  • Ensure standing orders are rendered in task briefs so child workers adhere to project-wide constraints.
  • Added tests verifying standing project orders are retained in plan task briefs.

Fixes #1549


Drafted with CodeAF · reviewed and owned by the author

@santoshkumarradha santoshkumarradha added this to the Reliable agent milestone Sep 27, 2026
@santoshkumarradha santoshkumarradha added bug Something the code does that it should not area:session The engine — turns, tasks, the toolbelt, checkpoints sev:critical Data loss, money spent wrongly, a false done, or the merge queue blocked labels Sep 27, 2026
@santoshkumarradha

santoshkumarradha commented Sep 27, 2026 •

Copy link
Copy Markdown
Member Author

Two-Pass Quality Review

Pass 1: Defects & Contracts

  • Brief Completeness & Standing Rule Inheritance: Plan-born task workers previously did not inherit or carry the project's standing orders into their briefing document, causing workers to operate unaware of house rules. With this fix, session.BeltWorkerBrief and run.NewBashWorker take the rendered standing orders string resolved via StandingWorld, appending it to the end of the brief.
  • Resolver Semantics & Single-Call Resolution: The standing orders are resolved once per run via RunSpec.Standing = a.standingWorld() in beltRunSpec, matching how frontier passes resolve orders once rather than repeatedly per worker.
  • Contract Boundary & Emptiness Law: If no standing orders apply or if the ambient side is disabled, StandingWorld cleanly returns "", and BeltWorkerBrief leaves the brief completely untouched byte-for-byte, avoiding any empty headings or extraneous whitespace.
  • Regression Verification: Regression tests in internal/session/bashbelt_worker_test.go (TestBeltWorkerBriefClosesOnStandingOrders, TestBeltWorkerBriefRendersNoStandingSectionWithoutOrders) and internal/run/note_once_test.go (TestAPlanBornWorkerIsHandedTheStandingOrders) thoroughly verify these contracts.

Pass 2: Architecture & Clean Code

  • Clean Architecture & Separation of Concerns: Standing order resolution remains strictly isolated to StandingWorld in internal/session/standing_world.go while internal/run accepts the pre-rendered string, preventing architectural leakage or filesystem coupling into the worker execution engine.
  • Do Errand Alignment: Headless errands executed via codeaf do similarly resolve standing orders via doStanding(workspace) in cmd/codeaf/chatv3_standing.go, ensuring complete consistency across interactive, delegated, and headless task workers.
  • Documentation & Changelog: Changelog entry in docs/changes/unreleased/1549-plan-task-worker-briefs-carry-standing-orders.md accurately describes the fix and passes formatting checks.

Drafted with CodeAF · reviewed and owned by the author

@santoshkumarradha

Copy link
Copy Markdown
Member Author

Pass 1 Review: Defects & Contracts

  • Defects check:
    • Issue: Plan-born task workers did not carry the project's standing orders in their briefs.
    • Fix: Threaded standing orders via generated by (and for headless runs) into , passed to , and appended in .
    • Empty check: Follows the emptiness law — empty standing orders render no section, verified by unit test .
    • Location: Verified standing orders appear at the end of the brief as a birth fact ( and ).
  • Contract check:
    • correctly handles nil store and returns empty string.
    • Engine wiring () passes cleanly to .
    • Unreleased changelog entry conforms to schema with valid surfaces .
  • Verdict: PASS 1 Clean.

drafted with CodeAF

@santoshkumarradha

Copy link
Copy Markdown
Member Author

Pass 2 Review: Architecture & Clean Code

  • Architecture check:
    • Resolves standing orders once per run rather than redundantly per worker (), ensuring all workers within a plan share identical house rules without multiple filesystem queries.
    • Maintains strict boundary separation: remains the sole arbiter of order applicability.
  • Hygiene & Tests:
    • Tests added across unit and integration boundaries:

    • All mock seats and tests updated with clean signature changes without leaking state.
  • Verdict: PASS 2 Clean.

drafted with CodeAF

@santoshkumarradha santoshkumarradha changed the title [WIP] feat(session): plan-born task worker briefs carry standing project orders (#1549) feat(session): plan-born task worker briefs carry standing project orders (#1549) Sep 27, 2026
@santoshkumarradha
santoshkumarradha marked this pull request as ready for review September 27, 2026 04:17
@santoshkumarradha

Copy link
Copy Markdown
Member Author

@AbirAbbas this is review ready

@santoshkumarradha santoshkumarradha left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed in two passes.

Pass 1 — does it do what #1549 asks? Yes. session.StandingWorld is exported as the one resolver door, RunSpec.Standing resolves the project's standing orders once per run in beltRunSpec, and the section is threaded CrewFactory → NewBashWorker → BeltWorkerBrief so plan-born workers close on it in their opening brief. The headless codeaf do errand path gets the same answer via doStanding against the run's workspace with no conversation session, which matches the resolver's place semantics.

Pass 2 — naming, error paths, leftovers, coverage.

  • Naming follows the surrounding code (standing/section/birth-seam vocabulary); comments cite the laws and the issue.
  • Error paths: store-open failure and resolver error both return no section, consistent with the existing emptiness law in standingWorld; whitespace-only orders render nothing (tested, TestBeltWorkerBriefRendersNoStandingSectionWithoutOrders).
  • Orders ride the opening brief, not a later note — correct, they are a birth fact.
  • All NewBashWorker / CrewFactory / BeltWorkerBrief call sites updated, tests included; no leftovers from the rebase spotted.
  • Regression covered end-to-end by TestAPlanBornWorkerIsHandedTheStandingOrders plus the brief-level TestBeltWorkerBriefClosesOnStandingOrders.

Nothing blocking from my side. LGTM once CI settles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:session The engine — turns, tasks, the toolbelt, checkpoints bug Something the code does that it should not sev:critical Data loss, money spent wrongly, a false done, or the merge queue blocked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session: plan-born task worker briefs omit standing project orders

2 participants