feat(spec)!: remove dead PolicySchema / definePolicy + stack policies (#1882, 11.0)#2387
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…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
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>
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.
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: deletesecurity/policy.zod.ts(PolicySchema,Password/Network/Session/AuditPolicySchema,definePolicy); drop thepoliciesstack 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: dropDcPolicyfixture + contract case.app-crm/app-showcase: drop unused policy definitions.Downstream check (../hotcrm, ../templates)
Verified both: zero Policy-API usage. hotcrm imports none; templates only imports
SharingRulefrom@objectstack/spec/security(untouched — the barrel keepsSharingRule/PermissionSet). No changes needed in either repo. The@objectstack/downstream-contractgate (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