hub-evaluator-may-approve.test.mjs
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠ breaking
1 day ago
| 1 | import { test } from 'node:test'; |
| 2 | import assert from 'node:assert/strict'; |
| 3 | import { actorMayApproveProposals } from '../hub/lib/hub-evaluator-may-approve.mjs'; |
| 4 | |
| 5 | test('actorMayApproveProposals: admin always true', () => { |
| 6 | assert.equal(actorMayApproveProposals('u1', 'admin', {}, false), true); |
| 7 | assert.equal(actorMayApproveProposals('u1', 'admin', { u1: false }, false), true); |
| 8 | }); |
| 9 | |
| 10 | test('actorMayApproveProposals: non-evaluator false', () => { |
| 11 | assert.equal(actorMayApproveProposals('u1', 'editor', {}, true), false); |
| 12 | assert.equal(actorMayApproveProposals('u1', 'viewer', {}, true), false); |
| 13 | }); |
| 14 | |
| 15 | test('actorMayApproveProposals: evaluator explicit map wins over env', () => { |
| 16 | assert.equal(actorMayApproveProposals('u1', 'evaluator', { u1: true }, false), true); |
| 17 | assert.equal(actorMayApproveProposals('u1', 'evaluator', { u1: false }, true), false); |
| 18 | }); |
| 19 | |
| 20 | test('actorMayApproveProposals: evaluator missing key uses env fallback', () => { |
| 21 | assert.equal(actorMayApproveProposals('u1', 'evaluator', {}, false), false); |
| 22 | assert.equal(actorMayApproveProposals('u1', 'evaluator', {}, true), true); |
| 23 | }); |
File History
2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠
1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6
docs: accept Calendar Events v0 spec with Phase 0 security …
Human
1 day ago