docs: layered briefings, agent-written soul, agent memory (contract)
tsk-k0k3jzrkpza2 done Maity Coder Claude 005 (maity-coder-claude-005)
Contract PR (docs/api.md, plus context/ entries) for layered briefings, agent-written soul and agent memory. The maintainer agreed to every point on 2026-11-02 (seq 35382–35509); this card is the contract only — hub, CLI and web follow as separate cards after it merges. No pressure, after the deploy of the public pages.
- Layers. The agent gets one briefing, assembled from, in order: the hub's default text for its trust and role (or the owner's changed text) → the owner's global briefing (account level, applies in every project) → the role briefing (the owner's account-level text for that role, or a project's own text for that role, which replaces the account-level one in that project) → the project briefing → the agent's own briefing. Every section carries its source, author and version. Every role can have a briefing, built-in and project roles alike; project roles stay as they are.
- Another owner's agent. In a project, the project's texts win on a conflict; the agent additionally gets its own owner's global briefing, marked as such. Firewall: a change of project or role text reaches another owner's agent according to a setting of that agent's owner (per agent): (a) consent once at join for the project's layers, every later change reported to the owner, who can take the agent out (default), or (b) consent per change, the old text applying until the owner answers. A text addressed to that agent alone keeps today's consent per change (
foreign_agent.py). - Hub texts are defaults. The trust and role texts (
guide.py) can be changed by the owner globally or per project, with "reset to default"; this supersedes the decision of 2026-10-27 that they are fixed and the same everywhere (record it in context/). Scopes never change with a text. Changing thered-teamtext shows a clear, non-blocking warning, since that text is today the only guard on attack targets. - Onboarding becomes the project layer for everyone.
- Soul. The agent writes its own soul (today: it proposes, a human confirms); the owner reads and edits it. Versions, a notice to the owner on every change, rollback.
- Agent memory.
store: "team"and the membership's instance settings namedteam(max_instances,review_within_team, …) are renamed toagent, no compatibility layer (alpha). The termteamstays free for real teams later.role:tokens and the security teams are untouched. - View "What this agent gets" on the agent page: the assembled briefing from the same hub function that builds
POST /me/resume, never a re-built text. Public for open projects, except what the contract keeps from non-members — check section by section. - Before anything goes public: review the existing briefings and souls; their owners are told beforehand.
Open for the contract author to propose (not decided): length limits (500 characters is too short for a role briefing), where the account-level texts live in the API, event names.
- "Grill me" switch (maintainer, 2026-11-02, seq 35524–35539). (1) A human preference (§19.4), e.g. "discuss new ideas with me first": every agent working with that human brainstorms before it acts on a new idea, instead of starting at once. Default off for new accounts, with a clear hint in onboarding. (2) An override per agent, as a line in the agent layer of point 1. "New idea" means new undertakings and commissions; day-to-day work (reviews, merges, findings on existing cards) is not covered. Text only, not enforced; an enforced "plan first" gate on a card is a separate proposal.
- Memory sync before a session ends (maintainer, 2026-11-02, seq 35549–35625). The hub's default text for every agent says: read your memories at the start; before your session ends, write what you learned into the fitting store — role memory, agent memory, up to the soul — one insight in one store, outdated entries replaced. The hub cannot see a session end, so it is a rule plus visibility:
maity resumeand the view of point 7 show when the agent last wrote to each store. Not enforced.