Repository navigation
feat(challenge): challenge schema, Stage ids and validation - #109
Merged
Merged
Conversation
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.
Contributor
|
🔍 Preview: https://website-9sytew4bq-ocobo-22231b32.vercel.app Built from website |
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.
This was referenced Oct 21, 2026
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94
Renames enjeu to challenge (posts#110): content type
challenge, files inchallenges/<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. ExportsCHALLENGE_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 read263 characters, cap 240 (23 over).scripts/validate-repository.js: validateschallenges/fr/*.mdandchallenges/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.validateRepositoryon a fixture repository.Decisions the spec left open
name:sales-experience,customer-experience,revenue-performance,sales-compensation,revenue-systems,revenue-ai. Cross-references keep usingkey; the slug only drives the URL. A golden test checks the fixture names;validateRepositorydoes not enforce it yet (follow-up below).case.headlineis 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.toolsallows 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.[]), printed asrootby the CLI.method.tools,case.story) carry no cap.method.toolsis required and may be empty.scripts/__tests__/fixtures/challenges/, notchallenges/, sopnpm validatestays green until real content is written.ai.partner(Agent window demo in the challenge schema #96) andaiBridge.demo(Partner block in the challenge schema #97). The strict schema rejects them until those tickets add them.claude,claap,chargebee,oneflowandfull-enrich, none of which exists intools/yet. Challenge cross-references and uniqueness #98 (cross-references) has to create them or adjust the fixtures.Questions for review (from spec #91)
case.storystays optional until Ocobo confirms a Story for the Revenue AI client case.Left as follow-ups
nameinvalidateRepository. It needs a decision on accents and apostrophes in future names.case.metrics[].value(value: 30) gives a type error, not a hint to quote it.Tests
pnpm test: 349 passed.pnpm validate: all content valid.