Skip to content

Challenge-widget: wire freeText grading, spec build-time cache, AI Core cost sizing (activation gates) #2441

Description

@jung-thomas

Follow-up to the json-render challenge-widget POC (research spike #2362). The POC is merged to main and deployed, but ships dark: DB flag flag.challengeWidget is OFF on PROD and no flag-on content rebuild has baked widgets. Before it can be activated in PROD, three gates from the #2362 writeup must clear.

Blockers to activation

1. Wire freeText grading

The generator writes a <slug>.challenge-answers.json sidecar with freeText reference answers, but no publish-side consumer exists — freeText challenges render and collect input but cannot be graded.

  • Add a ValidateAnswerSpecs-style upsert to persist reference answers.
  • Add a runtime grade endpoint (mirror the AI-quiz grading path).
  • MCQ is already client-graded (answerIndex); this is freeText only.

2. Spec the build-time cache

Unlike the AI-quiz path (loadAiQuizCache), every flag-on rebuild regenerates all specs — cost + per-build nondeterminism.

  • Add a per-slug cache for challenge specs (mirror loadAiQuizCache).
  • Required before any bulk/repeat PROD rebuild.

3. AI Core cost sizing

Size a full flag-on PROD generation pass: one model call per substantive step across ~1400 tutorials, capped by AI_AUTHOR_BUILD_CAP.

Also needed before public (not code)

  • Editorial review of AI-authored challenges — no human-in-loop review step exists.
  • Recorded greenlight to promote past spike status.

Activation order (once gates clear)

  1. Flip DB flag flag.challengeWidget = true on PROD.
  2. Flag-on full PROD rebuild: gh workflow run rebuild-content.yml --ref main -f mode=full -f challenge-widget-enabled=true.
  3. Re-smoke (expect transient done-button-render red against stale content until re-bake completes).

Ref: docs/developers/reference/generative-ui-research.md. Code seams: srv/lib/ai-challenge-spec.js, hugo-apps/src/challenge-render/, scripts/fetch-tutorials.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions