feat(desktop): planner datasource-qualified fields + apply-side datasource selection (a2td #220+#219 port, seam-1 packet B)#540
Merged
Conversation
…#217+#222 port, seam-1 packet A) Port-wave packet A from the content audit. #222 half: exported COLUMN_REF_REGEX + parseDatasourceQualifiedColumnRef / parseColumnInstanceRef / parseCanonicalColumnRef / formatCanonicalColumnRef in field-resolver (same API as a2td), private regexes in fields.ts / explicit-bind.ts replaced; preserved divergence (explicit-bind accepts bare [deriv:Base:sfx], fields require qualified); colon-tolerant instance parsing (fixes [Profit:Ratio] -> [Profit] mis-parse, caught by minion red run). #217 half: resolveField and proposal-binding resolveInSummary recognize exact canonical column_ref FIRST — hit resolves exact, ref-SHAPED miss fails closed (never falls to fuzzy); datasource selector matches internal name or UNIQUE caption (ambiguous caption refuses with guidance, Parameters excluded). Gate 5b closure untouched; listAvailableFields untouched (#535's file). Version 2.25.4 assumes #538 (2.25.3) merges first — resolve upward on conflict. Cursor-minion port (gpt-5.5-high), orchestrator-adjudicated: full suite 4,362 green firsthand, all 3 wrong-bind invariant suites green (210), tsc clean, lockstep 6/6, eslint clean (4 fixable errors fixed at adjudication). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ource selection (a2td #220+#219 port, seam-1 packet B) Port-wave packet B, stacked on packet A (#539). #220 half: planner fields accept exact column_ref OR {query, datasource?}; resolution cache keyed on (query, selector); task specs carry the resolved common datasource; ambiguous AND not_found both block the plan (closes the audit-verified hole where not_found-only still planned with a warning). #219 half: buildAndApplyWorksheet derives the rewrite datasource from explicitBind.datasource — the caption/first-workbook-datasource regex grab is DELETED; no-manifest passthrough infers a single datasource from the provided refs via the shared parser and FAILS CLOSED on mixed refs with a prescriptive block; injectTemplate blocks caller DATASOURCE that disagrees with the resolved mapping datasource. Two characterization pins deliberately re-baselined (caption-first -> common-ref datasource), each with a comment naming the new invariant. Zero contact with the receipt-formatting area (#538's file overlap — verified no conflict). Cursor-minion port (gpt-5.5-high), orchestrator-adjudicated: full suite 4,368 green firsthand, invariant suites 210 green, tsc clean, lockstep 6/6, eslint clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ttified test from base Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Port-wave packet B — STACKED on #539 (packet A); merge #539 first, then retarget this to feature/desktop (or merge in sequence). Completes the seam-1 multi-datasource port for the binary.
#220 half (planner):
fieldsaccepts exactcolumn_refstrings OR{query, datasource?}objects; resolution cache keyed on (query, selector); worksheet task specs carry the resolved common datasource; ambiguous AND not_found both block the plan — closes the audit-verified hole where not_found-only still produced a plan with a warning.#219 half (apply):
buildAndApplyWorksheetderives the rewrite datasource fromexplicitBind.datasource— the caption/first-workbook-datasource regex grab is deleted; the no-manifest passthrough infers a single datasource from the provided refs (shared parser from #539) and fails closed on mixed refs with a prescriptive block;injectTemplateblocks a callerDATASOURCEthat disagrees with the resolved mapping's datasource instead of silently using it.Characterization re-baselines (deliberate, 2):
buildAndApplyWorksheet.characterization.test.ts:253and:265— old pins asserted caption-first/first-non-Parameters datasource selection (the defect); new pins assert common-ref-datasource selection, each commented with the invariant it now pins.Validation (orchestrator, firsthand): full suite 4,368 green (298 files), wrong-bind invariant suites 210 green, tsc clean, lockstep 6/6, eslint clean. Zero contact with #538's receipt-formatting overlap in the shared file — verified conflict-free.
🤖 Generated with Claude Code