organization: move packages/business to packages/organization (rename r2 stage B1)
git mv packages/business -> packages/organization (@mosaic/organization). The old package stays as one-line re-export shims of each moved module, with src/business.mjs re-exporting src/organization-config.mjs and src/cli.mjs forwarding to the moved executable. BusinessError is OrganizationConfigError (one constructor, name kept BusinessError); OrganizationError stays distinct. The bus adapter gains organization-context.mjs (busOrganization), with business.mjs (busBusiness) as the same function. Import consumers, manifests, the lockfile, scripts/mosaic, stack-copy.sh COPY_PATHS (both roots), seat sandbox RUNNER_FILES and the copy closure walker (organization-imports.mjs, both roots required) move to the new path. v1 serialization, v1 writers and the stage A fixtures are unchanged; the stage A contract tests stay where they were and pass as before.
This commit is contained in:
1 parent
d6ab5047af
commit
a8d9eecf65
270 files changed
+5678
-5418
No files matched your search
@@ -32,7 +32,7 @@ import { createHash } from "node:crypto";
|
||||
import { join } from "node:path";
|
||||
import { parse as parseYaml } from "yaml";
|
||||
import { PERSONA_CHARS, personaTextFault } from "../packages/harness/src/bundle.mjs";
|
||||
import { selectorScope } from "../packages/business/src/selector.mjs";
|
||||
import { selectorScope } from "../packages/organization/src/selector.mjs";
|
||||
|
||||
// The tool names registered in hermes-agent's tools/*.py at df5700ebe (literal `name="..."` in
|
||||
// registry.register calls; the MCP and plugin tools get their names at run time), plus Hermes and
|
||||
|
||||
@@ -97,7 +97,7 @@ if [ "$STATUS" = 1 ]; then
|
||||
import { lstatSync } from "node:fs";
|
||||
const [repo, id] = process.argv.slice(1);
|
||||
const { loadSystem, rolesDir } = await import(`${repo}/packages/cli/src/config.mjs`);
|
||||
const { loadBusiness } = await import(`${repo}/packages/business/src/index.mjs`);
|
||||
const { loadBusiness } = await import(`${repo}/packages/organization/src/index.mjs`);
|
||||
const { libraryStatus, mirrorPath } = await import(`${repo}/packages/library/src/index.mjs`);
|
||||
const say = (...f) => console.log(f.join("\t"));
|
||||
// A library error code is a fixed [a-z-] string; anything else prints as one name.
|
||||
@@ -183,7 +183,7 @@ facts="$(cd "$REPO" && node --input-type=module -e '
|
||||
import { readFileSync } from "node:fs";
|
||||
const [repo, id] = process.argv.slice(1);
|
||||
const { loadSystem, rolesDir } = await import(`${repo}/packages/cli/src/config.mjs`);
|
||||
const { businessFilePath, configDir, loadBusiness, resolveInstance, systemVars } = await import(`${repo}/packages/business/src/index.mjs`);
|
||||
const { businessFilePath, configDir, loadBusiness, resolveInstance, systemVars } = await import(`${repo}/packages/organization/src/index.mjs`);
|
||||
const say = (...f) => console.log(f.join("\t"));
|
||||
let system;
|
||||
try { system = loadSystem(); } catch (e) { say("CONFIG", "bad", e.message.split("\n")[0]); process.exit(0); }
|
||||
|
||||
@@ -6,7 +6,7 @@ import { BusError, writeGrantEvent } from '../../packages/bus/src/broker.mjs';
|
||||
import { Store } from '../../packages/bus/src/store.mjs';
|
||||
import { startBroker } from '../../packages/bus/src/runtime.mjs';
|
||||
import { grantDecision } from '../../packages/bus/tests/host-fixtures.mjs';
|
||||
import { launchDoc } from '../../packages/business/tests/helpers.mjs';
|
||||
import { launchDoc } from '../../packages/organization/tests/helpers.mjs';
|
||||
import { fakeHarnesses, fixture } from '../../packages/cli/tests/helpers.mjs';
|
||||
import { bootConfig, loadSystem } from '../../packages/cli/src/config.mjs';
|
||||
import { createLauncher } from '../../packages/cli/src/launcher.mjs';
|
||||
|
||||
+4
-3
@@ -3,7 +3,7 @@
|
||||
# with registration for the control board. See packages/seat/README.md.
|
||||
# `mosaic queue <verb>`: the work queue. See packages/queue/README.md.
|
||||
# `mosaic business <verb>`: business files and role instances. See
|
||||
# packages/business/README.md.
|
||||
# packages/organization/README.md.
|
||||
# `mosaic inbox|decide|tasks|agents|trail|talk|stop|launches` and
|
||||
# `mosaic bus start|stop|status`: the human commands, managed sessions and
|
||||
# the bus host. See packages/cli/README.md.
|
||||
@@ -27,12 +27,13 @@ if [ "${1:-}" = queue ]; then
|
||||
fi
|
||||
if [ "${1:-}" = business ]; then
|
||||
# Row 165 (#1662): the human's role instance commands need the human proof,
|
||||
# so they run in packages/cli. validate and resolve stay in packages/business. Row 194 adds veto.
|
||||
# so they run in packages/cli. validate and resolve run in packages/organization (the old
|
||||
# packages/business path is a shim of it, rename r2 stage B). Row 194 adds veto.
|
||||
case "${2:-}" in
|
||||
instances|instance|veto) exec node "$REPO/packages/cli/src/cli.mjs" "$@" ;;
|
||||
esac
|
||||
shift
|
||||
exec node "$REPO/packages/business/src/cli.mjs" "$@"
|
||||
exec node "$REPO/packages/organization/src/cli.mjs" "$@"
|
||||
fi
|
||||
# `mosaic library survey`: names and counts from a writing repo, never its text
|
||||
# (packages/library/README.md). Other library verbs are bus verbs.
|
||||
|
||||
@@ -34,7 +34,7 @@ import process from "node:process";
|
||||
import { randomBytes } from "node:crypto";
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { BusinessError, validateRoleDocument } from "../packages/business/src/index.mjs";
|
||||
import { BusinessError, validateRoleDocument } from "../packages/organization/src/index.mjs";
|
||||
import { RunsError, isRunId, listRunRecords, readRunRecord } from "../packages/runs/src/index.mjs";
|
||||
import { initializeControl, assertProcessing } from "../packages/processing-control/src/state.mjs";
|
||||
import { runContainer } from "../packages/processing-control/src/containers.mjs";
|
||||
@@ -254,7 +254,7 @@ function validateTask(document, file) {
|
||||
// Role contract (M18, slice 1 row S1): seat-declared role authority. The
|
||||
// tools array is a ceiling - seats may narrow it, never escalate past it.
|
||||
// Version 2 adds a contract, an authority map and credential needs;
|
||||
// packages/business validates both versions. Unknown keys refuse, name must
|
||||
// packages/organization validates both versions. Unknown keys refuse, name must
|
||||
// match the filename, wrong document kind refuses.
|
||||
function validateRole(document, file) {
|
||||
try {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Sourced, not run: organization selector options, the shell half of
|
||||
# packages/business/src/selector.mjs (rename design r2, "Selector scopes and parser matrix"). A
|
||||
# packages/organization/src/selector.mjs (rename design r2, "Selector scopes and parser matrix"). A
|
||||
# script in the same checkout sources it; it defines functions only and runs no other program.
|
||||
#
|
||||
# --org and --business are one option family (id), and --org-file and --business-file are another
|
||||
|
||||
@@ -33,7 +33,10 @@ copy_root() { [[ "$ID" =~ ^[0-9a-f]{40}$ ]] || die '--copy must be a full 40-cha
|
||||
COPY_PATHS=(
|
||||
scripts/mosaic scripts/mosaic-config.mjs scripts/case2-persona-import.mjs
|
||||
adapters roles RELEASE package.json package-lock.json
|
||||
packages/bus/src packages/bus/schema.sql packages/business/src packages/cli/src packages/project
|
||||
packages/bus/src packages/bus/schema.sql packages/cli/src packages/project
|
||||
# Rename r2 stage B: packages/organization/src is the implementation. packages/business/src
|
||||
# holds the old-path shims that @mosaic/business callers and the stack-release helper import.
|
||||
packages/organization/src packages/business/src
|
||||
packages/conversation/src packages/discord/src packages/discord/bin packages/discord/extension packages/harness/src
|
||||
packages/seat/src packages/tasks/src packages/tasks/fields.json packages/tasks/requirements.json
|
||||
packages/processing-control
|
||||
|
||||
@@ -363,7 +363,9 @@ check_target() {
|
||||
# harness prints plugins.harness as JSON, or `none`, from the copy's loader
|
||||
# launchby prints launch.by, the PM's instance, from a plain JSON read (row 232); it imports
|
||||
# only business.mjs, for the business file's path
|
||||
# A failure exits 1 and prints its first line.
|
||||
# A failure exits 1 and prints its first line. The path stays packages/business/src/business.mjs
|
||||
# (rename r2 stage B): a copy from before the rename has only that file, and a newer copy keeps it
|
||||
# as a shim of packages/organization/src/organization-config.mjs, so one path reads both.
|
||||
PLUGINS_JS='
|
||||
const {readFileSync}=require("node:fs");const {pathToFileURL}=require("node:url");
|
||||
const [mode,copy,id,kind]=process.argv.slice(1);
|
||||
|
||||
Reference in new issue
Block a user