Repository navigation
Conversation
[Medium impact] The PR appears safe to merge, with the earlier fallback-reuse issue remaining as a non-blocking concern. Findings
SummaryThis PR checks Substitute maps against the original requested pairs and retries missing pairs once.
|
Compare schema-valid maps with the original requested entity-label pairs. Retry missing pairs once while retaining accepted substitutions, and report unresolved or failed retry records without discarding complete records. Refs #388 Signed-off-by: memadi <memadi@nvidia.com>
Recover a copied original only when known space variants identify one requested pair under the same label. Prefer exact entries and restore the trusted original without changing source text, offsets or synthetic values. Ambiguous matches retain the existing retry and failure behavior. Refs #388 Signed-off-by: memadi <memadi@nvidia.com>
Require a non-whitespace character in synthetic values in both Pydantic and exported JSON Schema validation. Preserve valid one-character and padded values, including replacement maps generated for rewrite mode. Refs #388 Signed-off-by: memadi <memadi@nvidia.com>
145acdd to
7ffb9f7
Compare
| filtered = _filter_replacement_map_to_input_entities( | ||
| raw_map=row.get(COL_REPLACEMENT_MAP), | ||
| parsed_entities=expected[position], | ||
| record_id=str(source[RECORD_ID_COLUMN].iloc[position]), | ||
| reconcile_unicode_whitespace=True, | ||
| ) | ||
| additions = [ | ||
| entry | ||
| for entry in filtered["replacements"] | ||
| if (entry["original"], entry["label"]) in missing[position] | ||
| ] | ||
| accepted[position]["replacements"].extend(additions) |
There was a problem hiding this comment.
The retry can give two different entities the same fallback value. If the first response copies Alice unchanged and omits Bob, the filter repairs Alice to [SUBSTITUTE_FIRST_NAME_1]. If the retry copies Bob unchanged, its fresh counter produces [SUBSTITUTE_FIRST_NAME_1] again. Both mappings are accepted, making two different people look like one in the output.
Keep track of accepted synthetic values when choosing fallback values on the retry.
There was a problem hiding this comment.
This is related to the discussion we had in PR #319 with different entities and same substitution in a single record.
There was a problem hiding this comment.
Yes, this is the same uniqueness invariant discussed in #319: different entities in one record must not end up with the same substitute. The distinction is that #394’s run-wide uniqueness fix doesn’t cover this path—the retry calls the filter with a fresh fallback counter, and it doesn’t reserve synthetic values already accepted for that record. So the collision scenario in my comment still applies.
Distinguish existing DataDesigner whole-response schema retries from the single missing-pair retry. Align failure diagnostics, Rewrite validation, per-row call counts and bundled agent guidance with the implemented flow. Update the issue plan to reflect the published branch and PR. Refs #388 Signed-off-by: memadi <memadi@nvidia.com>
Summary
Saved local notebook experiments identified two failure patterns that passed structural schema validation:
(value, label)pairs, with no unrelated entries. Two requested pairs were missing from the generated map.U+202FtoU+2009. Those six returned pairs therefore did not exactly match the requested pairs.These observations compare the saved requested inventories with parsed generation outputs, not raw provider HTTP responses. Issue #388 contains artifact provenance and evidence limits. Context exhaustion and the internal reason for omissions remain unproven.
Changes
failed_records, preserving complete records.DataDesigner's existing whole-response schema retries remain separate from the single completeness retry. This PR does not introduce per-entry schema recovery.
Local validation
Implementation plan
Fixes #388