Skip to content

test(plugin-security): split the three-officer posture cases one per auditor variant - #35452

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-35436-posture-test-budget
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-35436-posture-test-budget

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Fixes #35436
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;只拆分了一组权限测试,断言一条不少、含义不变。
  • 为什么做:这组测试在 CI 负载高时会撞到单条测试 5 秒的默认上限,跟改动无关却让别的修复一直是红的。
  • 出错会怎样:只动测试,不动产品代码;撤回即可。
  • 要你做什么:无,席位落地。

席位核对

What changes

  • packages/plugins/plugin-security/src/org-admin-assignment-boundary.posture.test.ts, the three-officer describe. The 12 cases (2 postures × 6 callers) each looped over the 3 auditor variants. They become 36 cases (2 postures × 6 callers × 3 variants). Each case does one variant's grant insert, removal by id, bulk removal and position holding, then removes every row it wrote, with the same finally as before. Every expect line is unchanged. The only code that moved is the for (const variant ...) loop, lifted from inside the it to around it.
  • The file's test-budget: header line keeps its number (20) and its class. Its REASON now says 128 cases, thirty-six of them three-officer cases, and why they were split.
  • No global testTimeout raise, no per-case timeout, no skip, nothing deleted.
  • Two-minute check: run this one file. You should see 128 green, with each three-officer case under 0.25 s locally.

Tests

These were run locally on one shared 4-core box under os-verify-lock.sh. Absolute seconds are shared-box readings; the ratios are the claim. Head 3de047739a:

before (BASE a9b36efffa) after (3de047739a)
file 104 passed, tests phase 20.94 s 128 passed, tests phase 22.27 s
three-officer cases 12, 265 to 611 ms each 36, 71 to 223 ms each

The slowest three-officer case drops from 611 ms to 223 ms (×0.36). Applied to the worst CI reading on the card (5534 ms on #35386's loaded shard), that is about 2.0 s, which leaves 2.5× headroom under the 5 s default.

vitest verdict lines
before:  Test Files  1 passed (1)   Tests  104 passed (104)   Duration  30.67s (tests 20.94s)
after:   Test Files  1 passed (1)   Tests  128 passed (128)   Duration  32.81s (tests 22.27s)
os-verify-lock: VERDICT command-exit 0 (both runs)
typecheck (@objectstack/plugin-security, tsc + scripts + check:test-typecheck): VERDICT command-exit 0

Acceptance notes

  • Mechanism reading: the repo's declared-budget shape is the one-line file header test-budget: SECONDS — CLASS: REASON, which scripts/measure-test-shard-timings.mjs (readTestBudget) reads. It governs the timings report's 10 s per-FILE wall line, not vitest's per-case timeout, and this file already carries one (20 s). It cannot hold a single case under 5 s, so splitting is the route.
  • The card reports the whole file at 75 to 179 s on loaded CI shards, against its declared 20 s budget. That was not re-measured here; it is left for the timings refresh lane.
  • Three other cases in the same file (the per-posture hidden-column cases) run about 0.56 to 0.64 s locally, the same order as the old three-officer cases. None is reported timing out, and they are untouched.

Verification

  • Gates: node scripts/pm/dispatch-gates.mjs --commands derived 54 commands for this diff. 52 exit 0. 2 exited 3, PREREQUISITE NOT MET (check:i18n and check:dual-build-cjs-loads need a full workspace build); they are recorded NOT MEASURED and left to CI. --ran reconciliation: 54 accounted, 52 run, 2 NOT-MEASURED, 0 UNRUN.
  • skip-changeset: this is a test-only diff, so nothing is published.
  • No ablation: no tested behaviour changed. The assertions are byte-identical; only their grouping into cases moved.

Generated by Claude Code

…variant

Each of the twelve caller cases did three variants' grant insert, removal
by id, bulk removal and position holding, and on loaded Test Core shards
reached vitest's 5 s per-test default. One case per posture, caller and
variant does a third of that work; every assertion is unchanged.

Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json a5ddeb6ead111f4d1a7373e05cf5ddcbab2b86a8 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:没有。只是把一组权限测试拆小,避免 CI 忙的时候超时。
  • 为什么做:这组测试在 CI 高负载时会超时,让无关的 PR 一直是红的。
  • 出错会怎样:只影响测试,产品代码不变。撤回即可。
  • 要你做什么:无。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head 3de047739a · 2026-11-19T09:59Z

  • Shape: test-only, 1 file (plugin-security/src/org-admin-assignment-boundary.posture.test.ts), +19/−16, no changeset because nothing publishes. Not governed. K = 6 since base a9b36eff, and it merges cleanly into current main.
  • Fixes vs card (plugin-security: the per-variant officer cases in org-admin-assignment-boundary.posture.test.ts hit vitest's 5000 ms default on a loaded Test Core shard #35436: "fix the time budget, not the assertions"; split the per-variant loop or declare a measured budget; don't raise the global testTimeout, skip or delete anything):
    • The AUDITOR_VARIANTS loop moves outside it, so 12 cases (posture × caller) become 36 (posture × caller × variant).
    • Every expect line is unchanged, and cell still names caller · variant. Each case seeds its own holdings (seedAuditorHolding with variant-prefixed ids) and runs the same finally cleanup over the four holders.
    • There is no timeout raise, skip or deletion. The test-budget: 20 header keeps its figure and class, and its REASON now counts 128 cases (104 + 24) and says why the split happened. The dev reads that the header governs the per-file report line, not vitest's 5 s per-case default, which is why splitting was the route.
  • One semantic note, acceptable: cleanup now runs after each variant, where it used to run once after all three. So variants 2 and 3 no longer start with variant 1's leftover inserted row. Each variant's assertions read only its own set or position and its own ids, and the verdict table is unchanged, so the pins are, if anything, better isolated.
  • Measurement: locally the slowest case drops from 611 ms to 223 ms (×0.36). Applied to the card's worst CI reading of 5534 ms, that is about 2.0 s, under the 5 s default with headroom.
  • Gates: on 3de04773, 12 success and 24 skipped, with 0 failed and 23 still running at review. data-1 lands only on full green, and a red that is not the timeout comes back here.
  • Landing clause: not governed, so data-1 lands it with no L2 owed (test-only, no contract face). Then data-1 merges main into fix(objectql): insert and delete open their after-abort unit inside the middleware chain, as update does #35386. A new push needs a fresh L1 only if it changes more than a main merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Landing · area data-1 · 2026-11-19T10:20Z

reading value
L1-a ACCEPT 7005808166 at head 3de047739a (= current head). It is test-only, so no L2 is owed.
check-governed-merges --pr 35452 NOT governed; 1 file, +19/−16; K = 6 (< 15)
CI complete on 3de047739a, 0 failed

State: draft → ready + auto-merge (merge queue). This closes #35436 via Fixes. Once it lands, #35383 is re-queued and main is merged into #35386.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 10:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 6d833b5 Nov 19, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35436-posture-test-budget branch November 19, 2026 10:46
os-bill pushed a commit that referenced this pull request Nov 19, 2026
Brings in the posture-test split (#35452) so this PR's Test Core shard can go green.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin-security: the per-variant officer cases in org-admin-assignment-boundary.posture.test.ts hit vitest's 5000 ms default on a loaded Test Core shard

2 participants