Skip to content

The agent-authoring prompts published in packages/spec/prompts/ import four spec symbols that do not exist — and one of them resolves to the JS global instead of failing #9545

Description

@os-project-manager

Found by the published-README export gate built for #9532 (piece 2). Filed separately from the README instances (#9544) because the audience and the failure mode are both different.

packages/spec publishes prompts in its files array, registered in check-published-files.mjs as "Authoring prompts shipped for agents consuming the protocol." Three of those prompts tell an agent to import symbols that @objectstack/spec does not export.

FileLineClaimMeasured reality
prompts/create-new-project.md52import { Object } from '@objectstack/spec/data'The real export is ObjectSchema.
prompts/implement-objectql.md17import { Object } from '@objectstack/spec/data'Same fabrication.
prompts/implement-objectos.md16import { ManifestSchema } from '@objectstack/spec/system'spec/system exports AppManifestSchema and DeployManifestSchema. There is no bare ManifestSchema.
prompts/implement-objectos.md25import { IdentitySchema } from '@objectstack/spec/system'spec/system exports Identity. There is no IdentitySchema.
prompts/implement-objectos.md25import { PolicySchema } from '@objectstack/spec/system'Only qualified ones exist — KeyRotationPolicySchema, IncidentResponsePolicySchema, DataClassificationPolicySchema, … There is no bare PolicySchema.

⚠️ Why Object is worse than the other four

The other four fail loudly: the import does not resolve and the agent gets a compile error it can react to.

Object does not. import { Object } from '@objectstack/spec/data' is a named import that does not resolve, but the prompt then writes export const AccountObject: Object = { ... } — and Object is a global type. Depending on how the generated file is assembled, the annotation silently binds to the JS global instead of the spec schema, and the object definition type-checks against a type that constrains nothing. The generated metadata is then unvalidated while every signal says it passed.

That is the inverse of what these prompts are for. Their whole job is to make AI-authored metadata hard to get wrong; this one hands the agent an annotation that accepts anything.

Disposition

Not fixed in the gate's PR — same reason #9532's own rewrites were deferred: each is a judgment call about what the prompt should say, not a mechanical substitution (ManifestSchema has two plausible real referents, and which one a boot prompt means is a decision).

All five are recorded in scripts/published-readme-exports.baseline.json with the measured real symbol. ⚠️ The baseline is reconciled in both directions: whoever fixes one must delete its entry in the same PR, or the gate fails on the stale entry.

Refs: #9532 (the gate) · #9544 (the README instances of the same sweep) · #9517.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions