npm notice run @mosaic/business@0.1.0 test
npm notice run node --test tests/
✔ the role file loads and resolves through loadBusiness (8.504862ms)
✔ the shipped file is exactly the approved list (1.044517ms)
✔ the assistant's authority is message.send and record.write within role (3.09732ms)
✔ the assistant talks to the user and the chief of staff only, and no other shipped role is limited (1.047311ms)
✔ a business grant through limits does not widen the role (2.482339ms)
✔ a launch block whose by is the assistant is refused (2.717366ms)
✔ the instance takes no credential references and no tracker (4.721492ms)
✔ an arbiter whose role definition declares messaging lists is refused, for each kind (8.202015ms)
✔ an arbiter without messaging lists is accepted beside the limited assistant (3.299292ms)
✔ the contract passes work to the chief of staff and directs no one (0.895336ms)
✔ REQ-HARN-2: the assistant holds the web grant, and no other role file does (2.283346ms)
✔ config directory and file path follow MOSAIC_CONFIG (1.527298ms)
✔ the fixture business validates and comes back frozen (6.538725ms)
✔ two instances may share a definition (3.201127ms)
✔ top-level refusals (8.238936ms)
✔ arbiters and projects (13.578514ms)
✔ role instances (4.965848ms)
✔ Vikunja bots (11.669074ms)
✔ a role without Vikunja takes no tracker block (2.381614ms)
✔ credential references match the definition's services (2.776914ms)
✔ launch (8.270622ms)
✔ REQ-THREAD-2 REQ-LAUNCH-1 launch.threadIdleSeconds: absent is the default, a positive integer is used, anything else refuses (4.189168ms)
✔ loadBusiness: file checks (1.906556ms)
✔ loadBusiness: not a regular file (35.708642ms)
✔ loading writes nothing (0.976715ms)
✔ names that are Object.prototype properties don't count as declared (2.551327ms)
✔ the shipped example refuses as written and validates once filled in (0.729975ms)
✔ the role file loads and resolves through loadBusiness (9.022092ms)
✔ the shipped file is exactly the approved list (0.31375ms)
✔ the resolved record matches the approved list, so a widened file fails (2.617182ms)
✔ the chief of staff holds role.launch, message.send, role.end, organization.change and record.write; every other action is gated (2.107068ms)
✔ the pm does not hold role.launch (2.500409ms)
✔ a business grant of a gated action through limits does not widen the role (3.572351ms)
✔ a limit that drops role.launch leaves the chief of staff with no launch block (1.784787ms)
✔ a launch block whose by is the pm instance is refused (3.326824ms)
✔ the contract names no duty to talk to the human and the pm contract no launch (0.515998ms)
✔ the instance takes no credential references and no tracker (3.01532ms)
✔ usage errors exit 4 (283.162014ms)
✔ validate: a good business exits 0 and prints instance digests (67.502752ms)
✔ validate: project files (328.803931ms)
✔ validate: missing files and a broken system config (232.646881ms)
✔ validate: credential reference problems exit 2 and name each one (66.313227ms)
✔ validate: a token file inside the repository is refused (62.704751ms)
✔ validate: role definitions come from MOSAIC_ROLES_DIR (188.4663ms)
✔ resolve: prints one instance's record (246.098916ms)
✔ resolve: refusals (361.921447ms)
✔ parse: exactly one of file or env, plus the service's date (3.348009ms)
✔ check: a good file has no problems (1.067994ms)
✔ check never opens the file: a write-only token passes (0.73366ms)
✔ check: file problems (1.135169ms)
✔ check: token files can't live in the repository or dataRoot, even through a linked directory (1.197637ms)
✔ check: dates and environment references (0.544157ms)
✔ each definition loads, with a contract file, and is exactly the approved list (4.867046ms)
✔ an organization file that declares them passes, and each resolves to least privilege (9.412498ms)
✔ the chief of staff launches each one; no other role does (5.389288ms)
✔ a C-suite role can't be made the launcher: launch.by must hold role.launch (3.669591ms)
✔ limits can narrow a C-suite role but never widen it (2.353266ms)
✔ any unknown key, tool, action or version in a role file is refused (1.343607ms)
✔ REQ-WAIT-1: GATED_ONLY is exactly the hard waits; the new actions are in the vocabulary (1.709403ms)
✔ REQ-WAIT-3: every action is routed or a hard wait, never both, and the routed list names only actions (0.372031ms)
✔ REQ-WAIT-2: a role listing a hard wait at either class is refused; the actions that left can be granted (5.18566ms)
✔ REQ-LIMIT-1 schema: every scope unset or zero, adjustable above four, bad values and unknown models refuse (21.452415ms)
✔ REQ-LIMIT-1 counts each exact scope at/over limit, unlimited and old tuple after model reassignment (1.109391ms)
✔ REQ-ROLE-3 writer: atomic validated revision, immutable previous bytes and authenticated actor/old/new receipt (241.64372ms)
✔ REQ-ROLE-3 writer: pre-rename fault leaves old file, post-rename recovery records commit, conflicting recovery refuses (283.552996ms)
✔ REQ-LIMIT-1 / decision145 migration prints only, preserves values, rejects ambiguity, and is idempotent (3.008458ms)
✔ REQ-LIMIT-1 shared settings validates the complete proposed selection and logs exact actor (198.430731ms)
✔ REQ-LIMIT-1 provider is table data: another provider routes separately and aliases share exact counts (1.815973ms)
✔ REQ-ROLE-3 refuses live writer locks, symlink targets and uncertain recovery without changing bytes (108.718061ms)
✔ REQ-PLUG-1 schema: plugins is optional, names known kinds and checked module names (17.568802ms)
✔ REQ-PLUG-1 REQ-ROLE-3 the setter writes plugins through the organization writer and logs old and new names (282.205194ms)
✔ vikunja:19/309 a patch changes only the kinds it names; null removes one kind, explicitly and in the trail (409.358874ms)
✔ vikunja:19/309 an unknown kind (set or removed), a bad module, an empty patch and null on the wrong shape are refused, nothing written (1.511728ms)
✔ REQ-PLUG-1 REQ-ROLE-3 the writer checks the bytes it writes: a Date in plugins is refused there too (40.208536ms)
✔ REQ-PLUG-1 REQ-ROLE-3 a refused setter write throws a code, changes nothing and logs nothing (1.532234ms)
✔ vikunja:19/305 with an exists check, the setter refuses a module no tree file answers to, before anything is written (80.71092ms)
✔ optional project repo is preserved and must be a normalized absolute path (14.381881ms)
✔ loaded business project repo cannot be nested in any declared code checkout (4.608396ms)
✔ path and load (3.002123ms)
✔ refusals (1.944389ms)
✔ record.write is within-role for the eleven approved v2 agents, never gated-only (4.650648ms)
✔ systemVars flattens the validated config (2.73646ms)
✔ precedence: system, business, project, project role, agent (7.656247ms)
✔ limits narrow the definition and never widen it (2.629276ms)
✔ role.launch stays within-role only for the instance the launch block names (4.766722ms)
✔ limits.authority without role.launch leaves the launcher with no launch block (1.738186ms)
✔ limits.authority narrows cross-role actions too (0.983755ms)
✔ classify (1.407903ms)
✔ the record carries what the broker and launcher need (0.779581ms)
✔ digest: key order doesn't matter, any value change does (9.313198ms)
✔ refusals (1.753989ms)
✔ the four shipped version 2 roles load (4.107757ms)
✔ shipped role scopes match addendum B section 2 and the SR runbook (1.374197ms)
✔ shipped authority follows the note's table (1.025077ms)
✔ every role file in roles/ loads through the validator, and a v2 contract exists (1.403295ms)
✔ version 1 files keep loading with no authority (1.123689ms)
✔ the conductor policy isn't a role (0.241901ms)
✔ a missing role file is exit 4, a symbolic link too (0.504403ms)
✔ version 2 refusals (1.827322ms)
✔ authority: closed vocabulary, no gated-only action, no overlap (2.715718ms)
✔ messaging: optional, role definitions and human, never the tester (1.667058ms)
✔ credentials: Gitea scopes (0.653212ms)
✔ credentials: Vikunja scopes are a group-to-verbs map from the grantable list (0.957115ms)
✔ credentials: services (0.435809ms)
✔ contract: a non-empty regular Markdown file beside the role file (1.056003ms)
✔ every key names known layers and a merge rule (1.182158ms)
✔ unknown keys and wrong layers refuse (1.013077ms)
✔ types (2.732872ms)
✔ merge: defaults, then the most specific layer wins (0.358004ms)
✔ merge: limits only narrow, and provenance lists each source (0.447769ms)
✔ merge doesn't change its inputs (0.179837ms)
✔ web.searxng takes https anywhere and http on loopback, so Jason's 127.0.0.1:8888 passes (0.262735ms)
ℹ tests 112
ℹ suites 0
ℹ pass 112
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1918.521824
