Skip to content

feat(challenge): challenge schema, Stage ids and validation - #109

Merged
wab merged 5 commits into
mainfrom
claude/enjeu-schema-62a0e7
Oct 21, 2026
Merged

wab merged 5 commits into
mainfrom
claude/enjeu-schema-62a0e7

Conversation

@wab

@wab wab commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #94

Renames enjeu to challenge (posts#110): content type challenge, files in challenges/<lang>/. "Enjeu" stays the French UI word.

What

  • scripts/schemas/stage-ids.js: the seven Stage ids in bow tie order, copied from the website (website#220). Frozen.
  • scripts/schemas/challenge.schema.js: strict Zod schema for a challenge. Exports CHALLENGE_KEYS, challengeSchema, validateChallenge. It covers every section, cap, count, key, order and step from spec Spec: challenge content type and Team member expert fields #91. Cap errors read 263 characters, cap 240 (23 over).
  • scripts/validate-repository.js: validates challenges/fr/*.md and challenges/en/*.md. A challenge must have an empty markdown body (frontmatterOnly), since every section lives in frontmatter.
  • scripts/__tests__/fixtures/challenges/: six golden fixtures, one per challenge, built from the six prototype mockups.
  • Tests: table tests on the schema (caps, counts, Stage ids, strictness, optional and required fields) and validateRepository on a fixture repository.

Decisions the spec left open

  • Slugs are English, from the name, the same in both languages. The slug is the kebab-case of the challenge name: sales-experience, customer-experience, revenue-performance, sales-compensation, revenue-systems, revenue-ai. Cross-references keep using key; the slug only drives the URL. A golden test checks the fixture names; validateRepository does not enforce it yet (follow-up below).
  • Two caps exceed spec Spec: challenge content type and Team member expert fields #91. case.headline is 120, the spec says 90: the Revenue AI headline is 98 characters, so the spec's own rule (longest mockup value plus about 20%) applies. method.tools allows up to 9, the spec says 0 to 6: Sales Experience shows 9 tools and Revenue Systems 7. The website layout (website#212) must allow for both.
  • Body error path is the root ([]), printed as root by the CLI.
  • Slugs (method.tools, case.story) carry no cap. method.tools is required and may be empty.
  • Fixtures live under scripts/__tests__/fixtures/challenges/, not challenges/, so pnpm validate stays green until real content is written.
  • Order follows the mockup navigation: se 1, cx 2, rp 3, sc 4, sy 5, ai 6.
  • A workstream covering two method steps records the first step number.
  • Bracketed placeholders from the mockups are kept verbatim in the fixtures.
  • Revenue AI case eyebrow ("Nous l'avons fait chez nous d'abord") has no schema field. The website can key it on ai.
  • Not yet allowed: partner (Agent window demo in the challenge schema #96) and aiBridge.demo (Partner block in the challenge schema #97). The strict schema rejects them until those tickets add them.
  • Tool slugs without a tool file: fixtures cite claude, claap, chargebee, oneflow and full-enrich, none of which exists in tools/ yet. Challenge cross-references and uniqueness #98 (cross-references) has to create them or adjust the fixtures.

Questions for review (from spec #91)

  • Do the French caps also apply to English text, or does English need its own measure?
  • A5: case.story stays optional until Ocobo confirms a Story for the Revenue AI client case.

Left as follow-ups

  • Enforce slug = kebab-case of name in validateRepository. It needs a decision on accents and apostrophes in future names.
  • A YAML number in case.metrics[].value (value: 30) gives a type error, not a hint to quote it.
  • Lengths count UTF-16 code units, so an emoji counts as two characters.

Tests

pnpm test: 349 passed. pnpm validate: all content valid.

wab added 2 commits October 21, 2026 12:56
Validate enjeux/fr and enjeux/en files against a strict Zod schema with
length caps, array counts and the seven bow tie Stage ids. Cap errors
state the length, the cap and the overage. A non-empty body fails.

Six golden fixtures, built from the enjeux-*.html mockups, pass.

Two caps differ from spec #91, both following the spec's own rule:
case.headline is 120 (Revenue AI headline is 98 characters) and
method.tools allows 9 (Sales Experience shows 9 tools).

Refs #94
Exact error paths instead of non-empty checks, strictness cases for every
section, 'must not be empty' for blank strings, ENJEU_KEYS exported, and
the cap test writes a French file.
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Preview: https://website-9sytew4bq-ocobo-22231b32.vercel.app

Built from website main with content from this PR's branch.

wab added 2 commits October 21, 2026 16:06
The slug is the kebab-case of the enjeu name, the same in French and
English. Cross-references keep using key; the slug only drives the URL.
The content type, its directory (challenges/<lang>/), schema file,
exports (CHALLENGE_KEYS, challengeSchema, validateChallenge), fixtures
and tests now say challenge. Enjeu stays the French UI word (posts#110).
@wab wab changed the title feat(enjeu): enjeu schema, Stage ids and validation feat(challenge): challenge schema, Stage ids and validation Oct 21, 2026
@wab
wab merged commit c3b6458 into main Oct 21, 2026
3 checks passed
@wab
wab deleted the claude/enjeu-schema-62a0e7 branch October 21, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Challenge content type: core schema, Stage ids and validation

1 participant