hosted-write-eval-hints-budget-data-integrity.test.mjs
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
12 days ago
| 1 | /** |
| 2 | * HOSTED-WRITE-EVAL hints budget — Tier 5 data-integrity: skip predicate + budget cap invariants. |
| 3 | */ |
| 4 | import { describe, it } from 'node:test'; |
| 5 | import assert from 'node:assert/strict'; |
| 6 | import { SCOOLING_REVIEW_TRAY_INTENT } from '../lib/hub-proposal-personal-self-apply.mjs'; |
| 7 | import { |
| 8 | HOSTED_PROPOSAL_REVIEW_HINTS_INLINE_BUDGET_MS, |
| 9 | shouldSkipInlineReviewHintsOnCreate, |
| 10 | } from '../hub/gateway/proposal-review-hints-async.mjs'; |
| 11 | |
| 12 | describe('hosted review-hints budget (data-integrity)', () => { |
| 13 | it('skip is exact-intent only (no substring / case drift)', () => { |
| 14 | assert.equal(shouldSkipInlineReviewHintsOnCreate({ intent: SCOOLING_REVIEW_TRAY_INTENT }), true); |
| 15 | assert.equal( |
| 16 | shouldSkipInlineReviewHintsOnCreate({ intent: `${SCOOLING_REVIEW_TRAY_INTENT} ` }), |
| 17 | true, |
| 18 | ); |
| 19 | assert.equal( |
| 20 | shouldSkipInlineReviewHintsOnCreate({ intent: 'Scooling.review_tray.approve' }), |
| 21 | false, |
| 22 | ); |
| 23 | assert.equal( |
| 24 | shouldSkipInlineReviewHintsOnCreate({ intent: 'scooling.review_tray.approve.extra' }), |
| 25 | false, |
| 26 | ); |
| 27 | }); |
| 28 | |
| 29 | it('budget constant stays a positive integer under 15s', () => { |
| 30 | assert.equal(Number.isInteger(HOSTED_PROPOSAL_REVIEW_HINTS_INLINE_BUDGET_MS), true); |
| 31 | assert.ok(HOSTED_PROPOSAL_REVIEW_HINTS_INLINE_BUDGET_MS > 0); |
| 32 | assert.ok(HOSTED_PROPOSAL_REVIEW_HINTS_INLINE_BUDGET_MS <= 5000); |
| 33 | }); |
| 34 | }); |
File History
1 commit
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
12 days ago