Files
jason.woltje 068d868a99 lead: commit rocko's untracked evidence (4471 files: queue-124 queue-129 queue-171 queue-178 queue-280 queue-31 queue-84 queue-85 queue-94)
Unclaimed files left in the canonical checkout. Inventory: canonical-cleanup-inventory.md (commit-as-evidence groups). detect-secrets scan clean on 2026-11-02: hits are sha256 pins, git object ids, test sentinels already in tracked tests and unit-file lines.
2026-11-02 15:05:15 -06:00

7.6 KiB

Row 171: thread-project names and business-file repositories

Brief: docs/plans/2026-10-19_project-names-and-repos.md, blob d825a84985, Gitea #1668 / P19 379. Mos mos-0854 approves option B and withdraws D1. Assigned by sage-1019; claimed rev 1970. Reviewer Dewey; gate owner Sage.

Base 0007309492 (origin/refactor); detached worktree /mnt/storage/src/mosaic-stack-rocko-171. The brief's pre-change locations still match. Canonical product files were not edited. No live stack, business-file, schema or store change, no Docker or browser run, no push or candidate source commit.

Behavior and scope

  • project.create checks an existing business-file repository name after unknown-repo and before project-exists. Missing or different repo refuses project-name-is-repo without a row; matching repo succeeds. Non-repository names retain linked/unlinked creation. Existing rows are not revalidated.
  • resolveProject reads the declared business only after project.list misses. Explicit and implicit business selection both get the repository guidance. A missing or malformed file keeps the old message, with no additional bus read. An existing store project returns before the diagnostic load.
  • project create translates only project-name-is-repo into the specified guidance, exit 2; other errors propagate.
  • busStatus maps only this new code to 409. The same patch updates the pinned webui bus.mjs hash and adds the requested comment; no proof, transport or caller change.
  • CLI README and project usage explain that a thread project named for a repo must carry it. No PRD edit.

Added scope: cli.mjs, sage-1021 (rev 1972)

Sage approved carrying the already-resolved business id without new reads. callFor records its existing businessFor result on the parsed context; channelCallFor attaches it as the returned caller's business property. These two scoped hunks implement that one metadata change. thread.mjs passes call.business and io.env to resolveProject. No other cli.mjs hunk, no system/host/bus read added, no transport change. The implicit-selection test writes stand-in host.json in scratch, naming only its own test process and start time; no host or unit starts.

Row 170 also owns cli.mjs at talk/waitingLines. These hunks stay inside callFor/channelCallFor. Whichever row lands second must rebase and rerun touched files under decision 127. Origin remained 000730949 at verification.

Neighboring fixture correction

packages/cli/tests/thread-cli.test.mjs:174 previously awaited project create stack as setup for missing/ambiguous threaded-instance assertions, ignoring whether creation succeeded. The new guard correctly refused that setup, so the first run failed with a later missing-project error (cli-thread-green.log). The one-line correction uses --repo stack and asserts exit 0; every downstream assertion is unchanged. This file is within the brief's CLI tests. The final single-file rerun is cli-thread-final.log, 11/11. The row-164 line-47 fixture and its other approved parity setup hunks are untouched.

Tests and mutants

Five acceptance tests are implemented, each with its own named mutant and killing test. M2 removes the new name-membership guard rather than the entire refusal: removing the entire new rule would preserve legacy behavior, while removing its scope incorrectly refuses unrelated names.

Brief item Test Mutation Result
1 packages/bus/tests/threads.test.mjs:550 — project.create refuses a repository name without its matching repo before any write M1-repo-name-guard: packages/bus/src/broker.mjs:2251 KILLED
2 packages/bus/tests/threads.test.mjs:569 — project.create keeps unrelated names with and without a repository M2-repo-name-scope: packages/bus/src/broker.mjs:2251 KILLED
3 packages/cli/tests/project-name-repo.test.mjs:27 — threads project resolution explains a business repository and falls back if its file cannot load M3-resolver-repository-hint: packages/cli/src/thread.mjs:52 KILLED
4 packages/cli/tests/project-name-repo.test.mjs:58 — project create prints the repository-name refusal and exits two without writing M4-create-repository-hint: packages/cli/src/project.mjs:32 KILLED
5 packages/webui/tests/project-name-repo.test.mjs:5 — a repository-name project refusal is an HTTP conflict M5-http-conflict: packages/webui/src/bus.mjs:93 KILLED

Bus item 1 checks absent repo, a different declared repo, matching success, zero writes on refusal, and ordering against unknown-repo and project-exists. Item 3 also checks implicit selection, missing/malformed config, a successful resolution despite broken config, and no extra bus reads.

Red logs were recorded before production changes: bus 1 fail / 1 pass (legacy preservation is already correct), CLI 2 failures, WebUI 1 failure. They fail for the missing intended behavior. All five final mutant runs fail their named test for the intended behavior; M2 throws the wrongly introduced project-name-is-repo refusal. No syntax/import/timeout failure was counted as a kill.

Verification

Sage-1021 granted focused files and five mutants only. Busy check CLEAR, with exit-status gating before runs. Every file ran singly, in sequence. Grant span: 2026-10-19T18:28:46Z to 2026-10-19T18:31:21Z.

File Tests Passed Failed
bus-threads-green.log 17 17 0
cli-project-names-green.log 2 2 0
webui-project-names-green.log 1 1 0
channel-proof-green.log 2 2 0
cli-project-green.log 4 4 0
cli-thread-final.log 11 11 0

Script-parsed total: 37 tests, 37 passed, 0 failed/cancelled/skipped. Every changed test file ran singly: bus threads, bus channel-proof, CLI project-name-repo and thread-cli, WebUI project-name-repo. CLI project.test.mjs was also checked. No package or shell-suite green is claimed; those belong to Sage's landing gate.

Mutants run with start_new_session, a 180-second timeout, process-group/descendant termination on timeout, and finally restoration. Exact-once preflight passed 5/5. Final candidate worktree/staged hashes and base+patch reconstruction verify all 11 paths. After the last runner exited, cwd-scoped node/chromium sweep was empty; slot clear sent at 2026-10-19T18:31:21Z. No tracked flake, timeout or sandbox run occurred.

Environment: TMPDIR=/mnt/storage/scratch/rocko-171/tmp, DOCKER_HOST=unix:///nonexistent.sock. Runner MOSAIC_CONFIG points to scratch/no-live-config.json so older tests without a config fixture cannot fall through to the user's config. New CLI tests supply their own complete fixture config. No live file or unit is read or modified.

Reader and pin searches

reader-and-pin-search-before.json records base product paths. reader-and-pin-search.json records rg -n -F searches over all 281 package test and scripts/test-*.sh files for every changed path, basename and old/new 64-hex file hash (11 paths). It also extracts matching lines carrying 64-hex pins. Direct imports of cli.mjs have broader coverage than this focused grant; Sage runs the package/shell gate.

The only old transport hash to update is webui bus.mjs in bus channel-proof.test.mjs: dfbc2289337376b94a399a61599fd4af402b802deb2267dcffc5cf23502c9a4c → 76a1b57858c4aa41071746713a196299264851c18322a6f9869d553f0362d421. A closed source comparison confirms the STATUS entry is the sole bus.mjs change. The other three proof baselines remain unchanged and pass.

Landing

Candidate is a reviewable patch only. Sage posts the review request as jarvis because Rocko has no credential. Dewey reviews the manifest; Sage owns the full gate. Nothing goes live here; the window keeps expecting [] from the live threads read until the landing reaches a re-pin.