hosted-write-eval-hints-budget-unit.test.mjs
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
9 days ago
| 1 | /** |
| 2 | * HOSTED-WRITE-EVAL hints budget — Tier 1 unit: skip + default budget constants. |
| 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 inline budget (unit)', () => { |
| 13 | it('default inline budget is 2000 ms (under Scooling 15s abort)', () => { |
| 14 | assert.equal(HOSTED_PROPOSAL_REVIEW_HINTS_INLINE_BUDGET_MS, 2000); |
| 15 | assert.ok(HOSTED_PROPOSAL_REVIEW_HINTS_INLINE_BUDGET_MS < 15_000); |
| 16 | }); |
| 17 | |
| 18 | it('skips Scooling review-tray intent on create', () => { |
| 19 | assert.equal( |
| 20 | shouldSkipInlineReviewHintsOnCreate({ intent: SCOOLING_REVIEW_TRAY_INTENT }), |
| 21 | true, |
| 22 | ); |
| 23 | }); |
| 24 | |
| 25 | it('does not skip ordinary Hub create intents', () => { |
| 26 | assert.equal(shouldSkipInlineReviewHintsOnCreate({ intent: 'note.update' }), false); |
| 27 | assert.equal(shouldSkipInlineReviewHintsOnCreate({}), false); |
| 28 | assert.equal(shouldSkipInlineReviewHintsOnCreate(null), false); |
| 29 | }); |
| 30 | }); |
File History
1 commit
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
9 days ago