Repository navigation
fix(cli, api): keep the overall extraction instruction in ixp packages - #455
Merged
Merged
Conversation
An IXP project's overall extraction instruction is part of the model's prompt, but packages dropped it. A project uploaded from a package ran a different prompt from the one it was downloaded from, and scored differently in Measure, with nothing to show anything was missing. The instruction lives on the `default` label group, not on the dataset, and neither `LabelGroup` nor `UpdateDataset` had a field for it. Add one to each, and send it from `re package upload`. Only send it when the package has one, so that an older package leaves the new project's own default alone instead of blanking it.
anachili
force-pushed
the
chi.heng/package-overall-extraction-instruction
branch
from
October 8, 2026 13:03
f70a83a to
2279f3c
Compare
Merged
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.
An IXP project's overall extraction instruction goes into the model's prompt, but
re package download/re package uploaddropped it. A project uploaded from a package ran a different prompt from the one it was downloaded from, and scored differently in Measure, with nothing to show anything was missing.A customer promoting projects from a Test to a Production tenant hit this. The annotated data transferred exactly — same documents, same annotations, field for field — but the project score fell by twelve points, concentrated on the identifier and name fields that most depend on the instruction to tell them apart.
It was missed because the instruction lives on the
defaultlabel group, not on the dataset, so the label defs the group is created with do not carry it. Field group, field and field type instructions already round tripped — this was the only level that did not. It is the last open item of RE-7680, after model config in #392 and field types in #394.What changed
LabelGroupgainsinstructions, sore package downloadwrites it into the package'sdataset.json.UpdateDatasetgainsdefault_label_group_instructions, sent as_default_label_group_instructions.re package uploadsends it for IXP projects, in theupdate_datasetcall that already restores the model config. Every dataset has adefaultgroup from creation, so it does not need a separate request after the group's label defs.Only sent when the package has an instruction, so an older package leaves the new project's own default alone instead of blanking it.
Breaking (
reinfer-clientAPI):LabelGroupandUpdateDataseteach gain a field, so struct literals of them need an extra initializer.Test plan
UpdateDatasetserializes it under the right key and omits it when unset.cargo test -p reinfer-client— 41 passed.cargo clippy --workspace --all-targetsandcargo fmt --all --checkclean.label_groupsliteral in thetest_create_update_dataset_customintegration test.label_groups[].instructions(LabelGroup.instructionsis a required field), andPUTaccepts_default_label_group_instructionsand applies it to the default group (_update_custom_label_groups_with_default_group_instructions, in place since before March 2026, so every ring has it). Both ends cap the instruction at 4096 characters, so a packaged instruction can never be too long for the update.Not in scope
re update dataset— it only comes from a package.rule_setonMoonFormFieldDef).instructions=""when serializing field choices, so nothing the CLI sends would take effect.RE-7680