Skip to content

Commit 58f5b41

Browse files
committed
docs(scripts): the skill-example probe header states its final design
Names the ts-parse door, the chunked alternatives, the two ownership tiers, the stack map normalization, the ComponentPropsMap dispatch and the counter-example verdict the probe now applies. Claude-Session: https://claude.ai/code/session_01CXydFDyiQwNbGFkmwrcRQq Co-authored-by: Claude <noreply@anthropic.com>
1 parent f0909ba commit 58f5b41

1 file changed

Lines changed: 26 additions & 11 deletions

File tree

‎scripts/skill-example-probe.mjs‎

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
*
3434
* ## Transform — what a fence becomes before a schema can judge it
3535
*
36-
* TypeScript and JSON fences are parsed with the TypeScript compiler's parser
37-
* (never executed) and object/array literals are STATICALLY EVALUATED; YAML
38-
* fences go through `yaml`. The supported shapes, by name:
36+
* TypeScript and JSON fences are parsed with the TypeScript parser through
37+
* `scripts/ts-parse.mjs` (never executed; a body that does not parse is a
38+
* reported miss, never a recovered tree) and object/array literals are
39+
* STATICALLY EVALUATED; YAML fences go through `yaml`. Supported shapes:
3940
*
4041
* factory-call `defineX({...})` anywhere in the fence (outermost only)
4142
* create-call `X.create({...})`, `XSchema.parse({...})`
@@ -45,6 +46,8 @@
4546
* bare-literal a fragment that IS one object/array literal (`{...}`)
4647
* yaml-doc each YAML document
4748
*
49+
* A fence that reads as none of them whole is split at blank lines and each
50+
* chunk tried alone (the catalog writes alternatives one after another).
4851
* Inside a literal: same-fence `const` bindings are followed; `Field.<kind>(…)`
4952
* is called for real on the spec's own pure helper; everything else that is not
5053
* a literal (a call, a function, a template with substitutions, a property
@@ -59,21 +62,33 @@
5962
* ## Mapping — which schema judges which example
6063
*
6164
* In order: (1) the code's own claim — the factory or constructor it calls,
62-
* or the type it is annotated with (FACTORY_TARGETS; a type `T` → the exported
63-
* `TSchema`); (2) an explicit `os:check-yaml <decl>` marker; (3) for a fragment,
64-
* KEY OWNERSHIP — the one registry metadata type (or the stack) whose object
65-
* shape declares every top-level key; zero or several owners is a coverage
66-
* miss. A fragment is judged PARTIALLY: each present key against that key's
67-
* own member schema, so an omitted required key is never a red there. Headings
68-
* are not used: they name topics, not shapes.
65+
* or the spec type it is annotated with (FACTORY_TARGETS; a type `T` → the
66+
* exported `TSchema`, unless `T` is imported from outside the spec or listed in
67+
* TYPE_NOT_A_SPEC_SHAPE); (2) an explicit `os:check-yaml <decl>` marker; (3) for
68+
* a fragment, KEY OWNERSHIP (`resolveOwner`): tier 1, the one registry
69+
* metadata type (a union kind through each option; tombstone keys claim
70+
* nothing) or the stack whose shape declares every top-level key, judged
71+
* PARTIALLY so an omitted key is never a red; tier 2, only when tier 1 finds no
72+
* owner, the one exported named object schema the fragment is a COMPLETE
73+
* instance of, judged whole. Zero or several owners is a coverage miss.
74+
* Headings are not used for mapping: they name topics, not shapes.
75+
*
76+
* Two pre-parse steps mirror what the runtime itself does, so the judge does
77+
* not report a shape the platform accepts: a stack's map-format collections are
78+
* normalized to arrays (`normalizeStackInput`), and every component node's
79+
* `properties` is judged by its `ComponentPropsMap` row — the dispatch
80+
* `check-yaml-examples` ports from the authoring gate, ported here unchanged.
6981
*
7082
* ## Verdicts kept apart
7183
*
7284
* STRUCTURAL RED the schema refuses what was read: `unrecognized_keys`
7385
* (a wrong or retired key), `invalid_type`/`invalid_union`
7486
* (wrong nesting or shape), `invalid_value`, `too_small`, a
7587
* refinement (`custom`) — reported per Zod code.
76-
* COVERAGE MISS the transform could not produce a judgeable value.
88+
* COUNTER-EXAMPLE code the text shows to say it is wrong (`isCounterExample`)
89+
* — counted as refused (the text confirmed) or accepted (a
90+
* semantic ❌), never a red and never a replay signature.
91+
* COVERAGE MISS the transform or the mapping produced nothing to judge.
7792
*
7893
* ## The replay (REPLAY_SET)
7994
*

0 commit comments

Comments
 (0)