Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .changeset/prune-dead-audit-config-cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
"@objectstack/spec": minor
---

feat(spec)!: remove the dead `AuditConfig` cluster from `@objectstack/spec/system` (#1878 recheck loose-end)

The entire `system/audit.zod.ts` module — `AuditConfigSchema`,
`AuditStorageConfigSchema`, `AuditRetentionPolicySchema`,
`AuditEventFilterSchema`, `SuspiciousActivityRuleSchema`,
`DEFAULT_SUSPICIOUS_ACTIVITY_RULES`, and the `AuditEvent` /
`AuditEventActor` / `AuditEventTarget` / `AuditEventChange` /
`AuditEventType` / `AuditEventSeverity` shape schemas (plus all their
type exports) — is removed. Verified zero consumers repo-wide: the live
audit path (`plugin-audit`) imports none of it, defines its own
`sys_audit_log` row shape, and captures **unconditionally** via engine
hooks, so `AuditConfigSchema.enabled: false` advertised a semantic
(turning the compliance ledger off) the platform deliberately rejects.
Same ADR-0056 D8 family as the earlier `compliance.zod` / `masking.zod` /
`RLSAuditConfig` / `PolicySchema` removals: security/compliance-shaped
config must never merely look live.

**Migration — every dead knob maps to a live surface (or is deliberately
not configurable):**

| Removed (never enforced) | Live replacement |
| --- | --- |
| `AuditConfigSchema.enabled` | none — audit capture is **always on** (compliance ledger; `object.zod` `trackHistory` contract) |
| `eventTypes` / `excludeEventTypes` / `minimumSeverity` / `AuditEventFilterSchema` | none today — if event filtering ships it lands as an `audit` **settings** namespace (ADR-0069 pattern), not app metadata |
| which fields/objects are summarized + History tab UI | object-level + field-level **`trackHistory`** (live, enforced by plugin-audit) |
| `AuditRetentionPolicySchema` / `storage` | object **`lifecycle`** `audit` category (retain → archive → delete) + per-org settings overrides (ADR-0057) |
| `SuspiciousActivityRuleSchema` / `DEFAULT_SUSPICIOUS_ACTIVITY_RULES` | none — no detection engine exists; security monitoring is org-operations tooling, not app-package metadata |
| `AuditEvent*` shape schemas | the `sys_audit_log` object definition in `plugin-audit` is the row-shape source of truth |

No first-party, example, or downstream-contract code imported any of
these symbols; `defineStack` never accepted an `audit` key, so no stack
config changes. Docs page `references/system/audit.mdx` is removed by
regeneration; the security-context module doc now marks audit alongside
the previously removed compliance/masking subsystems.
269 changes: 0 additions & 269 deletions content/docs/references/system/audit.mdx

This file was deleted.

1 change: 0 additions & 1 deletion content/docs/references/system/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ This section contains all protocol schemas for the system layer of ObjectStack.

<Cards>
<Card href="/docs/references/system/app-install" title="App Install" description="Source: packages/spec/src/system/app-install.zod.ts" />
<Card href="/docs/references/system/audit" title="Audit" description="Source: packages/spec/src/system/audit.zod.ts" />
<Card href="/docs/references/system/auth-config" title="Auth Config" description="Source: packages/spec/src/system/auth-config.zod.ts" />
<Card href="/docs/references/system/book" title="Book" description="Source: packages/spec/src/system/book.zod.ts" />
<Card href="/docs/references/system/cache" title="Cache" description="Source: packages/spec/src/system/cache.zod.ts" />
Expand Down
1 change: 0 additions & 1 deletion content/docs/references/system/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"translation",
"worker",
"---Observability---",
"audit",
"logging",
"metrics",
"tracing",
Expand Down
14 changes: 10 additions & 4 deletions content/docs/references/system/security-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ Unified Security Context Protocol

Provides a central governance layer that correlates and unifies

the four independent security subsystems:
the four independent security subsystems it was designed against. Three of

- **Audit** (audit.zod.ts): Event logging and suspicious activity detection
the four have since been REMOVED per ADR-0056 D8 (declared-but-never-enforced;

see system/index.ts notes) — only encryption survives, marked experimental:

- **Audit** (audit.zod.ts — REMOVED): the live audit path is plugin-audit's

always-on capture + object/field `trackHistory` + lifecycle `audit` retention

- **Encryption** (encryption.zod.ts): Field-level encryption and key management

- **Compliance** (compliance.zod.ts): Regulatory framework enforcement (GDPR/HIPAA/SOX/PCI-DSS)
- **Compliance** (compliance.zod.ts — REMOVED): GDPR/HIPAA/SOX/PCI-DSS configs

- **Masking** (masking.zod.ts): PII data masking and tokenization
- **Masking** (masking.zod.ts — REMOVED): PII data masking and tokenization

This schema enforces cross-cutting security policies, ensuring compliance

Expand Down
20 changes: 14 additions & 6 deletions docs/audits/2026-07-security-props-liveness-recheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ enterprise/cloud-enforced (agent `access`).

## Genuine remaining loose ends (actionable)

1. **Prune `AuditRetentionPolicySchema`** (`packages/spec/src/system/audit.zod.ts`)
— a real parsed-only/dead spec schema with no runtime consumer; retention is
enforced on the `lifecycle` surface. Prune (or wire-rename to `lifecycle`).
2. **SharingRule dead recipient types** — `owner`-type rules and `group`/`guest`
recipients are skipped by the bootstrap while criteria-type rules enforce.
Enforce-or-prune the dead subset so authored rules don't silently no-op.
1. ~~**Prune `AuditRetentionPolicySchema`**~~ — **✅ Done (2026-07-27)**, and the
verified scope was larger: the **entire `audit.zod.ts` module** (AuditConfig /
AuditStorageConfig / AuditRetentionPolicy / AuditEventFilter /
SuspiciousActivityRule + the AuditEvent* shape schemas) had zero consumers —
the live audit path (plugin-audit) captures unconditionally via engine hooks
and defines its own `sys_audit_log` row shape, and `AuditConfigSchema.enabled`
contradicted the always-on compliance-ledger contract. Whole module removed;
the enforced authoring surface is object/field `trackHistory` + the object
`lifecycle` `audit` category, with per-org overrides in settings.
2. ~~**SharingRule dead recipient types**~~ — **✅ Done (#3557)**: recipients
reconciled against the live identity model — `group` wired as `team`,
`business_unit` added, and the unenforceable `guest` recipient + `owner`-type
rules removed from the authoring surface (authored rules no longer silently
no-op).
3. **Per-org / per-user IP allow-list** — global-only today; per-org
`sys_organization.allowed_ip_ranges` is unimplemented (tracked **#2571**).
4. **Doc / ledger drift** (non-code-behavior):
Expand Down
1 change: 0 additions & 1 deletion packages/spec/PROTOCOL_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ This document serves as the **Grand Map** of the ObjectStack specification. It l
| [`auth-config.zod.ts`](src/system/auth-config.zod.ts) | | **Auth Configuration**. SSO, OIDC, SAML settings. |
| [`http-server.zod.ts`](src/system/http-server.zod.ts) | | **HTTP Server**. Server port, CORS, and middleware settings. |
| [`logging.zod.ts`](src/system/logging.zod.ts) | | **Logging**. Log levels and output formats. |
| [`audit.zod.ts`](src/system/audit.zod.ts) | | **Audit Trail**. Audit logging configuration. |
| [`cache.zod.ts`](src/system/cache.zod.ts) | | **Caching**. Redis/Memory cache strategies. |
| [`metrics.zod.ts`](src/system/metrics.zod.ts) | | **Observability**. Prometheus/OpenTelemetry metrics. |
| [`tracing.zod.ts`](src/system/tracing.zod.ts) | | **Tracing**. Distributed tracing configuration. |
Expand Down
21 changes: 0 additions & 21 deletions packages/spec/api-surface.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,24 +605,6 @@
"AppTranslationBundleSchema (const)",
"AudienceBook (interface)",
"AudienceCaller (interface)",
"AuditConfig (type)",
"AuditConfigSchema (const)",
"AuditEvent (type)",
"AuditEventActor (type)",
"AuditEventActorSchema (const)",
"AuditEventChange (type)",
"AuditEventChangeSchema (const)",
"AuditEventFilter (type)",
"AuditEventFilterSchema (const)",
"AuditEventSchema (const)",
"AuditEventSeverity (type)",
"AuditEventTarget (type)",
"AuditEventTargetSchema (const)",
"AuditEventType (type)",
"AuditRetentionPolicy (type)",
"AuditRetentionPolicySchema (const)",
"AuditStorageConfig (type)",
"AuditStorageConfigSchema (const)",
"AuthConfig (type)",
"AuthConfigSchema (const)",
"AuthPluginConfig (type)",
Expand Down Expand Up @@ -727,7 +709,6 @@
"CursorStyleSchema (const)",
"CursorUpdate (type)",
"CursorUpdateSchema (const)",
"DEFAULT_SUSPICIOUS_ACTIVITY_RULES (const)",
"DashboardLike (interface)",
"DataClassification (type)",
"DataClassificationPolicy (type)",
Expand Down Expand Up @@ -1169,8 +1150,6 @@
"SupplierSecurityPolicySchema (const)",
"SupplierSecurityRequirement (type)",
"SupplierSecurityRequirementSchema (const)",
"SuspiciousActivityRule (type)",
"SuspiciousActivityRuleSchema (const)",
"SystemFieldName (type)",
"SystemObjectName (type)",
"SystemUserId (type)",
Expand Down
11 changes: 0 additions & 11 deletions packages/spec/json-schema.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,16 +1262,6 @@
"system/AppInstallResult",
"system/AppManifest",
"system/AppTranslationBundle",
"system/AuditConfig",
"system/AuditEvent",
"system/AuditEventActor",
"system/AuditEventChange",
"system/AuditEventFilter",
"system/AuditEventSeverity",
"system/AuditEventTarget",
"system/AuditEventType",
"system/AuditRetentionPolicy",
"system/AuditStorageConfig",
"system/AuthConfig",
"system/AuthPluginConfig",
"system/AuthProviderConfig",
Expand Down Expand Up @@ -1532,7 +1522,6 @@
"system/SupplierSecurityAssessment",
"system/SupplierSecurityPolicy",
"system/SupplierSecurityRequirement",
"system/SuspiciousActivityRule",
"system/Task",
"system/TaskExecutionResult",
"system/TaskPriority",
Expand Down
Loading