fix(permissions): type-check its tests (#4040 tranche 1) - #4287
Merged
Conversation
…4040) `packages/permissions` gains a `tsconfig.test.json` on the objectui#3032 template, chained from its `type-check` script, so all four test files are compiled. All five declared code-tier errors were the same TS2741: fixtures annotated `RoleDefinition` while omitting its required `permissions`. The empty array they gain is accurate rather than padding — those roles grant nothing directly, and every grant the cases exercise arrives through the `ObjectPermissionConfig[]` beside them. A further 21 errors were config-tier (TS2304 on the Node `global` the provider suites stub `fetch` through), resolved by `types: ["node"]`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 11, 2026 11:22
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4040 — tranche 1, package 5 of 5. Substituted for
plugin-grid, which stopped on a public-type question and is filed as #4277. One package per PR, per the 裁决 on objectstack-ai/objectstack#4118 (PM, 2026-08-03):Measured before / after
TEST_DEBT90e792e11), template as-isThe 21 are
TS2304: Cannot find name 'global'across the twoMePermissionsProvidersuites, which stub the fetch seam as
global.fetch = vi.fn().globalis an ambientdeclaration, so
types: ["node"]in the test project resolves all 21 — config-tier, exactlythe class the card's template section is about, and it leaves the declared 5 intact:
The five code-tier errors: incomplete fixtures, not a wrong type
RoleDefinition.permissions(packages/types/src/permissions.ts:50) is a requiredObjectLevelPermission[]carrying a role's direct object grants. Five fixtures declaredRoleDefinitionwithout it.The type is not the problem, so it was not touched: every grant these cases exercise arrives
through the
ObjectPermissionConfig[]beside the roles, keyed by object, and what the rolefixtures pin is identity and inheritance — which is all
resolveRoles(
src/evaluator.ts:92) reads.permissions: []is therefore the accurate value for theseroles rather than padding added to satisfy a compiler, and the cases assert exactly what
they did before.
Discrimination proof — the new project can fail
No guard test's assertions changed here, so the thing that needs its discrimination shown is
the new project itself. Appending a provably-false line to
src/__tests__/store.test.ts:Reverted immediately; the probe is not in the diff.
Filed, not fixed
RoleDefinition.permissionsis required and read by nothing in this repository — theevaluator, store and provider all take
RoleDefinition[]and use onlyname/inherits.That is an observation about a dormant declared surface, not a defect a user meets, so it is
filed separately rather than resolved here; changing it either way is a public-type call.
Verification
TEST_DEBTshrinks by exactly this package's line; no other entry is touched.Generated by Claude Code