Docs / How it works
Projects and knowledge: one workflow, many projects
Status: built. The session binds ONE project itself (decision 0006; skills/README.md, Rules, item 2). One local workflow
serves several projects (other sites, other mailboxes), each with its own knowledge base. Configuring a project has no UI:
skills and agents do it, the owner answers questions from time to time.
The agents are the users of this CRM; the admin app only shows state.
1. Decisions
| # | Decision | Why |
|---|---|---|
| 1 | A project is a folder projects/<slug>/; the files are the source of truth, SQLite is an index rebuilt from them |
One source of truth; an agent edits a file, a human reads a diff; no settings screen |
| 2 | project.md schema v1 is one ## Settings table plus the existing ## Notion databases list |
The Notion parser already reads that list (@hub/notion project.ts); a table is ignored by it |
| 3 | Knowledge is markdown files, searched with SQLite FTS5 in @hub/db; no embeddings until measured need (section 5) |
Small corpus, local, deterministic, zero model, zero network |
| 4 | A session belongs to exactly one project: the phrase or $HUB_PROJECT (hub agent <slug>) binds it; the mail routing rules are one pure function (section 7) |
Isolation by construction, not by the agent's care |
| 5 | The agent asks one question at a time and records the answer with its date; it never re-asks (section 8) | Owner's attention is the scarce resource |
| 6 | Two new packages: @hub/projects (registry) and @hub/knowledge (index, search, MCP tool) |
Registry is needed by the installer, notion, mail, db; knowledge depends on it, not the reverse |
2. Project folder
projects/<slug>/
project.md schema v1 (section 3): Settings, Brands (optional), Notion databases, Answers, Notes; the only required file
mail-filters.md hand-written classification rules (skill `mail-filters`), committed
knowledge/
files/ the knowledge base: Markdown entries, edited by hand (committed)
taxonomy.md optional: the words entries may use (section 5, "Taxonomy"); `audiences` enforced
sequences/ follow-up sequences, one file each (doc 23); copied from `app/projects/_template/sequences/`
workflows/ playbook files (doc 20)
@dev/ the project's development kanban (`hub dev`)
.generated/ everything generated from the files above, git-ignored by ONE rule: mail-filters.xml, mail-filters.api.json, knowledge-import.json (last import: source, date, counts, per-file sha256)
dumps/ notion-dump output (git-ignored)
reports/ agent reports on local disk, git-ignored: kb/ (KB gaps), problems/, runs/ (doc 18)
Hand-written: project.md, mail-filters.md, knowledge/files/, knowledge/taxonomy.md, sequences/, workflows/, @dev/ (the project's development kanban, hub dev init <slug> --apply; table by hub dev index <slug>; doctor step dev.kanban). Generated or produced by agents: .generated/, reports/, dumps/, knowledge/notion/. The Notion CRM pack is core reference, not project data: it lives in app/projects/_template/notion-crm/.
<slug>:[a-z0-9-]+, equals the folder name and is theprojectcolumn everywhere. It is renamed only withhub project rename <old> <new>(below), never by moving the folder by hand.- The knowledge base is the folder
knowledge/files/and nothing else: to change an entry, edit its file and reindex. The files are the source and the search index follows them: an attended session reads, greps, writes and edits them directly (owner, 2026-11-24;skills/README.md, "Reading and writing files"), and the running server reindexes the project when a file under itsknowledge/changes and once at start (P140 K1,apps/server/src/knowledge/start.ts); doctor stepknowledge.indexproves the index's hashes and brands match the files, andhub knowledge index <slug>stays the manual door. An entry the agent writes or changes isapproved: falseunless the owner approved it in that session. Notion is not a knowledge source and is not re-read; an old Notion Knowledge database is migrated once (knowledge-import), then ignored. - Per-project skill overrides (
<slug>/skills/<name>/SKILL.md) do not exist and are not planned (decision 0010): a difference between projects is a Settings row or a kind (section 3A), not a copy of a skill. The skills a session of a project may use are the kind'sskills, listed in.generated/PROJECT.jsonand checked by the guard hook (section 6). hub project setup <slug> [--tone <text>] [--signoff <text>] [--languages <tags>] [--brand <Brand>=<addresses and domains>]... [--brand-signature <Brand>=<line><br><line>]...: answers the open questions in one pass. A flag writes that row (By = owner, through the same validator as every write);--brandadds or updates a## Brandsrow,--brand-signaturesets the Signature of an existing one (section 3C); in a terminal,toneandsignoffthat are still empty are asked, with the kind's tone hint as the suggestion, and Enter skips. Without a terminal and without flags it changes nothing.statusis never changed here: the project leavesdraftwhen the owner editsproject.md.hub project addresses <slug> --routes <file> [--apply]: compares the addresses a project lists with the forwarding rules of an exported routing snapshot (JSON{ "<zone>": { "rules": [...] } }, the Cloudflare Email Routing shape;-reads stdin). A literaltorule that is enabled and forwards into one of the project's accounts or addresses is an address that reaches the project; catch-all rules are reported by zone. Dry run by default;--applyappends the missing ones tomail.aliasesas the owner's answer. It never calls an API: exporting the snapshot needs the owner's own token and is done outside the core. Mail is routed by account first-class, so an unlisted forwarded address still reaches the project; the list matters for telling products apart and for dropping our own outbound mail.hub project rename <old> <new>(dry run;--applydoes it): renames the folder, the slug in the# <slug>heading andnamerow ofproject.md, theprojectcolumn of every table and the registry row in ONE immediate transaction (the database file is copied next to itself first,app.db.before-rename-<old>-<stamp>), the generated session files understate/projects/, slug references in.generated/and the sticky agent binding. It refuses a taken target and undoes the file changes if the database refuses. Prose that names the old slug (docs, notes) is not rewritten: sweep it by hand.- Creating a project =
project-setupskill (section 8), never hand-made. Retiring one =status | archivedin itsproject.md(the folder stays; it behaves likepaused, the registry marks itarchived); rows keep theirprojectvalue.
3. project.md schema v1
Layout, in this order (headings are fixed; the parser reads by heading):
# <name>: one heading; the notion parser takes it as the display name. A short paragraph under it: what the project is.## Settings: the table below, columnsField | Value | Answered | By.Answeredis an ISO date.Byisowner(answered by the owner),default(the agent applied the default, owner did not object), oragent(derived from a system, e.g.list_accounts). A row exists only once the field is decided; a missing optional row means "default applies, never asked". Lists are comma-separated. Empty value is written as an empty cell.## Brands(optional, P60): one row per product the project answers for, columnsBrand | Receives at | Signature | Answered | By, with the optional trailingDisplay nameandBookingcolumns (section 3C). Absent: the project has one brand and its drafts end withsignoffalone.## Notion databases: list items- <slug>: <data source id>(existing format, read by@hub/notion). Slugs:clients,leads,tasks,documentsare the core databases of the Notion pack (conversation reports aredocumentsof Type Report; there is noreportsdatabase, decision 0022);bug-reports(P145, decision 0054: required by no kind, made byhub install --only notion.bug-reports),deals,organizations,open-loops(the legacy modulesales-legacy, never written by the Hub),business-contacts,expenses,paymentsare optional. Which ones a project deploys is its kind'snotionModules, and which ones it must list is the kind'srequired(section 3A:clients, plusleadsforsales-pipeline). An oldreportsorknowledgeentry is read and ignored.## Links(optional, P101): tableGroup | Label | Target | Under | Answered | By; a target isnotion:<database role>,notion:<32 hex page id>or anhttps://URL.Undernests one level in the same group. The Hub resolves Notion roles through the project's existing data-source ids and opens them through the P61notion.openPageaction (its web page; P131: the Notion app opens it when this Mac has it, else the browser); it never reads page prose or writes from this menu. An absent table means an empty menu and keeps legacy project files valid.## Answers: append-only log, columnsDate | Field | Question | Answer.## Notes: free prose.
Trap: a list item of the form - word: value outside ## Notion databases is an error (stray_list_item, packages/projects/src/parse.ts). Outside that heading use tables or sentences, never - key: value items.
Fields (every field of v1)
| Field | Type | Req | Default | Read by | Meaning |
|---|---|---|---|---|---|
schema |
int | yes | 1 |
@hub/projects |
schema version; a parser refuses an unknown one |
kind |
key of the kind registry (section 3A) | no | generic |
@hub/projects, doctor, installer, project-setup |
what kind of project this is: it decides modules and which fields below are required |
name |
text | yes | folder slug | admin app, reports | display name (also the # heading) |
status |
draft active paused archived |
yes | draft |
hub send, doctor, registry |
only an active project sends; setup sets active after doctor passes; archived is retired and routes like paused |
languages |
list of BCP-47 | no | en |
reply, triage skills | first is the default; drafts answer in the client's language when it is listed |
timezone |
IANA | no | host timezone | reports, calendar.timezone default |
quiet hours and report dates |
mail.accounts |
list | yes | none | routing, hub guard, Connections ("Found in Apple Mail") |
Mail.app account names, exactly as list_accounts returns them |
mail.addresses |
list | no | the accounts' own addresses | routing | every address this project receives at: aliases, the form-lead address |
mail.aliases |
list | no | none | routing | addresses that route to the project but are not a Mail account or the sender: aliases, a planned address. Merged into config.mail.addresses, so routing, the duplicate-claim check and doctor treat them as addresses (for example a planned address before a mailbox switch) |
mail.domains |
list | no | none | agent, resolveBrand, sync |
domains whose mail reaches the project through forwarding or a catch-all (its brands, P52). Not used for routing; hub agent puts them, with the accounts, addresses and aliases, into the session rules (projectIdentity), so the agent never refuses its own project's mail as another project's. A domain belongs to one project: project_addresses holds it as kind domain and a second claim stops the sync (P60). Once a ## Brands table exists, every domain must be in a row (doctor) |
mail.mailboxes |
list | no | INBOX |
parsed, read by no command | mailboxes to read for new mail |
mail.sent_mailbox |
text | no | Sent Mail |
Sent detection (osascript, decision 0026) |
the Apple Mail mailbox a waiting draft is looked for in once sent |
mail.sender |
address | yes | first of mail.addresses |
mail_draft |
the technical From address used only when the receiving account is not on mail.accounts (P58: a reply goes from the address the client wrote to, or the receiving account); never the brand's visible name |
mail.pass |
daily off |
no | off |
the server's pass schedule (apps/server/src/passes/) |
P147 (decision 0055 point 9): daily runs the mail pass once a day over Mail ▸ Needs you, one turn per sender's newest open message; its drafts join the day's lead batch, never sent by it |
mail.pass_at |
HH:MM |
no | 10:00 |
the same | the mail pass's time of day on this Mac's clock |
mail.pass_window_days |
1 to 60 | no | 3 |
the same | how many days back the mail pass looks for open messages |
draft.recipients |
test any or list |
no | test |
mail_draft guard, hub send |
who a draft may go to; test = the global allow_list of config/config.json. In the server's send policy, not project.md (P49 S11): state/projects/<slug>/send-policy.json, set by a person with hub send policy set (section 3B); a row left in project.md is ignored with a warning and fails doctor (send policy) |
send.mode |
draft auto |
no | draft |
hub send, doctor |
draft: only a person sends; auto: hub send --due sends drafts of send.classes after the cancel window. In the server's send policy, not project.md (P49 S11): state/projects/<slug>/send-policy.json, set by a person with hub send policy set (section 3B); a row left in project.md is ignored with a warning and fails doctor (send policy) |
send.classes |
list of mail classes | no | none | hub send --due |
classes of the kind that may be autosent (client-facing only). In the server's send policy, not project.md (P49 S11): state/projects/<slug>/send-policy.json, set by a person with hub send policy set (section 3B); a row left in project.md is ignored with a warning and fails doctor (send policy) |
send.daily_cap |
positive int | no | kind default (5) | hub send --due |
most autosends in a rolling 24 hours. In the server's send policy, not project.md (P49 S11): state/projects/<slug>/send-policy.json, set by a person with hub send policy set (section 3B); a row left in project.md is ignored with a warning and fails doctor (send policy) |
send.delay_minutes |
1 to 1440 | no | kind default (10) | hub send --due |
cancel window before an autosend. In the server's send policy, not project.md (P49 S11): state/projects/<slug>/send-policy.json, set by a person with hub send policy set (section 3B); a row left in project.md is ignored with a warning and fails doctor (send policy) |
tone |
text, one line | yes | none | reply skill | how replies sound; longer voice goes in knowledge/files/voice.md |
signoff |
text, one line | no; with a ## Brands table it is part of every signature |
empty: no sign-off line | draft_write (the writer signs) |
the sign-off line of every draft, the same for all of the project's brands ("Best regards,"). The writer appends it, then the brand's Signature (section 3C); the agent never types it. Per language (P65 S2): en: Best regards, | ru: С уважением, (the | is a table cell's escaped bar); the writer picks the line of the reply's language (more than half of its letters Cyrillic: ru, else en), untagged text is for every language among the project's languages, and with no line for the reply's language (none tagged for it, or untagged lines only while the language is not in languages) it signs in English and the card shows the amber check signature_language (P65 live send check: a Russian reply under languages: en was signed "Best regards," with no check). Mail adds no signature to a hub draft (it is written by script, P52), so empty means the draft ends with the body |
notion.teamspace |
text | no | none | doctor, deploy skill |
the CRM teamspace name, for humans and checks |
notion.teamspace_id |
Notion teamspace id (UUID) | no | none | project-setup (from notion-get-teams), the session's capabilities line and the guard (P82) |
the id of that teamspace: a page may be created at its root, and the capabilities line names the teamspace only once it is set; stored normalised |
notion.parent_page |
Notion page id (UUID) | no | none | deploy skill | the page the deploy skill creates databases under (a scratch page or a project root page); wins over notion.teamspace; stored normalised |
notion.token_file |
file name | no | notion-token |
@hub/notion, MCP config |
file under state/secrets/ holding that workspace's token; never the value |
booking.url |
https URL or none |
no | none | the hub MCP tools, the lead pass and sweep prefetch, draft_write and messenger_draft_write (P155) |
the project's booking link for a call (Calendly, Cal.com, a Google appointment page); a brand's Booking cell overrides it; the agent offers it once per thread where a call helps (skills/README.md rule 19), a wrong or repeated link is refused at the write (booking_link_mismatch); a public URL, so core code and docs use made-up ones |
calendar.name |
text | no | none | calendar skill |
name of the calendar that holds are written to; absent: the skill reports no-calendar, never guesses |
calendar.id |
text | no | none | calendar skill |
calendar id when two calendars share a name; with calendar.connector, the Google calendar id holds go to |
calendar.timezone |
IANA tz | no | timezone |
calendar skill |
zone of the owner's working hours |
calendar.connector |
list of gcal-<label> |
no | none | session files, guard, calendar skill |
P62: Google Calendar connectors this project's Claude sessions may use, from any Google account; holds go to the first, into calendar.id (else its primary calendar). Needs a kind with the calendar module (a parse warning otherwise). @docs/core/26-capabilities.md |
drive.connector |
list of gdrive-<label> |
no | none | session files, guard, link operation | P62: Google Drive connectors this project's sessions may search, read and link from; never share, write or trash |
drive.folder |
list of Drive folder ids | no | none | guard | P62: a Drive search must name one of these folders; empty: the connector's whole Drive |
notion.databases |
section | yes | none | notion, skills | the ## Notion databases list; clients required (and leads for sales-pipeline); any other entry (an old knowledge or reports one) is ignored |
links |
section | no | empty | admin sidebar, project_show, project-setup |
the optional ## Links table; one declared Quick Links menu per project, with role/id Notion targets or HTTPS destinations |
knowledge.source |
files |
no | files |
knowledge-import, index |
the local folder knowledge/ is the base; the only value is files |
knowledge.scope |
shared by-brand |
no | shared |
index, knowledge_search, draft_write's record, doctor |
shared: one knowledge base for every brand of the project (two brands may share one KB). by-brand: every entry lists its brands (names of ## Brands rows, or ANY) and search is filtered by the thread's brand (section 5). Needs two or more brand rows (doctor) |
notion.stamp_sends |
on off |
no | on |
the send door and Sent detection (app/packages/notion/src/stamp.ts, read at each send) |
P89: on, after a confirmed send the Hub writes Last sent at and Last sent by (the sender's setup name, state/person.json) on the client's Clients page, found by the recipient's address; off, nothing is written. Needs the hub integration with Update content and both fields in Notion; anything missing is one ops-log line, never a failed send |
notion.convert_leads |
on off |
no | on |
the send door and Sent detection (app/packages/notion/src/lead-convert.ts, read at each send) |
P97 (decision 0044): on, at a confirmed send to the address of a lead (a Leads row, not Spam) the Hub links the lead's Client to the one Clients card with that address, or creates one (Relationship Lead) when none has it, and sets the lead's Status New to In progress; several cards: links none and says so on the lead card. Needs Update content (link, Status) and Insert content (a new card) for the hub integration; a refusal is one ops-log line and a line on the lead card, never a failed send. off: nothing is written on leads at a send |
leads.notice_senders |
list of addresses | no | none | the Mail reader (apps/server/src/mail/inbound.ts) |
P97: the addresses whose mail is a site's notification of a lead (a copy of a Leads row, not a person writing). Their mail is never an Inbox client row, even when mail-filters.md whitelists them (client there keeps it visible in Mail); a machine address the filters whitelist (robot@…, noreply@…) counts as one too. Stored rows from them are dismissed with reason lead_notice on the next read |
leads.window_days |
1 to 365 | no | 14 |
the Leads reader (apps/server/src/clients/leads-reader.ts) |
P97: Mail ▸ Inbox lists the Leads rows still New (or with no Status) received in the last this many days, as "New leads (N)"; older New rows are one muted count with Open in Notion. The Hub never bulk-writes them |
leads.pass |
daily off |
no | off |
the server's pass schedule (apps/server/src/passes/) |
P147 (decision 0055): daily runs the lead pass once a day, one headless turn per open lead with no decision; it drafts and proposes, never sends (the owner's Send all ready does). off runs none (the dock phrase and Run now still work) |
leads.pass_at |
HH:MM |
no | 09:30 |
the same | the lead pass's time of day on this Mac's clock |
messengers.autolink |
on off |
no | on |
the server's autolink (apps/server/src/messengers/autolink/setup.ts, read fresh every 30 s) |
P84: on, the Hub links a private Telegram or WhatsApp chat by itself when its phone (E.164) or Telegram username equals the identifier of exactly one Notion client record with an email, imports 30 days and writes an Activity line; off, such a chat is only a suggestion on Messengers ▸ Chats. A project.md that does not parse reads as off |
messengers.language |
BCP-47 | no | client's language | Messenger reply preparation | Project language override; empty means answer in the client's language. A non-empty per-chat language remains an explicit exception. |
messengers.instruction |
text, max 4000 | no | empty | Messenger reply preparation | One project-wide instruction applied to every linked chat; a non-empty per-chat instruction overrides it. Client messages remain untrusted data. |
follow_ups.schedule |
daily off |
no | daily |
the server's follow-up schedule (apps/server/src/follow-ups/) |
P142 (decision 0050): daily sweeps the project's silent clients once a day; off runs no sweep (the dock phrase still works). Not protected: it only starts or stops runs |
follow_ups.at |
HH:MM |
no | 09:00 |
the same | the sweep's time of day on this Mac's clock; a Mac asleep then sweeps once when it is next up |
run.quiet_hours |
HH:MM-HH:MM or off |
no | global config | parsed, read by no command (manual-first) | no run in this window |
run.max_messages |
int | no | global (5) | parsed, read by no command | messages per run |
run.max_budget_usd |
number | no | global | parsed, read by no command | cost cap per run |
setup.completed |
date | no | none | project-setup |
set when setup ends |
setup.doctor |
<date> pass or <date> fail: <check> |
no | none | project-setup |
last doctor --project result |
Example (invented project; the ids are placeholders):
# Acme Travel
Boutique travel agency; leads arrive from the site form at hello@acme.example.
## Settings
| Field | Value | Answered | By |
|---|---|---|---|
| schema | 1 | 2026-11-14 | agent |
| name | Acme Travel | 2026-11-14 | owner |
| status | active | 2026-11-15 | agent |
| languages | en, de | 2026-11-14 | owner |
| mail.accounts | owner@acme.example | 2026-11-14 | agent |
| mail.addresses | owner@acme.example, hello@acme.example | 2026-11-14 | owner |
| mail.sender | hello@acme.example | 2026-11-14 | owner |
| tone | warm, brief, no exclamation marks | 2026-11-14 | owner |
| signoff | Kind regards, | 2026-11-14 | owner |
| knowledge.source | files | 2026-11-14 | owner |
| setup.doctor | 2026-11-15 pass | 2026-11-15 | agent |
## Notion databases
- clients: 00000000-0000-4000-8000-000000000001
- documents: 00000000-0000-4000-8000-000000000002
## Answers
| Date | Field | Question | Answer |
|---|---|---|---|
| 2026-11-14 | tone | How should replies sound? | warm, brief, no exclamation marks |
## Notes
Seasonal: peaks in April and October.
One schema. The fields above are one table in code, app/packages/projects/src/fields.ts (field, path in the resolved config, zod reader), and the resolved shape is ProjectBase in schema.ts. The parser, the in-place writer, doctor, the registry and the installer all read them; a test (test/kinds.test.ts, test/doc.test.ts) fails when a field is missing from this table or does not land on a ProjectBase path. "Req" above is for the default kind; the kind decides (next section).
A project folder that holds only the databases list (the layout that predates schema v1) is adopted into v1 by running project-setup in adopt mode (it asks only for missing required fields).
3A. Kinds
A kind is data owned by core (app/packages/projects/src/kinds.ts, validated by the Kind schema at load): modules (mail, calendar, knowledge, filters, notion, bulk, sequences), required (dotted paths of the resolved config that must have a value once the project is not a draft, for example tone or notion.databases.clients), notionModules (which part of the Notion CRM pack it deploys), mailClasses (the classification set; generic is the eight classes every rule file uses), skills (allowed for a bound session), defaults and a starting taxonomy. Each mail class carries skippable, neverSpam, triage and a label color; @hub/mail-filters reads the project's classes from its kind (the rules file stays the same table). hub project sync writes .generated/PROJECT.json (kind, modules, skills, mail classes, resolved settings, missing required fields) and hub project show <slug> --json prints it: skills read that instead of the prose. Kinds are neutral (no owner or product names) and carry no code.
| Kind | For | Required beyond mail accounts, sender and tone |
|---|---|---|
generic |
the default; the set every project had before kinds | Notion database clients |
sales-pipeline |
a sales pipeline with viewings | clients, leads |
software-support |
software support, no calendar | clients |
shop |
orders and returns by mail, no Notion CRM | nothing |
A missing required field is a warning in a draft project and an error otherwise. An unknown kind is an error. Add a kind only when a second project needs it. doctor reads the kind: checks of a module the kind does not use are skipped, and hub projects shows the kind. project-setup writes the kind row first and copies the kind's taxonomy to knowledge/taxonomy.md; after that the project owns the file.
3B. Sending (decision 0011, plan P23)
The agent has no send tool in any mode: the deny rules of hub agent (DENIED_TOOLS, Bash(osascript *), sendmail, mail) and the PreToolUse guard stay, and app/apps/installer/test/send-safety.test.ts fails if a send tool stops being denied. The same deny rules and guard refuse hub sequences pause and resume, and hub sequences enrol without --phrase is refused by the CLI and flagged by the guard: a session enrols a client only on the owner's words in that session, recorded with the enrolment (23-sequences.md). Mail autosend remains hub send --due; A Messenger reply is prepared as an unsent draft, by the agent (messenger_draft_write) or by the owner's Prepare reply (the Hub LLM); delivery goes through the send door: the owner's Send, or (decision 0046) the agent's messenger_send in an attended session on the owner's word in that session, which the server verifies in the session log before the same door; never a background or unattended operation, never Mail.
The send policy is the server's (P49 S11). Who a draft may go to and whether anything is autosent live in state/projects/<slug>/send-policy.json ({schema: 1, recipients: "test" | "any" | [addresses], mode: "draft" | "auto", classes, dailyCap, delayMinutes, updatedAt, by}, strict), not in project.md, so a session that may edit its project folder cannot switch a project to auto or widen its recipients. No file means the safe default: drafts only, recipients: test (the global allow_list). A person sets it with the old field names: hub send policy <slug> shows it, hub send policy set <slug> send.mode auto send.classes client draft.recipients any writes it ("" restores a default), and hub send policy migrate [<slug>] [--dry-run], once per instance, which moves the old rows out of project.md keeping the owner's values (an existing policy file wins). state/ is read-only in every session's sandbox and covered by Edit deny rules in every mode (24-terminal.md). @hub/send, draft_write's record and the admin read the policy through loadProject(..., { policyDir }).
A manual send needs a person's ticket (P49 S12). The admin's Send first asks POST /api/sends/tickets for a single-use ticket (60 s, bound to that draft) that is minted only for the admin's exact origin with Sec-Fetch-Site: same-origin; the apply without it is 403. A local script can forge headers, so the ticket raises the bar; the unattended sandbox, which has no loopback network, is the boundary.
mail-mcp has no send tool, and a draft saved in Mail's Drafts mailbox is a message, not an outgoing message, so Mail's send command cannot send it. The hub therefore reads the draft from Mail (subject, recipients, plain text, attachment count), re-checks it, and sends a new outgoing message with exactly that text through osascript run by the hub process (the P17 osascript deny rule binds the agent's shell, not the hub). It then moves the original draft to the Trash. Limits: plain text only, no attachments (a draft with attachments is refused), and the new message does not carry In-Reply-To headers. All of it sits behind the Mailer interface in the shared package @hub/send (app/packages/send, imported by hub send and by the admin's server; packages never import apps); tests use FakeMailer and never reach Mail.
hub send <draftId> [--apply] (dry run by default) refuses, with exit code 2 and one JSON line, when any of these holds: the draft is not ready and checked; the project is not active; the draft.recipients rule does not admit every To, Cc and Bcc of the real Mail draft; a placeholder ([Owner: ...], {{x}}) is left in subject or text; the draft has injection_suspected (recorded by draft_write's record); a red safety result (for example do_not_contact) is unacknowledged; the draft has attachments; the draft's sender or account is not the project's; Stop all is on; the draft was already sent or is being sent; Mail holds no draft, or more than one, that matches the recorded mailRef, subject and recipient. A follow-up step (a draft with enrollment_id, P47) is refused in every send mode: the owner sends it from Mail (23-sequences.md). Every apply writes a send_log row first (status sending, full text) and ends it sent or failed. Exit codes: 0 ok (a clean dry run too), 1 a failure while sending or writing, 2 refused or bad input.
hub send --due [--project <slug>] [--apply] is the autosend runner, off unless a project says send.mode: auto. It queues eligible drafts (class listed in send.classes, same checks as above, plus the daily cap) as queued rows due after send.delay_minutes, and sends the rows that are due after re-reading the Mail draft: the text must equal the queued snapshot, the draft must still be ready, the project still auto and the class still listed. A queued row is cancelled by hub send --cancel <logId>, by holding or skipping the draft, or by Stop all (hub send --stop [--project <slug>], lifted with --resume). Nothing runs it on a schedule.
The admin sends too (plan S3), through one confirmed route on the loopback server, POST /api/projects/:slug/drafts/:id/send. Its first call (apply: false) is the dry run: it reads Mail and returns the exact mail (from, to, cc, subject, text) or a 409 with the whole list of reasons. Its second call (apply: true) carries the recipients and subject the person saw and sends only if Mail's draft still matches them; it runs the same assess and writes the same send_log row as hub send (actor admin). The Drafts screen shows the button on a recorded draft that is ready and Checked, the exact mail inline for confirmation (no dialog, app/@rules rule 2), Injection suspected and the mail class on the row. Settings ▸ Sending (P70) has Stop all / Resume for one project or every project; Activity's Sends view has the send history, each subject linking to its draft, and Cancel for a queued row; a failing setup check (hub project doctor without Mail and Notion) is a "Needs you" item on Overview. A sent mail cannot be recalled, so only a queued row can be cancelled. The agent's session cannot reach this route: its deny rules refuse any Bash command naming a loopback host and WebFetch to loopback (HUB_API_COMMANDS).
Messenger sends (P71 M4, M5, decision 0036 point 7). A messenger draft of the owner's own Telegram account or WhatsApp number is sent through a second route of the same kind, POST /api/projects/:slug/messengers/drafts/:id/send, never by the agent and never automatically: the dry run names the chat, the account, who and the exact text, or every refusal in words; the apply needs a ticket of kind: "messenger" from the same ticket door, refuses a text or chat that changed since the dry run, and writes its send_log row (channel telegram_user or whatsapp, messenger_draft_id) before it sends once, with no retry. Its guards are its own and are checked again inside the write: the chat has an inbound message (the Hub never makes first contact), the chat is linked and the account connected, Stop sending (for the project or *) stops every channel, in test mode (draft.recipients: test) allow_list holds telegram:<id> or whatsapp:+<number>, and at most 30 sends in a rolling 24 hours and one every 20 s per account (counted from send_log). A failure is recorded as failed and the draft waits again. Code: packages/messengers/src/door.ts, P126 D1; the package side: app/packages/messengers/README.md. P112 S2: the door is five stages, each a function on fresh reads: the assessment (also the project's lifecycle, active only, and the draft's client still the chat's), the authorization (the caller states its authority, the owner's click or decision 0046's owner word, never by default, and gets one SendAuthorization bound to the draft, chat, account, text hash and send-policy generation), the final checks (lifecycle and policy generation read again), the audit (the send_log row first) and the delivery (confirm and send, each re-checking the text hash). Each outcome is one ops line with the action id. Decision 0048's server-side autopilot (P139) is a further authority in the same union and passes the same stages; it is not built. The Mail door has the same stages (assess, authorizeMail, auditMail, deliver in @hub/send), and Mail's send_log write now reads Stop all again too.
Which Mailer the server uses is decided once at start by HUB_MAILER. Unset: Mail.app. HUB_MAILER=fake: a fake that never leaves the process, for the e2e run (apps/admin/playwright.config.ts sets it) and demos; it is refused unless HUB_DB names a database file (the default path is the live one), any other value stops the server, and /api/health reports mailer so the admin shows "Test mailer: nothing is really sent" on every screen. hub send on the command line ignores HUB_MAILER and always uses Mail.app. Every such switch of the server (HUB_MAILER, HUB_LLM, HUB_CONNECTIONS_PROBE, HUB_TERMINAL_SHELL, HUB_AGENT_TOOLS, HUB_LAUNCHCTL, HUB_OPENER, and the off switches HUB_MESSENGERS, HUB_INBOUND, HUB_SENT) is read once at start by @hub/config/modes with this one rule (HUB_LLM=fake alone needs no database), and the start log names every fake and off switch on one line. config/config.json has one reader too, @hub/config/instance: a malformed field is left out and named by the doctor's files.config-keys, the rest still applies.
3C. Brands, sign-off and signature (P60)
One project per set of mailboxes; a brand is a row. A product whose mail reaches the project's accounts (a forwarded domain, an alias) is a row of ## Brands, never a second project: a second project on the same mailbox would split one client's history and the account claim refuses it anyway. The row's Brand names the Notion option, so the table is the one list of names for Notion, silence.brand of the lead forms (doc 22) and the knowledge axis.
A brand is a project key (P145, decision 0053). One rule names a project everywhere: projectKey(name) is the name in lower case with everything but a-z and 0-9 dropped (packages/projects/src/brands/key.ts), so Caribbean MLS, caribbean-mls and CaribbeanMLS are one key. A ## Brands row, a Notion Projects option (Clients, Documents, Business contacts, Tasks, Expenses, Bug reports), a Leads Brand option, a backend's django-cfg project_keys value and a notice's X-Project-Key match when their keys are equal; the Hub keeps no second name. Every brand row is a project key; a project key need not be a brand (a development with no mailbox of its own). The writers take the one option with the key (none or two: none, never a new option): a new Clients card gets Projects, a known card the Hub links to a lead of another project gains that option, and nothing is ever removed. hub install --only notion.projects adds a brand's missing option; hub doctor --only notion.project-keys prints brand->key->options per database. Clients' Project signals is a Notion formula nobody writes; a weak guess is a Project hint: line in the summary. The registry of keys, for the sites outside the Hub: _map/projects/project-keys.md.
## Brands
| Brand | Receives at | Signature | Answered | By | Display name | Booking |
|---|---|---|---|---|---|---|
| Acme Travel | acme.example, hello@acme.example | Acme Travel team<br>acme.example | 2026-11-14 | owner | Acme Travel | https://cal.example.test/acme-travel/30min |
| Acme Villas | villas.example | Acme Villas team<br>villas.example | 2026-11-14 | owner | Acme Villas | |
Receives at: addresses and domains, comma separated. An address must be one of the project's accounts,mail.addressesormail.aliases, or sit on one of itsmail.domains; a domain must be onmail.domains. No address or domain in two rows; brand names are unique (case-insensitive). The parser (parseBrands,packages/projects/src/brands/table.ts) refuses anything else as an error.Signature: the lines that sign a draft of this brand,<br>between lines. Empty = not answered yet.Display name: the optional visible name in theFromheader. The writer composesDisplay name <technical address>while keeping the address selected by P58 and the send gate. Empty or absent preserves Mail's current account name, so legacy five-column tables and single-brand projects are unchanged. Control characters, angle brackets and names over 120 characters are refused.Booking(P155): the brand's booking link (one https URL),none(this brand never offers one), or empty (the project'sbooking.url). A thread whose brand is not resolved (many messenger chats) gets the one link every brand shares, or none when they differ (bookingLinkOf,packages/projects/src/brands/booking.ts). A table without the column reads as empty; the writer adds the column when a value needs it.- Writer:
hub project setup --brand,--brand-signature, optional--brand-display-nameand--brand-booking(--bookingforbooking.url) (orapplyBrandRow/writeBrandRow), through the parser's own check.
Which brand a message is (resolveBrand, pure). Step 1, the address they wrote to (wroteTo): walk X-Gm-Original-To, X-Original-To, X-Forwarded-For (every entry), X-Forwarded-To, Delivered-To, To, Cc; the first address that is the project's own and not one of its account addresses wins; only if there is none, the first account address. A forward names the account in Delivered-To and X-Forwarded-To, so reading those first would make every forwarded mail the account's. Step 2: the row that lists wroteTo exactly, else the row that lists its domain, else no brand, with the reason. Never a default brand. Who a reply goes from is a separate rule (P58), not this one.
Which brand a reply is signed as (replyBrand, packages/agent/src/drafts/sign.ts; P147 3m finding C). First the thread: the newest of our sends that the answered message names (its own Message-ID, In-Reply-To, References) and that carried a brand. Then resolveBrand, when the client wrote to a brand's own address. When they wrote to the shared account's address, or to none, the brand of the lead that address came from. Only then the headers. The shared account (every brand's mail goes from it) never turns one brand's thread into another's; a pin test covers a thread whose To is the other brand's address.
The writer signs and names the sender. draft_write (hub MCP) reads the answered message's headers (one direct read, READ_HEADERS_SCRIPT), resolves the brand, and appends signoff plus that brand's Signature after the body (a block from an earlier version is removed first, so a revision is signed once). A text that ends with the agent's own closing, in any language, is refused with own_signoff and never edited (P65 S2, P60 finding 1). In its last four non-empty lines: one of the project's own sign-off or signature lines; a short line ending with a comma (not the greeting, not a list's continuation) with only name lines after it ("С теплом и дружеским поклоном," over "Команда Carapis", "Thanks," over "Mark"); a team or brand name line with only name lines after it ("Carapis team", "Команда Carapis"); or a closing phrase of SIGNOFF_PHRASES (en, ru, uk, de, es, fr, pt, it), alone, with a short name, or opening a longer closing that ends with a comma. A name line is at most five words with no . / @ : ? ! ;, holding a brand name, a name its signature lines sign with, a team word, or (after a closing) up to three capitalised words. The Signature lines take the same per-language form as signoff (en: Carapis team \| ru: Команда Carapis, one cell, <br> between lines), picked by the reply's language. No table: signoff alone. Brand unresolved, headers unreadable, or its Signature empty: the writer appends [Owner: signature for <wroteTo or brand or "unknown brand">], which hub send refuses. A person's Save in the admin (P56) is written as he left it. The four addressing facts remain separate: brand identifies the product, brandDisplayName is its optional visible name, fromSeenByClient is the complete From header Mail saved (for example Carapis <hello@reforms.ai>), and clientWroteTo is the address of ours the client addressed. fromReason explains only a technical fallback. The display name never authorizes an address or changes the send gate. draft_write's record stores drafts.wrote_to and drafts.brand from the result (through the hook ledger, never from the agent's payload), and the card shows "They wrote to info@... (Brand)". message_show (hub MCP, read-only, no Mail read) gives the brand and brandDisplayName for headers the agent already read, for the Notion Brand column and knowledge_search.
A revision records itself. draft_write with draft = a hub draft id (a sent one is refused already_sent, P83; a done or skipped one draft_finished, P99, both before Mail is asked) updates that draft's record in place (same id, mailRef, client, recipients and context block; new preview, brand and wroteTo, and the reason when reason is passed, P99; Checked off because the text changed; Activity "Draft updated") on a short write connection of its own, and answers recorded: true. draft_write's record stays for the first draft of a thread, which alone carries the context block.
4. Registry in SQLite (index, rebuilt from the files)
./run.sh project sync (K2; also run by every hub agent and hub up, so the index cannot drift) reads every projects/*/project.md, validates it, and replaces these rows in one transaction. Nothing writes them by hand.
| Table | Columns | Notes |
|---|---|---|
projects |
slug pk, name, status, kind, archived, settings_json, hash, synced_at |
replaces projectsRepo.list() (distinct project values). kind and archived are derived from project.md. settings_json is read back through ProjectBase (a stale row fails loudly) |
project_addresses |
address, project, kind (account, address or domain) |
unique per address for kind address and per domain for kind domain (P60): a duplicate claim is a hard error at sync, not a coin flip at run time; accounts may be shared |
project_questions |
id, project, field, question, options_json, default, status (open answered), asked_at, answered_at, answer |
at most one open row per project (unique partial index); see section 8 |
project columns in the existing tables stay plain text (no foreign key in v1); a repository write for an unknown project throws unknown_project.
5. Knowledge
Layout of an entry
Markdown with YAML front matter. The fields mirror the former Notion Knowledge database, so a one-time migration is a mapping, not an interpretation.
| Front matter | Former Notion property | Meaning |
|---|---|---|
title (required) |
Question |
entry title |
approved |
Approved |
only approved entries are returned by default. Default true; a migrated page keeps its old value |
use |
Use |
STATE (a draft may state it) or MARKER (context only, never quoted). Default STATE. A migrated page with an empty Use becomes MARKER (never quote what nobody marked as quotable) |
audiences |
Audiences |
list; ANY matches every audience; an empty list is visible to no audience-filtered search |
brands |
Brand |
list of ## Brands names, or ANY (true for every brand of the project). Read only in a knowledge.scope by-brand project, and required there (see "Brands" below); a shared project ignores it |
category, kind, stages, folder |
same names | filters and display |
phrasings |
Phrasings |
how clients ask it; indexed, never quoted |
valid_until, last_confirmed |
Valid until, Last confirmed |
a passed valid_until marks the entry expired and drops it from default results |
source, supersedes |
Source, Supersedes |
provenance |
notion_id, notion_edited |
page id, last_edited_time |
migrated entries only |
Body = the page body (Notion .md), the answer in plain markdown. Path: knowledge/<files|notion>/<folder>/<slug>-<id8>.md, folder from the Notion Folder select (programmes/grenada becomes two directories), id8 = first 8 hex chars of the page id (stable when a title changes; a renamed file is deleted and rewritten by import).
Where the admin shows it (P74). The admin's Knowledge table groups its rows by topic, read from the path alone (entryTopic in @hub/contract/knowledge): the folder, one heading per directory level (playbooks/client is Playbooks over Client); an entry directly in files/ falls under its category; neither is "Other", last. The brand is a level on top only when the base's brands differ (an ANY entry under "All brands", first; an entry with two brands under each). Labels are the code or folder as words (ABOUT_DAN "About dan"; an upper-case code of three letters or fewer as written, API), in label order. So a flat base groups by category and a foldered one by its folders; moving files into folders is never needed for the screen.
Taxonomy
knowledge/taxonomy.md (optional, hand-written, parsed in @hub/knowledge) lists the words entries may use, one ## <axis> section each (audiences, category, stages, kind), words in UPPER_SNAKE separated by commas or bullets. knowledge index and knowledge check validate against it: an unknown audiences value is an error (the entry is not indexed: a typo would silently hide it from audience-filtered search), an unknown category, stages or kind is a warning naming the nearest word (nothing filters on them yet). A section the file does not declare is not checked, and without the file nothing is validated. A malformed file is reported as invalid. Nothing is shared between projects: a fact two projects need is copied into each.
Brands (P60)
A project with several products (## Brands, section 3C) chooses with knowledge.scope whether they share one knowledge base (shared, the default: two brands of one business answering the same questions) or keep each product's facts apart (by-brand). In by-brand, strict and simple: every entry lists brands; shared facts say so with brands: [ANY]; an entry without brands or with a name that is not a ## Brands row is an error and is not indexed (the same mechanism as an unknown audience; knowledge check and doctor row knowledge entries name known brands report the same files, through the one rule entryBrandProblem). "Untagged = shared" was rejected: it would make every old entry an answer for every product the day the filter ships. Brand names come from the ## Brands table, not from taxonomy.md (one list of names). Brands are not folders: folders are topics, and a fact two brands share would have to live in two places.
Index
Table knowledge_docs in @hub/db: id, project, path (relative to the project folder, unique with project), title, use, approved, audiences (JSON), brands (JSON, P60), category, kind, valid_until, body, phrasings, content_hash, updated_at. Virtual table knowledge_fts (FTS5, external content knowledge_docs, columns title, phrasings, body), tokenize='unicode61 remove_diacritics 2', prefix='2 3', kept in sync by triggers. Drizzle cannot model virtual tables: the FTS5 DDL and triggers go in a hand-written migration (drizzle-kit generate --custom).
Reindex is incremental by content_hash and brands: knowledge index <project> walks knowledge/, upserts a file whose text or canonical brands changed (a ## Brands rename, or a column added after the row was written, heals without a file edit), deletes rows whose file is gone. The server runs it at start and on a file change (P140 K1); the CLI is for a server that is not running.
Retrieval choice: markdown + FTS5, embeddings only on measured need
- Corpus: tens to a few hundred short entries per project (one live Knowledge base has 34 folders). Keyword search over title, phrasings and body is enough at this size, and
Phrasingsalready stores the client's own wording, which is what embeddings would otherwise add. - Local fit: FTS5 ships inside
better-sqlite3, already a dependency of@hub/db. No model download, no network, no key, millisecond queries, reproducible ranking (bm25), explainable hits (the agent log can show which words matched). - Languages:
unicode61handles Latin and Cyrillic and folds diacritics. No stemmer on purpose: theporterstemmer is English-only and would hurt ru/de. Misses are fixed by adding a phrasing to the entry, a visible, reviewable edit. - Ranking:
bm25(knowledge_fts, 10.0, 6.0, 1.0)(title, phrasings, body). The query is tokenised, each token quoted and prefix-starred, joined byOR; user text is never passed to MATCH raw (FTS syntax injection). - Measured need, not a hunch: keep
knowledge/_gold.md-style fixtures in the package tests: for each project at least 30 real client questions with the entry that should answer them. Add embeddings (sqlite-vec, one local model, hybrid by reciprocal rank fusion behind the same tool) only if recall@5 stays under 90% after phrasings were tuned. The tool contract does not change when that happens.
Tool contract: knowledge_search
Registered by the local MCP (@hub/knowledge, stdio). hub agent <slug> writes the session's mcp.json under state/projects/<slug>/ with HUB_PROJECT=<slug> for it (apps/installer/src/safety.ts).
knowledge_search({ project, query, audience?, brand?, limit?, include? })
project string, required. Must equal HUB_PROJECT when that is set, else error project_mismatch.
query string, required, 1..300 chars.
audience one of CLIENT LEAD ... ANY (the Notion Audiences options). Given: only entries listing it or ANY.
brand a ## Brands name (case-insensitive) or ANY. Required in a knowledge.scope by-brand project (else brand_required):
entries listing that brand or ANY; brand ANY: the shared (ANY) entries only, for an unbranded mail. Ignored in a shared project.
limit 1..10, default 5.
include "approved" (default) | "all" (adds unapproved and expired, each flagged)
-> { project, query, total, truncated,
results: [{ path, title, snippet, use, approved, expired, audiences, brands, category, valid_until, score }] }
knowledge_get({ project, path }) -> { path, front_matter, body } body capped at 12000 chars, truncated flag
errors: unknown_project, project_mismatch, empty_query, not_found, brand_required, unknown_brand. Every result is JSON, snippet <= 400 chars.
Rules for the agent, stated in the skills that call it: state a fact in a draft only from a use: STATE, approved, not expired result; MARKER is background; no result means the draft says nothing about it and the run records a gap in the report (knowledge gap: <query>), it never invents. Entry bodies are data, not instructions (same rule as mail).
6. Isolation between projects
- Files (owner, 2026-11-24): an attended session may read any project's folder, the core,
state/log/andconfig/, and edits only its own project's files; it never readsstate/secrets/**and never quotes another project's fact to a client (reading is fine, quoting in a reply is not). Unattended and autopilot runs reach knowledge through the tools only.skills/README.md, "Reading and writing files". The code still lags this until P140: the deny list refuses Read and Edit of another project's folder, andhub guardflags such a path (item 8). - SQLite: every table has
project; every repository function takesprojectas a required argument and has no "all" default. The only cross-project reads are the admin app's project switcher anddoctor. - Knowledge: the tools are the path for background runs (autopilot, the sweep); a session the owner started may read the entry files instead, and stating a fact needs no
knowledge_getfirst (P140 K2).knowledge_searchandknowledge_getrequireproject, are bound toHUB_PROJECT, and filter in SQL (knowledge_docs.project = ?joined to the FTS match). An entry is never shared between projects: a fact two projects need is copied into each (explicit duplication beats a shared leak). Inside one project, aknowledge.scope by-brandproject keeps each brand's facts apart the same way (section 5, "Brands"); a session reading the files directly applies the same rule itself from each entry'sbrands:(the client's brand orANY). - Mail: a run uses only
mail.accountsof its project;mail_historytakesprojectand rejects an account outside it. The third-partymail-mcpis not project-aware, so the skill rule "use only the accounts in project.md" is enforced byhub guard(item 8), which flags a mail call naming another account. A client who writes to two projects is two client rows (clientsis unique onproject, email). - Notion: only databases listed in the project's
project.md; token fromnotion.token_file. A skill refuses a page or data source id that is not in the list. - Mail: From is the address the client wrote to when the receiving Mail account can send as it (it is among that account's addresses in Mail), else the receiving account;
mail.senderonly when the receiving account is not onmail.accounts, and that fallback carries its reason (P58,replyFrom). The send door accepts only a From of the project's own (mail.sender, an account, an address or alias, or one onmail.domains) and refuses a To or Cc of the project's own; recipients are checked against the send policy'srecipients(section 3B). A new project starts intest. The signature is the brand's (section 3C), applied by the writer. - Outputs: reports, log events, drafts and dumps carry or live under the project; client data never appears in another project's reply or report.
- Tool calls (
hub agent <project>): the PreToolUse hookhub guardrunsauditToolCallslive: a mail call naming an account outside the project, a knowledge call naming another project, a path in another project's folder, a send-capable tool, and a hub skill that the project's kind does not allow. Warn by default,HUB_GUARD=blockrefuses. Claude Desktop sessions have prompt-level isolation only; usehub agent <slug>for anything touching more than one mailbox.
7. Which project a message belongs to
The session binds its project itself (decision 0006); no command routes mail before a session starts. The rules a message belongs to a project by are one pure function, resolveProject (app/packages/projects/src/route.ts), over the message's account and recipients (To, Cc, Delivered-To, X-Original-To). Addresses are lower-cased; a +tag is stripped for comparison.
- Candidates:
activeprojects where a recipient equals one ofmail.addresses, or the message's account is inmail.accounts. - A recipient match wins over an account match (one Mail account can hold mail for several projects through aliases).
- Exactly one candidate: the message is that project's.
- Zero candidates (
unrouted) or more than one (ambiguous): no project, never a default one. A match only on a project that is notactiveisinactive. - Form leads: the system mail from the site form is addressed to the project's lead address (
mail.addresses), so it maps like any mail. - Outgoing mail (history): attributed to the project of its recipient's client row, never routed on its own.
doctorfails when an address or account is claimed by two projects (pk onproject_addresses), when amail.domainsentry is listed by two projects, or when anactiveproject has none.- After the project, the brand is resolved inside it (
resolveBrand, section 3C): a brand is never a second project.
8. Question-asking protocol
Goal: configuration happens through conversation, costs the owner few answers, and is never repeated.
- Read first. Before asking, read
## Settingsand## Answersof the project andproject_questions. A field with a row is decided; never ask it. Optional fields get their default silently (By=default) and are shown once in the closing summary. - One question at a time, closed form: the field, why it is needed (one clause), a proposed default, at most three options. In the owner's language (Russian today); files stay English.
- Ask only what the agent cannot find out. Accounts from
list_accounts, databases from Notion search, sender from the addresses: derive, then confirm in one question ("Is hello@acme.example the sender for Acme Travel?"). A new project needs at most six answers: name, accounts/addresses, Notion databases, knowledge source, tone, test mode; a project with several products adds one answer per brand (its name and addresses, then its signature, or one pattern for all of them), one for the sharedsignoff, and one forknowledge.scope(asked only with two or more brands,sharedproposed). - Where. In the chat of the session the owner started. A question that has to wait is one
project_questionsrow (status=open, unique per project);project-setupin resume mode lists open questions and asks the oldest. - Record at once. Write the Settings row (value, today's date,
By=owner), append the Answers row, mark the questionanswered, then run./run.sh doctor --project <slug>. - Never re-ask. The only reasons to ask a decided field again: (a)
doctorproves the value false (the account is not in Mail): ask as a correction, quoting the old answer and what was found; (b) the owner says to change it. The new answer replaces the Settings row; the Answers log keeps the history. - Silence is not consent for risk.
draft.recipients any(hub send policy set, run by the owner) andstatus: activeare set only after an explicit owner answer or a passingdoctorplus the owner's yes. Everything else may take its default.
9. Skills in this track
skills/project-setup/SKILL.md: the interview, writesproject.md, runsdoctor; also adopt and resume modes.skills/kb-review/SKILL.md: merges the KB-gap reports (reports/kb/) of a period into ranked fixes with draft entries (doc 18).skills/knowledge-import/SKILL.md: fillsknowledge/from the Notion dump or from files, then indexes and checks.- Interview mode of
skills/notion-project-deploy(doc15) is this same interview:project-setupcalls the deploy skill when the project's Notion has no databases yet.
Update this page when the architecture changes.