Skip to content

Ask a department, get that department: room role prompt + its own desk - #247

Merged
TruongGiang2000 merged 1 commit into
mainfrom
feat/dept-ask-expertise
Oct 9, 2026
Merged

TruongGiang2000 merged 1 commit into
mainfrom
feat/dept-ask-expertise

Conversation

@TruongGiang2000

Copy link
Copy Markdown
Collaborator

What

When the founder addresses one department in Ask (chip, roster tap, or "ask finance…" in the text), the answer now comes from that department's room role prompt and its own desk, not a generalist with a department label.

  • Prompt (companyChatCore.ts): the room's role prompt (lens, metrics, pushback, characteristic failure) joins the cached static block, plus an on-record rule: a figure the answer depends on that isn't in context is named as missing, never invented. An ordinary turn is byte-identical to before.

  • Context (ChatContext.compose): a <Dept> desk block containing:

    • the brief fields that department owns: runway and constraints → Finance, traction → Sales, problem → Marketing and Design, goal → all
    • its done and open tasks
    • up to 4 of its filed deliverables

    Desk items aren't repeated in the ranked prior work.

  • Store: the desk follows the same deptKey the prompt uses (task, chip, or text), and deliverables resolve through deptKey(forSourceTaskId:), so Team Build drafts count too.

This is step 1 of "one founder runs the whole company". Per-department memory and single-department routing in the room come later.

Verified

  • jest 1068/1068, including new tests: every chat dept key carries its room role, and the on-record rule appears only on department turns
  • Swift ChatContext suites 42/42, including 5 new desk tests: own work and tasks only, field ownership, "not on record", no duplicate excerpt, no desk without a department
  • Department and speaker suites pass. The host restarts are the known 26.2 isolated-deinit crash, with the same count on main
  • In the app, on a real account: "Ask Finance: how many months of runway do we have, and what should we charge for the Pro plan?" → Crash · Finance answered that runway "is not on record", asked for cash and burn, named both open Finance tasks and the locked pricing decision, and reasoned from gross margin and positioning

Note

Department answers run longer than the usual 2–4 sentences when they show their arithmetic. The prompt allows that on purpose; worth a look in testing.

🤖 Generated with Claude Code

A question addressed to Finance in Ask got a mandate and a skill list
(DEPARTMENT_FOUNDATIONS) over the same context every department got. The
room's role prompts — lens, metrics, pushback, characteristic failure —
were only ever read in Plan, so the same Finance answered a convened
question with runway arithmetic and an Ask question without it.

Prompt (companyChatCore.ts): with a dept_key, the cached static block now
carries that department's room role prompt, framed for a one-to-one chat,
plus an on-record rule: a figure the answer depends on that is not in the
context is named as missing, never invented. Still shared across founders,
so the prefix cache keeps paying. registry.ts is safe to import into the
chat sidecar: its graph is anthropicCore (model ids, no SDK), preamble and
types — checked before choosing not to split the role strings out.

Context (ChatContext.compose): a "<Dept> desk" block — the brief fields
that department owns (runway/constraints to Finance, traction to Sales,
problem to Marketing/Design, goal to all; an empty one reads "not on
record"), its done and open tasks, and up to 4 of its own filed
deliverables. Desk items are excluded from the ranked prior work so none
is excerpted twice. Four of the five interview fields that reached no
prompt at all now reach the department that needs them.

The desk follows the SAME department the prompt answers as (deptKeyFor:
task, chip, or text), not only the chip — otherwise "ask finance about
runway" got Finance's lens over a context with none of Finance's work.
Deliverables resolve through deptKey(forSourceTaskId:), so Team Build
drafts land on the right desk.

Verified: jest 1068/1068; ChatContext suites 42/42 incl. 5 new desk
tests; department/speaker suites pass (host restarts are the known 26.2
isolated-deinit crash — same count on main). In the app on a real
account, "Ask Finance: how many months of runway…" answered "it is not
on record", named both open Finance tasks and the locked pricing decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TruongGiang2000
TruongGiang2000 merged commit 7b64cde into main Oct 9, 2026
2 checks passed
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