feat(desktop): exact column_ref first-class + shared ref helpers (a2td #217+#222 port, seam-1 packet A)#539
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>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mattcfilbert
added a commit
that referenced
this pull request
Jul 17, 2026
…ttified test from base Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mattcfilbert
added a commit
that referenced
this pull request
Jul 17, 2026
…ource selection (a2td #220+#219 port, seam-1 packet B) (#540) * feat(desktop): exact column_ref first-class + shared ref helpers (a2td #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> * feat(desktop): planner datasource-qualified fields + apply-side datasource 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> --------- 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 A (a2td #217 + #222 twins), from the content-signature port audit — the resolver half of the seam-1 multi-datasource correctness cluster, worth having in the feature/desktop binary: a duplicate
Profitacross datasources currently resolves by name-affinity and can silently bind the wrong one.#222 half: shared exported ref helpers in
field-resolver.ts(COLUMN_REF_REGEX,parseDatasourceQualifiedColumnRef,parseColumnInstanceRef,parseCanonicalColumnRef,formatCanonicalColumnRef— same API as a2td); private regexes infields.ts/explicit-bind.tsreplaced. Documented divergence preserved (explicit-bind accepts bare[deriv:Base:sfx]; fields require datasource-qualified). Colon-tolerant instance parsing — the minion's red run caught[Profit:Ratio]being mis-parsed as[Profit]and pinned it.#217 half:
resolveFieldand proposal-bindingresolveInSummaryrecognize an exact canonicalcolumn_refFIRST — a hit resolvesexact; a ref-SHAPED miss fails closed asnot_found(never falls through to fuzzy). Datasource selector matches internal name or UNIQUE caption; ambiguous captions refuse with guidance (Parametersexcluded). Gate 5b single-datasource closure untouched.listAvailableFieldsuntouched (#535's file — coordinated, not collided).Validation (orchestrator, firsthand): full suite 4,362 green (298 files), all three wrong-bind invariant suites green (210 tests — portability, bind-behavior-matrix, carrier-uniqueness),
tscclean, lockstep 6/6, eslint clean (4 fixable errors fixed at adjudication). Version 2.25.4 assumes #538 (2.25.3) merges first — resolve upward on conflict.Companions: #538 (receipt honesty, packet C) already open; packet B (planner/apply datasource selection, a2td #219+#220) stacks on this branch next.
🤖 Generated with Claude Code
Adversarial review adjudication (fresh-context GPT review, orchestrator-verified): the review returned two findings, both refuted by reference-parity — (1) ref-match-before-name ordering in
resolveInSummaryis byte-for-byte the a2td-merged design (explicit comment in a2tdvalidate.ts:217: refs are already datasource-qualified, so they resolve before duplicate captions — the ordering that closed #217's bug class; the trigger requires a field named as another field's canonical ref string, adversarial not user input); (2) internal-name-beats-caption selector precedence is identical in a2td'smatchingFieldsForDatasource— deterministic, with explicit refusal on caption-side ambiguity. Review's clean lenses: call-site enumeration, colon-parsing edge cases, old-vs-new regex grammar preservation. No port-introduced behavior deltas found.