---
phase: 66-expansion-qualification-adbc-tests
plan: 03
type: execute
wave: 3
depends_on:
  - 66-02
files_modified:
  - _notes/error_with_adbc.md
autonomous: false
requirements:
  - EXPAND-CTX-03
must_haves:
  truths:
    - "`_notes/error_with_adbc.md` retains its original downstream-reporter content for historical context."
    - "The file now opens with a `## Resolution (v0.10.0)` header section of 2-3 sentences pointing at the Phase 66 fix and the regression guard."
    - "The resolution section references the commit(s) that landed Plan 02's migration so future readers can follow the chain."
    - "D-11: `_notes/error_with_adbc.md` updated with a closing `## Resolution (v0.10.0)` header section (2-3 sentences) per CONTEXT.md decision; file is NOT archived to `_notes/archive/` (per D-11 archiving is optional, in-place close-out is the default)."
  artifacts:
    - path: "_notes/error_with_adbc.md"
      provides: "Historical downstream bug report + v0.10.0 resolution close-out"
      contains: "## Resolution (v0.10.0)"
  key_links:
    - from: "_notes/error_with_adbc.md"
      to: "test/integration/test_adbc_queries.py"
      via: "Inline mention of regression-guard test file path and `just test-adbc-queries` recipe"
      pattern: "test_adbc_queries"
    - from: "_notes/error_with_adbc.md"
      to: "src/expand/resolution.rs qualify_and_quote_table_ref"
      via: "Mention of the helper that emits fully-qualified `\"database\".\"schema\".\"table\"` references"
      pattern: "qualify_and_quote_table_ref"
---

<objective>
Close out EXPAND-CTX-03 by prepending a `## Resolution (v0.10.0)` header section to `_notes/error_with_adbc.md`, leaving the original downstream-reporter content intact below it for historical context.

Purpose: Per CONTEXT.md D-11, this note has value as the original downstream-bug-reporter context. Rather than deleting, prepend a brief resolution section pointing at the Phase 66 fix, the helper used, and the regression-guard test.

Output: 1 file edit; roughly 10 lines added at the top of `_notes/error_with_adbc.md`.
</objective>

<execution_context>
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/66-expansion-qualification-adbc-tests/66-CONTEXT.md
@.planning/phases/66-expansion-qualification-adbc-tests/66-RESEARCH.md
@.planning/phases/66-expansion-qualification-adbc-tests/66-02-SUMMARY.md

# File being modified (28 lines, original content preserved verbatim)
@_notes/error_with_adbc.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Prepend resolution header to error_with_adbc.md</name>
  <files>_notes/error_with_adbc.md</files>
  <read_first>
    - _notes/error_with_adbc.md (current 28-line content; preserve verbatim below the new section)
    - .planning/phases/66-expansion-qualification-adbc-tests/66-CONTEXT.md D-11 (close-out format — 2-3 sentence header section)
    - .planning/phases/66-expansion-qualification-adbc-tests/66-RESEARCH.md §Code Examples block titled `_notes/error_with_adbc.md close-out header` (template wording for the new section)
    - .planning/phases/66-expansion-qualification-adbc-tests/66-02-SUMMARY.md (Plan 02 commit SHAs for inline reference)
  </read_first>
  <action>
Prepend a new section at the top of `_notes/error_with_adbc.md`. The original 28 lines starting with `The actual error when the xfail mark is removed:` MUST be preserved verbatim below the new section, separated by a horizontal-rule divider and a `[original content below]` marker.

The new section uses the heading `## Resolution (v0.10.0)` followed by a 2-3 sentence paragraph that states: (a) the issue was fixed by Phase 66 covering EXPAND-CTX-01..03, (b) the fix is that semantic view expansion now uses `qualify_and_quote_table_ref` at every emission site (name the five paths: main expand path, FACTS, semi-additive, window metrics, materialization routing) and emits fully-qualified `"database"."schema"."table"` references that resolve regardless of the per-call Connection's catalog/schema defaults, (c) the regression is guarded by `test/integration/test_adbc_queries.py` runnable via `just test-adbc-queries`.

Follow that paragraph with a `See commits:` line listing the actual Plan 02 short-SHAs (read from `.planning/phases/66-expansion-qualification-adbc-tests/66-02-SUMMARY.md` or via `git log --oneline -- src/expand/sql_gen.rs | head -3`). Then a horizontal-rule divider and the `[original content below]` marker, then the verbatim original content.

Use the verbatim template in RESEARCH.md §Code Examples (the block titled "_notes/error_with_adbc.md close-out header") as the source-of-truth for the exact heading text and wording — substitute real commit SHAs in place of the template's placeholders. Do NOT introduce additional headings beyond `## Resolution (v0.10.0)`. Do NOT modify the original content. Do NOT archive the file to `_notes/archive/` — D-11 leaves archiving optional and the simpler in-place close-out is the default.
  </action>
  <verify>
    <automated>grep -q '^## Resolution (v0.10.0)' _notes/error_with_adbc.md && grep -q 'qualify_and_quote_table_ref' _notes/error_with_adbc.md && grep -q 'test_adbc_queries' _notes/error_with_adbc.md && grep -q 'The actual error when the xfail mark is removed' _notes/error_with_adbc.md</automated>
  </verify>
  <acceptance_criteria>
    - `grep -n '^## Resolution (v0.10.0)' _notes/error_with_adbc.md` returns exactly one match at line 1 (or very close to top).
    - `grep -n 'qualify_and_quote_table_ref' _notes/error_with_adbc.md` returns at least one match within the new section.
    - `grep -n 'test_adbc_queries' _notes/error_with_adbc.md` returns at least one match within the new section.
    - `grep -n 'just test-adbc-queries' _notes/error_with_adbc.md` returns at least one match (the recipe name appears in the resolution paragraph).
    - `grep -n 'The actual error when the xfail mark is removed' _notes/error_with_adbc.md` still returns the line from the original content (preservation check).
    - `grep -nE '^See commits:' _notes/error_with_adbc.md` returns one match referencing at least one short-SHA (7+ hex chars).
    - `wc -l _notes/error_with_adbc.md` reports the previous line count (28) plus ~10 new lines — total approximately 38-42 lines.
    - File contains a horizontal-rule divider (`---`) separating the new section from the original content.
  </acceptance_criteria>
  <done>Resolution header prepended; original content preserved verbatim; grep gates green; file commits via standard pre-commit hook (no fmt/clippy involved — markdown only).</done>
</task>

<task type="checkpoint:human-verify" gate="blocking">
  <name>Task 2: Final phase quality-gate confirmation</name>
  <files>(no files modified — verification only)</files>
  <what-built>
    Full Phase 66 deliverable: 7-site qualification migration (Plan 02) + ADBC test scaffolding 7/7 PASS (Plans 01+02) + close-out note (this plan).
  </what-built>
  <action>Pause for human verification. Executor presents the steps under <how-to-verify> to the user and waits for the resume-signal.</action>
  <how-to-verify>
    1. `just test-all > /tmp/claude/test_all_phase66_final.log 2>&1; RC=$?; tail -120 /tmp/claude/test_all_phase66_final.log; echo "RC=$RC"` — confirm exit 0. (`test-adbc-queries` should be in the recipe list and reporting 7/7 PASS.)
    2. `just ci > /tmp/claude/ci_phase66_final.log 2>&1; RC=$?; tail -120 /tmp/claude/ci_phase66_final.log; echo "RC=$RC"` — confirm exit 0.
    3. Read `_notes/error_with_adbc.md` end-to-end; confirm the `## Resolution (v0.10.0)` section reads coherently (2-3 sentences, accurate, points at the right commits and the right test file). This is the VALIDATION.md Manual-Only verification for EXPAND-CTX-03.
    4. Confirm Phase 66 satisfies ALL three EXPAND-CTX requirements:
       - EXPAND-CTX-01: `grep -c 'qualify_and_quote_table_ref' src/expand/sql_gen.rs src/expand/semi_additive.rs src/expand/window.rs src/expand/materialization.rs` totals at least 10 (3+3+3+1 new + 3 pre-existing in sql_gen.rs).
       - EXPAND-CTX-02: `just test-adbc-queries` exits 0; output reports `7 PASS / 0 SKIP / 0 FAIL`.
       - EXPAND-CTX-03: `_notes/error_with_adbc.md` contains the `## Resolution (v0.10.0)` section.
    5. If `mktemp` is blocked at any step, retry with `dangerouslyDisableSandbox: true` per CLAUDE.md Rule 2.
    6. Reminder: this phase does NOT touch REL-01/REL-02/REL-03. CHANGELOG `## [0.10.0]` section, `Cargo.toml`/`description.yml` bump, and milestone example file are deferred to milestone close per `feedback_defer_release_tasks.md`. Do not add them in this phase verification.
  </how-to-verify>
  <verify>
    <automated>echo "Manual checkpoint — see how-to-verify steps; user confirms with resume-signal."</automated>
  </verify>
  <done>User responds to the resume-signal confirming the checkpoint passed.</done>
  <resume-signal>Type "approved" to mark Phase 66 ready for `/gsd-verify-work`, or describe issues.</resume-signal>
</task>

</tasks>

<threat_model>
No new threats; see RESEARCH.md §Security Domain. Documentation-only edit; no production code, no test code, no build wiring affected.
</threat_model>

<verification>
- `_notes/error_with_adbc.md` opens with `## Resolution (v0.10.0)` section referencing `qualify_and_quote_table_ref` and `test_adbc_queries.py`.
- Original 28-line content preserved verbatim below a horizontal-rule divider.
- `just test-all` and `just ci` remain green (no regression introduced by the note edit).
- All three EXPAND-CTX requirements satisfied across Plans 01-03.
</verification>

<success_criteria>
- EXPAND-CTX-03 satisfied: `_notes/error_with_adbc.md` updated in-place with resolution section.
- Phase 66 deliverable complete across all three plans.
- Quality gate (`just test-all` + `just ci`) green.
- Manual reviewer judges the resolution section coherent and accurate.
- No release-prep tasks (CHANGELOG / version bump / example file) included — those are deferred to milestone close.
</success_criteria>

<output>
Create `.planning/phases/66-expansion-qualification-adbc-tests/66-03-SUMMARY.md` when done. Cross-reference Plans 01 and 02 SUMMARYs and confirm EXPAND-CTX-01..03 all closed.
</output>
