Skip to content

[finding] The skill-reference Exports: fallback ranks by source order, so DEPRECATED_/NON_AUTHORABLE_/LEGACY_ constants headline customer-facing rows #12201

Description

@os-litant

Filed unassigned while converging build-skill-references.ts on the shared module-docblock selector (#12094). Out of that card's scope — that one fixes which doc block is published; this is about what the fallback publishes when there is no module doc block at all. #12094 explicitly left the fallback chain in place and named the follow-up question, so this records the measurement rather than pre-judging it.

What

When a .zod.ts has no module doc block, extractDescription() in packages/spec/scripts/build-skill-references.ts falls through to an export list:

constre=/export\s+const\s+(\w+Schema|\w+)\s*(?:[:=])/g;// …if(exports.length>0)return`Exports: ${exports.slice(0,5).join(', ')}`;

Two properties combine badly on a customer-facing surface:

  1. Rank is source order, not importance — slice(0, 5) keeps whichever five happen to be declared first.
  2. The regex has no notion of public authorable surface — any export const qualifies, including constants whose own names say they are not for authoring.

Measured

After #12094 lands, these rows are what skills/** publishes (measured on main at 22c42c9 plus that change):

  • skills/objectstack-automation/references/_index.md

    - `…/src/automation/approval.zod.ts` — Exports: ApproverType, DEPRECATED_APPROVER_TYPES, NON_AUTHORABLE_APPROVER_TYPES, ORG_MEMBERSHIP_LEVELS, APPROVER_EXPRESSION_ROOTS
    

    Two of the five named constants are explicitly deprecated or explicitly non-authorable.

  • skills/objectstack-i18n/references/_index.md

    - `…/src/system/translation.zod.ts` — Exports: LocaleSchema, FieldTranslationSchema, ActionResultDialogTranslationSchema, ObjectTranslationDataSchema, LEGACY_OBJECT_FIRST_KEYS
    

Why it is worth a card

The line is true — it is an accurate list of what the module exports, which is why #12094 kept it (an honest export list beats a confidently wrong prose sentence). It is the ranking that is the hazard, and only on this surface: skills/** is loaded whole into a customer agent's context window, and its job is to teach that agent what it may author. A row that headlines DEPRECATED_APPROVER_TYPES and NON_AUTHORABLE_APPROVER_TYPES is pointing an authoring agent at exactly the vocabulary it must not use, with nothing on the line marking them as such.

This is the "make AI-written metadata hard to get wrong" axis rather than a correctness bug — nothing is broken, and no gate is wrong today.

Options (not pre-judging)

The middle option interacts with the third: the population that reaches the fallback at all is the same ~9 files, so authoring their module doc blocks removes the symptom without any generator change.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions