feat(agents): root and project agent copies at bus boot (#1873) #1917

Merged
jason.woltje merged 4 commits from org-a3 into refactor 2026-11-11 02:58:07 +00:00
Owner

Roles round 2, slice A3 (#1873): root and project agent copies at bus boot.

  • At boot the bus reads the root agents file once (cli config.mjs copiesAtBoot) and freezes a copy set: each root agent the organization doesn't exclude becomes name, and each agent a project defines becomes name.project. Each copy goes through the same validateBusinessDocument and checkRoles path an org instance takes. Nothing reads the root file after boot.
  • Copy states: instance, unbound (credential-unbound, naming the missing service, never a value), refused (copy-refused, project-refused). An org instance with the same name wins. A project copy used outside its project refuses project-agent-elsewhere. Webui maps all four to 409.
  • Project unions reach every agent. An excluded or refused project gives that agent no mount, and thread.create and room verbs in that project refuse project-refused.
  • Checkouts a launch may not see get an empty tmpfs over them. A symlink or file at such a path refuses the launch checkout-unsafe.
  • The launcher rechecks unions after async preparation, and the bus's final admission binds the organization file's revision. Any edit between preparation and admission refuses organization-changed.

Lane: Sol. Gate: 365 files, 4175/0 across the full seat, organization, bus and cli suites plus the browser file, and the files upstream changed. Rebased by the Lead onto a3e82efe2 (redact4); range-diff all =, and the A3 suites plus every redaction acceptance file reran on the rebased tree. Reviews: daybreak-blue security (approve), Sol build (changes 5, fixed), Sol re-check (changes 4, fixed), independent final check (changes 2, both P1, fixed), Opus re-check (approve).

Deferred P3s, logged as follow-ups: role definition files are outside the revision bind; a removed project's checkout stays visible; any organization edit refuses an in-flight launch. Also open: credential binding for copies, and a two-org thread-copy isolation test.

Roles round 2, slice A3 (#1873): root and project agent copies at bus boot. - At boot the bus reads the root agents file once (cli `config.mjs` `copiesAtBoot`) and freezes a copy set: each root agent the organization doesn't exclude becomes `name`, and each agent a project defines becomes `name.project`. Each copy goes through the same `validateBusinessDocument` and `checkRoles` path an org instance takes. Nothing reads the root file after boot. - Copy states: instance, unbound (`credential-unbound`, naming the missing service, never a value), refused (`copy-refused`, `project-refused`). An org instance with the same name wins. A project copy used outside its project refuses `project-agent-elsewhere`. Webui maps all four to 409. - Project unions reach every agent. An excluded or refused project gives that agent no mount, and `thread.create` and room verbs in that project refuse `project-refused`. - Checkouts a launch may not see get an empty tmpfs over them. A symlink or file at such a path refuses the launch `checkout-unsafe`. - The launcher rechecks unions after async preparation, and the bus's final admission binds the organization file's revision. Any edit between preparation and admission refuses `organization-changed`. Lane: Sol. Gate: 365 files, 4175/0 across the full seat, organization, bus and cli suites plus the browser file, and the files upstream changed. Rebased by the Lead onto a3e82efe2 (redact4); range-diff all `=`, and the A3 suites plus every redaction acceptance file reran on the rebased tree. Reviews: daybreak-blue security (approve), Sol build (changes 5, fixed), Sol re-check (changes 4, fixed), independent final check (changes 2, both P1, fixed), Opus re-check (approve). Deferred P3s, logged as follow-ups: role definition files are outside the revision bind; a removed project's checkout stays visible; any organization edit refuses an in-flight launch. Also open: credential binding for copies, and a two-org thread-copy isolation test.
jason.woltje added 4 commits 2026-11-11 02:57:59 +00:00
Each root agent an organization does not exclude, and each agent a project
defines, becomes a copy when the organization's bus boots. The root file is
read once, through loadRootAgents, at the cli boot step; the snapshot is fixed
until the next boot. A bound copy joins the organization document's roles and
goes through validateBusinessDocument and checkRoles with the organization's
own credential map. A copy whose role needs a credential service is unbound
and refuses at launch by name and service (credential-unbound); a copy the
organization refuses is copy-refused; every agent in a project whose union
refuses is project-refused, naming the project. A project agent launches
only with its own project's mounts and takes a thread only in its project
(project-agent-elsewhere). Refusal events carry the code alone. The bus's
instances read carries the copies with their running runs, and the Agents
grid shows each copy's real status and reason.

channel-proof re-pins webui bus.mjs for four STATUS entries; no proof or
transport change. packages/business gets the agent-copies.mjs re-export.
Review fix round for slice A3.

- Every project's union is recomputed from the current organization file
  at each load. A refused union refuses the project's own copies and every
  inherited root or org agent there: no mount at launch (checkout-skipped,
  project-refused), no thread and no room, each naming the project and why.
- A project exclude removes that project's mount from the excluded agent;
  a narrow reaches the instance's resolved limits, so its real bundle is
  narrowed. A narrow in any project narrows the instance for every launch,
  since one launch mounts every project it works in.
- Two copies whose instance names collide both refuse, naming each
  claimant; the view lists the claimants. An organization instance of the
  same name replaces a root or project copy, at boot and after it, and the
  copy is gone rather than refused.
- Rooms hold only the thread instances that work in the room's project.
- The grid finds an agent's copy by name and project from the bus view,
  never by rebuilding the instance name.
- Real-boot regressions: inherited agents in a refused union, exclude and
  narrow in the bundle, an org override after boot, two organizations each
  running a copy, a root file change while running, and a grid fed by a
  booted bus.
- A checkout an earlier launch left for a project the instance may no longer
  work in is covered by an empty tmpfs inside the sandbox; the host copy stays.
- The launcher rechecks every prepared project against the reloaded document
  after preparation, and the bus's final admission takes the instance and
  checks the broker's current unions.
- A project define whose vars changed since boot refuses its copy until the
  next start.
- Instance-name collisions are recomputed at each reload from the frozen root
  claims and the current project defines; every claimant refuses.
jason.woltje merged commit 82dcba2d45 into refactor 2026-11-11 02:58:07 +00:00
Sign in to join this conversation.