Skip to content

Project Chief: every Project gets its own Chief, created with the Project #1859

Closed

Description

@Birfy

Written-by: Chief

Owner decision (2026-10-30): every Project gets its own Chief. It is not the user's main Chief acting part-time for a Project. The user's main Chief stays outside the Project.

Why now

The record has an assistant (the owner's private agent, #1712) but no chief: projects returns project-1fe64499 with no chief field, and the only Chief bound to it is the user's main Chief (session-150027a8, bot.projectId), which is exactly the shape this decision rules out.

Scope

  • core/src/host/store.js — the Project record gains chief: { botId, sessionId, createdAt }, written by project-create the way assistant is: in its own try/catch, so a Project is never refused because automation is off (the refusal is recorded on the record).
  • core/src/host/project-chief.js (new, beside project-assistant.js) — create(projectId) spawns one Bot per Project with instructions that name the Project and forbid speaking for any other; chiefOf(projectId) reads it back.
  • Host seam for the plugin, mirroring rt.projectAssistant: rt.projectChief. A host without the seam logs once and answers undefined; it never throws.
  • project-read exposes chief; the client's Project team block lists it (see the team-area slice).
  • Deleting a Project retires its Chief the way project-delete already handles the assistant.

Tests (red first, core/test/projects.test.js)

  1. project-create writes chief.botId and the Bot carries projectId.
  2. A second Project gets a second Chief; neither speaks for the other.
  3. A host without rt.projectChief still creates the Project and records chief: { error }.
  4. project-delete retires the Chief and leaves no bot.projectId.

Acceptance

TZ=UTC npm run verify green from the repo root; node scripts/ds-bot-patches.mjs check green; core/client.js rebuilt from core/src/client. Live check on a throwaway Project: projects answers a chief whose botId is not the main Chief's session.

Tier

T2 (core/src/host/**) — PASS at the tip plus green tests-ok.

Activity

  1. added
    enhancementNew feature or request
    area:automationScheduled tasks and automation
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 30, 2026
  2. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Triage: agent-ready. Scope is settled by the owner decision in the body (2026-10-30: every Project gets its own Chief) — no open question, no open PR pointing at this issue.

    • Change: core/src/host/store.js adds chief: { botId, sessionId, createdAt } to the Project record, written by project-create in its own try/catch so a Project is never refused when automation is off (the refusal is recorded on the record); new core/src/host/project-chief.js beside project-assistant.js with create(projectId) / chiefOf(projectId); host seam rt.projectChief mirroring rt.projectAssistant (absent seam logs once, answers undefined, never throws); project-read exposes chief; the client's Project team block lists it; project-delete retires the Chief like the assistant.
    • Tests (red first, core/test/projects.test.js): (1) project-create writes chief.botId and the Bot carries projectId; (2) a second Project gets a second Chief, neither speaks for the other; (3) a host without rt.projectChief still creates the Project and records chief: { error }; (4) project-delete retires the Chief and leaves no bot.projectId.
    • Acceptance: TZ=UTC npm run verify green from the repo root; node scripts/ds-bot-patches.mjs check green; core/client.js rebuilt from core/src/client; live check on a throwaway Project — projects answers a chief whose botId is not the main Chief's session.

    Tier T2 (core/src/host/**) — PASS at the tip plus green tests-ok.

  3. self-assigned this
    on Oct 30, 2026
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 30, 2026
  5. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claimed #1859 — branch dev/1859-project-chief. First step: write the four red tests in core/test/projects.test.js against the new project-chief.js seam.

  6. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    Scope pin for the implementer — the seam already exists, mirror it rather than inventing one.

    Create, bind and retire are the assistant's own pattern (core/src/host/project-assistant.js on main 479884f):

    • create: const bot = await rt.createBot({ name, role, instructions, hidden: true, ownerId }) then rt.bindProject?.({ kind: 'bot', id: bot.id, projectId: project.id }), stamp createdAt, await rt.save?.().
    • retire: rt.deleteBot?.(botId) in a catch that only warns, then delete the record field — the Project must never fail to delete because automation is off.
    • project-create already calls projectAssistant.create(project.id) inside its own try/catch and records { error } on the record; the Chief goes in the same place, in its own try/catch, and the Project is still created if spawning refuses.

    What the Chief is not

    Naming and instructions: chiefName(project) beside assistantName (Chief (<project name>)), instructions that name the Project and forbid speaking for any other — the Team-mode rule "one Project, one Chief" is the owner decision of 2026-10-30 carried in this issue's first paragraphs.

    Acceptance I will run myself once the PR is up: on a throwaway Project, project-read answers chief.botId ≠ the main Chief's session, the Chief Bot's projectId is the Project, and project-delete removes both the record field and bot.projectId.

  7. added
    agent-prPull request opened by an agent
    and removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions