feat(bus,cli,organization,webui): applying a starter pack is the hire decision, hires fall back to the assistant's route (#1873) #1963

Merged
jason.woltje merged 4 commits from pdpr2 into refactor 2026-11-15 01:01:56 +00:00
Owner

Applying a starter pack is the hire decision (#1873). Jason's ruling, 2026-11-14: "If I choose a starter pack and apply it, that is a decision!" This replaces section 3 of the starter packs design ("apply never hires"). Briefs: PACK-DECISION-BRIEF.md (lane pd) and PACK-ROUTE-BRIEF.md (lane pr2). No roles, contracts or schema change. Schema stays 3w.

Lane pd (359b3299b, 3e53af394):

  1. pack.apply.console commits the pack, then hires each proposed agent through the existing hire-decisions path (#raiseHire and hire.resolve.console). Each hire gets its own decision and its evidence names pack.hire. When the call returns, the agents exist.
  2. Authority follows invariant 7. The owner's apply approves every line, including flagged and credential lines. A credential line is approved but not bound, so the agent's launch refuses credential-unbound until its services are bound. An agent's apply hires nothing.
  3. New verb pack.hire.console and CLI mosaic org pack hire ID PACK [--project P] hire from a pack already applied, and hire nobody twice. New refusals: pack-not-applied, pack-hire-route-missing. A second pack hire on the same org refuses organization-busy. Results are per proposal, not all or nothing.
  4. WebUI: the pack card shows "N agents hired" and a "Hire the N proposed agents" button for packs applied before this change. Agent cards say "from pack X". The page redraws at once. Fire is hidden on the chief and the assistant.

Lane pr2 (bfd2cc5e7, b913f0f4c): a pack hire takes its harness and model from the chief of staff, else from the org assistant (the instance with definition assistant; the one named assistant wins, else the first in key order), else it refuses pack-hire-route-missing. Receipt lines carry routeFrom. Lead ruling: no chief on the dev instance has a model, so without this, applying a pack there still hired nobody.

Gates: pd 407 files, 3972/0 at 3e53af394. pr2 243 files, 2673/0 at b913f0f4c. pr2 red before: 1 pass / 3 fail on the pd tip with the new tests.

Lead check (Lead, env -i, 333 files: touched tests, importers of touched src, refusal/redact/rename-b/project-runtime/schema pins) at b913f0f4c: 3813/1. The one red is control-board scan.test 'lastError carries the assistant errorMessage', a same-millisecond mtime tie under load in a file this PR does not touch; it passes 70/0 three times alone.

Reviews (fresh Opus 5.5 delegates): pd review approved with six findings. P2#2 (an owner supersede withdrew the old inbox decision before the replacement hired), P3#3, P3#5 and P3#6 were fixed. The pd re-check approved, and its mutation checks show each fix is pinned by a test. pr2 review approved with three P3s, all fixed in b913f0f4c.

Deferred, with Lead rulings:

  • P2#1: the member pack hire works at the bus (bindHireConsole), but no WebUI or CLI path reaches it. Adding a member writer to the Console opens a new production path for a member hire cap, which is a security boundary, so it is a follow-up row.
  • P3#4: project agents don't show which pack hired them.
  • The Agents table shows the definition as org:hire-<uuid> instead of the role name.
  • The pack hire latch is in memory only. Fire covers org-level agents only.
  • Reviewer note: the CLI owner path is the first non-Console path that approves hire decisions.
Applying a starter pack is the hire decision (#1873). Jason's ruling, 2026-11-14: "If I choose a starter pack and apply it, that is a decision!" This replaces section 3 of the starter packs design ("apply never hires"). Briefs: `PACK-DECISION-BRIEF.md` (lane pd) and `PACK-ROUTE-BRIEF.md` (lane pr2). No roles, contracts or schema change. Schema stays 3w. Lane pd (359b3299b, 3e53af394): 1. `pack.apply.console` commits the pack, then hires each proposed agent through the existing hire-decisions path (`#raiseHire` and `hire.resolve.console`). Each hire gets its own decision and its evidence names `pack.hire`. When the call returns, the agents exist. 2. Authority follows invariant 7. The owner's apply approves every line, including flagged and credential lines. A credential line is approved but not bound, so the agent's launch refuses `credential-unbound` until its services are bound. An agent's apply hires nothing. 3. New verb `pack.hire.console` and CLI `mosaic org pack hire ID PACK [--project P]` hire from a pack already applied, and hire nobody twice. New refusals: `pack-not-applied`, `pack-hire-route-missing`. A second pack hire on the same org refuses `organization-busy`. Results are per proposal, not all or nothing. 4. WebUI: the pack card shows "N agents hired" and a "Hire the N proposed agents" button for packs applied before this change. Agent cards say "from pack X". The page redraws at once. Fire is hidden on the chief and the assistant. Lane pr2 (bfd2cc5e7, b913f0f4c): a pack hire takes its harness and model from the chief of staff, else from the org assistant (the instance with definition `assistant`; the one named `assistant` wins, else the first in key order), else it refuses `pack-hire-route-missing`. Receipt lines carry `routeFrom`. Lead ruling: no chief on the dev instance has a model, so without this, applying a pack there still hired nobody. Gates: pd 407 files, 3972/0 at 3e53af394. pr2 243 files, 2673/0 at b913f0f4c. pr2 red before: 1 pass / 3 fail on the pd tip with the new tests. Lead check (Lead, env -i, 333 files: touched tests, importers of touched src, refusal/redact/rename-b/project-runtime/schema pins) at b913f0f4c: 3813/1. The one red is control-board scan.test 'lastError carries the assistant errorMessage', a same-millisecond mtime tie under load in a file this PR does not touch; it passes 70/0 three times alone. Reviews (fresh Opus 5.5 delegates): pd review approved with six findings. P2#2 (an owner supersede withdrew the old inbox decision before the replacement hired), P3#3, P3#5 and P3#6 were fixed. The pd re-check approved, and its mutation checks show each fix is pinned by a test. pr2 review approved with three P3s, all fixed in b913f0f4c. Deferred, with Lead rulings: - P2#1: the member pack hire works at the bus (`bindHireConsole`), but no WebUI or CLI path reaches it. Adding a member writer to the Console opens a new production path for a member hire cap, which is a security boundary, so it is a follow-up row. - P3#4: project agents don't show which pack hired them. - The Agents table shows the definition as `org:hire-<uuid>` instead of the role name. - The pack hire latch is in memory only. Fire covers org-level agents only. - Reviewer note: the CLI owner path is the first non-Console path that approves hire decisions.
jason.woltje added 4 commits 2026-11-15 01:01:47 +00:00
Ruling 2026-11-14: a person's pack apply records one hire decision per
proposed hire and applies it in the same act, through the hire-decisions
path, with the evidence an inbox approval leaves.

- bus: pack.apply.console runs the pack hire loop; pack.hire.console hires
  an applied record's open proposals. The owner's apply approves flagged and
  credential lines; a member with org.hire gets the unflagged hires and the
  rest open as awaiting-owner decisions; an agent apply still refuses
  human-required. Project packs hire into projects.<p>.agents. Nothing is
  hired twice. Credential lines are approved, not bound. New refusal codes
  pack-not-applied and pack-hire-route-missing. The instances read names the
  pack each hire came from; the packs read lists hired agents and open
  proposals with reasons.
- organization: pack.hire.console maps to org.hire; instances carry
  hireDecision.
- cli: mosaic org pack hire ID PACK [--project P]; apply prints the hires.
- webui: pack card shows N agents hired, open proposals with reasons and
  "Hire the N proposed agents"; Agents and organization pages redraw on
  mosaic-org-changed; agent cards say "from pack X"; Fire (not on the chief
  or assistant) removes the card at once with a receipt.
- docs: design doc section 3 dated note, TOOLS.md, package READMEs.
Review pd-review.md (changes 6). Fixed:
- P2#2: the owner's pack hire withdraws a pack-raised inbox decision only
  after its replacement hire applied; a replacement that refuses (route
  missing, prepare refusal) leaves the old decision open in the inbox.
- P3#3: an apply whose hire loop throws after the apply committed still
  answers the apply receipt, with no hires and the code as hireError; the
  route passes a code through and the card says the hires did not run.
- P3#5: the packs read marks an awaiting-owner line this pack's own hire
  raised fromPack: true; the owner's card counts it in "Hire the N".
- P3#6: one pack hire loop per business; a second refuses
  organization-busy and raises nothing.
- P2#1 docs: TOOLS.md and the bus README say no member surface calls
  pack.hire.console yet (the member surface is a recorded follow-up).

Deferred: P3#4 project agents naming their pack (projectUnion is shared
with the runtime).
pack.state gave a pack hire only the chief of staff's resolved route, so an
org whose chief has no model refused every hire pack-hire-route-missing. The
route is now the chief's (launch.by), else the org assistant's (the instance
whose definition is assistant; the one named assistant when there are several,
else the first in key order), else null. Both resolve through resolveInstance,
need harness and model, and carry thinking when set. pack.state adds routeFrom,
and each hired or awaiting-owner receipt line carries it. Refusal next step,
CLI hint, WebUI hire reason and the bus, CLI and TOOLS docs say the refusal now
means neither has a route.
The WebUI packs receipt passes routeFrom through on each hire line; the WebUI
README and TOOLS.md name it. The starter packs design doc gets a dated note
for the 2026-11-14 route ruling. New bus tests: a member pack hire on the
assistant route marks hired and awaiting-owner lines routeFrom assistant, and
a project pack with no chief route hires into the project on the assistant's
harness and model.
jason.woltje merged commit b913f0f4c8 into refactor 2026-11-15 01:01:56 +00:00
Sign in to join this conversation.