Skip to content

feat(desktop): exact column_ref first-class + shared ref helpers (a2td #217+#222 port, seam-1 packet A)#539

Merged
mattcfilbert merged 3 commits into
feature/desktopfrom
claude/seam1-port-a
Jul 17, 2026
Merged

feat(desktop): exact column_ref first-class + shared ref helpers (a2td #217+#222 port, seam-1 packet A)#539
mattcfilbert merged 3 commits into
feature/desktopfrom
claude/seam1-port-a

Conversation

@mattcfilbert

@mattcfilbert mattcfilbert commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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 Profit across 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 in fields.ts/explicit-bind.ts replaced. 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: resolveField and proposal-binding resolveInSummary recognize an exact canonical column_ref FIRST — a hit resolves exact; a ref-SHAPED miss fails closed as not_found (never falls through to fuzzy). Datasource selector matches internal name or UNIQUE caption; ambiguous captions refuse with guidance (Parameters excluded). Gate 5b single-datasource closure untouched. listAvailableFields untouched (#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), tsc clean, 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 resolveInSummary is byte-for-byte the a2td-merged design (explicit comment in a2td validate.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's matchingFieldsForDatasource — 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.

mattcfilbert and others added 2 commits July 17, 2026 18:13
…#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
mattcfilbert merged commit a2a0632 into feature/desktop Jul 17, 2026
3 checks passed
@mattcfilbert
mattcfilbert deleted the claude/seam1-port-a branch July 17, 2026 22:49
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>
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.

1 participant