You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spec): published agent prompts reference real exports (#9545) (#9615)
Three published agent-authoring prompts in packages/spec/prompts told agents to
import five symbols @objectstack/spec does not export. Four failed loudly. The
fifth did not: `import { Object } from '@objectstack/spec/data'` does not
resolve, so `export const AccountObject: Object = { ... }` bound to the
JavaScript global instead, and metadata authored from that prompt type-checked
against a type that constrains nothing -- false assurance handed to an
automated author.
Every substitution was measured against the built .d.ts, not guessed:
- Object -> ObjectSchema.create({ ... }), the house authoring convention (34
uses across the example apps; zero uses of the annotation form). Making the
form genuinely constrain exposed that the prompt's own example set
enable.audit / enable.workflow, neither of which exists; they are now
trackHistory / files, the pair the schema's own docstring uses.
- implement-objectql.md keeps the real Field and QuerySchema imports and
derives the metadata type as z.infer of typeof ObjectSchema, matching
prompts/instructions.md and spec's own src/contracts/schema-driver.ts. No
bare Object type is exported -- it would shadow the JS global.
- ManifestSchema -> ObjectStackDefinitionSchema on the package root. The
prompt's subject is objectstack.config.ts, which is neither /system manifest.
- IdentitySchema / PolicySchema have no bare referent anywhere in spec. Rule #2
now names RLSUserContextSchema and RowLevelSecurityPolicySchema from
@objectstack/spec/security.
- The three dead "Key Files to Watch" paths now point at stack.zod.ts,
security/rls.zod.ts and kernel/events.zod.ts.
The five baseline entries are deleted in the same commit; the gate is
reconciled in both directions and green.
Claude-Session: https://claude.ai/code/session_01Fs18A2DdXLVN2h8PaaFBcP
Co-authored-by: Claude <noreply@anthropic.com>
There is no bare `Identity` or `Policy` schema: identity is the per-request RLS
36
+
user context, and policy is per-object and per-operation. Broader posture lives
37
+
in the qualified schemas (`TenantSecurityPolicySchema`, `PermissionSetSchema`).
27
38
28
39
### Rule #3: API Gateway Contract
29
40
The HTTP/Gateway layer must perform strict request/response validation using `api/contract.zod.ts` and `api/endpoint.zod.ts`.
@@ -36,13 +47,13 @@ Do not invent event formats. Use the standard CloudEvents-compatible structure.
36
47
37
48
## 3. Workflow
38
49
39
-
1.**Define Configuration**: Start by mapping `ManifestSchema` to your runtime config.
40
-
2.**Initialize Identity**: Implement the Auth Provider using `IdentitySchema`.
50
+
1.**Define Configuration**: Start by mapping `ObjectStackDefinitionSchema` to your runtime config.
51
+
2.**Initialize Identity**: Implement the Auth Provider so it produces a context that satisfies `RLSUserContextSchema`.
41
52
3.**Setup Gateway**: Configure routes based on `ApiRoutesSchema` (from `api/discovery.zod.ts`).
42
53
43
54
## 4. Key Files to Watch
44
55
45
-
-`system/manifest.zod.ts`: The "Kernel Configuration".
46
-
-`system/identity.zod.ts`: The "Security Context".
47
-
-`system/events.zod.ts`: The "System Bus".
56
+
-`stack.zod.ts`: The "Kernel Configuration" (`ObjectStackDefinitionSchema`, `defineStack`).
57
+
-`security/rls.zod.ts`: The "Security Context" (`RLSUserContextSchema`, `RowLevelSecurityPolicySchema`).
58
+
-`kernel/events.zod.ts`: The "System Bus" (`EventSchema`; the `kernel/events/*` sub-modules are internal — import from the published `@objectstack/spec/kernel` entrypoint).
"why": "@objectstack/spec/data exports `ObjectSchema`. `Object` resolves to the JS global instead of failing loudly — the worst shape for a published AGENT-AUTHORING prompt."
"why": "@objectstack/spec/system exports `AppManifestSchema` and `DeployManifestSchema`; there is no bare `ManifestSchema`. Published agent-authoring prompt."
"why": "@objectstack/spec/system has no bare `PolicySchema` — only qualified ones (`KeyRotationPolicySchema`, `IncidentResponsePolicySchema`, `DataClassificationPolicySchema`, …). Published agent-authoring prompt."
0 commit comments