Skip to content

fix: enforce the guide lesson authoring contract - #1438

Open
fhammerschmidt wants to merge 1 commit into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-guide-contract
Open

fhammerschmidt wants to merge 1 commit into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-guide-contract

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

A typo or omission in exercise.expectedOutput previously produced an unfinishable manual checkpoint. Lesson IDs were not checked against the documented slug format, and numeric positions were silently truncated. Loader data also included absolute build paths and unused metadata.

Enforce the guide's authoring contract:

  • Validate lesson slugs and slash-separated exercise slugs.
  • Require positions to be signed 32-bit integers without truncation or overflow.
  • Require a string exercise.expectedOutput in the lesson model; preserve exact whitespace and empty strings, and remove the unsupported manual-check variant.
  • Remove unused description and exercise.title fields from the model, lessons, and authoring documentation.
  • Keep source paths in build diagnostics and duplicate checks, then discard them before returning the public lesson model.

Run frontmatter and real filesystem collection tests in Node through the guide CI command. Coverage includes malformed fields, duplicate identifiers and positions with both filenames, nested MDX discovery, ordering, and serialized lessons without build paths. An empty expected output still needs a runtime log to complete its checkpoint.

Targets website master (v12). No compiler repository changes.

Validation:

  • ReScript compilation with warnings treated as errors passes.
  • All 52 lesson contract and filesystem tests pass locally.
  • Guide production build passes.
  • Generated HTML and loader data in both build/client and out contain lesson data without source paths or the build directory.
  • Formatting passes.
  • All six GitHub Actions jobs pass, including the 52 lesson checks and 44 guide browser tests.

Fixes #1404.
Part of #1421.

Validate slug identifiers, 32-bit integer positions, and required exact output strings. Remove unused description and exercise title metadata and keep source paths only in build diagnostics.

Run frontmatter and real lesson collection checks in Node as part of guide CI. Cover malformed fields, duplicate diagnostics, nested discovery, exact output, and path-free serialized lessons.

Fixes rescript-lang#1404

Part of rescript-lang#1421.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T21:13:56.302375Z 1c48f66 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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.

Lesson contract not enforced

1 participant