Skip to content

Add Extract-AI schema authoring and General Instructions compatibility - #1184

Merged
mborodii-prog merged 2 commits into
mainfrom
codex/1182-train-extract-schema
Sep 15, 2026
Merged

mborodii-prog merged 2 commits into
mainfrom
codex/1182-train-extract-schema

Conversation

@ebhills

@ebhills ebhills commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Linked issue

Closes #1182.
Companion Excel changes: https://github.com/wrangleworks/WranglesXL/pull/1250.

What changes

train.extract previously required the legacy seven-column AI table. It now follows Excel's authoring contract, allowing the optional schema columns needed for nested objects, arrays, paired examples, and smaller valid definitions. Model updates preserve content-level AI settings while applying explicit overrides.

  • Add Train Extract-AI schema writing from Python, recipes, and structured content documents.
  • Preserve arbitrary column layouts and native JSON-compatible cell values while validating known authoring fields.
  • Support model updates with content-level AI settings preservation and explicit overrides.
  • Document schema authoring, update behavior, validation boundaries, and runtime compatibility.
  • Standardize saved instructions as Settings.GeneralInstructions, use General Instructions in schemas and documentation, and keep instructions as the Python/recipe parameter.

The connector accepts settings and uses variant: ai when creating a model. The lower-level SDK accepts a full Columns/Data/Settings document with variant="extract-ai". Pattern-model behavior, the legacy seven-value SDK list input, and the SDK HTTP-response return contract remain supported.

How it was verified

  • 170 focused offline Python tests passed, covering authoring/serialization, saved settings, explicit overrides, alias precedence and clearing, shared runtime compilation, Python and recipe instruction composition, public schemas, SDK compatibility, and pattern-model regressions.
  • Coverage includes tests/connectors/test_train_extract_ai.py, tests/test_ai_definition.py, the saved-model instruction transport test in tests/test_openai_extract_ai.py, TestWrangleSchema, and focused legacy train connector/SDK tests.
  • 54 cross-repository compatibility cases passed: actual XL and PY save helpers produced identical settings; every payload compiled identically with PY v1.20.2 and the updated reader.
  • The companion XL changes passed 47 focused Jest tests and a TypeScript no-emit check.
  • git diff --check passed.

These are local, offline checks. GitHub CI and live Excel/service verification are separate release checks; no live saved models were changed by these tests.

Compatibility and risk

Only Find is universally required at authoring time. Save-time validation preserves unknown columns, blank rows, and original cell values; runtime compilation remains stricter. A successful save does not establish that a definition will execute successfully. Updates replace the submitted schema table rather than merging omitted rows or columns back in.

Saved instruction aliases are read in this order: GeneralInstructions, AdditionalMessages, instructions, messages, ignoring case/spaces/punctuation. An explicitly present empty string, null, or empty list clears instructions. An explicit update through any alias overrides the existing setting; conflicting aliases within one supplied document use the stated precedence. Call-level instructions are appended to the saved instructions and remain distinct from saved-setting overrides.

New saves synchronize GeneralInstructions and an identical AdditionalMessages compatibility copy, removing other instruction aliases and preserving unrelated settings. This keeps older Python readers working without a bulk model migration or API-Core change.

Rollout and rollback

Release the updated XL authoring paths first, then PY in the following release window. Reload existing Excel task panes before releasing the new Python reader: an old editor can change only AdditionalMessages and leave a stale GeneralInstructions value, which the new reader will prefer.

Before release, verify creating, editing, clearing, saving, reopening, and extracting with a disposable model. After publishing Python, separately promote the package in Lambda-Recipes and verify both Excel and recipe execution.

Keep the compatibility copy until all supported readers and writers have migrated. Reader rollback remains supported by AdditionalMessages. If an older writer or rollback introduces conflicting copies, reconcile the intended value through an updated save path before using the new reader.

Ready-for-review checklist

  • One human delivery owner is assigned
  • The linked issue is correct; no release milestone has been inferred
  • 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

See the pull request workflow.

@ebhills ebhills self-assigned this Sep 14, 2026
@ebhills ebhills changed the title Add Train Extract-AI schema authoring and settings preservation Add Extract-AI schema authoring and General Instructions compatibility Sep 14, 2026
@mborodii-prog
mborodii-prog merged commit b829bdd into main Sep 15, 2026
34 of 39 checks passed
@mborodii-prog
mborodii-prog deleted the codex/1182-train-extract-schema branch September 15, 2026 09:35
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.

Align train.extract with WranglesXL saved-model schema and optional columns

2 participants