Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fa3b980
feat(onboarding): ship jaffle-shop DuckDB starter sample
Jul 24, 2026
96533a4
feat(onboarding): resolve + ship starter sample from wrapper package
Jul 24, 2026
c15671f
fix(onboarding): sample-source-resolver + regenerate script — codex-r…
Jul 24, 2026
aa49db3
feat(onboarding): first-run activation — core logic (detection, marke…
Jul 24, 2026
1e8597f
fix(onboarding): Phase 4a codex-review refinements
Jul 24, 2026
8f727e8
feat(onboarding): activation dialog + /starter + /activation wiring
Jul 24, 2026
f524cb0
fix(onboarding): Phase 4b codex-review refinements
Jul 24, 2026
4848da6
test(onboarding): Phase 5a — marker, materialize, tool-detection, sam…
Jul 24, 2026
2449a89
docs(onboarding): VHS tape + helper script for /starter demo
Jul 24, 2026
c88fd76
feat(onboarding): starter_materialize tool — LLM-invoked wrapper arou…
Jul 27, 2026
2c1eba3
refactor(onboarding): rename starter_materialize tool → sample_setup
Jul 27, 2026
e89955f
feat(onboarding): activation menu as agent-appended text; drop the mo…
Jul 27, 2026
eb957f7
fix(onboarding): harden sample_setup against path traversal + atomic …
Jul 28, 2026
883cf21
fix(onboarding): template branches for sample_setup states + de-vacat…
Jul 28, 2026
ff35d93
fix(onboarding): consensus-review Round 1–3 — safety, correctness, pa…
Jul 28, 2026
5f67208
test(onboarding): add coverage for consensus-review test gaps (27–31)
Jul 28, 2026
ea6ec07
fix(onboarding): codex sweep — canonicalize HOME + lstat orphan sweep
Jul 28, 2026
ae31698
fix(onboarding): dbt runtime probe falls back through cmd.exe on Windows
Jul 28, 2026
89028ff
fix(onboarding): kilo-code-bot findings — alongside branch wording + …
Jul 28, 2026
6c8b445
fix(onboarding): cubic P1s + codex-sweep NEW-10 — marker identity, te…
Jul 28, 2026
33f6e3a
fix(onboarding): refuse ANY single-quote in pasted dbt path (kilo fol…
Jul 28, 2026
cb53255
refactor(onboarding): dedupe against existing monorepo utilities (5 o…
Jul 29, 2026
53cbde8
fix(onboarding): cubic P1 traversal + P2 event-loop + P2 Windows dbt.…
Jul 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ tsconfig.tsbuildinfo
**/.github/meta/pr-body-*.md
.bridge-merge-report.md
/data/

# Rendered VHS demos — regenerable from .tape files, kept out of git
docs/media/*.gif
12 changes: 12 additions & 0 deletions packages/opencode/sample-projects/jaffle-shop-duckdb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build/run artifacts that must NOT be committed. `target/*` (not `target/`)
# so the re-include below actually works — git ignores the CONTENTS of target/
# individually, then lets us un-ignore the one pre-compiled artifact we ship.
# Using `target/` here would exclude the directory as a whole and make the
# `!target/manifest.json` line inert (git will not descend into an ignored
# directory to re-include children).
target/*
!target/manifest.json

dbt_packages/
logs/
.user.yml
55 changes: 55 additions & 0 deletions packages/opencode/sample-projects/jaffle-shop-duckdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Jaffle Shop — altimate-code starter sample

Everything below runs against a local DuckDB file — no cloud warehouse, no
credentials, no network calls.

## What's in here

```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The file tree in the 'What's in here' section omits .gitignore, which is one of the shipped files (confirmed via MATERIALIZE_ENTRIES in materialize.ts). Users who materialize the sample will get a .gitignore without seeing it documented. Add it to the tree so the listing stays accurate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/sample-projects/jaffle-shop-duckdb/README.md, line 8:

<comment>The file tree in the 'What's in here' section omits `.gitignore`, which is one of the shipped files (confirmed via `MATERIALIZE_ENTRIES` in `materialize.ts`). Users who materialize the sample will get a `.gitignore` without seeing it documented. Add it to the tree so the listing stays accurate.</comment>

<file context>
@@ -0,0 +1,55 @@
+
+## What's in here
+
+```
+dbt_project.yml         dbt project config
+profiles.yml            DuckDB profile — path is project-relative
</file context>

dbt_project.yml dbt project config
profiles.yml DuckDB profile — path is project-relative
sample-manifest.json version metadata used by altimate-code to detect
stale copies on upgrade
models/
staging/
stg_customers.sql renames raw customer columns to snake_case
stg_orders.sql renames raw order columns
schema.yml column descriptions + unique/not_null tests
marts/
customers.sql one row per customer, joins in order counts
orders.sql one row per order, joins in customer names
schema.yml column descriptions + tests + relationships
seeds/
raw_customers.csv 3 rows of test data
raw_orders.csv 4 rows of test data
target/
manifest.json PRE-COMPILED dbt manifest — ships with the sample so
altimate-code's static workflows (/discover, /review)
work without dbt-core / dbt-duckdb installed
```

## What to try (works with zero external tools)

- `/discover stg_customers` — walk the DAG and see what depends on this model
- `/review models/marts/customers.sql` — run the reviewer against a mart model
- Open any `.sql` file and ask altimate-code to explain the transformation
- Ask altimate-code "what tests would you recommend for `orders`?"

## What to try (needs `dbt-core` + `dbt-duckdb` installed)

```bash
pip install dbt-duckdb
cd ~/altimate-sample-dbt # or wherever you materialized the sample
dbt seed # load the CSVs into DuckDB
dbt build # run models + tests
duckdb target/jaffle.duckdb -c 'select * from customers'
```

Once `dbt-duckdb` is on your `$PATH`, altimate-code detects it automatically
and the "run" workflows appear in `/help`.

## Bringing your own project

When you're ready to switch to your real dbt project, `cd` into it and run
altimate-code again. The scan will pick up your `dbt_project.yml` and offer
to connect its warehouse.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "jaffle_shop"
version: "1.0.0"

profile: "jaffle_shop"

model-paths: ["models"]
seed-paths: ["seeds"]
target-path: "target"
clean-targets: ["target", "dbt_packages"]

models:
jaffle_shop:
staging:
+materialized: view
marts:
+materialized: table
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
select
c.customer_id,
c.first_name,
c.last_name,
count(o.order_id) as order_count,
coalesce(sum(o.amount), 0) as total_amount
from {{ ref('stg_customers') }} c
left join {{ ref('stg_orders') }} o on c.customer_id = o.customer_id
group by c.customer_id, c.first_name, c.last_name
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
select
o.order_id,
o.customer_id,
c.first_name || ' ' || c.last_name as customer_name,
o.order_date,
o.amount
from {{ ref('stg_orders') }} o
join {{ ref('stg_customers') }} c on o.customer_id = c.customer_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2

models:
- name: customers
description: One row per customer with total order count and revenue.
columns:
- name: customer_id
description: Primary key.
data_tests:
- unique
- not_null
- name: order_count
description: Number of orders placed by the customer (0 when none).
data_tests:
- not_null
- name: total_amount
description: Sum of all order amounts (0 when none).
data_tests:
- not_null

- name: orders

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: orders model schema omits customer_name, order_date, and amount columns that the SQL model produces. Same discoverability gap as the customers model — these columns won't surface in dbt docs or the review UI.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/sample-projects/jaffle-shop-duckdb/models/marts/schema.yml, line 21:

<comment>orders model schema omits `customer_name`, `order_date`, and `amount` columns that the SQL model produces. Same discoverability gap as the customers model — these columns won't surface in dbt docs or the review UI.</comment>

<file context>
@@ -0,0 +1,32 @@
+        data_tests:
+          - not_null
+
+  - name: orders
+    description: One row per order with a joined customer name.
+    columns:
</file context>

description: One row per order with a joined customer name.
columns:
- name: order_id
description: Primary key.
data_tests:
- unique
- not_null
- name: customer_id
description: Foreign key to `stg_customers`.
data_tests:
- not_null
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2

models:
- name: stg_customers
description: Renamed customer columns from the raw seed.
columns:
- name: customer_id
description: Primary key of the customer.
data_tests:
- unique
- not_null

- name: stg_orders
description: Renamed order columns from the raw seed.
columns:
- name: order_id
description: Primary key of the order.
data_tests:
- unique
- not_null
- name: customer_id
description: Foreign key to `stg_customers`.
data_tests:
- not_null
- relationships:
to: ref('stg_customers')
field: customer_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select
id as customer_id,
first_name,
last_name
from {{ ref('raw_customers') }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
select
id as order_id,
customer_id,
order_date,
amount
from {{ ref('raw_orders') }}
14 changes: 14 additions & 0 deletions packages/opencode/sample-projects/jaffle-shop-duckdb/profiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# DuckDB profile — everything runs locally against a single file at
# `target/jaffle.duckdb` (created on first `dbt build`). No cloud credentials.
# `path:` is unqualified, so dbt-duckdb resolves it against the PROCESS
# working directory at build time — NOT the project directory. Run
# `dbt build` from the materialized sample dir (`cd <sample-path>`) and
# the database lands at `<sample-path>/target/jaffle.duckdb`.
# Run it from anywhere else and dbt writes to `$PWD/target/jaffle.duckdb`.
jaffle_shop:
Comment on lines +3 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Comment incorrectly states that dbt-duckdb resolves the path against the process working directory. Per the official dbt-duckdb documentation, the path is resolved relative to the profiles.yml file location by default. Since this profiles.yml lives at the project root, the practical behavior is the same (the database lands at <project>/target/jaffle.duckdb when running from the project directory), but the comment's explanation is wrong and will mislead anyone trying to understand or debug the path resolution if they run dbt from a different directory while pointing at this profiles.yml.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/sample-projects/jaffle-shop-duckdb/profiles.yml, line 3:

<comment>Comment incorrectly states that dbt-duckdb resolves the `path` against the process working directory. Per the official dbt-duckdb documentation, the `path` is resolved relative to the profiles.yml file location by default. Since this profiles.yml lives at the project root, the practical behavior is the same (the database lands at `<project>/target/jaffle.duckdb` when running from the project directory), but the comment's explanation is wrong and will mislead anyone trying to understand or debug the path resolution if they run dbt from a different directory while pointing at this profiles.yml.</comment>

<file context>
@@ -0,0 +1,14 @@
+# DuckDB profile — everything runs locally against a single file at
+# `target/jaffle.duckdb` (created on first `dbt build`). No cloud credentials.
+# `path:` is unqualified, so dbt-duckdb resolves it against the PROCESS
+# working directory at build time — NOT the project directory. Run
+# `dbt build` from the materialized sample dir (`cd <sample-path>`) and
</file context>
Suggested change
# `path:` is unqualified, so dbt-duckdb resolves it against the PROCESS
# working directory at build time — NOT the project directory. Run
# `dbt build` from the materialized sample dir (`cd <sample-path>`) and
# the database lands at `<sample-path>/target/jaffle.duckdb`.
# Run it from anywhere else and dbt writes to `$PWD/target/jaffle.duckdb`.
jaffle_shop:
# DuckDB profile — everything runs locally against a single file at
# `target/jaffle.duckdb` (created on first `dbt build`). No cloud credentials.
# `path:` is unqualified, so dbt-duckdb resolves it relative to this
# `profiles.yml` location (the project directory). Run
# `dbt build` from the materialized sample dir (`cd <sample-path>`) and
# the database lands at `<sample-path>/target/jaffle.duckdb`.
# Run it from anywhere else and behavior depends on where dbt finds this profile.

target: dev
outputs:
dev:
type: duckdb
path: "target/jaffle.duckdb"
threads: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$comment": "Metadata about this sample project. Distinct from dbt's target/manifest.json — this is our own version stamp for conflict detection on the materialized copy at ~/altimate-sample-dbt/. If you edit any source file below, run ./regenerate.sh and commit the refreshed target/manifest.json alongside your change.",
"name": "jaffle-shop-duckdb",
"version": "1.0.0",
"kind": "altimate-starter-sample",
"source": "packages/opencode/sample-projects/jaffle-shop-duckdb",
"requires": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: requires field declares dbt version constraints that are never enforced at runtime — the manifest is the source of truth for sample version (version), but the requires.dbt-core and requires.dbt-duckdb constraints have no consumers. If someone has dbt-core 1.6.x or dbt-duckdb 2.x there's no early validation, just a late failure when the dbt commands themselves break. Consider either wiring the constraints into the tool-detection probe or documenting in a comment that they're informational-only.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/sample-projects/jaffle-shop-duckdb/sample-manifest.json, line 7:

<comment>`requires` field declares dbt version constraints that are never enforced at runtime — the manifest is the source of truth for sample version (`version`), but the `requires.dbt-core` and `requires.dbt-duckdb` constraints have no consumers. If someone has dbt-core 1.6.x or dbt-duckdb 2.x there's no early validation, just a late failure when the dbt commands themselves break. Consider either wiring the constraints into the tool-detection probe or documenting in a comment that they're informational-only.</comment>

<file context>
@@ -0,0 +1,16 @@
+  "version": "1.0.0",
+  "kind": "altimate-starter-sample",
+  "source": "packages/opencode/sample-projects/jaffle-shop-duckdb",
+  "requires": {
+    "dbt-core": ">=1.7 <2.0",
+    "dbt-duckdb": ">=1.7 <2.0"
</file context>

"dbt-core": ">=1.7 <2.0",
"dbt-duckdb": ">=1.7 <2.0"
},
"notes": [
"Renamed profile from the original test fixture: `test_jaffle_shop` → `jaffle_shop`.",
"DuckDB target file resolves project-relative at `target/jaffle.duckdb`; no host paths bake into the profile.",
"target/manifest.json ships pre-compiled so static workflows (/discover, /review) work without dbt installed."
],
"$assets_comment": "Single source of truth for the file list shipped to end users. `packages/opencode/src/altimate/onboarding/materialize.ts` copies these into the user's home; `packages/opencode/script/publish.ts` copies the same list into the wrapper npm package at release time; `packages/opencode/test/altimate/onboarding/publish-parity.test.ts` cross-checks both consumers use the same list. Adding a new sample file? Add it here — everything else picks it up automatically.",
"assets": [
{ "from": "README.md", "kind": "file", "required": true },
{ "from": "dbt_project.yml", "kind": "file", "required": true },
{ "from": "profiles.yml", "kind": "file", "required": true },
{ "from": "sample-manifest.json", "kind": "file", "required": true },
{ "from": ".gitignore", "kind": "file", "required": false },
{ "from": "models", "kind": "dir", "required": true },
{ "from": "seeds", "kind": "dir", "required": true },
{ "from": "target/manifest.json", "kind": "file", "required": true }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,first_name,last_name
1,Alice,Smith
2,Bob,Jones
3,Carol,White
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,customer_id,order_date,amount
1,1,2024-01-15,100
2,1,2024-02-20,200
3,2,2024-01-10,150
4,3,2024-03-05,300
Loading
Loading