Skip to content

J3: read challenge files through the content API #229

Closed

Description

@wab

Parent

#212 (PRD: website redesign v2, delivery steps J1 to J6)

What to build

The website reads challenge files from the posts repo, like stories, blog posts, pages and jobs.

  • A new challenge Zod schema and a validator in ContentValidators.
  • fetchChallenge (by language and slug) and fetchChallenges (by language) in the content API.
  • Files live under challenges/<lang>/<slug>.md, frontmatter only.
  • Both content sources work: local filesystem and GitHub.

The schema mirrors the core schema of ocobo-revops/posts#94 (Challenge content type: core schema, Stage ids and validation): key (rp, se, sc, cx, sy, ai), order, hero, bowtie.activeStages (Stage ids from #220 (J2: bow tie stage model with the seven Stage ids)), symptoms, audience, workstreams, aiBridge without its demo, method, case (with case.story optional) and diagnostic. It is a strict object, so unknown keys such as extraSections fail. The agent window demo and the partner block come in #230 (J3: agent window demo and partner block in the challenge schema).

The website schema must accept every file the posts schema accepts. Both schemas change in the same pair of PRs.

Acceptance criteria

  • Schema tests: a complete file validates, and each optional section can be absent.
  • Schema test: bowtie.activeStages rejects an unknown Stage id.
  • The six golden fixtures of posts#94 validate against the website schema.
  • Content API tests: one challenge by language and slug; every challenge of a language; a missing file returns not_found.

Questions for review

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, AFK-ready for an agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions