npm notice run @mosaic/business@0.1.0 test
npm notice run node --test tests/
✔ the role file loads and resolves through loadBusiness (9.597237ms)
✔ the shipped file is exactly the approved list (1.203174ms)
✔ the assistant's authority is message.send and record.write within role (3.364375ms)
✔ the assistant talks to the user and the chief of staff only, and no other shipped role is limited (0.982977ms)
✔ a business grant through limits does not widen the role (2.271256ms)
✔ a launch block whose by is the assistant is refused (2.535096ms)
✔ the instance takes no credential references and no tracker (3.853085ms)
✔ an arbiter whose role definition declares messaging lists is refused, for each kind (5.96299ms)
✔ an arbiter without messaging lists is accepted beside the limited assistant (3.556686ms)
✔ the contract passes work to the chief of staff and directs no one (1.014701ms)
✔ REQ-HARN-2: the assistant holds the web grant, and no other role file does (2.257362ms)
✔ config directory and file path follow MOSAIC_CONFIG (1.706827ms)
✔ the fixture business validates and comes back frozen (6.976803ms)
✔ two instances may share a definition (3.098838ms)
✔ top-level refusals (7.783094ms)
✔ arbiters and projects (11.055772ms)
✔ role instances (4.873722ms)
✔ Vikunja bots (12.432634ms)
✔ a role without Vikunja takes no tracker block (2.714598ms)
✔ credential references match the definition's services (2.58503ms)
✔ launch (9.246014ms)
✔ REQ-THREAD-2 REQ-LAUNCH-1 launch.threadIdleSeconds: absent is the default, a positive integer is used, anything else refuses (3.897576ms)
✔ loadBusiness: file checks (1.803071ms)
✔ loadBusiness: not a regular file (36.906861ms)
✔ loading writes nothing (0.947101ms)
✔ names that are Object.prototype properties don't count as declared (2.539605ms)
✔ the shipped example refuses as written and validates once filled in (0.728888ms)
✔ the role file loads and resolves through loadBusiness (10.226093ms)
✔ the shipped file is exactly the approved list (0.32212ms)
✔ the resolved record matches the approved list, so a widened file fails (3.440373ms)
✔ the chief of staff holds role.launch, message.send, role.end, organization.change and record.write; every other action is gated (2.277084ms)
✔ the pm does not hold role.launch (2.597543ms)
✔ a business grant of a gated action through limits does not widen the role (4.124056ms)
✔ a limit that drops role.launch leaves the chief of staff with no launch block (1.738818ms)
✔ a launch block whose by is the pm instance is refused (3.980015ms)
✔ the contract names no duty to talk to the human and the pm contract no launch (1.019427ms)
✔ the instance takes no credential references and no tracker (4.693232ms)
✔ usage errors exit 4 (308.850956ms)
✔ validate: a good business exits 0 and prints instance digests (60.373942ms)
✔ validate: project files (301.949555ms)
✔ validate: missing files and a broken system config (233.987421ms)
✔ validate: credential reference problems exit 2 and name each one (63.506012ms)
✔ validate: a token file inside the repository is refused (61.975422ms)
✔ validate: role definitions come from MOSAIC_ROLES_DIR (185.602132ms)
✔ resolve: prints one instance's record (246.624711ms)
✔ resolve: refusals (376.691613ms)
✔ parse: exactly one of file or env, plus the service's date (3.352574ms)
✔ check: a good file has no problems (1.151451ms)
✔ check never opens the file: a write-only token passes (0.464528ms)
✔ check: file problems (1.290868ms)
✔ check: token files can't live in the repository or dataRoot, even through a linked directory (1.436318ms)
✔ check: dates and environment references (0.57949ms)
✔ each definition loads, with a contract file, and is exactly the approved list (4.656117ms)
✔ an organization file that declares them passes, and each resolves to least privilege (7.834462ms)
✔ the chief of staff launches each one; no other role does (4.227579ms)
✔ a C-suite role can't be made the launcher: launch.by must hold role.launch (3.141382ms)
✔ limits can narrow a C-suite role but never widen it (2.34921ms)
✔ any unknown key, tool, action or version in a role file is refused (2.632668ms)
✔ REQ-WAIT-1: GATED_ONLY is exactly the hard waits; the new actions are in the vocabulary (1.837791ms)
✔ REQ-WAIT-3: every action is routed or a hard wait, never both, and the routed list names only actions (0.396943ms)
✔ REQ-WAIT-2: a role listing a hard wait at either class is refused; the actions that left can be granted (5.30842ms)
✔ REQ-LIMIT-1 schema: every scope unset or zero, adjustable above four, bad values and unknown models refuse (21.507805ms)
✔ REQ-LIMIT-1 counts each exact scope at/over limit, unlimited and old tuple after model reassignment (1.114395ms)
✔ REQ-ROLE-3 writer: atomic validated revision, immutable previous bytes and authenticated actor/old/new receipt (258.967378ms)
✔ REQ-ROLE-3 writer: pre-rename fault leaves old file, post-rename recovery records commit, conflicting recovery refuses (266.105284ms)
✔ REQ-LIMIT-1 / decision145 migration prints only, preserves values, rejects ambiguity, and is idempotent (4.309719ms)
✔ REQ-LIMIT-1 shared settings validates the complete proposed selection and logs exact actor (227.011574ms)
✔ REQ-LIMIT-1 provider is table data: another provider routes separately and aliases share exact counts (1.879955ms)
✔ REQ-ROLE-3 refuses live writer locks, symlink targets and uncertain recovery without changing bytes (130.740799ms)
✔ REQ-PLUG-1 schema: plugins is optional, names known kinds and checked module names (18.617206ms)
✔ REQ-PLUG-1 REQ-ROLE-3 the setter writes plugins through the organization writer and logs old and new names (332.19497ms)
✔ vikunja:19/309 a patch changes only the kinds it names; null removes one kind, explicitly and in the trail (424.914224ms)
✔ 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.554732ms)
✔ REQ-PLUG-1 REQ-ROLE-3 the writer checks the bytes it writes: a Date in plugins is refused there too (43.022762ms)
✔ REQ-PLUG-1 REQ-ROLE-3 a refused setter write throws a code, changes nothing and logs nothing (1.625239ms)
✔ vikunja:19/305 with an exists check, the setter refuses a module no tree file answers to, before anything is written (98.517559ms)
✔ optional project repo is preserved and must be a normalized absolute path (14.451464ms)
✔ loaded business project repo cannot be nested in any declared code checkout (6.137616ms)
✔ path and load (3.031751ms)
✔ refusals (1.982635ms)
✔ record.write is within-role for the eleven approved v2 agents, never gated-only (4.745951ms)
✔ systemVars flattens the validated config (2.270363ms)
✔ precedence: system, business, project, project role, agent (5.84455ms)
✔ limits narrow the definition and never widen it (2.101152ms)
✔ role.launch stays within-role only for the instance the launch block names (4.952572ms)
✔ limits.authority without role.launch leaves the launcher with no launch block (1.86313ms)
✔ limits.authority narrows cross-role actions too (1.037525ms)
✔ classify (1.084244ms)
✔ the record carries what the broker and launcher need (1.279123ms)
✔ digest: key order doesn't matter, any value change does (8.406016ms)
✔ refusals (1.933005ms)
✔ the four shipped version 2 roles load (3.68944ms)
✔ shipped role scopes match addendum B section 2 and the SR runbook (0.886973ms)
✔ shipped authority follows the note's table (0.82845ms)
✔ every role file in roles/ loads through the validator, and a v2 contract exists (1.352113ms)
✔ version 1 files keep loading with no authority (0.921487ms)
✔ the conductor policy isn't a role (0.176306ms)
✔ a missing role file is exit 4, a symbolic link too (0.352647ms)
✔ version 2 refusals (1.340866ms)
✔ authority: closed vocabulary, no gated-only action, no overlap (2.306152ms)
✔ messaging: optional, role definitions and human, never the tester (1.46686ms)
✔ credentials: Gitea scopes (0.719106ms)
✔ credentials: Vikunja scopes are a group-to-verbs map from the grantable list (0.991797ms)
✔ credentials: services (0.483901ms)
✔ contract: a non-empty regular Markdown file beside the role file (0.574639ms)
✔ every key names known layers and a merge rule (0.921441ms)
✔ unknown keys and wrong layers refuse (0.852618ms)
✔ types (2.110047ms)
✔ merge: defaults, then the most specific layer wins (0.292852ms)
✔ merge: limits only narrow, and provenance lists each source (0.329986ms)
✔ merge doesn't change its inputs (0.154104ms)
✔ web.searxng takes https anywhere and http on loopback, so Jason's 127.0.0.1:8888 passes (0.181177ms)
ℹ tests 112
ℹ suites 0
ℹ pass 112
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1921.103424
