Skip to content

feat: academy-first CLI/MCP workflow and stronger quality gate - #114

Merged
willwearing merged 3 commits into
mainfrom
feat/academy-cli-workflow
Apr 11, 2026
Merged

feat: academy-first CLI/MCP workflow and stronger quality gate#114
willwearing merged 3 commits into
mainfrom
feat/academy-cli-workflow

Conversation

@willwearing

Copy link
Copy Markdown
Owner

Summary

  • Make academies the default agent authoring shape: new graspful create academy CLI + graspful_create_academy MCP tool, new graspful_import_academy MCP tool, and graspful import support for academy manifests with --course-dir and per-course publish. Backend academy-graph.controller now accepts API-key auth via JwtOrApiKeyGuard so the CLI can drive the whole loop without a browser session.
  • Stronger review gate: replace cross_concept_coverage with problem_teaching_alignment (problems must reference material introduced in the current KP, earlier KPs, or prerequisite concepts) and add a kp_atomicity advisory warning when a KP instruction contains a long parallel list (6+ items, The Math Academy Way Ch. 14). Warnings surface in graspful review output. Bump the default KP stub count from 2 to 3 and teach the brand scaffold to accept --topic for specific landing copy.
  • Optimistic quiz and section-exam UI: advance immediately via startTransition and show a "Saving answer..." indicator, with rollback on failure. Covered by new Vitest tests.
  • Content refresh: rewrite posthog-use-case-selling.yaml to pass the new teaching alignment and atomicity checks; refresh AGENTS.md, CLAUDE.md, README.md, docs/adding-a-course.md, and per-package READMEs so the academy-first workflow is canonical. Check in the draft plan for the wrong-answer remediation loop.
  • Test infra: Playwright now builds the backend before starting it (timeout 120s) and a new e2e spec agent-academy-cli-flow.spec.ts scaffolds, imports, and publishes an academy through the real CLI against a live backend.

Test plan

  • bun run test — 578 backend, 263 web, 35 shared, 10 mcp, CLI all pass. Fixed stale MCP TOOLS.length assertion (10 -> 12).
  • bun run build — all 6 turbo tasks pass (effective typecheck).
  • bun run lint — touched workspaces lint clean. Pre-existing ESLint v9 config gap in apps/site is unrelated and reproduces on main.
  • bun x playwright test agent-academy-cli-flow — new academy CLI e2e passes (21.8s).
  • bun x playwright test docs-smoke — 24 smoke tests pass (covers every doc page touched in this PR).
  • Full Playwright suite runs in CI.

Generated with Claude Code

Most agent-authored courses should start as an academy — a connected
curriculum of one or more courses — not a single course file. This makes
that the default path across CLI, MCP, backend auth, and the runbook.

- Add `graspful create academy` CLI command and `graspful_create_academy`
  MCP tool backed by shared `scaffoldAcademyObject`.
- Add `graspful_import_academy` MCP tool and `graspful import` support
  for academy manifests with `--course-dir` resolution and per-course
  publish.
- Allow API-key auth on `/orgs/:orgId/academies` by swapping
  `SupabaseAuthGuard` for `JwtOrApiKeyGuard` so the CLI can import
  academies without a browser session.
- Replace the weak `cross_concept_coverage` quality check with
  `problem_teaching_alignment`: problems must reference material
  introduced in the current KP, earlier KPs, or prerequisite concepts.
- Add advisory `kp_atomicity` warning that flags KP instructions with
  long parallel lists (6+ items) as likely teaching multiple facts.
- Surface warnings in `graspful review` output and analytics.
- Bump default KP stub count from 2 to 3 and teach the brand scaffold
  to take an optional `--topic` for specific landing copy.
- Optimistic quiz and section-exam UI: advance on submit via
  `startTransition`, show a "Saving answer..." indicator, and roll back
  on failure. Covered by new Vitest cases.
- Playwright config now builds the backend before starting it and
  raises the timeout to 120s so live e2e runs are reproducible.
- Add end-to-end Playwright spec that scaffolds, imports, and publishes
  an academy through the real CLI against a live backend.
- Refresh AGENTS.md, CLAUDE.md, README.md, docs/adding-a-course.md, and
  per-package READMEs so the academy-first workflow is canonical.
- Rewrite `posthog-use-case-selling.yaml` to pass the new teaching
  alignment and atomicity checks.
- Check in draft plan for the wrong-answer remediation loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graspful Ready Ready Preview, Comment Apr 11, 2026 5:59pm

willwearing and others added 2 commits April 11, 2026 11:42
…drift

Harden checkProblemTeachingAlignment against false positives so a single
lexically drifted problem in an otherwise aligned KP no longer blocks the
review gate. Two changes:

- Skip the check when the teaching path has fewer than 8 distinct stems.
  Stub fixtures and in-progress drafts effectively have nothing to judge
  against and should not be punished by a content-quality gate.
- Only fail a KP when every judgable problem is off-topic. A drifted
  single problem is a content-author nit, not a gate violation.

Also extracts the alignment ignore list to a module-level constant for
clarity and updates tests to cover the new whole-KP-drift behavior plus
stub-fixture immunity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…heck

The publish-draft-course e2e test was failing because its minimal course
YAML had stub-style instruction and workedExample text that shared no
vocabulary with the problems. The new problem_teaching_alignment check
correctly flagged the KPs as content the instruction doesn't teach, so
publish returned passed=false.

Update the fixture so instruction and worked example actually teach the
material the problems test — arithmetic addition, Rayleigh scattering,
water chemistry (concept-alpha) and addition, Earth's orbit, chemical
symbols (concept-beta). This is the canonical fix: the fixture should
model a real well-authored course, not a content-quality workaround.

Also clean up a set of stale planning docs that were already removed in
the working tree.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@willwearing
willwearing merged commit b88336e into main Apr 11, 2026
5 checks passed
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.

1 participant