Skip to content

feat(spec)!: remove dead PolicySchema / definePolicy + stack policies (#1882, 11.0) - #2387

Merged
os-zhuang merged 3 commits into
mainfrom
v11-remove-policyschema
Jun 27, 2026
Merged

feat(spec)!: remove dead PolicySchema / definePolicy + stack policies (#1882, 11.0)#2387
os-zhuang merged 3 commits into
mainfrom
v11-remove-policyschema

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Closes#1882. Part of the 11.0/next-major breaking-change batch (#2364), ADR-0049 enforce-or-remove.

Why

PolicySchema (org security policy — password/network/session/audit) is 100% unenforced: no runtime consumer ever reads it. Removed rather than implemented.

Changes

  • @objectstack/spec: delete security/policy.zod.ts (PolicySchema, Password/Network/Session/AuditPolicySchema, definePolicy); drop the policies stack field + its collection wiring (MAP_SUPPORTED_FIELDS, METADATA_ALIASES, stack key list). api-surface regenerated (diff is exactly the 8 Policy exports).
  • @objectstack/downstream-contract: drop DcPolicy fixture + contract case.
  • Examples app-crm / app-showcase: drop unused policy definitions.

Downstream check (../hotcrm, ../templates)

Verified both: zero Policy-API usage. hotcrm imports none; templates only imports SharingRule from @objectstack/spec/security (untouched — the barrel keeps SharingRule/PermissionSet). No changes needed in either repo. The @objectstack/downstream-contract gate (the framework's standing representation of downstream consumers) stays green.

Not touched

SharingRule, PermissionSet, RLS, and every unrelated *PolicySchema (Retry/Retention/Concurrency/RLS/KeyRotation/…).

Verification

spec security 123, downstream-contract 14, objectql 718 green; check:api-surface ✓; spec + downstream-contract + example-crm + example-showcase build green (57 tasks).

🤖 Generated with Claude Code

…s` (#1882, 11.0)
PolicySchema (org security policy: password/network/session/audit) was 100%
unenforced (no runtime reader). Per ADR-0049 enforce-or-remove, removed:
- spec: delete security/policy.zod.ts + drop the `policies` stack field and its
collection wiring (MAP_SUPPORTED_FIELDS / METADATA_ALIASES in
shared/metadata-collection.zod.ts + the stack key list).
- downstream-contract: drop DcPolicy fixture + contract case.
- examples app-crm/app-showcase: drop unused policy defs.
- regen api-surface (only the 8 Policy exports removed).
Verified downstream: ../hotcrm + ../templates have ZERO Policy-API usage
(templates only imports SharingRule, untouched). spec security 123 +
downstream-contract 14 + objectql 718 green; api-surface check ✓; spec/examples
build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercelBot commented Jun 27, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 27, 2026 4:16pm

Request Review

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tests tooling size/l labels Jun 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/downstream-contract, @objectstack/spec.

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

  • content/docs/concepts/architecture.mdx(via @objectstack/spec)
  • content/docs/concepts/cloud-artifact-api.mdx(via packages/spec)
  • content/docs/concepts/cluster-semantics.mdx(via @objectstack/spec)
  • content/docs/concepts/design-principles.mdx(via packages/spec)
  • content/docs/concepts/implementation-status.mdx(via @objectstack/spec)
  • content/docs/concepts/index.mdx(via @objectstack/spec)
  • content/docs/concepts/metadata-driven.mdx(via @objectstack/spec)
  • content/docs/concepts/metadata-lifecycle.mdx(via packages/spec)
  • content/docs/concepts/north-star.mdx(via packages/spec)
  • content/docs/concepts/packages.mdx(via @objectstack/spec)
  • content/docs/concepts/setup-app.mdx(via @objectstack/spec)
  • content/docs/concepts/skills.mdx(via @objectstack/spec)
  • content/docs/concepts/webhook-delivery.mdx(via @objectstack/spec)
  • content/docs/getting-started/architecture.mdx(via @objectstack/spec)
  • content/docs/getting-started/cli.mdx(via @objectstack/spec)
  • content/docs/getting-started/core-concepts.mdx(via @objectstack/spec)
  • content/docs/getting-started/examples.mdx(via @objectstack/spec)
  • content/docs/getting-started/quick-start.mdx(via @objectstack/spec)
  • content/docs/guides/adding-a-metadata-type.mdx(via @objectstack/spec)
  • content/docs/guides/ai-capabilities.mdx(via @objectstack/spec)
  • content/docs/guides/airtable-dashboard-analysis.mdx(via @objectstack/spec)
  • content/docs/guides/analytics-datasets.mdx(via @objectstack/spec)
  • content/docs/guides/api-reference.mdx(via @objectstack/spec)
  • content/docs/guides/business-logic.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/backward-compatibility.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/error-catalog.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/field-type-gallery.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/field-validation-rules.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/permissions-matrix.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/protocol-diagram.mdx(via packages/spec)
  • content/docs/guides/cheatsheets/query-cheat-sheet.mdx(via @objectstack/spec)
  • content/docs/guides/cheatsheets/quick-reference.mdx(via @objectstack/spec)
  • content/docs/guides/client-sdk.mdx(via @objectstack/spec)
  • content/docs/guides/common-patterns.mdx(via @objectstack/spec)
  • content/docs/guides/contracts/auth-service.mdx(via packages/spec)
  • content/docs/guides/contracts/cache-service.mdx(via packages/spec)
  • content/docs/guides/contracts/data-engine.mdx(via @objectstack/spec)
  • content/docs/guides/contracts/index.mdx(via @objectstack/spec)
  • content/docs/guides/contracts/metadata-service.mdx(via packages/spec)
  • content/docs/guides/contracts/storage-service.mdx(via packages/spec)
  • content/docs/guides/data-modeling.mdx(via @objectstack/spec)
  • content/docs/guides/deployment-vercel.mdx(via @objectstack/spec)
  • content/docs/guides/driver-configuration.mdx(via @objectstack/spec)
  • content/docs/guides/error-handling-client.mdx(via @objectstack/spec)
  • content/docs/guides/error-handling-server.mdx(via @objectstack/spec)
  • content/docs/guides/external-datasources.mdx(via @objectstack/spec)
  • content/docs/guides/formula.mdx(via @objectstack/spec)
  • content/docs/guides/hook-bodies.mdx(via packages/spec)
  • content/docs/guides/kernel-services.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/dashboard.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/field.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/flow.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/index.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/object.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/validation.mdx(via @objectstack/spec)
  • content/docs/guides/metadata/workflow.mdx(via @objectstack/spec)
  • content/docs/guides/packages.mdx(via @objectstack/spec)
  • content/docs/guides/plugin-development.mdx(via @objectstack/spec)
  • content/docs/guides/plugins.mdx(via @objectstack/spec)
  • content/docs/guides/project-scoping.mdx(via @objectstack/spec)
  • content/docs/guides/public-forms.mdx(via @objectstack/spec)
  • content/docs/guides/runtime-services/email-service.mdx(via packages/spec)
  • content/docs/guides/runtime-services/index.mdx(via packages/spec)
  • content/docs/guides/runtime-services/queue-service.mdx(via packages/spec)
  • content/docs/guides/runtime-services/sharing-service.mdx(via packages/spec)
  • content/docs/guides/runtime-services/storage-service.mdx(via packages/spec)
  • content/docs/guides/security.mdx(via @objectstack/spec)
  • content/docs/guides/seed-data.mdx(via @objectstack/spec)
  • content/docs/guides/skills.mdx(via @objectstack/spec)
  • content/docs/guides/standards.mdx(via @objectstack/spec)
  • content/docs/guides/troubleshooting.mdx(via @objectstack/spec)
  • content/docs/guides/validating-metadata.mdx(via @objectstack/spec)
  • content/docs/protocol/knowledge.mdx(via @objectstack/spec)
  • content/docs/protocol/objectos/config-resolution.mdx(via @objectstack/spec)
  • content/docs/protocol/objectos/i18n-standard.mdx(via @objectstack/spec)
  • content/docs/protocol/objectos/lifecycle.mdx(via @objectstack/spec)
  • content/docs/protocol/objectos/plugin-spec.mdx(via @objectstack/spec)
  • content/docs/protocol/objectos/runtime-capabilities.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/index.mdx(via packages/spec)
  • content/docs/protocol/objectql/query-syntax.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/schema.mdx(via @objectstack/spec)
  • content/docs/protocol/objectql/security.mdx(via packages/spec)
  • content/docs/protocol/objectql/state-machine.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/actions.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/concept.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/index.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/layout-dsl.mdx(via packages/spec)
  • content/docs/protocol/objectui/record-alert.mdx(via @objectstack/spec)
  • content/docs/protocol/objectui/widget-contract.mdx(via @objectstack/spec)
  • content/docs/releases/index.mdx(via @objectstack/spec)
  • content/docs/releases/v9.mdx(via @objectstack/spec)

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.

…a removal
metadata-collection.test.ts asserted the now-removed `policies`/`policy`
collection alias (PLURAL_TO_SINGULAR / pluralToSingular / singularToPlural).
Full spec suite (6595) now green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… PolicySchema removal
stack.policies no longer exists. Exhaustive repo grep confirms no remaining
.policies collection access or definePolicy/DcPolicy usage.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit 63d5403 into mainJun 27, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the v11-remove-policyschema branch June 27, 2026 16:22
os-zhuang added a commit that referenced this pull request Jul 17, 2026
PROTOCOL_MAP.md is hand-written and nothing regenerates it, so renames
orphan rows silently. 25 of its 132 `src/…` links pointed at files that no
longer exist.
The reported row was misdiagnosed, and the git history says why. The prose
"Virtual capabilities for analytics datasets" was NOT a half-finished
rewrite left by #1620 — it has been there verbatim since the map was created
(ced379b), when `data/dataset.zod.ts` held the *seed* schema
(object/externalId/mode/records). It never described that file. So this is
one wrong row plus one absent row, not one half-updated row:
- `data/dataset.zod.ts` -> `data/seed.zod.ts`, described as seed fixtures
(renamed by #1620 to free `dataset` for analytics, ADR-0021).
- the analytics dataset the old prose was reaching for is a real, unlisted
schema: added as `ui/dataset.zod.ts` (ADR-0021 semantic layer).
The sweep found the same rot everywhere, all from deliberate refactors that
left the map behind:
- `src/hub/**` (9 rows) — the directory no longer exists (142703d).
Survivors rehomed: license/registry-config/tenant -> src/system,
plugin-registry/plugin-security -> src/kernel; composer, marketplace,
space, hub-federation and api/hub were deleted outright. Section 9 is
therefore gone and Kernel renumbered 10 -> 9.
- `src/ai` (10 rows) — narrowed by 629a716. Repointed where a successor
exists (agent-action -> tool, cost -> usage, rag-pipeline ->
knowledge-source); dropped nlq/orchestration/predictive/devops-agent/
feedback-loop/plugin-development/runtime-ops.
- `identity/role` -> `identity/position` (ADR-0090 D3 renamed sys_role).
- `security/policy` (#2387), `system/compliance` + `system/masking`
(ADR-0056 D8) — removed as dead, rows dropped.
Gate: scripts/protocol-map.test.ts asserts every link resolves. Proven to go
red first — it listed exactly the 25 dead links before the fix. It rides Test
Core (required); `core: packages/**` covers the file and turbo's
$TURBO_DEFAULT$ inputs include it, so a map-only edit still re-runs the test
rather than cache-hitting to a false green. A new workflow job would not have
blocked merges (main requires only 4 checks), and check-links.yml is dormant
(workflow_dispatch only) and does not cover packages/spec.
Deliberately asserts links only, not completeness: the map is a curated
digest, not a generated index.
Sibling of #3138, which fixed the identical stale `data/dataset.zod.ts`
pointer in build-skill-references.ts's SKILL_MAP. That one guards generated
artifacts that ship to third parties; PROTOCOL_MAP.md is hand-written and
repo-internal (not in the package's npm `files`), so it needs its own check.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
os-zhuang added a commit that referenced this pull request Jul 26, 2026
#1878) (#3503)
The 2026-06 audit flagged a cluster of security-shaped props as
"parsed-but-unenforced / false compliance." Re-verified against current code:
the gap was closed the correct way — PolicySchema was deleted (#2387) and its
capabilities rebuilt as enforced auth settings (ADR-0069); allowTransfer,
apiEnabled/apiMethods, flow runAs, ADR-0057 scope and criteria-type
SharingRules are enforced; agent visibility and role.parent were pruned
(positions are flat, ADR-0090).
- Add 2026-07-security-props-liveness-recheck.md: per-property status with
file:line evidence + the genuine remaining loose ends (prune
AuditRetentionPolicySchema; enforce-or-prune SharingRule owner/group/guest
recipients; per-org IP allow-list #2571; two ledger/comment drift fixes).
- Annotate the two stale 2026-06 security docs (README section 1 +
security-identity audit) as rechecked/superseded.
Docs-only; empty changeset (releases nothing).
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
os-zhuang added a commit that referenced this pull request Jul 27, 2026
…#3686) (#3704)
* feat(spec)!: remove SkillSchema.permissions — it never gated anything (#3686)
Owner decision on the enforce-or-prune call: prune.
skill.permissions was declared, surfaced in the Studio form under an "Access —
Required permissions to use this skill" section, and echoed by the objectui
preview — but no runtime read it. The cloud SkillRegistry selects skills by
active/triggerConditions/tools only. A security-shaped field that enforces
nothing invites an author (or an AI) to believe a skill is gated when it is
not — same disposition as agent `visibility` (#1901) and PolicySchema (#2387).
Removed: the schema property; the form's whole Access section (it existed only
for this field); its generated i18n keys (surgically, not via a full extract
rerun, which would drag in unrelated drift); the liveness-ledger entry + count
table row; and the `permissions` line from the objectstack-ai skill doc — both
its prop table (replaced by a migration note) and its os:check TS block, which
compiles against the spec and would otherwise fail check:skill-examples.
Added a regression test pinning that an authored `permissions` key is stripped
(SkillSchema is non-strict, so it degrades silently rather than breaking boot).
Verified: 6688 spec tests; check:liveness / check:docs / check:api-surface /
check:skill-docs / check:skill-examples all green.
Refs #3686, #1878.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore: ratchet down the role-word baseline for the pruned skill.permissions line
Removing the `permissions` row from the objectstack-ai skill doc dropped its
role-word count 6 -> 5; the ratchet requires the baseline to follow. Only that
one entry changed (verified: no other file was whitewashed by --update).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore(i18n): regenerate es-ES/ja-JP/zh-CN bundles after the skill Access section removal
I removed the en keys by hand but left the other three locales stale; the
translation-bundle drift gate caught it. Regeneration touched ONLY the skill
access/permissions keys in the three locales (24 deletions, verified line by
line — no unrelated blocks were rewritten).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/lteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P0][security] PolicySchema is 100% dead — enforce or remove

1 participant

@os-zhuang