Skip to content

lint: warn when an action that writes as the caller targets an object no permission set lets its invokers write ("ungranted caller write") #39714

Backlog

Description

@objectstack-fleet

eval@os-elon-musk · os-elon-musk · session_016WV4cys3d4KkznXzBcQvKF

Filing gate: ③ maintainer-directed. Source: maintainer — Elon in the eval seat's project thread, 2026-12-04T14:05Z, 「做」, answering the seat's proposal to add a build-time permission check. Grading: area:build · domain:devx · Feature (fleet-sourced) · p3 · reach: read from metadata rules, not measured on a live save.

维护者速读

  1. 问题:应用里有些操作按「当前用户身份」写数据。如果没有任何权限集让能用这个操作的人写目标对象,这个操作一定报 403,但现在 os validate 不会提示。
  2. 要做的:在 lint 里加一条警告规则,规则形状跟现有的「导航对象无人可读」检查一样。
  3. 验收:构造这种应用会出警告;合法设计不出,比如操作以系统身份运行。
  4. 需要你做的:无。只是警告,不拦保存。

Business rationale

A builder, human or AI, sees the gap at os validate instead of a user meeting a 403 in production. This complements the skill-text card, which carries most of the value: today's misses were direct-edit grants that only the business description names, and no static rule can know them.

Premise (read at origin/main 8e4dda4)

  • Script actions run elevated ({ ...ec, isSystem: true }, packages/lint/src/validate-readonly-action-writes.ts:30), so a set that withholds the verb is legitimate there. ⛔ Do not warn on them.
  • Declarative operation: 'update' actions run as the caller, "never system-elevated" (packages/spec/src/ui/action.zod.ts ~:1816). So do type: 'flow' actions targeting a runAs: 'user' flow (packages/spec/src/automation/flow.zod.ts ~:1286) with literal record-write nodes. The declarative-update executor is still planned in the liveness ledger (action.zod.ts ~:1813): check the ledger before landing.
  • Who can invoke: requiredPermissions capabilities (action.zod.ts ~:2416) matched by a set's systemPermissions; with none, any set that reads the object.
  • Nearest rule to copy: nav-object-ungranted (packages/lint/src/validate-nav-access.ts, matrix from build-access-matrix.ts, wired at reference-integrity-suite.ts ~:685).

Change

  • A new packages/lint/src/validate-*.ts rule. For each caller-identity write action, warn when no permission set that can invoke it grants the verb on the written object.
  • Carry over nav-object-ungranted's exemptions: platform objects, and stacks that declare no sets.
  • Severity is warning (ADR-0090 D6 advisory posture, since grants may live in another package).
  • Ships with its .user-text.ts, a rule-explanations/ entry, the suite and index wiring, tests, a changeset, and a row in skills/objectstack-data/references/lint-rules.md (Tier H; a separate skills PR is fine).
  • Check whether the MCP draft door's publish verdict carries lint warnings (packages/metadata-protocol/src/metadata-diagnostics.ts ~:463); if it does, an AI builder sees the warning there too.

Acceptance

  • A fixture with an operation: 'update' action on an object whose only set lacks allowEdit warns.
  • No warning when:
    • a set grants the verb;
    • the action is a script action (elevated);
    • the flow is runAs: 'system'.
  • The example apps and showcase stay at zero new warnings, or each one is a real gap, named in the PR.

Dedupe: searched "ungranted write lint", "write-orphan", "build denies the persona": no card for this rule.

Activity

  1. added
    enhancement
    pm:queue
    domain:devx
    on Dec 4, 2026
  2. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:build · domain:devx · Feature · p3 · pm:queue · size S, touched 2026-12-04T14:26Z. Rationale: a new lint warning for an action that writes as the caller on an object no permission set lets its invokers write. New capability, not a UX improvement, so a Feature at p3, done in the area's order. It is the build-time half of the maintainer's 「做」 with #39713. Issue type set to Feature.
    Grade: p3 · pm:queue · size S · claimable when pm:queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:builddomain:devxenhancementpm:queuepriority:p3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions