fix(cli,bus,organization): E2E round 6, refusal lines name the next step, template save keeps prose (#1873) #1962

Merged
jason.woltje merged 4 commits from f6c into refactor 2026-11-14 02:26:41 +00:00
Owner

CLI, bus and organization fixes from E2E round 6 (#1873). Tester report: e2e-r6-cli-report.md (0/0/7), plus WebUI report P2-5. Brief: E2E6-FIX-BRIEF.md, lane f6c. No roles or contracts change, no credential handling change, schema stays 3w.

  1. Stale-lock refusals from bus status, start, stop and restart print mosaic: next: mosaic bus recover <org> (host.mjs, org-bus.mjs).
  2. org definitions failures print one line with no stack trace and no host path. A bad id or name exits 4 with the usage line. A missing org file is unknown-organization; any other unreadable file is definitions-unreadable.
  3. Pack, board and workflow refusals print their hint, the way template save does. The test runs a CliError-shaped transport over the real broker, not the mock that hid this.
  4. console start and stop clear a console/start.lock whose named supervisor (pid and start time) is gone. A live holder's lock is never cleared, and neither is a lock that names no holder. Release writes a released marker and unlinks only when the fd still matches the path, so a released lock is cleared, not restored.
  5. Template save no longer writes placeholders. Lead ruling: a placeholder is allowed only where a field's whole value is the identifier, and no captured field qualifies, so free text is saved verbatim. The preview lists each field that mentions an org-specific name or a project root, so the owner reads them before saving. The red-before test was "hand finished work to review" with project work, which used to become "finished {project}".
  6. A stopped bus is not outcome-unknown. The client marks a request not sent only when connect fails (ENOENT, ECONNREFUSED, ENOTDIR, ENOTSOCK). The shims exit 5, and the CLI maps exit 5 with outcome-unknown to bus-not-running. A dropped answer after connect stays outcome-unknown.
  7. autonomy-precondition carries the reason, including on the hire paths.
  8. New template-exists refusal (refusal table group R10, in TEMPLATE_CODES) for a save under a taken name. The name check runs before the digest check. The CLI exits 2. The WebUI template route maps it to 409. Without that mapping the route answered 503 outcome-unknown, and the Lead added it in the last commit.

Pins moved: templates.test, org-templates.test, template-save.test, channel-proof.test (human-cli.mjs and transport.mjs hashes), template-http.test.

Lane gate at 38d659a3f: 173 files, 2272/0. Full gate at the first fix commit: 455 files, 5130/1. The one red was template-http.test:88, fixed here by 65f7288ce.

Lead check under env -i on this head (408 files: touched tests, importers of every touched src basename, refusal, redact, rename-b, project-runtime and schema tests, without v1 and agents probes): 4759/2 plus 37 environment skips (systemd user scopes, FED R7, Quick Setup scratch fixture). The 2 fails: CHAT-01 jsonschema (base) and a case1-accept precheck inner-timeout under load, which passes 57/0 alone; f6c does not touch that file.

Reviews (fresh Opus 5.5 delegates): the review approved with five P3s. P3-1 to P3-3 were fixed (released start locks, ENOENT mapping, path cut after : and backtick). The re-check approved with four notes. rc-2 (a failed marker write skipped the unlink) and rc-4 (docs) were fixed. The rebase onto f6w (23b5e24eb) applied cleanly and range-diff shows the three commits unchanged.

Upgrade note: templates saved on e6ab8bc1f (SP8/SP9) may hold literal {org}, {project} or {root}, and apply no longer resolves them. Re-save them. Only dev instances have any.

Follow-ups:

  • Design section 5 item 1 still describes placeholders. The Lead ruling replaced that rule, so the doc needs an amendment.
  • Prose that names a project root is saved verbatim. The preview lists it under mentions.
  • The WebUI autonomy route should forward the bus reason for autonomy-precondition. A test should check that every TEMPLATE_CODES entry has a WebUI mapping.
  • A two-holder console lock outcome is still possible with three commands racing one dead lock. The released-marker write has no direct test.
CLI, bus and organization fixes from E2E round 6 (#1873). Tester report: `e2e-r6-cli-report.md` (0/0/7), plus WebUI report P2-5. Brief: `E2E6-FIX-BRIEF.md`, lane f6c. No roles or contracts change, no credential handling change, schema stays 3w. 1. Stale-lock refusals from `bus status`, `start`, `stop` and `restart` print `mosaic: next: mosaic bus recover <org>` (host.mjs, org-bus.mjs). 2. `org definitions` failures print one line with no stack trace and no host path. A bad id or name exits 4 with the usage line. A missing org file is `unknown-organization`; any other unreadable file is `definitions-unreadable`. 3. Pack, board and workflow refusals print their hint, the way template save does. The test runs a CliError-shaped transport over the real broker, not the mock that hid this. 4. `console start` and `stop` clear a `console/start.lock` whose named supervisor (pid and start time) is gone. A live holder's lock is never cleared, and neither is a lock that names no holder. Release writes a released marker and unlinks only when the fd still matches the path, so a released lock is cleared, not restored. 5. Template save no longer writes placeholders. Lead ruling: a placeholder is allowed only where a field's whole value is the identifier, and no captured field qualifies, so free text is saved verbatim. The preview lists each field that mentions an org-specific name or a project root, so the owner reads them before saving. The red-before test was "hand finished work to review" with project `work`, which used to become "finished {project}". 6. A stopped bus is not outcome-unknown. The client marks a request not sent only when connect fails (ENOENT, ECONNREFUSED, ENOTDIR, ENOTSOCK). The shims exit 5, and the CLI maps exit 5 with outcome-unknown to `bus-not-running`. A dropped answer after connect stays outcome-unknown. 7. `autonomy-precondition` carries the reason, including on the hire paths. 8. New `template-exists` refusal (refusal table group R10, in TEMPLATE_CODES) for a save under a taken name. The name check runs before the digest check. The CLI exits 2. The WebUI template route maps it to 409. Without that mapping the route answered 503 outcome-unknown, and the Lead added it in the last commit. Pins moved: templates.test, org-templates.test, template-save.test, channel-proof.test (human-cli.mjs and transport.mjs hashes), template-http.test. Lane gate at 38d659a3f: 173 files, 2272/0. Full gate at the first fix commit: 455 files, 5130/1. The one red was template-http.test:88, fixed here by 65f7288ce. Lead check under `env -i` on this head (408 files: touched tests, importers of every touched src basename, refusal, redact, rename-b, project-runtime and schema tests, without v1 and agents probes): 4759/2 plus 37 environment skips (systemd user scopes, FED R7, Quick Setup scratch fixture). The 2 fails: CHAT-01 jsonschema (base) and a case1-accept precheck inner-timeout under load, which passes 57/0 alone; f6c does not touch that file. Reviews (fresh Opus 5.5 delegates): the review approved with five P3s. P3-1 to P3-3 were fixed (released start locks, ENOENT mapping, path cut after `:` and backtick). The re-check approved with four notes. rc-2 (a failed marker write skipped the unlink) and rc-4 (docs) were fixed. The rebase onto f6w (23b5e24eb) applied cleanly and range-diff shows the three commits unchanged. Upgrade note: templates saved on e6ab8bc1f (SP8/SP9) may hold literal `{org}`, `{project}` or `{root}`, and apply no longer resolves them. Re-save them. Only dev instances have any. Follow-ups: - Design section 5 item 1 still describes placeholders. The Lead ruling replaced that rule, so the doc needs an amendment. - Prose that names a project root is saved verbatim. The preview lists it under mentions. - The WebUI autonomy route should forward the bus reason for autonomy-precondition. A test should check that every TEMPLATE_CODES entry has a WebUI mapping. - A two-holder console lock outcome is still possible with three commands racing one dead lock. The released-marker write has no direct test.
jason.woltje added 4 commits 2026-11-14 02:26:33 +00:00
1. Stale bus host lock refusals from bus status, start, stop and restart
   name mosaic bus recover ORG.
2. org definitions: unknown org, unknown or malformed name and bad id give
   one refusal or usage line, no stack trace, no host path.
3. Pack, board and workflow refusals print their hint as template save does;
   tested with the real CliError transport shape.
4. console start and stop clear a console/start.lock whose named supervisor
   (pid and start time) is gone; a live or unnamed holder refuses.
5. Template save keeps free text verbatim and writes no placeholders; the
   preview lists each field that mentions an org-specific name.
6. A request the shim never sent (no socket, connect refused) exits 5 and
   the CLI reports bus-not-running with the start and recover line.
7. autonomy-precondition carries the check that failed, including on the
   hire paths.
8. Saving under an existing template name refuses template-exists with a
   next step; refusal table entry added, channel-proof pins moved.
P3-1: releasing a console start lock marks it released through its own
descriptor and removes the path only while it is still that file; a
released lock put back by a racing clear is cleared by the next start or
stop.
P3-2: org definitions reports unknown-organization only when the
organization file itself is missing; another missing file names the
operation.
P3-3: the path cut also covers a path after ':' or inside backticks.
f6c added template-exists for a save under a taken name. The template
route had no entry for it, so a duplicate save answered 503
outcome-unknown. Map it to 409 and move the SP8 pin.
jason.woltje merged commit 65f7288cea into refactor 2026-11-14 02:26:41 +00:00
Sign in to join this conversation.