rhf-d-catalog-consent.test.mjs
sha256:fbe982a22c05c6fe2e93876f250deecdb43d883f648b4e1810c7546caa9f17db
docs: activate KNOWTATION- board identity and preserve livi…
Human
minor
⚠ breaking
1 day ago
| 1 | /** |
| 2 | * RHF-d — catalog match helper unit tests (production probe lives in scripts/). |
| 3 | */ |
| 4 | |
| 5 | import { describe, test } from 'node:test'; |
| 6 | import assert from 'node:assert/strict'; |
| 7 | |
| 8 | import { getTrustedCatalogIdentity } from '../lib/agent/trusted-external-provider-catalog.mjs'; |
| 9 | import { catalogEntryMatches } from '../scripts/verify-rhf-d-catalog-consent.mjs'; |
| 10 | |
| 11 | describe('RHF-d catalog verification helpers', () => { |
| 12 | test('frozen retail catalog entry matches itself exactly', () => { |
| 13 | const expected = getTrustedCatalogIdentity('agent_codex_retail'); |
| 14 | assert.ok(expected); |
| 15 | const match = catalogEntryMatches(expected, expected); |
| 16 | assert.equal(match.ok, true); |
| 17 | }); |
| 18 | |
| 19 | test('rejects provider mismatch', () => { |
| 20 | const expected = getTrustedCatalogIdentity('agent_codex_retail'); |
| 21 | assert.ok(expected); |
| 22 | const bad = { ...expected, provider: 'groq' }; |
| 23 | const match = catalogEntryMatches(bad, expected); |
| 24 | assert.equal(match.ok, false); |
| 25 | assert.equal(match.field, 'provider'); |
| 26 | }); |
| 27 | }); |
File History
1 commit
sha256:fbe982a22c05c6fe2e93876f250deecdb43d883f648b4e1810c7546caa9f17db
docs: activate KNOWTATION- board identity and preserve livi…
Human
minor
⚠
1 day ago