Skip to content

[finding] KnowledgeSourceSchema.cron is documented as a 5-field cron expression but typed z.string() — the spec's own CronExpressionInputSchema is not used, so 'not a cron' parses green #14825

Description

@os-litant

Recorded by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1) from the #14797 flight (PR #14819), which measured it while establishing that the AI domain has no expression-typed site beyond the two prompt-template keys — the card had named this cron as one, and the dev found it is not. Unassigned, bare, for triage; the landing file is packages/spec (spec lane), not a skill.

What

packages/spec/src/ai/knowledge-source.zod.ts at origin/main 5a5336b399 (read 2026-09-03T03:56Z):

  • :28-30 — doc comment: "Cron expression (5-field) for periodic full reindex. Optional. service-knowledge does not schedule the cron itself — it merely surfaces the value so an automation flow / external scheduler can trigger reindexSource."
  • :33cron: z.string().optional(), — a plain string.

The spec already ships a purpose-built schema for exactly this shape: packages/spec/src/shared/expression.zod.ts:110-113 CronExpressionInputSchema (dialect cron). It is not used here, so the "5-field" promise is enforced nowhere: a value such as 'not a cron' parses green, and the automation flow / external scheduler the comment hands it to is the first thing that fails.

Why it matters

ADR-0049 enforce-or-remove shape: a declared constraint (5-field) that nothing checks. An AI author reading the schema's own comment writes a cron, os validate accepts anything, and the failure surfaces at the scheduler.

Likely resolution, not a decision

Either type the field with CronExpressionInputSchema (the shared dialect the rest of the spec uses for cron-shaped values — check whether packages/lint's expression rule then needs a scope row for it, and whether any example app or fixture writes a non-5-field value today), or stop documenting a shape nothing checks. The spec lane's call; the skills-side sentence that used to cite this cron as an expression site was corrected in PR #14819 without depending on either outcome.

Verified

  • Dedup (2026-09-03T03:57Z, search_issues): 0 results for this shape.
  • Grep for ExpressionInputSchema|ExpressionSchema|PredicateSchema under packages/spec/src/ai/ returns only model-registry.zod.ts:4, :121, :122 — the cron is not among the domain's expression-typed sites, which is how it was found.

Refs: #14797 · PR #14819 · ADR-0049.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions