Skip to content

feat(lint): navigation reachability vs. granted access (#3583) - #3698

Merged
os-zhuang merged 1 commit into
mainfrom
claude/app-metadata-validation-assessment-xskbcg
Jul 27, 2026
Merged

feat(lint): navigation reachability vs. granted access (#3583)#3698
os-zhuang merged 1 commit into
mainfrom
claude/app-metadata-validation-assessment-xskbcg

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

方案里的 R5:把应用导航暴露的对象与 buildAccessMatrix 做 join —— 这是 ADR-0090 D6 那张矩阵的第一个 lint 消费者(此前只有 os compile 的快照门禁在用)。

问题

导航和权限是两份互相独立、各自合法的元数据,所以应用可以为一个「没有任何权限集授予 read」的对象挂菜单。入口正常渲染,点开就 permission-denied。

这个故障在开发期会被掩盖:平台内置的 admin_full_access通配授权,所以你以管理员身份浏览时一切正常,而对应用真正发放权限集的那批用户是坏的。

三个静默条件(误报地板)

  • 平台对象(由各自的包授权)
  • stack 完全没声明权限集 —— 说明权限在别处管理,逐条报警没有信息量
  • 任何权限集带通配 objects: { '*': … }

最后一条是在真实应用上验证时发现的规则 bug:访问矩阵把通配记在字面 key * 下,不处理的话,规则会对「授权最充分」的 stack 报得最凶。

同时修正了 finding 文案。初版写的是「对所有用户失败,包括管理员」—— 这是错的,admin_full_access 是通配集,管理员进得去。诊断信息夸大其词会教会作者忽略它,所以改成如实描述。

在真实应用上的结果

应用 权限集 findings
app-crm 2 0
app-todo 0 0(未声明权限集,整体跳过)
app-showcase 8 7

showcase 那 7 条经核实是真实发现,不是误报:它把 everyone 绑定到 showcase_member_default,该集授权 7 个对象,而导航暴露约 20 个 —— 普通成员确实打不开 Teams / Categories / Field Zoo / Cascading Select / Expense Reports / Business Units / Preferences。

我没有顺手改 showcase 的权限模型:那是示例应用的产品决策(有些入口可能本就打算只给管理员),应由维护者决定是补授权还是给这些导航项加 requiredPermissions 门控。

验证

  • 测试:lint 447 / cli 642 全过;eslint、nul-bytes、api-surface 干净。
  • 接入 validate/lint/compile 三个入口。

关联:#3583 · #3640(方案)· #3657(Phase 1)· #3684(Phase 2)· ADR-0090 D6


Generated by Claude Code

Assessment R5. Joins what an app's navigation exposes against
buildAccessMatrix — the first lint consumer of the ADR-0090 D6 matrix,
which until now only backed `os compile`'s snapshot gate.

Navigation and permissions are separate metadata, each valid alone, so an
app can ship a menu entry for an object no permission set grants read on.
The entry renders and opening it fails permission-denied. The failure
hides during development because the platform's built-in
`admin_full_access` carries a wildcard grant, so it works while you
browse as an administrator and breaks for exactly the users the app ships
permission sets for.

Advisory severity: a grant may come from a set another installed package
ships, which a static check cannot see. Quiet by construction in three
cases — platform-provided objects (granted by their own packages), a
stack that declares no permission sets at all (permissions are managed
elsewhere, so flagging every entry says nothing), and any stack whose set
carries a wildcard `objects: { '*': … }` grant. That last one is a bug
found while verifying against the real apps: the access matrix records the
wildcard under the literal key `*`, so without it the rule would have
fired hardest on the stacks that granted the most.

Verification also corrected the finding text. An earlier draft claimed the
entry fails "for every user, including admins" — untrue, since
admin_full_access is a wildcard set. The message now says what actually
happens, because a diagnostic that overstates its case teaches authors to
discount it.

Findings on the example apps: app-crm 0, app-todo 0 (declares no
permission sets), app-showcase 7 — verified TRUE positives, not false
ones: showcase binds `everyone` to `showcase_member_default`, which
grants 7 objects while the navigation exposes ~20, so a member genuinely
cannot open Teams / Categories / Field Zoo / Cascading Select / Expense
Reports / Business Units / Preferences. Left for the showcase maintainers
rather than silently rewriting an example app's permission model.

Suites: lint 447, cli 642 passing; eslint, nul-bytes and api-surface clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBks5G7AkwrvgF2kL5rfkT
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 27, 2026 2:59pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m and removed documentation Improvements or additions to documentation tests tooling labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/lint.

19 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via packages/cli)
  • content/docs/api/client-sdk.mdx (via @objectstack/cli)
  • content/docs/api/data-flow.mdx (via @objectstack/cli)
  • content/docs/api/environment-routing.mdx (via @objectstack/cli)
  • content/docs/api/error-catalog.mdx (via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx (via packages/cli)
  • content/docs/deployment/backup-restore.mdx (via @objectstack/cli)
  • content/docs/deployment/cli.mdx (via @objectstack/cli)
  • content/docs/deployment/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx (via packages/cli)
  • content/docs/permissions/authentication.mdx (via @objectstack/cli)
  • content/docs/permissions/authorization.mdx (via @objectstack/lint)
  • content/docs/plugins/packages.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx (via @objectstack/cli)
  • content/docs/releases/v16.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang marked this pull request as ready for review July 27, 2026 15:09
@os-zhuang
os-zhuang merged commit f2b8ac9 into main Jul 27, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/app-metadata-validation-assessment-xskbcg branch July 27, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants