Repository navigation
Commit 3924009
feat(dbt-tools): auto-run schema-verify after build --model
The agent has been ignoring skill-level instructions to call
schema-verify before declaring done (v4 and v5 trace inspection
showed the agent reads the rule, writes the intention in
chain-of-thought, then doesn't run the command). Building a full
harness-level validator framework that intercepts session
termination is real engineering; this commit ships the smallest
forcing mechanism that doesn't require touching the session loop:
auto-trigger schema-verify inside the build command's own response.
The agent now cannot see a successful `altimate-dbt build --model X`
without also seeing the schema-verify verdict in the same tool
result. The diff is in the JSON response under `schema_verify`,
in-context where the agent's attention sits — much harder to
ignore than a system-prompt skill rule.
Behavior:
- `build` without `--model` is unchanged (project-wide build, no
per-model verify makes sense).
- `build --model X` runs schema-verify on X after a successful
build. The full structured result lives at `schema_verify`.
- A verify failure does NOT mask the build's stdout — both are
reported. Build status remains the success/error signal.
- If verify itself errors (missing manifest, unbuilt table), the
error is reported under `schema_verify.error` with a fix hint.
Tests:
- Updated existing build-test mocks to include parseManifest +
getColumnsOfModel (no behavior change, just shape consistency).
- New assertion: build --model X result now contains schema_verify.
Skill: dbt-schema-verify body adds a note that the agent gets
schema-verify "for free" inside build's response, so it doesn't
need to call it twice for verification.
This is a stepping stone — the full validator framework that
intercepts session termination is the next iteration. This commit
tests whether putting the diff inline with the build response is
enough to break through the ignore-the-rule pattern.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 519b817 commit 3924009
3 files changed
Lines changed: 47 additions & 3 deletions
File tree
- .opencode/skills/dbt-schema-verify
- packages/dbt-tools
- src/commands
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
16 | 41 | | |
17 | 42 | | |
18 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
| |||
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
| |||
0 commit comments