Skip to content

Decide whether sub-agent worker task boards should be persisted at all — and if so, lane column + driver routing + a reader, together #1968

Description

@macanderson

Problem

#1708 removed the sub-session worker's task-board mirror (PR #1967). That write was corrupt at the tasks table's key — a worker board numbers from "1" in its own namespace, so it upserted over the lead's rows at UNIQUE(session_id, task_id) — and its stated purpose ("so tasks queries see sub-agent boards too") was unachievable at that key, because no reader could tell a worker row from a lead row even if the rows had survived.

Dropping it was the correct call for the bug, and it is the reason the /clear seal (#1692) is now airtight: the driver is the session mirror's sole writer. But it means a sub-agent worker's private task board is now durably invisible. A delegated worker that plans its own sub-tasks with task_create leaves no persisted trace of that plan — only its lane's live events and its executions row survive.

That may well be correct (a worker board is scaffolding for one run, the same lifetime the pipeline gives an authored witness). This issue exists so the decision is on record rather than implied by a deletion, and so the work is scoped if the answer is "yes, we want them."

What it would take

The shape #1708 identified, unchanged by PR #1967 — all three parts are required together, and any one alone reintroduces a defect:

  1. A lane column in the tasks UNIQUE key. UNIQUE(session_id, lane, task_id) — the lead's rows carry lane = 'lead' (or NULL), a worker's carry its lane (sub:2, req:1). Without this the ordinal collision returns exactly as A worker mirrors its OWN task board into the lead session's tasks rows — ordinal collision, and it bypasses /clear's board seal #1708 described it.
    • crates/stella-store/src/ddl.rsTASKS_DDL (note its doc comment documents the current key and the SQL-NULL distinctness quirk; both need updating).
    • crates/stella-store/src/migrations/ — a migration bumping SCHEMA_VERSION. Existing rows backfill to the lead lane.
    • crates/stella-store/src/task_board.rsrecord_task_board takes the lane; list_session_tasks either filters by lane or returns it.
  2. Route the write through the driver. A worker-thread write cannot consult SubSessions::predates_task_board, so a pre-clear worker would repopulate a cleared mirror — A worker mirrors its OWN task board into the lead session's tasks rows — ordinal collision, and it bypasses /clear's board seal #1708's defect 2, which the lane column does not fix. Carry the board on SupervisorMsg::Ended (crates/stella-cli/src/subsession.rs) and let session_clear::settle_worker_task (crates/stella-cli/src/command_deck/session_clear.rs) arbitrate, exactly as it already does for the lead's row.
  3. A reader that renders the lane. Both current readers are lane-blind:

Constraints

  • crates/stella-store/src/lib.rs and src/tests.rs are at their file-size ceilings; crates/stella-cli/src/command_deck.rs is a god file closed to growth. New logic goes in sibling modules — stella-store/src/task_board.rs, stella-cli/src/subsession/closeout.rs and command_deck/session_clear.rs all have room. Do not raise a ceiling in scripts/file-size-baseline.txt.
  • stella-observatory must not link stella-store (it reads the DB directly) — a schema change means updating crates/stella-observatory/tests/schema_conformance.rs, which calls record_task_board.

Definition of done

Either:

  • Closed as "won't do", with a sentence in crates/stella-cli/src/subsession/closeout.rs's module docs recording that worker boards are intentionally ephemeral; or
  • All three parts above shipped together, with a witness test proving a worker board and a lead board coexist under one session without either overwriting the other, and that a pre-clear worker's board still cannot appear after /clear. The two witnesses in crates/stella-cli/src/subsession/closeout.rs must keep passing or be consciously replaced — they pin A worker mirrors its OWN task board into the lead session's tasks rows — ordinal collision, and it bypasses /clear's board seal #1708's two defects and a partial reintroduction would trip them.

Refs #1708, #1692, #1631. Follows PR #1967.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clistella-cli — commands, flags, wiringtriageUntyped request — convert by adding bug / feature / epic

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions