hosted-write-eval-hints-budget-data-integrity.test.mjs
34 lines 1.3 KB
Raw
sha256:4215cecbbabf5591b1ff69053cc938b4b6c800f0d487be40618c1d4254d8b67b security: npm audit fix pre-bridge 2026-09-05 Human 3 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 3 commits
sha256:4215cecbbabf5591b1ff69053cc938b4b6c800f0d487be40618c1d4254d8b67b security: npm audit fix pre-bridge 2026-09-05 Human 3 days ago
sha256:9eaa2a7ec9aaf5866cd03d0deadf843cca97778299d1857b5452f71d92a1880a feat(f24): flip DOCS_NOTION_HUB_KEY_AUTHORIZED=true (Tier 3) Human minor 16 days ago
sha256:e4c529f14a0bb908c1caaaeb3f95f3623a1a82e636e7e3722ca2cd3dc9821263 security: npm audit fix pre-bridge 2026-07-29 Human 40 days ago