Skip to content

Add per-row AI question templates and for_each answers - #1205

Merged
ebhills merged 6 commits into
mainfrom
codex/ai-question-templates
Sep 29, 2026
Merged

ebhills merged 6 commits into
mainfrom
codex/ai-question-templates

Conversation

@ebhills

@ebhills ebhills commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Linked issue

Closes #1204

What changes

Products with different candidate categories can now build their AI questions from each input row, without a separate Python wrangle.

  • All four answer wrangles support {{ column_name }} substitution in instructions and criterion description values. Recipe templates can reference the full row while input selects the shared provider state.
  • Per-question for_each names a column containing a list or dictionary and binds each candidate to a local variable. Each repeated question produces one output column: list inputs return lists of answers, and dictionary inputs retain their original keys. Empty-string placeholders return {} at the same key or position without generating a question.
  • Ordinary and generated questions share one provider request per nonempty row. Answer fields, probability labels, and candidate order are preserved.
  • Typesafe caching defaults to off for all four answer wrangles; explicit opt-in and environment overrides remain available.
  • ai_answers.md documents templates, for_each, blank slots, and output shaping. ai_configuration.md retains provider-specific sections and documents Typesafe caching off by default. A small synthetic category-scoring recipe and Python runner demonstrate the workflow.

How it was verified

  • Complete credential-free suite at a2b9d9cb: scripts/test-local.ps1 — 2,622 passed, 6 skipped, 139 deselected on Windows/Python 3.13. The subsequent correction changes only ai_configuration.md.
  • Regression coverage includes all four wrangles, list/dictionary outputs, empty and blank slots, alias errors, rendering, cache opt-in and identity, filtered/concurrent recipes, and the sample runner with mocked provider responses.
  • All 15 current YAML examples in the two AI guides parsed successfully; provider headings and configuration-guide scope were verified, and git diff --check passed.
  • Read-only code review found no actionable issues. No live provider calls or deployment were performed for this validation. GitHub checks are pending.

Compatibility and risk

Existing questions without templates or for_each keep their output contract. {{ ... }} in description strings now denotes a row template; references must resolve unambiguously. Callers needing fixed candidate slots supply blank-string placeholders, since omitted keys are not inferred. Changing the packaged cache default increases actual provider requests for repeated inputs; explicit catalog/caller/environment overrides still apply.

extract.ai and split.dictionary are unchanged. There is no persisted data migration; rollback is to revert this PR, including its cache defaults.

Ready-for-review checklist

  • One human delivery owner is assigned: @ebhills
  • The linked issue and intended milestone are correct (no release milestone assigned)
  • The branch is current with main and has no merge conflicts
  • Focused tests pass
  • New or changed behavior has direct test coverage
  • Documentation/schema/configuration is updated where applicable
  • The PR contains no unrelated changes
  • The PR description reflects the branch's current scope and latest validation
  • One primary reviewer is requested only when this PR is ready

Draft pending GitHub checks and delivery-owner review.

Add column placeholders and for_each expansion across AI answer wrangles, preserve grouped candidate results, and include a runnable category-scoring fixture with existing split operations. Refs #1204.
Return keyed results directly, simplify the active sample to split.dictionary, and keep the user's optional recipe sections commented out. Update runner output, schemas, docs, and regression tests. Refs #1204.
@ebhills ebhills self-assigned this Sep 28, 2026
@ebhills
ebhills marked this pull request as ready for review September 29, 2026 22:13
@ebhills
ebhills merged commit e64c8f5 into main Sep 29, 2026
18 checks passed
@mborodii-prog
mborodii-prog deleted the codex/ai-question-templates branch October 5, 2026 10:17
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.

Add per-row AI question templates and for_each expansion

1 participant