diff --git a/packages/spec/src/automation/flow.zod.ts b/packages/spec/src/automation/flow.zod.ts index e8dc49631b..eb77ee9242 100644 --- a/packages/spec/src/automation/flow.zod.ts +++ b/packages/spec/src/automation/flow.zod.ts @@ -247,7 +247,11 @@ export const FlowSchema = lazySchema(() => z.object({ /** Execution Config */ active: z.boolean().default(false).describe('Is active (Deprecated: use status)'), - runAs: z.enum(['system', 'user']).default('user').describe('Execution context'), + // ⚠️ EXPERIMENTAL — NOT ENFORCED (ADR-0049, #1888). The service-automation + // engine ignores `runAs`: a flow declaring `runAs: system` does not elevate, + // and `user` does not de-elevate — steps run as the triggering context's + // identity regardless. Identity switching is tracked by #1888 (M2). + runAs: z.enum(['system', 'user']).default('user').describe('[EXPERIMENTAL — not enforced] Execution context'), /** Error Handling Strategy */ errorHandling: z.object({ diff --git a/packages/spec/src/security/policy.zod.ts b/packages/spec/src/security/policy.zod.ts index 7af689a3af..6a087b554a 100644 --- a/packages/spec/src/security/policy.zod.ts +++ b/packages/spec/src/security/policy.zod.ts @@ -46,9 +46,18 @@ export const AuditPolicySchema = lazySchema(() => z.object({ /** * Security Policy Schema * "The Cloud Compliance Contract" + * + * ⚠️ EXPERIMENTAL — NOT ENFORCED (ADR-0049, #1882). + * This schema is currently a no-op: it is not registered as a metadata type and + * has no runtime consumer. Password complexity, session idle/absolute timeout, + * `forceMfa`, the IP allow-list (`trustedRanges`/`vpnRequired`) and audit + * retention/redaction are all parsed but enforced by nothing — `better-auth` + * runs hardcoded defaults regardless. Authoring a policy here does NOT change + * behaviour. Treat as a forward-looking contract only; do not rely on it for + * compliance. Enforcement (or removal) is tracked by #1882 for M2. */ export const PolicySchema = lazySchema(() => z.object({ - name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Policy Name'), + name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('[EXPERIMENTAL — not enforced] Policy Name'), password: PasswordPolicySchema.optional(), network: NetworkPolicySchema.optional(), diff --git a/packages/spec/src/security/sharing.zod.ts b/packages/spec/src/security/sharing.zod.ts index a7fe3f3df3..688d21b191 100644 --- a/packages/spec/src/security/sharing.zod.ts +++ b/packages/spec/src/security/sharing.zod.ts @@ -93,6 +93,14 @@ export const OwnerSharingRuleSchema = lazySchema(() => BaseSharingRuleSchema.ext /** * Master Sharing Rule Schema + * + * ⚠️ EXPERIMENTAL — NOT ENFORCED as authored (ADR-0049, #1887). + * The live engine enforces a divergent runtime model (`sys_sharing_rule`: JSON + * `criteria_json`, recipient enum `user`/`team`/`department`/`role`/`queue`). + * This spec's CEL `condition` is never compiled (unparsable CEL degrades to + * "match nothing"), and recipients such as `role_and_subordinates`/`guest` have + * no runtime mapping. Authoring a rule via this schema does NOT grant access — + * use `sys_sharing_rule` directly until reconciliation. Tracked by #1887 (M2). */ export const SharingRuleSchema = lazySchema(() => z.discriminatedUnion('type', [ CriteriaSharingRuleSchema,