Repository navigation
Recipe 53: Semantic feature discovery #53
Description
Recipe 53 of 60 · Level 5 (Expert) · Evaluation & optimization ·
Noul+Score
Use case
Judge text against externally proposed semantic features, select a feature set through a budgeted validation search, and evaluate the frozen downstream classifier on an untouched test set.
What to build
The folder recipes/53-semantic-feature-discovery/ with notebook.ipynb, README.md, and fixtures/, meeting the recipe contract. Start from python tools/new_recipe.py 53 and the template in recipes/_template/.
Build notes
- Candidate features are supplied in the fixtures. The notebook proposes none.
- Select a feature set through a budgeted validation search and record the budget spent.
- Freeze the set, then evaluate the downstream classifier once on an untouched test split.
Decision design
- Noul. Write each proposition as a statement that is true or false. One independent question per label or concern, sent together in one request. Noul has no confidence field, so each threshold is chosen from examples and evaluated.
- Score. Describe every rubric level in words, in order. Show the
scoreand the distribution over levels. Mapping, weighting, and arithmetic on scores happen in Python. - Composition. Independent questions share one request. A question that depends on an earlier answer goes in a later request, and the notebook makes that boundary visible.
Level 5 scope
Controlled optimization studies or closed-loop simulations requiring budgets, baselines, and held-out or trajectory evaluation.
Acceptance criteria
-
recipes/53-semantic-feature-discovery/notebook.ipynbruns top to bottom offline, with no key and no network, and its outputs are committed - Live mode is opt-in (
JEV_COOKBOOK_LIVE=1withTYPESAFE_API_KEY) and uses the same question definitions as the offline run - Fixtures are synthetic, include the hard cases named in the build notes, carry gold labels, and pass the fixture validator
- Every response fixture records its provenance, and the notebook states which mode it ran in
- Evaluation: Frozen test accuracy against the recipe 35 feature set and baseline, with the budget ledger.
- Budgets, seeds, and frozen configurations are recorded in the notebook output
- A baseline is run under the same conditions, and any held-out split is used exactly once after choices are frozen
- Results are reproducible from the committed seeds and fixtures
- No statement about Jev's quality, latency, or cost appears without recorded live inference; in a synthetic run, metrics are labelled as pipeline checks
-
recipes/53-semantic-feature-discovery/README.mdsays what the recipe teaches, how to run it, and what was and was not measured live - The pull request changes only
recipes/53-semantic-feature-discovery/and CI is green
Dependencies
- Blocked by Foundation: CI executes every notebook offline and validates fixtures #69 (CI executes every notebook offline and validates fixtures)
- Builds on Recipe 35: Semantic feature extraction #35 (Semantic feature extraction). Merge those first and reuse their patterns; do not copy their fixtures.
- Tracked in Epic: Level 5 · Expert recipes #79
Sources
Read these before writing the questions.
- S02 · TypeSafe AI: Primitives (Questions): Choice, Noul, Score, independent questions, and dependent follow-up calls.
- S03 · TypeSafe AI: Confidence: Distribution-derived confidence and task-specific thresholds informed by observed outcomes.
- S06 · TypeSafe AI: Cookbooks: Worked patterns for extraction, citation checking, skill selection, hierarchical classification, and feature discovery.
Out of scope
- Changes to shared code, the catalog, or the root README. If the shared package is missing something, open a foundation issue and link it here.
- Real side effects of any kind. Actions are simulated.
Amendment (2026-10-20): multi-proposition Noul fixture coverage
Added under #283 before any builder is dispatched. This section adds to the acceptance criteria above; it is not part of "Out of scope". The same requirements are written for authors and builders in docs/recipe-template.md (the bullet beginning "Noul propositions are statements"), and tests/test_recipe_guard.py (noul_proposition_gold_coverage) enforces the first of them.
If this recipe asks more than one Noul proposition about the same state, its fixtures must satisfy all three requirements:
- Every proposition has at least one gold-true row and one gold-false row in each scored split,
validationandtest. Threshold selection uses onlyvalidation; the held-outtestsplit stays untouched until choices are frozen. - The recipe states which truth combinations the use case admits, and the fixtures include at least one row for each admissible combination. For two propositions, consider both true, both false, and each true alone; document any combination the use case excludes, and why.
- For every proposition, at least one row where that proposition's tag changes the composed Python outcome, with the other propositions' tags and the frozen policy settings held fixed. Identify the row.
These are separate obligations: positive and negative coverage alone does not establish truth-combination coverage, and neither establishes that each proposition can change the outcome.
- The fixture set meets the three multi-proposition
Noulrequirements above: gold-true and gold-false rows for every proposition in each scored split, every admissible truth combination, and an outcome-determining row for every proposition.
Activity
Foundation: state Noul fixture requirements where issue authors and b…