feat: find_activity — the registry half of find → invoke - #75
Merged
Conversation
9 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 30, 2026
adamstankiewicz
force-pushed
the
feat/find-activity-mvp
branch
from
August 30, 2026 18:49
74fa87b to
bf9c42e
Compare
adamstankiewicz
force-pushed
the
feat/find-activity-mvp
branch
from
August 30, 2026 18:55
fe0788e to
2fe7a75
Compare
The a2learn marketplace MVP: one new MCP tool that answers a learning need with ranked activity listings. The novelty is that listings are GENERATIVE — the registry lists capabilities that manufacture a standards-verified activity on demand, not a shelf of files. Each result is an a2learn manifest (docs/a2learn/manifest.md): the verified standard it teaches, whether it assesses, and the exact show_widget arguments that build it — so the invoke half already existed and the loop closes with zero new rendering code. Discovery is deliberately model-free once the standard resolves: verification hits the standards graph, ranking is deterministic coverage + keyword scoring (crude, and cheap enough that agents will actually browse before guessing). Topic-only calls reuse buildWidget's proposeFor (now exported) so 'the water cycle' resolves to a verified 5-ESS2-1 the same way show_widget would. Live-verified both paths: standardCode → 11 ranked listings for 3.NF.A.2 (verified); topic-only → proposed and verified 5-ESS2-1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…exist yet Same rule as everywhere else: no references to the a2learn format docs until they ship with a producer. The a2learn:0 field stays as the draft lineage marker; this file is the normative source for the listing shape until the format lands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…he format when it ships Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The type is the normative source for the listing shape and crosses the wire to model consumers — the literal fields (tier, generative, provenance.generated) encode marketplace and registry doctrine nothing at the use site explains, so the semantics live on the fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s, deterministic ranking Runs against the real registry and the keyless example standards source, so verification is integration-tested offline: known code verifies with every listing carrying kind + standardCode verbatim; a hallucinated code lands on rejectedCodes and degrades to standard-agnostic topic listings; check-flavored needs float assessing kinds; identical calls rank identically. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ActivityManifest and FindResult move to src/lib/activities/types.ts — the wire contract importable without the finder's runtime (which reaches the model layer through proposeFor). find.ts re-exports, so consumers are unchanged; the module is type-only by design. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
adamstankiewicz
force-pushed
the
feat/find-activity-mvp
branch
from
August 30, 2026 19:28
5695b75 to
824ac13
Compare
… meaning 'assess' The ranking comment now states the design honestly: a deterministic default ordering, not semantics — the calling model holds the real judgment via the listing metadata. Within that tier, the intent lexicon is grounded (revised Bloom 'evaluate' verbs + formative/summative classroom vocabulary), matched on stems so 'assessment' and 'quizzes' hit, with bare 'grade' deliberately excluded: topics legitimately say 'grade 4', and that boosted assessing kinds spuriously. Tests cover the stems and pin the grade-level false-positive. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… of word lists The proper IR answer, in the repo's idiom: need and planner descriptions compared by cosine over provider embeddings (OpenAI via the armed fallback key, or Bedrock Titan; Anthropic ships no embeddings endpoint, so the default deployment falls back to lexical). Assessment intent is read from anchor phrases by geometry — no keyword lists anywhere on the semantic path. Registry vectors are memoized per process (the corpus is sixteen static descriptions); only the need embeds per query. Honesty is structural: FindResult.ranking says which ranker ran, an embedding failure degrades to lexical instead of failing discovery, and the lexical scorer survives only as the stated fallback. Tested without a network: cosine behavior, similarity ordering, and anchor-driven intent (a need with zero lexical overlap with any assessment word still boosts assessing kinds) against a deterministic toy embedding space; the find suite pins the fallback path and its honest label. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Functionally verified live through the full production path (OpenRouter → text-embedding-3-small → cosine over the real registry): time-ordering needs rank timeline-builder first, categorizing needs rank drag-categorize first, and the per-process vector cache holds (first call embeds the corpus, later calls embed only the need). Bedrock embed model id becomes env-overridable (access is per account); the fallback catch now warns with the reason — probing found a Bedrock 403 being swallowed silently, which would downgrade a misconfigured deployment forever without a trace. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The manifest is the shape third parties program against, and `gradeBand`
could only ever describe K-12: an undergraduate year or a new-hire cohort
has no honest value to put in it. `audience` carries the naming authority
with the value — `[{ scheme: 'k12-us', values: ['4'] }]` — which is the
shape `standards[]` already uses, so "4" is unambiguous instead of meaning
grade 4 here and year 4 somewhere else.
Behavior change worth reviewing: the caller's free-text `gradeHint` no
longer falls back into the field. "8th grade" is not a `k12-us` value and
nothing verified it, so laundering it into a scheme would make the manifest
assert something no graph said. An absent audience reads as unstated, never
"suitable for anyone" — both rules are now tested, including the negative
control that the hint stays out.
Safe because nothing consumed the old field: find_activity wrote it and
never read it back, and ranking scores plannerDescription and the assess
anchors, not audience. Only the emitting site changes.
`StandardRef.gradeLevels` keeps its name and shape — it is an honest label
for what a K-12 source emits — and gains a comment saying what a non-grade
source does instead (leave it empty, express audience through `tags`),
since `reachesGrade` already lets unlabelled standards through rather than
gating them out on missing data.
No mcp:build: nothing here is reachable from widget components — two
type-only edits and one server-side emitter.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What & why
One new MCP tool,
find_activity, that answers a learning need with ranked activity listings. The novelty: listings are generative — the registry lists capabilities that manufacture a standards-verified activity on demand, not a shelf of files. Each result carries the exactshow_widgetarguments that build it, so the invoke half already existed and the loop closes with zero new rendering code. Discovery is model-free once the standard resolves: verification hits the graph; ranking is deterministic coverage + keyword scoring. Topic-only calls reuseproposeFor, so "the water cycle" resolves to a verified 5-ESS2-1 the same wayshow_widgetwould.Type of change
Breaking or contract changes
Additive only: one new tool beside
show_widget; nothing existing changes shape. The listing format converges onsrc/lib/a2learn/manifest.tsin #79's phase 2 after both merge.How it was verified
pnpm lintandrm -rf .next && npx tsc --noEmitpnpm buildstandardCode→ 11 ranked listings for 3.NF.A.2 (verified); topic-only → proposed and verified 5-ESS2-1Merge note: touches
src/app/api/mcp/route.ts, as does #76 — whichever merges second rebases; both edits are additive (a tool entry + a handler branch), so the conflict is mechanical.Authorship
package.json/pnpm-lock.yamlchanges🤖 Generated with Claude Code