feat(agents): root and project agent level writers, CLI and Settings forms (#1873) #1913

Merged
jason.woltje merged 4 commits from org-a2 into refactor 2026-11-11 00:27:49 +00:00
Owner

Agent levels slice A2 (#1873): people can now set root and project agents, from the Console and the CLI.

  • Organization writers for the root agent file and a project's agent overrides, each with a revision check, a lock, an owner-uid check on the file and every ancestor directory (an ancestor writable by others refuses unless sticky), and a receipt.
  • A project can define, narrow or exclude agents, but can't change the organization's assistant or chief.
  • mosaic agents root|project ... CLI verbs. They load the instance's system config before any read or write and refuse on a missing, malformed or wrong-instance config. Errors print only our own error text with no host path.
  • Console: Settings > Agents gets root and project level forms. Each POST route checks Origin and Sec-Fetch-Site, limits the body, and uses the organization's id rule for names. Drafts survive repaints and a revision conflict.

Lane: Opus. Rebased onto 96c900d21 by the Lead (range-diff all =); A2's own files plus the organization and cli redaction tests rerun on that tree: 11 files, 104/0. Full gate on e9a079fcc: 324 files, 3210/3. None of the three is A2's: case1-accept C4 P10 inner is the known timing flake that also fails on base; system-types-browser passes alone 5/0; rename-v1-wire fails on base because RR added decision.resolve.delivery to a response its test pins (follow-up).

Review: Sol build (1 P1, 4 P2, 1 P3) and Sol security (3 P2), one fix round. Kept on purpose: the root summary shows the model value, per design line 241. Deferred: per-account root files; accounts.mjs assertAccountsOwner has the same ancestor-directory gap this lane closed for agent files.

Agent levels slice A2 (#1873): people can now set root and project agents, from the Console and the CLI. - Organization writers for the root agent file and a project's agent overrides, each with a revision check, a lock, an owner-uid check on the file and every ancestor directory (an ancestor writable by others refuses unless sticky), and a receipt. - A project can define, narrow or exclude agents, but can't change the organization's assistant or chief. - `mosaic agents root|project ...` CLI verbs. They load the instance's system config before any read or write and refuse on a missing, malformed or wrong-instance config. Errors print only our own error text with no host path. - Console: Settings > Agents gets root and project level forms. Each POST route checks Origin and Sec-Fetch-Site, limits the body, and uses the organization's id rule for names. Drafts survive repaints and a revision conflict. Lane: Opus. Rebased onto 96c900d21 by the Lead (range-diff all `=`); A2's own files plus the organization and cli redaction tests rerun on that tree: 11 files, 104/0. Full gate on e9a079fcc: 324 files, 3210/3. None of the three is A2's: case1-accept C4 P10 inner is the known timing flake that also fails on base; system-types-browser passes alone 5/0; rename-v1-wire fails on base because RR added `decision.resolve.delivery` to a response its test pins (follow-up). Review: Sol build (1 P1, 4 P2, 1 P3) and Sol security (3 P2), one fix round. Kept on purpose: the root summary shows the model value, per design line 241. Deferred: per-account root files; `accounts.mjs` `assertAccountsOwner` has the same ancestor-directory gap this lane closed for agent files.
jason.woltje added 4 commits 2026-11-11 00:27:47 +00:00
Root writer for <configDir>/agents.json (owner only, revision-checked, atomic, A1-validated,
receipts name agents and keys only), the project.agents writer verb on the organization
writer, `mosaic agents root` and `mosaic project agents` verbs, and owner-only Settings >
Agents edit forms on GET/POST hooks gated like /api/agents/levels.
The CLI agent verbs validate the instance config through loadSystem before
any read or write, and print a fixed line for errors they do not own. The
root writer refuses a config directory with an ancestor another user can
write without the sticky bit. The project HTTP route checks agent names
with the organization ID_PATTERN and answers 400 naming the key.

The Settings level forms take their own class, so the role-instance
handlers no longer catch them, and keep both drafts in module state with
the revision each began at. The organization writer tests now reach the
file's own uid check and test the assistant protection with an assistant
in the fixture.
jason.woltje merged commit a4eed1e219 into refactor 2026-11-11 00:27:49 +00:00
Sign in to join this conversation.