npm notice run @mosaic/business@0.1.0 test
npm notice run node --test tests/
✔ the role file loads and resolves through loadBusiness (10.548834ms)
✔ the shipped file is exactly the approved list (1.228386ms)
✔ the assistant's authority is message.send and record.write within role (3.683682ms)
✔ the assistant talks to the user and the chief of staff only, and no other shipped role is limited (0.986042ms)
✔ a business grant through limits does not widen the role (2.3382ms)
✔ a launch block whose by is the assistant is refused (2.807141ms)
✔ the instance takes no credential references and no tracker (4.304246ms)
✔ an arbiter whose role definition declares messaging lists is refused, for each kind (6.914945ms)
✔ an arbiter without messaging lists is accepted beside the limited assistant (4.614251ms)
✔ the contract passes work to the chief of staff and directs no one (1.214654ms)
✔ REQ-HARN-2: the assistant holds the web grant, and no other role file does (2.941348ms)
✔ config directory and file path follow MOSAIC_CONFIG (2.412464ms)
✔ the fixture business validates and comes back frozen (7.422565ms)
✔ two instances may share a definition (2.961836ms)
✔ top-level refusals (6.601931ms)
✔ arbiters and projects (9.336956ms)
✔ role instances (4.94913ms)
✔ Vikunja bots (15.102483ms)
✔ a role without Vikunja takes no tracker block (3.56508ms)
✔ credential references match the definition's services (3.6885ms)
✔ launch (8.83128ms)
✔ REQ-THREAD-2 REQ-LAUNCH-1 launch.threadIdleSeconds: absent is the default, a positive integer is used, anything else refuses (5.026916ms)
✔ loadBusiness: file checks (2.295721ms)
✔ loadBusiness: not a regular file (43.612314ms)
✔ loading writes nothing (1.139752ms)
✔ names that are Object.prototype properties don't count as declared (2.811079ms)
✔ the shipped example refuses as written and validates once filled in (0.733766ms)
✔ the role file loads and resolves through loadBusiness (10.746005ms)
✔ the shipped file is exactly the approved list (0.329656ms)
✔ the resolved record matches the approved list, so a widened file fails (2.787363ms)
✔ the chief of staff holds role.launch, message.send, role.end, organization.change and record.write; every other action is gated (2.840727ms)
✔ the pm does not hold role.launch (3.035954ms)
✔ a business grant of a gated action through limits does not widen the role (3.588575ms)
✔ a limit that drops role.launch leaves the chief of staff with no launch block (1.972003ms)
✔ a launch block whose by is the pm instance is refused (4.341036ms)
✔ the contract names no duty to talk to the human and the pm contract no launch (0.492973ms)
✔ the instance takes no credential references and no tracker (3.267876ms)
✔ usage errors exit 4 (298.214236ms)
✔ validate: a good business exits 0 and prints instance digests (66.746097ms)
✔ validate: project files (314.816895ms)
✔ validate: missing files and a broken system config (234.673827ms)
✔ validate: credential reference problems exit 2 and name each one (60.381722ms)
✔ validate: a token file inside the repository is refused (65.808188ms)
✔ validate: role definitions come from MOSAIC_ROLES_DIR (183.164798ms)
✔ resolve: prints one instance's record (250.632231ms)
✔ resolve: refusals (369.496569ms)
✔ parse: exactly one of file or env, plus the service's date (3.640872ms)
✔ check: a good file has no problems (1.634815ms)
✔ check never opens the file: a write-only token passes (0.776707ms)
✔ check: file problems (1.311251ms)
✔ check: token files can't live in the repository or dataRoot, even through a linked directory (1.348772ms)
✔ check: dates and environment references (0.61056ms)
✔ each definition loads, with a contract file, and is exactly the approved list (5.90182ms)
✔ an organization file that declares them passes, and each resolves to least privilege (9.339357ms)
✔ the chief of staff launches each one; no other role does (5.598148ms)
✔ a C-suite role can't be made the launcher: launch.by must hold role.launch (6.437049ms)
✔ limits can narrow a C-suite role but never widen it (4.068034ms)
✔ any unknown key, tool, action or version in a role file is refused (1.355569ms)
✖ REQ-WAIT-1: GATED_ONLY is exactly the hard waits; the new actions are in the vocabulary (3.020026ms)
✔ REQ-WAIT-3: every action is routed or a hard wait, never both, and the routed list names only actions (0.532982ms)
✖ REQ-WAIT-2: a role listing a hard wait at either class is refused; the actions that left can be granted (1.700591ms)
✔ REQ-LIMIT-1 schema: every scope unset or zero, adjustable above four, bad values and unknown models refuse (24.214488ms)
✔ REQ-LIMIT-1 counts each exact scope at/over limit, unlimited and old tuple after model reassignment (1.322064ms)
✔ REQ-ROLE-3 writer: atomic validated revision, immutable previous bytes and authenticated actor/old/new receipt (257.203488ms)
✔ REQ-ROLE-3 writer: pre-rename fault leaves old file, post-rename recovery records commit, conflicting recovery refuses (246.21555ms)
✔ REQ-LIMIT-1 / decision145 migration prints only, preserves values, rejects ambiguity, and is idempotent (3.270633ms)
✔ REQ-LIMIT-1 shared settings validates the complete proposed selection and logs exact actor (285.573299ms)
✔ REQ-LIMIT-1 provider is table data: another provider routes separately and aliases share exact counts (1.913163ms)
✔ REQ-ROLE-3 refuses live writer locks, symlink targets and uncertain recovery without changing bytes (115.323092ms)
✔ REQ-PLUG-1 schema: plugins is optional, names known kinds and checked module names (18.165732ms)
✔ REQ-PLUG-1 REQ-ROLE-3 the setter writes plugins through the organization writer and logs old and new names (297.382164ms)
✔ vikunja:19/309 a patch changes only the kinds it names; null removes one kind, explicitly and in the trail (433.217065ms)
✔ 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.471241ms)
✔ REQ-PLUG-1 REQ-ROLE-3 the writer checks the bytes it writes: a Date in plugins is refused there too (36.15546ms)
✔ REQ-PLUG-1 REQ-ROLE-3 a refused setter write throws a code, changes nothing and logs nothing (1.583682ms)
✔ vikunja:19/305 with an exists check, the setter refuses a module no tree file answers to, before anything is written (106.753984ms)
✔ optional project repo is preserved and must be a normalized absolute path (15.503723ms)
✔ loaded business project repo cannot be nested in any declared code checkout (4.411439ms)
✔ path and load (3.459081ms)
✔ refusals (1.708272ms)
✔ record.write is within-role for the eleven approved v2 agents, never gated-only (4.335237ms)
✔ systemVars flattens the validated config (2.07101ms)
✔ precedence: system, business, project, project role, agent (7.774974ms)
✔ limits narrow the definition and never widen it (3.116111ms)
✔ role.launch stays within-role only for the instance the launch block names (6.943515ms)
✔ limits.authority without role.launch leaves the launcher with no launch block (2.629068ms)
✔ limits.authority narrows cross-role actions too (1.089462ms)
✔ classify (1.05187ms)
✔ the record carries what the broker and launcher need (1.133199ms)
✔ digest: key order doesn't matter, any value change does (7.942315ms)
✔ refusals (2.160973ms)
✔ the four shipped version 2 roles load (2.811367ms)
✔ shipped role scopes match addendum B section 2 and the SR runbook (0.822279ms)
✔ shipped authority follows the note's table (0.604429ms)
✔ every role file in roles/ loads through the validator, and a v2 contract exists (1.474942ms)
✔ version 1 files keep loading with no authority (1.16582ms)
✔ the conductor policy isn't a role (0.270789ms)
✔ a missing role file is exit 4, a symbolic link too (0.510698ms)
✔ version 2 refusals (2.091691ms)
✔ authority: closed vocabulary, no gated-only action, no overlap (2.802027ms)
✔ messaging: optional, role definitions and human, never the tester (2.275603ms)
✔ credentials: Gitea scopes (1.453728ms)
✔ credentials: Vikunja scopes are a group-to-verbs map from the grantable list (1.044153ms)
✔ credentials: services (0.471709ms)
✔ contract: a non-empty regular Markdown file beside the role file (0.572541ms)
✔ every key names known layers and a merge rule (0.925215ms)
✔ unknown keys and wrong layers refuse (0.712562ms)
✔ types (2.119973ms)
✔ merge: defaults, then the most specific layer wins (0.284313ms)
✔ merge: limits only narrow, and provenance lists each source (0.329155ms)
✔ merge doesn't change its inputs (0.129315ms)
✔ web.searxng takes https anywhere and http on loopback, so Jason's 127.0.0.1:8888 passes (0.182226ms)
ℹ tests 112
ℹ suites 0
ℹ pass 110
ℹ fail 2
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1938.82275

✖ failing tests:

test at tests/hard-waits.test.mjs:22:1
✖ REQ-WAIT-1: GATED_ONLY is exactly the hard waits; the new actions are in the vocabulary (3.020026ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  ... Skipped lines
  
    [
      'account.create',
      'credential.mint',
      'data.delete',
      'deploy',
  ...
      'network.expose',
  -   'spend'
    ]
  
      at TestContext.<anonymous> (file:///home/jwoltje/dewey-scratch/r139/wt/packages/business/tests/hard-waits.test.mjs:23:10)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.start (node:internal/test_runner/test:1262:17)
      at startSubtestAfterBootstrap (node:internal/test_runner/harness:387:17) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: [ 'account.create', 'credential.mint', 'data.delete', 'deploy', 'git.push.protected', 'message.external', 'network.expose' ],
    expected: [ 'account.create', 'credential.mint', 'data.delete', 'deploy', 'git.push.protected', 'message.external', 'network.expose', 'spend' ],
    operator: 'deepStrictEqual',
    diff: 'simple'
  }

test at tests/hard-waits.test.mjs:33:1
✖ REQ-WAIT-2: a role listing a hard wait at either class is refused; the actions that left can be granted (1.700591ms)
  AssertionError [ERR_ASSERTION]: Missing expected exception: spend
      at TestContext.<anonymous> (file:///home/jwoltje/dewey-scratch/r139/wt/packages/business/tests/hard-waits.test.mjs:35:12)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:974:18)
      at Test.postRun (node:internal/test_runner/test:1542:19)
      at Test.run (node:internal/test_runner/test:1467:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: undefined,
    expected: /always gated/,
    operator: 'throws',
    diff: 'simple'
  }
