---
phase: 18-verification-and-integration
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
  - Justfile
  - Cargo.toml
autonomous: true
requirements: [VERIFY-01, VERIFY-02, BUILD-04]

must_haves:
  truths:
    - "gsd/v0.5-milestone branch exists with all Phase 15-17.1 code integrated"
    - "just test-all passes on the integrated branch (including test-vtab-crash)"
    - "cargo test passes without C++ compilation (bundled mode, no extension feature)"
    - "Cargo.toml version is 0.5.0"
  artifacts:
    - path: "Justfile"
      provides: "test-vtab-crash target added to test-all chain"
      contains: "test-vtab-crash"
    - path: "Cargo.toml"
      provides: "Version bump to 0.5.0"
      contains: 'version = "0.5.0"'
  key_links:
    - from: "Justfile:test-all"
      to: "test-vtab-crash"
      via: "dependency in test-all recipe"
      pattern: "test-all:.*test-vtab-crash"
    - from: "Justfile:test-vtab-crash"
      to: "test/integration/test_vtab_crash.py"
      via: "uv run"
      pattern: "uv run test/integration/test_vtab_crash.py"
---

<objective>
Integrate the two divergent branches (feat/cpp-entry-point with parser extension code, gsd/v0.1-milestone with crash fixes) into a single gsd/v0.5-milestone branch, add the vtab crash test to the permanent test harness, bump version to 0.5.0, and verify the full test suite passes.

Purpose: Create a unified branch with all v0.5.0 code and establish the green baseline for final verification.
Output: gsd/v0.5-milestone branch with all tests green, version 0.5.0, test-vtab-crash in test-all.
</objective>

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

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/18-verification-and-integration/18-CONTEXT.md
@.planning/phases/18-verification-and-integration/18-RESEARCH.md
@.planning/phases/17.1-python-vtab-crash-investigation/17.1-01-SUMMARY.md
@.planning/phases/17.1-python-vtab-crash-investigation/17.1-02-SUMMARY.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Create integrated branch and update test harness</name>
  <files>Justfile, Cargo.toml</files>
  <action>
1. Create the new branch from feat/cpp-entry-point:
   ```bash
   git checkout feat/cpp-entry-point
   git checkout -b gsd/v0.5-milestone
   ```

2. Cherry-pick Phase 17.1 commits in chronological order (disjoint file sets -- zero conflict expected):
   ```bash
   git cherry-pick b0e57bd   # test_vtab_crash.py
   git cherry-pick f618eac   # runtime type validation (error.rs, table_function.rs)
   git cherry-pick 043024b   # DECIMAL cast skip (table_function.rs)
   ```
   If any cherry-pick fails unexpectedly, investigate the conflict and resolve manually. Per research, these branches modify completely disjoint file sets so conflicts should not occur.

3. Update Justfile to add test-vtab-crash target and include it in test-all:
   - Add new recipe:
     ```just
     # Run Python vtab crash reproduction tests against the built extension.
     test-vtab-crash: build
         uv run test/integration/test_vtab_crash.py
     ```
   - Update test-all to include the new target:
     ```just
     test-all: test-rust test-sql test-ducklake-ci test-vtab-crash
     ```
   Place the test-vtab-crash recipe near the other test recipes (after test-ducklake-ci).

4. Bump Cargo.toml version from "0.4.0" to "0.5.0" (line 3).

5. Commit the Justfile and Cargo.toml changes:
   ```
   chore(18-01): add test-vtab-crash to test-all, bump version to 0.5.0
   ```
  </action>
  <verify>
    <automated>git log --oneline -6 && grep 'version = "0.5.0"' Cargo.toml && grep 'test-vtab-crash' Justfile</automated>
  </verify>
  <done>gsd/v0.5-milestone branch exists with 3 cherry-picked commits + 1 harness/version commit. Cargo.toml shows 0.5.0. Justfile has test-vtab-crash in test-all.</done>
</task>

<task type="auto">
  <name>Task 2: Run full test suite baseline and verify BUILD-04</name>
  <files></files>
  <action>
1. Run `just test-all` as the baseline assessment. This exercises:
   - `test-rust` (cargo nextest run -- Rust unit + proptest + doc tests)
   - `test-sql` (sqllogictest -- includes phase16_parser.test for native DDL)
   - `test-ducklake-ci` (DuckLake integration)
   - `test-vtab-crash` (Python crash reproduction, 13 tests)

   NOTE: If `cargo nextest` is not installed, the test-rust step will fail. In that case, temporarily modify Justfile's test-rust recipe to use `cargo test` instead and re-run. Alternatively, install nextest with `cargo install cargo-nextest --locked`.

2. If any tests fail, triage:
   - Simple regressions (< 30 min fix): fix inline and commit with descriptive message
   - Complex regressions: document in plan summary for separate phase

3. Verify BUILD-04 structurally: confirm that `cargo test` (which uses default features = bundled, NOT extension) does not trigger C++ compilation. Check build.rs -- it should exit early when CARGO_FEATURE_EXTENSION is not set. Run `cargo test` separately and verify no C++ compilation output (no "Compiling duckdb.cpp" or cc-related output).

4. Verify VERIFY-02 structurally: confirm that `test/sql/phase16_parser.test` exists and is listed in `test/sql/TEST_LIST`. This file covers the full native DDL cycle (CREATE SEMANTIC VIEW + query).
  </action>
  <verify>
    <automated>just test-all</automated>
  </verify>
  <done>just test-all passes with zero failures. BUILD-04 confirmed (cargo test runs without C++ compilation). VERIFY-02 confirmed (phase16_parser.test present and exercised by test-sql).</done>
</task>

</tasks>

<verification>
- `just test-all` exits 0 on gsd/v0.5-milestone branch
- `git log --oneline feat/cpp-entry-point..gsd/v0.5-milestone` shows 4 commits (3 cherry-picks + 1 harness/version)
- `cargo test` completes without cc crate compiling duckdb.cpp
- `test/sql/phase16_parser.test` exists and runs via test-sql
</verification>

<success_criteria>
- gsd/v0.5-milestone branch created with all Phase 15-17.1 code
- test-vtab-crash added to Justfile and included in test-all
- Cargo.toml version = "0.5.0"
- just test-all passes (VERIFY-01)
- phase16_parser.test runs as part of test-sql (VERIFY-02)
- cargo test works without C++ compilation (BUILD-04)
</success_criteria>

<output>
After completion, create `.planning/phases/18-verification-and-integration/18-01-SUMMARY.md`
</output>
