Skip to content

feat: foundation for the dbt Power User features - #30

Merged
hkaltai merged 18 commits into
mainfrom
feat/pu-mods-foundation
Nov 17, 2026
Merged

hkaltai merged 18 commits into
mainfrom
feat/pu-mods-foundation

Conversation

@hkaltai

@hkaltai hkaltai commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Sets up the plugin side of the dbt Power User features. Separate follow-up PRs fill in each feature.

  • Tool chain (hooks/tool-chain.ts): one ordered pipeline around every tool call. A Bash call goes through bashRewrite, bashGate, the call, then bashAfter. An edit runs editAfter and readOrEditAfter, and a read runs readOrEditAfter. When a gate denies a call, nothing after it runs. A failed or refused call runs no file phases.
  • Features (hooks/features/*): nine feature modules (cost, cte-profile, defer, docs, health, runs, sql-graph, to-model, comments), registered in a fixed order in features/index.ts. Each one is a stub for now, so a call passes through unchanged.
  • dbt command parsing (hooks/dbt-command.ts) and an altimate-cli.ts helper that runs altimate-code tool commands. The parser has a written supported-input contract at the top of the file. It reports an invocation only when the static text shows dbt will start. Each prefix word (command, exec, nohup, env, time) and each launcher's run (uv, uvx, poetry, pdm, pipenv, hatch, rye) has its own option grammar. An unknown option, a keyword in program position, an unreadable line, or a value that needs expansion gives no invocation, or marks it dynamic, rather than a guess.
  • Status line (hooks/status-line.ts): joins the features' parts in their fixed order.
  • Lineage: its tool.call hook stays in lineage.tsx. What moves is runTool and its helpers (within, textOf, persistedPath, mcpServer), which go to altimate-cli.ts and are shared with the features. The features' turn and session calls run from lineage's and the band's hooks. Lineage behavior matches main 1.6.1, with the per-edit column lookup through the CLI, and main's lineage and task-impact tests pass unchanged.
  • plugin.json userConfig adds these settings: maxScanBytes, healthBlocksPush, healthConfigPath, commentsPollSeconds, commentsInContext.

This depends on the altimate-code tools in AltimateAI/altimate-code#1736.

Changelog

  • Added: settings for the upcoming dbt Power User features. They have no effect until those features ship.
  • Changed: lineage's CLI helpers moved to a shared module. Lineage behavior is unchanged.

How did you verify your code works?

  • claude plugin test plugins/altimate-code: 354 pass, 0 fail across 11 files. This includes the lineage graph and layout suites, the new tool-chain and dbt-command suites, and a whole-plugin test that a Bash call passes through unchanged while every feature is a stub.
  • A multi-reviewer review loop runs on this PR next. Each finding gets a reply here.

Cost side effects

None. The features are stubs and make no model calls, warehouse queries or cloud requests.

Demo video

Demo video (hosted)

F.mp4 — watch on Notion (Altimate workspace; recorded from the approved head of this PR).

🤖 Generated with Claude Code

hkaltai and others added 3 commits November 13, 2026 16:31
Each feature gets its own file under hooks/features/, called by name from
features/index.ts in a fixed order: its own hooks, the session and turn
events, its band line and its tool-call phases. One tool.call hook
(tool-chain.ts) runs Bash and file handling in fixed phases: bashRewrite,
bashGate, the call, bashAfter, editAfter, readOrEditAfter. The status line
is built from parts (status-line.ts). runTool moves to altimate-cli.ts with
a `write` option that goes through the CLI with --allow-write.
dbt-command.ts finds the dbt invocations in a shell command line. New
userConfig fields: maxScanBytes, healthBlocksPush, healthConfigPath,
commentsPollSeconds, commentsInContext.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Subshells after keywords, case patterns, process substitution, arrays,
arithmetic and function definitions parse again; quotes in a heredoc inside
a substitution are text; a function or case pattern named dbt is not an
invocation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Review loop result: approved

Three independent reviewer runs looked at this PR: Claude (approve, confidence 0.8), a second Claude pass on the parser, and Codex. A separate run then checked each round of fixes. Replies to every finding:

Round 1 (fixed in 4328fc3)

  • F1 [MAJOR] Heredoc bodies were parsed as dbt commands. Fixed. A heredoc at the top level now makes the line unreadable, while a here-string (<<<) still parses.
  • F2 [MINOR] Malformed lines (dbt run >, dbt run &&, dbt run ), dbt run ()) returned invocations. Fixed by checking the line's structure first. The first version of that check (wellFormed) was too strict; see the next section.
  • F3 [MINOR] Quoted parentheses inside $(…) broke substitution matching. Fixed.
  • F4 [MINOR] Short options written joined to their value (-tprod, -sorders) were dropped. Fixed.
  • F5 [MINOR] Some dbt global options that take a value (--warn-error-options, -r, --indirect-selection, …) had their value read as the subcommand. Fixed.
  • F6 [MINOR] env -u FOO dbt run, env -C dir and exec -a hid the dbt call. Fixed.
  • F7 [MINOR] DBT_TARGET and DBT_TARGET_PATH set in front of dbt were ignored. Fixed. The -t and --target-path flags still take precedence.
  • F8 [MINOR] Undocumented: a bashGate that fails lets the call through. Documented in every feature stub. A gate that must hold a call catches its own error and returns { deny }.
  • F9 [MINOR] Undocumented: turnStart and turnComplete also fire for subagent turns. Documented in all nine stubs, with a note to check agentId.
  • F10 [MINOR] The feature order was written in three places, and its test only compared against a literal. Fixed. FEATURE_IDS is now defined once (in status-line.ts) and reused, and the test checks how the status line is built from it.
  • F11 [NIT] An unused RenderElement import, and $.ui.resolve(e) called twice. Fixed.

Fix check on round 1 (fixed in 6f6c89e)

  • [MAJOR] wellFormed refused valid shell lines: time (…), if (…); then, ! (…), { (…); }, case … esac (with and without a leading (), <(…) and >(…), name=(…), for ((…)), and f() ( … ). Fixed. A ( right after a keyword now starts a subshell, and case patterns are understood. <(…), >(…), ((…)) and arrays are each read as one word, and the commands inside <(…) are reported with offsets that match the original line. Each listed line has a test.
  • [MINOR] Quotes inside a heredoc in $(…), as in Claude's git commit -m "$(cat <<'EOF' …)", were read as quotes. Fixed: the heredoc body is skipped up to its closing delimiter.
  • [MINOR] dbt run () and dbt() {…} counted as dbt calls. Fixed. A function definition takes exactly one name, and the function name is not reported as a call.

Second fix check (passed). Its follow-ups:

  • [MINOR] function f() { dbt run; } returned nothing. Fixed and tested.
  • [MINOR] A case pattern named dbt was reported as an invocation. This was already the behaviour before this PR, but it was a one-line fix, so it is done: pattern words are never commands. Tested.
  • [MINOR] ((cd a && dbt run)), written as nested subshells with no space between the parentheses. Not changed. A leading (( is read as arithmetic, which is how bash reads it first. The only effect is that no result is reported, and this form is rare. Writing ( (…) ) works.
  • [NIT] $((1<<2)) inside a multi-line $(…), and a heredoc's delimiter followed by ) on the same line. Not changed. Both cases are rare, and the only effect is that no result is reported.
  • [NIT] Stale comments about heredocs. Fixed.
  • ;& and ;;& still make the line unreadable, as they did before this round of fixes. The only effect is that no result is reported.

Checks: claude plugin test plugins/altimate-code: 211 pass, 0 fail. The fix check also fuzzed the parser with 300k random lines and found no exceptions or hangs.

@hkaltai

hkaltai commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Demo recording: /Users/harish/.quikim/artifacts/pu-mods/videos/F.mp4 (with the asciinema cast F.cast beside it, 82 s). It shows, in order: command -v altimate pointing at the build from this branch; altimate tool list with the nine dbt Power User tools; tool run dbt_run_results returning the stub failure with exit code 1; claude plugin test on the plugin branch (tool chain, feature order and the through-the-plugin stub test, 211 pass); then Claude Code started with --plugin-dir on this plugin, where /lineage customers opens the lineage pane as before and a dbt Bash call goes through the tool chain unchanged.

readable() also returns null rather than false when a line cannot be
read, matching its declared type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Confirm-gate review of 4328fc3..6f6c89e (claude -p and codex exec, both REQUEST CHANGES). Replies:

  • [MAJOR] here-string read as a heredoc (dbt-command.ts:69): fixed in 2b31340. <<< no longer matches << at its second character. New regression test: dbt run -s a && echo "$(cat <<< text⏎)". It fails on 6f6c89e and passes now.
  • [MAJOR] readable() returned false against its Set<number> | null type (:309): fixed in 2b31340. It now returns null, so behaviour is unchanged. Strict tsc now reports no errors in dbt-command.ts.
  • [MAJOR] dotted function names (dbt.run() { … }), [MAJOR] escaped \case, [MINOR] function f { … } without parentheses, [MINOR] # <<EOF inside $(…), [NIT] time;: deferred as follow-ups. These are rare forms, and in each one the parser reports no dbt call, so the Bash call passes through unwrapped and is never blocked. This matches the follow-ups already listed. There is no production caller of parseDbtCommand yet.
  • [MINOR] >(…) order; $(…)/backtick bodies not parsed: not changed. Substitution bodies were never parsed for invocations, so this is not a regression from this range.
  • [NIT] unquoted heredoc delimiter regex: not changed. Unusual delimiters only make the line unreadable (no dbt call is reported).

Plugin tests: 212 pass, 0 fail.

@hkaltai

hkaltai commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Confirm-gate r2 at 2b31340: claude APPROVED, codex REQUEST CHANGES.

  • Both reviewers confirm the here-string fix works and the readable() null change does not change behaviour.
  • New finding (claude MINOR, codex MAJOR), dbt-command.ts:69: the new line[j - 1] !== '<' guard also skips a real heredoc that comes right after an escaped \<, as in echo $(cat \<<<EOF⏎…⏎EOF⏎). The heredoc body is then read as code and the line reports no dbt call. Nothing is wrongly blocked, but the dbt call is missed.
  • Not fixed yet. This gate allows at most two runs, and both are used up. The likely fix is to check whether the previous < was escaped, not just whether it is a <. The fix needs the owner's go-ahead, and it needs another gate run. Leaving this PR as a draft.

Skip a here-string's <<< as one operator instead of refusing any << after a <,
so \<<<EOF still opens a heredoc whose body is read as text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Confirm-gate r3 on 2b31340..b36cbe6: fixed in b36cbe6, the r2 finding (dbt-command.ts:69, a heredoc right after an escaped \< was skipped).

  • A here-string's <<< is now skipped as one operator, so the look-behind guard is gone. \<<<EOF opens a heredoc again, and <<<, <<EOF, <<-EOF and quoted delimiters read as before.
  • Regression test a heredoc right after an escaped < is still a heredoc, so its quotes are text: it fails on 2b31340 and passes on b36cbe6. Plugin tests: 213 pass, 0 fail.
  • Reviewers: claude APPROVED (one MINOR note, not a defect: <<<<, which is invalid shell, is now read differently); codex APPROVED (no findings; it checked here-strings, <<EOF, <<-EOF and quoted delimiters separately).

@hkaltai
hkaltai marked this pull request as ready for review November 14, 2026 05:44
@hkaltai

hkaltai commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

review-loop: APPROVED at b36cbe6

@kilo-code-bot

kilo-code-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Incremental pass over ac0d379..2c98769. The commit narrows the prefix and launcher grammar: exec -c is no longer read (empty environment, so what dbt sees is unknown), and the shared runner option lists become per-launcher tables. I re-checked the changed behavior against the file's documented contract and the new tests: exec -c/-cl now give no invocation while exec -l, exec -a NAME and time -p still parse; the launcher loop stops at --, skips a value flag with or without =, accepts repeated short flags (-qq, -vv) only when the launcher has the single flag, and returns no invocation for an unknown option; uvx --from is read as a value and uv run -- --project x dbt run stays rejected. The rejects are the conservative direction the header documents (a dropped option such as uv run --site-packages makes the line unread rather than reporting a phantom dbt run), and every new table entry I checked is either a boolean or a value flag for that launcher, so no newly accepted form turns a non-dbt command into an invocation.

The one new item is a simplification in the changed launcher loop, not a behavior defect.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
plugins/altimate-code/hooks/dbt-command.ts 718 RUNNER_OPTIONS[runner]! is a loop-invariant lookup recomputed per iteration, and words[i]!.text.split('/').pop()! is computed twice at lines 702-703; both can be hoisted/factored once
Files Reviewed (2 files)
  • plugins/altimate-code/hooks/dbt-command.ts - 1 suggestion
  • plugins/altimate-code/hooks/dbt-command.test.ts - no issues

Fix these issues in Kilo Cloud

Previous Review Summaries (6 snapshots, latest commit ac0d379)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit ac0d379)

Status: No Issues Found | Recommendation: Merge

Incremental pass over 2c494ec..ac0d379. No new issues in the changed lines. The two open items from earlier rounds are fixed at this head:

  • The open major on the prefix/launcher grammar: dbt-command.ts:696-710 now reads only each prefix's own options (command -p, exec -c/-l/-cl/-lc/-a NAME, time -p, -- after command/exec/nohup/env) and returns no invocation for anything else, so command --help dbt run, nohup -x dbt run, env if dbt run and uv run -- --project x dbt run no longer parse as a dbt run. The launcher loop (dbt-command.ts:726-740) stops at --, accepts known value flags with or without =, and returns no invocation for an unknown option or a help/version option. Re-checked the accepted forms against their shell semantics (exec -a NAME value skipping, trailing --, env -- NAME=value, nohup --, command -p --): each parses the command bash actually runs, and the rejected forms are the conservative direction the file's header documents.
  • The trailing-backslash minor: lex returns null at dbt-command.ts:262, so no offset can pass the line's end, while a real backslash-newline is still skipped as a continuation at line 213-216.

Also verified: within (altimate-cli.ts:70-72) attaches the work's rejection handler before scheduling the deadline, so a throwing $.clock.after leaves no unhandled rejection, and the new test asserts that order; the plugin.json/README "not used yet" wording matches the code (no hook reads those settings at this head); the earlier statusParts reset, chain-registration test and write precondition findings remain fixed.

Files Reviewed (6 files)
  • plugins/altimate-code/.claude-plugin/plugin.json
  • plugins/altimate-code/README.md
  • plugins/altimate-code/hooks/altimate-cli.test.ts
  • plugins/altimate-code/hooks/altimate-cli.ts
  • plugins/altimate-code/hooks/dbt-command.test.ts
  • plugins/altimate-code/hooks/dbt-command.ts

Previous review (commit 2c494ec)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • plugins/altimate-code/hooks/dbt-command.ts
  • plugins/altimate-code/hooks/dbt-command.test.ts
  • plugins/altimate-code/hooks/tool-chain.ts
  • plugins/altimate-code/hooks/tool-chain.test.ts
  • plugins/altimate-code/hooks/altimate-cli.test.ts

Incremental pass over 176e8b5..2c494ec. All four earlier findings are fixed and verified in current code:

  • dbt-command.ts:749 — assignmentDynamic is OR-ed into dynamic, so DBT_TARGET=$T time dbt run now reports dynamic: true while DBT_TARGET=prod time dbt run still reports target: 'prod' (regression cases at dbt-command.test.ts:206-208). The flag is only set by the pre-launcher assignment loop, so dbt arguments that look like assignments are not counted.
  • tool-chain.ts:86-98 — steps.limit and steps.log are both guarded; a throwing deadline or logger returns fallback, so the gate still runs (covered by tool-chain.test.ts:165).
  • tool-chain.test.ts:115 — the registration test now uses a clock whose deadline never fires and asserts no tool chain · timeout was logged, so every stub phase is actually reached.
  • altimate-cli.test.ts:20 — the stand-in has clock.after, so the MCP no-answer fallback is taken; the test counts the MCP call and checks the CLI argv of the second call.

The remaining files in that commit range (integrations.tsx, integrations.test.tsx, plugin.json/marketplace.json versions, CHANGELOG.md, README.md) only carry content already on main that the merge brought in; they are not part of the PR diff against 087f425, so they were not re-reviewed as changes.

Checked edge cases in the changed parser code: $"…" quote handling, backslash retention in double quotes, $'…' escapes, unquoted ~/{a,b}/{1..3}/*/?/[, and launcher -h/--help/-V/--version. Each behaves per the documented contract (conservative dynamic, no invented literal values), and none of the new heuristics turns a true expansion into a literal value.

Previous review (commit 176e8b5)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
plugins/altimate-code/hooks/dbt-command.ts 746 A dynamic DBT_TARGET/DBT_TARGET_PATH in front of a prefix word (time, nohup, …) is dropped from dynamic, so it is reported as "no target" instead of unknown
plugins/altimate-code/hooks/tool-chain.ts 85 steps.limit/steps.log are unguarded inside bounded; a throwing logger rejects the phase helper and the whole pre-phase, including the gate, is skipped

SUGGESTION

File Line Issue
plugins/altimate-code/hooks/tool-chain.test.ts 113 quick.clock preempts every phase, so the "every feature is a stub" pass-through test exercises only the timeout path
plugins/altimate-code/hooks/altimate-cli.test.ts 20 The stand-in has no clock.after, so the "no answer" MCP fallback the test names is never reached (the read call fails with a TypeError that runTool's catch hides)
Files Reviewed (5 files)
  • plugins/altimate-code/hooks/altimate-cli.test.ts - 1 issue
  • plugins/altimate-code/hooks/dbt-command.test.ts - no issues
  • plugins/altimate-code/hooks/dbt-command.ts - 1 issue (carried, re-verified)
  • plugins/altimate-code/hooks/tool-chain.ts - 1 issue (carried, re-verified)
  • plugins/altimate-code/hooks/tool-chain.test.ts - 1 issue (carried, re-verified in unchanged code)

Checked this increment (9409397c..176e8b5) against the earlier findings. The parser now keeps backslashes bash keeps inside double quotes, treats unquoted ~, {a,b}/{1..3} and */?/[ as expansions (values dropped, dynamic set), marks a $'…' with an escape as dynamic instead of reporting the raw escape text, reads $"…" as an ordinary double-quoted string, accepts $-, and returns no invocation when the launcher is asked for help/version (uv run --help, uvx --version). The $"…" branch does not turn a quoted NAME=value into an assignment (quotedAt stays before the =). The three earlier findings are unchanged in this increment: prefix words still reset firstAssignment before dynamic is computed, bounded still calls steps.limit/steps.log outside its guard (the new comment at tool-chain.ts:43 documents the timeout, not the throw), and the plugin-level pass-through test still uses quick.clock. One new test-precision gap is reported above.

Fix these issues in Kilo Cloud

Previous review (commit 9409397)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
plugins/altimate-code/hooks/dbt-command.ts 727 A dynamic DBT_TARGET/DBT_TARGET_PATH in front of a prefix word (time, nohup, …) is dropped from dynamic, so it is reported as "no target" instead of unknown
plugins/altimate-code/hooks/tool-chain.ts 85 steps.limit/steps.log are unguarded inside bounded; a throwing logger rejects the phase helper and the whole pre-phase, including the gate, is skipped

SUGGESTION

File Line Issue
plugins/altimate-code/hooks/tool-chain.test.ts 113 quick.clock preempts every phase, so the "every feature is a stub" pass-through test exercises only the timeout path
Files Reviewed (13 files)
  • plugins/altimate-code/.claude-plugin/plugin.json
  • plugins/altimate-code/README.md
  • plugins/altimate-code/hooks/altimate-cli.ts
  • plugins/altimate-code/hooks/dbt-command.ts - 1 issue
  • plugins/altimate-code/hooks/dbt-command.test.ts
  • plugins/altimate-code/hooks/features/index.ts
  • plugins/altimate-code/hooks/features/index.test.ts
  • plugins/altimate-code/hooks/integrations.tsx
  • plugins/altimate-code/hooks/integrations.test.tsx
  • plugins/altimate-code/hooks/lineage.tsx
  • plugins/altimate-code/hooks/tool-chain.ts - 1 issue
  • plugins/altimate-code/hooks/tool-chain.test.ts - 1 issue
  • plugins/altimate-code/types/index.d.ts

Checked this increment (f6816998..9409397c) against the earlier findings: the parser hardening covers command -v, quoted words, expansions (dynamic), redirection spans and --partial-parse-file-path; relative-phase failures are now caught synchronously by attempt; every phase has a deadline; and the status parts are cleared at session start. Lineage's move of runTool/within/textOf into altimate-cli.ts preserves the previous semantics at every call site. The three items above are new behaviour introduced by this increment; the remaining earlier threads are either fixed or already tracked.

Fix these issues in Kilo Cloud

Previous review (commit f681699)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • plugins/altimate-code/hooks/altimate-cli.ts
  • plugins/altimate-code/hooks/dbt-command.test.ts
  • plugins/altimate-code/hooks/dbt-command.ts
  • plugins/altimate-code/hooks/integrations.test.tsx
  • plugins/altimate-code/hooks/integrations.tsx
  • plugins/altimate-code/hooks/status-line.ts
  • plugins/altimate-code/hooks/tool-chain.test.ts

Checked this increment against the earlier findings: the invocation offsets now start at the assignment/launcher after any prefix words (verified for if/then/!/time/nohup/env and env -u HOME/env -C forms, including the splice-to-valid-shell case), a new session clears persisted status parts before redrawing, and a new test asserts the single tool.call chain hook is registered and executes the call it is given. No new issues found.

Previous review (commit b36cbe6)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
plugins/altimate-code/hooks/dbt-command.ts 430 start includes leading shell keywords (if, then, !, time, nohup, env), so splicing the reported span corrupts the command

SUGGESTION

File Line Issue
plugins/altimate-code/hooks/altimate-cli.ts 167 write option has no callers and adds --allow-write without user approval
plugins/altimate-code/hooks/status-line.ts 14 statusParts is persisted but never reset per session
plugins/altimate-code/hooks/tool-chain.test.ts 91 Plugin-level test cannot detect a missing installToolChain
Files Reviewed (20 files)
  • plugins/altimate-code/.claude-plugin/plugin.json - no issues
  • plugins/altimate-code/hooks/altimate-cli.ts - 1 suggestion
  • plugins/altimate-code/hooks/dbt-command.ts - 1 warning
  • plugins/altimate-code/hooks/dbt-command.test.ts - no issues
  • plugins/altimate-code/hooks/features/comments.tsx - no issues
  • plugins/altimate-code/hooks/features/cost.tsx - no issues
  • plugins/altimate-code/hooks/features/cte-profile.tsx - no issues
  • plugins/altimate-code/hooks/features/defer.tsx - no issues
  • plugins/altimate-code/hooks/features/docs.tsx - no issues
  • plugins/altimate-code/hooks/features/health.tsx - no issues
  • plugins/altimate-code/hooks/features/index.ts - no issues
  • plugins/altimate-code/hooks/features/runs.tsx - no issues
  • plugins/altimate-code/hooks/features/sql-graph.tsx - no issues
  • plugins/altimate-code/hooks/features/to-model.tsx - no issues
  • plugins/altimate-code/hooks/integrations.tsx - no issues
  • plugins/altimate-code/hooks/lineage.tsx - no issues
  • plugins/altimate-code/hooks/status-line.ts - 1 suggestion
  • plugins/altimate-code/hooks/tool-chain.test.ts - 1 suggestion
  • plugins/altimate-code/hooks/tool-chain.ts - no issues
  • plugins/altimate-code/types/index.d.ts - no issues

Also verified while reviewing: the runTool/within/textOf/persistedPath move from lineage.tsx to altimate-cli.ts leaves no dangling imports or duplicate definitions, and all five runTool call sites use the new options shape correctly (cliOnly, until); the nine feature stubs and every dispatch function call the ids in FEATURE_IDS order; the band and status-line wiring keeps prior behavior when no feature line exists.

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash-1017 · Input: 82.4K · Output: 24.4K · Cached: 960K

…sion, chain wiring tested

- parseDbtCommand's start leaves out the shell keywords and prefix commands in front of dbt (if, then,
  !, time, nohup, env and its options) and keeps the assignments right before it, so a rewrite spliced
  between start and end keeps the line valid shell.
- The status parts are cleared at session start, so an earlier session's part is not drawn again.
- runTool's write option documents that the caller must have the user's yes first.
- A test asserts the plugin registers the tool chain's hook and that it runs the call it is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

review-loop: APPROVED at f681699

Verify-only gate on b36cbe6..f681699 (fixes for the Kilo review threads): Claude APPROVED, Codex APPROVED. Non-blocking MINOR follow-ups:

  • Wrap clearStatusParts in session start with the same .catch log as startLineage.
  • In the chain-wiring test, also assert that nothing was logged.
  • Cover nohup X=1 dbt run, where X=1 is a command name, not an assignment.

@sahrizvi sahrizvi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consensus review: request changes

Panel: Claude (lead) and Codex. Codex reviewed on its own first, then each side checked the other's findings. Every finding below was reproduced against the code or by running it, and both reviewers accept every finding at the severity shown.

Head reviewed: f681699831. Merge base: 15ef117. CLI: built from AltimateAI/altimate-code#1736 at d8c34693b0.

Why changes are requested

  • Five open majors.
    • Four are in dbt-command.ts. Each is a wrong parse of a kind a later rewrite or gate would act on: prefix options (command -v dbt run, env -u), quoted words read as assignments or keywords, unexpanded $VAR/$(…) returned as selectors and targets, and a replacement span that swallows interleaved redirections. See the inline comments.
    • The fifth is not tied to a diff line: the branch no longer merges onto main (see the PR comment).

What holds up

  • Pass-through. With every feature a stub, the chain passes Bash, Read and Edit calls through unchanged. It hands next the same input object and returns the same result object, and it adds no deny and no context.
  • Exceptions. An async exception in any feature phase, including one raised inside the parser, is logged and skipped, and the call runs unchanged.
  • Parser at runtime. parseDbtCommand is not called by any runtime code at this head. Fuzzing it with 200,000 random shell-like inputs never made it throw, and a typical parse takes about 8 µs.
  • Ordering and the tests. The chain order and its failure handling are covered by the new suites. Every mutation I tried was caught:
    • the gate seeing the command before the rewrite (1 test fails);
    • a stub that rewrites (3 fail);
    • file phases running after a failed call (1 fails);
    • a stub gate that denies (6 fail).
  • Missing or old CLI. altimate-cli.ts runs the CLI by argv with no shell and a timeout, and logs nothing from the output. No code at this head calls #1736's tools. An older CLI answers with an Unknown tool error status, which runTool maps to ok:false.
  • Lineage. lineage.test.tsx is byte-identical at base and head and passes at both. The lineage tool.call hook stays in lineage.tsx; what moved to altimate-cli.ts is runTool and its helpers, unchanged except for the options object.

Suites (base 15ef117 → head)

Check Base Head
claude plugin validate --strict plugins/altimate-code fails on warnings: 4 TS2345 in lineage.test.tsx, plus a missing icon the same warnings; no new type errors
claude plugin validate (non-strict), both paths passes passes
claude plugin test plugins/altimate-code 189 pass, 0 fail 216 pass, 0 fail
tests/*.sh (7) all pass all pass
pytest tests/ 65 pass 65 pass

The repository has no tsconfig and no separate tsc step; the type check runs inside claude plugin validate.

No live check was run. A Claude Code session with an isolated HOME and config stops at the login screen, and this review does not sign in. The lineage parity evidence is the unchanged lineage suite, which passes at base and head.

Findings not tied to a diff line, and the nits, are in a separate PR comment.

firstAssignment = null
continue
}
if (word.startsWith('-') && prefix !== null) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: prefix options can make a command that runs nothing parse as a dbt invocation (Codex; reproduced)

parseDbtCommand('command -v dbt run') returns a run invocation with span dbt run. The shell only looks up the name there and dbt never starts. Prefix environment changes are ignored too: DBT_TARGET=prod env -u DBT_TARGET dbt build returns target: 'prod', but env -u removes that variable before dbt starts. A later gate or rewrite would then act on a call that never happens, or on the wrong target. Prefix words need per-command handling (command -v/-V is a lookup, env -u NAME drops NAME), or the parser should return no invocation. The same applies to nohup X=1 dbt run, which your own loop listed as a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834. The parser now returns no invocation for a lookup (command -v/-V), for env followed by any option (env -u NAME, -i, -S…), and for a NAME=val word after a wrapper that runs its first argument (nohup, command, exec). There, that word is the command, so nohup X=1 dbt run doesn't run dbt. command -p/command -- and env with only assignments still parse, and env's assignments count like leading ones. DBT_TARGET=prod env -u DBT_TARGET dbt build now gives no invocation. Test: "prefix options: a lookup, env with options and a NAME=value after a wrapper are no invocation", which fails on the old code. The header comment now states the contract: when the static text doesn't show that dbt starts, no invocation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not resolved (only partly). Both inputs from round 1 now give no invocation, and the new test covers them. But the same kind of input still parses as a dbt run: other options after command, nohup, exec and time are skipped (command --help dbt run, nohup --help dbt run), a keyword after env is taken as a keyword (env if dbt run), and launcher options are still read after -- (uv run -- --project x dbt run). This is the open major in this round's review, on dbt-command.ts line 637.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now fixed in ac0d379 and 2c98769. Details are in this round's thread on dbt-command.ts.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still not resolved, but narrowed at d563dce. Every round-1 and round-2 input gives []. The four prefix forms left are in the round-3 review's inline comments.

if (c === '\\') {
text += line[i + 1] ?? ''
i += 2
} else if (c === "'") {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: dropping quote information turns words that are not assignments or keywords into assignments and keywords (Codex; reproduced)

"DBT_TARGET=prod" dbt run parses as a dbt run with target: 'prod'. Bash instead tries to run a command named DBT_TARGET=prod, and dbt never starts. Likewise "if" dbt run is read as keyword if plus a dbt call. Once a quote is stripped into text, ASSIGNMENT and PREFIX_WORDS can no longer tell the difference. Record per token whether it had any quoted part, and skip assignment and keyword matching for those tokens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834. Each token records where its first quoted part starts. A token quoted before its = is never an assignment, and a quoted token is never a keyword or prefix command. So "DBT_TARGET=prod" dbt run and "if" dbt run give no invocation. DBT_TARGET="prod" dbt run stays an assignment, as in bash, and a quoted "dbt" is still dbt. Test: "a quoted word is never an assignment, a keyword or a prefix command, but a quoted dbt is dbt", which fails on the old code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at 2c494ec. "DBT_TARGET=prod" dbt run and "if" dbt run give no invocation. DBT_TARGET="prod" dbt run is still an assignment, and "dbt" run and 'dbt' run still parse as dbt. Reverting isAssignment to ignore quotedAt fails the new test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for checking, and for the mutation checks.

if (SELECT_FLAGS.has(flag)) {
if (inline !== null) select.push(...inline.split(/\s+/).filter(Boolean))
selecting = true
} else if (flag === '-t' || flag === '--target') target = value()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: unexpanded variables and substitutions come back as literal selectors and targets (Codex; reproduced)

  • dbt run --target "$DBT_TARGET" returns target: '$DBT_TARGET'.
  • dbt run -s "$(printf orders)" returns select: ['$(printf', 'orders)'], while dbt itself receives orders.
  • for m in a b; do dbt run -s $m; done returns select: ['$m'].

A single-quoted literal and an expanding double-quoted value end up the same, so a cost estimate or gate built on select or target would look at models or a target that don't exist. A value containing an unquoted or double-quoted $ or backtick should be reported as unknown (null, or a flag on the invocation), not as a value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834. The tokenizer keeps $(…), ${…}, $NAME, $1 and backticks (unquoted or in double quotes) inside one word, so "$(printf orders)" is no longer split. DbtInvocation has a new documented dynamic field. It is true when any word of the invocation holds an expansion, and such a value is never reported: it is left out of select, and target/targetPath are null. The doc comments say a dynamic invocation's select and target are unknown. An expansion in the binary or the subcommand gives no invocation. Single-quoted '$literal' is still read literally. Test: "an expansion is part of its word, and the invocation is dynamic; its values are never reported", with all three of your examples plus DBT_TARGET=$T dbt run. It fails on the old code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at 2c494ec. Every expanded value I tried gives dynamic: true with nothing reported, including --target "$T", --select "$(cat x)", -s $m, backticks, X=$Y and DBT_TARGET=$T time dbt run, --vars "{k: $v}", $'…\n…', ~/x, {a,b} and an unquoted *. Single-quoted '$m' and "*" are still read as literals, which is right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for checking, and for the mutation checks.

hasDefer,
hasState,
start,
end: words[words.length - 1]!.end,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: the replacement span includes redirections inside the command (Codex; reproduced)

For dbt run > run.log -s orders, line.slice(start, end) is the whole command, > run.log included, even though the field's doc says redirections are excluded. A caller that replaces the span with a rewritten dbt run -s orders --target dev, as start/end are documented to allow, silently drops the redirection. Either make end stop before the first redirection that sits among the arguments, or return no invocation (or no safe span) for that form. A test on slice(start, end) for this input would lock it in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834, by refusing the form. A redirection among the arguments with another argument after it (dbt run > run.log -s orders, dbt run 2>/dev/null --target dev) gives no invocation, and the header lists it as unsupported. A trailing redirection still works, and the test asserts line.slice(start, end) is dbt run -s orders for dbt run -s orders > run.log. Test: "a redirection among the arguments with an argument after it is unsupported; a trailing one is left out of the range", which fails on the old code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at 2c494ec. A redirection among the arguments now gives no invocation: dbt run > run.log -s orders, >out 2>err -s m, > >(tee o) -t x and a redirection between the binary and the subcommand. Trailing redirections, pipes and &&/;/& stay outside the span: 2>&1, &>, >|, |&, <&0 and 3<>f all checked. I also fuzzed 200,000 lines: 0 throws, and every span parses alone as the same invocation. The only exception is a trailing backslash (a new minor). Removing the guard fails the new test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for checking, and for the mutation checks.

'-C',
])
// dbt options that take a value, so the value is not read as the subcommand or as a selector.
const DBT_VALUE_FLAGS = new Set([

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: global value flags missing from DBT_VALUE_FLAGS shift the subcommand

dbt --partial-parse-file-path p run parses as subcommand: 'p', with subcommandEnd just past p. Flags inserted at subcommandEnd then land before the real subcommand, and a gate keyed on run misses the call. The fix is to add the remaining global value options, or to stop at the first word in dbt's subcommand list. It doesn't block because the input is an edge case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834. --partial-parse-file-path and --packages-install-path are added to the global value flags. When the first word isn't a dbt subcommand, the parser also keeps scanning for the first word that is one (falling back to the first word if none is), so a global value option it doesn't know no longer hides run. Test: "global options that take a value come before the subcommand, and an unknown word does not hide the subcommand", which fails on the old code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at 2c494ec. dbt --partial-parse-file-path p run gives run, and the fallback that scans for the first known subcommand handles --log-level, -r and --warn-error-options too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for checking, and for the mutation checks.

}

export async function featuresSessionStart($: EngineInterface, e: Args<'session.start'>) {
await runsSessionStart($, e).catch(error => failed($, 'runs', 'sessionStart', error))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: a feature that throws synchronously escapes .catch and skips the plugin's own hook

await f($, e).catch(...) catches only a rejected promise. A feature written as a plain function that throws before it returns one escapes the catch. I checked this by mutating features/runs.tsx:

  • A sync throw in sessionStart makes the engine skip the plugin's whole session.start hook ("altimate-code's session.start hook was skipped"), and 23 plugin tests fail.
  • A sync throw in bandLine drops the whole band, integrations and lineage both (7 tests fail).
  • A sync throw in bashRewrite/bashGate rejects beforeCall. The chain then runs the original command and skips every later feature's gate (fail-open).

That breaks this file's own rule that one feature's failure never stops another. Wrapping each call as Promise.resolve().then(() => f($, e)).catch(...) (or try/catch) fixes it. It doesn't block today because every stub is async, so it is safe in a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834. Every feature call in features/index.ts goes through a new attempt(), which catches a synchronous throw as well as a rejection, logs it and skips that feature. That covers session start, band lines, rewrite, gate and the file phases. Test: features/index.test.ts tests attempt with a sync throw and a rejection, and checks that every phase still runs. A limit to mention: the test harness refuses dynamic import(), so the test can't swap a real feature module for a throwing one phase by phase. The phases are covered through the shared helper.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at 2c494ec. I made runs' sessionStart, bandLine and bashGate throw synchronously. Only the test that expects no logs fails (349/350). Session start, the band and the tool calls are all intact, and when cost's gate is made to deny, its deny still comes back after the throw. Making attempt call run() outside its try fails the new attempt test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for checking, and for the mutation checks.

readsBefore: EDIT_READS_BEFORE,
}
// The chain failing never stops the call: it then runs as it came, and its result goes back as is.
const pre = await beforeCall(input, steps).catch(() => ({ e: input, deny: null, before: null }))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: no phase has a deadline

beforeCall and afterCall await every feature with no time limit. A feature promise that never settles (a CLI call with no timeout, a lost $.mcp.call) would hold every Bash, Read, Edit, Write and MultiEdit call of every session with the plugin, including users who never touch dbt. The lineage hook at base bounds its own hold with HOLD_TOTAL_MS. Bounding each phase with within() from altimate-cli.ts, and passing the call through when time runs out, would keep that guarantee for the features. It doesn't block because the stubs make it unreachable today, so it is safe in a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3fa4834. Every beforeCall/afterCall phase is bounded with within() from altimate-cli.ts, using PHASE_TIMEOUT_MS = 5 s. When time runs out the call goes through unchanged, with no deny and no rewrite, and the timeout is logged. The limit and the logger can be injected on ChainSteps for tests. Tests: "a phase that never settles is given up on…" and "a phase that throws at once…", which fail on the old code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at 2c494ec. PHASE_TIMEOUT_MS is 5 s for each phase. When a gate times out, the call goes ahead (fail open), and the note beside the constant says so. Removing steps.limit from bounded makes the never-settling test time out. Still open, as nits: one budget is shared by all nine gates, work that timed out is not cancelled, and the features' session and turn hooks have no deadline. A remaining edge case where a throwing $.clock.after leaves a rejection unhandled is an inline minor on altimate-cli.ts line 70.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Noted the shared budget, the timed-out work that isn't cancelled, and the hooks without a deadline, for when the gates are built. The throwing-clock edge is fixed in ac0d379.

"maxScanBytes": {
"type": "number",
"title": "Largest BigQuery scan without asking",
"description": "A dbt run, build or show that BigQuery estimates would scan more bytes than this is held until you allow it with /allow-scan. 0 never holds one. Other warehouses are never held.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: the setting descriptions promise controls that don't exist yet (Codex)

These texts say a scan over maxScanBytes "is held until you allow it with /allow-scan" and that git push "is refused" when healthBlocksPush is on. Neither exists at this head: /allow-scan isn't registered, and every gate is a stub. Someone who turns on healthBlocksPush or lowers maxScanBytes would think they are protected when they aren't. Until the features ship, either mark the settings as not yet active in their descriptions, or add them in the PR that implements each one. It doesn't block because nothing breaks, so it is safe in a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partly done, in 3fa4834 and 9409397. maxScanBytes now has min: 0 and commentsPollSeconds has min: 30, and the README has a Settings section for all five. I declined the "not active yet" wording, with this reason. The nine feature branches that implement these settings don't edit the description lines, so a marker added here would merge into them without a conflict and ship on settings that work. The features land with this foundation in the same release, so a released plugin never offers a setting with no feature behind it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not resolved. The min values and the README Settings section are good. But the descriptions still promise a /allow-scan command and push blocking, and with the stubs neither exists: maxScanBytes = 1 holds nothing, and healthBlocksPush = true blocks nothing. I accept that the plan is to release the features together with this PR. But this PR carries no version bump, so nothing stops a release that includes it from going out before those features land. That release would show settings that do nothing. This is still a minor and doesn't block. A short "takes effect when the cost check ships" note, or holding back the userConfig block until the features land, would close it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ac0d379. All five setting descriptions now begin "Not used yet: … isn't in this version", and the scan and push titles end in "(not used yet)". The scan setting no longer mentions /allow-scan. The README Settings section says no setting is used yet. Each feature branch rewords its own settings when it ships the behaviour.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at d563dce. All five descriptions begin "Not used yet", /allow-scan is gone, and the README Settings section says no setting is used yet. Nothing in hooks/ or commands/ reads them.

@sahrizvi

Copy link
Copy Markdown
Collaborator

Consensus review: findings not tied to a diff line, and nits

Panel: Claude (lead) and Codex. Head: f681699831.

Major: the branch no longer merges onto main

git merge-tree origin/main f681699831 reports content conflicts in three files:

  • hooks/integrations.tsx
  • hooks/lineage.tsx
  • types/index.d.ts

The conflict is more than textual. Since this branch was cut, main's 1.6.0 changed the lineage per-edit column lookup to go through the CLI instead of the MCP server. This PR moves runTool, within, textOf, persistedPath and mcpServer out of lineage.tsx into altimate-cli.ts. So the rebase has to redo that move against the new lineage code, and the claim that lineage behaviour is unchanged needs to be re-checked against current main. The parity I checked is against the old base only. The open #23 touches the same files, so whichever PR lands second resolves the conflicts again.

Minor: no version bump or CHANGELOG entry (Codex)

  • plugin.json still says 1.5.0 (main is at 1.6.0), and CHANGELOG.md has no entry. The changelog lines are only in the PR description.
  • Installs pinned to a version will not see the new settings as an update.
  • Number: main is at 1.6.0 and feat: dbt helpers from dbt Power User in Claude Code sessions (1.6.0) #23 also claims 1.6.0, so the next release that includes this PR is 1.7.0, or this PR goes under [Unreleased] and ships with the first feature PR. Which one is a release decision, not a blocker. A CHANGELOG entry in whichever section you choose is needed before merge.
  • It doesn't block because the number is a release call and the entry is safe to add in the rebase.

Nits

  1. The PR description doesn't match the code.
    • It says the lineage pane's tool-call wiring "moves into the shared chain". The lineage tool.call hook actually stays in lineage.tsx. What moved is runTool and its helpers, and the features' turn and session calls now run from lineage's hooks.
    • claude plugin test reports 216 tests, not 207.
  2. userConfig hardening for when the settings are read.
    • Resolve healthConfigPath inside the dbt project, and reject absolute paths and ... Constraining it now isn't needed, because nothing reads it yet.
    • Give commentsPollSeconds and maxScanBytes a lower bound.
    • Document the five settings in the README.
    • Nothing reads the settings at this head, so an unset or malformed value can't throw at load.
  3. Unguarded clearStatusParts. In session.start, clearStatusParts($) has no .catch, unlike startLineage. If $.ui.status throws, the rest of the session start is skipped. Your own review loop also listed this.

hkaltai and others added 4 commits November 17, 2026 06:19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parseDbtCommand: prefix options (command -v, env options, a NAME=value
after a wrapper), quoted words, expansions (new dynamic field), and
interleaved redirections no longer give an invocation or a literal value
they cannot back; dbt's global value options and the first known
subcommand are found past an unknown word.

Feature phases catch a synchronous throw like a rejection, the tool chain
bounds each phase with a deadline and passes the call through on timeout,
and clearing the status line at session start no longer skips the rest of
the start. Settings that do nothing yet say so, with lower bounds, and the
README lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setting descriptions and the README section describe the shipped
behaviour, so a feature that implements a setting does not inherit a
note saying it is inactive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Replies to the comment above (findings not tied to a diff line):

  • Merge conflict with main (major): resolved in c3ffdd8, a merge of origin/main with no rebase. Main's 1.6.0 lineage is kept as it is: the per-edit column lookup goes through the CLI (runTool(…, { cliOnly: true, until: deadline })), and turn.complete runs both main's task impact and the features. within, textOf, persistedPath, runTool and mcpServer have one copy, in altimate-cli.ts. lineage.tsx and main's new task-impact.tsx import them from there. integrations.tsx keeps main's task-impact band and adds the feature chain. types/index.d.ts keeps main's new types and drops isLineageBandHidden, which nothing uses any more. Main's lineage.test.tsx, task-impact.test.tsx, impact-report.test.ts and report-graph.test.ts are byte-identical to origin/main and pass. claude plugin test: 341 pass, 0 fail.
  • Version bump / CHANGELOG: not done in this PR, by plan. The release PR bumps the version and writes the CHANGELOG entry for the foundation and the nine features together, so this PR stays at main's 1.6.0.
  • Nit 1, PR description: I'll correct it. The lineage tool.call hook stays in lineage.tsx, and what moved is runTool and its helpers. The test count will be updated as well.
  • Nit 2, userConfig hardening: maxScanBytes has min 0, commentsPollSeconds has min 30, and the README documents the five settings. Resolving healthConfigPath inside the project (no absolute paths or ..) goes in the feature that first reads it, because nothing reads it yet.
  • Nit 3, clearStatusParts: fixed in 7f472f5. It now has a .catch that logs, and a test shows a status line that can't be drawn doesn't stop the rest of session start.

…te of runTool

A backslash in double quotes is dropped only before $, a backtick, a quote, a backslash or a newline, and a $'...' word holding an escape is dynamic instead of reported undecoded. runTool's write route (CLI only, --allow-write) now has a test, the subcommand comment says what the parser does, and the gate stubs say what the phase deadline means for a gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
select,
target: targetDynamic ? null : (target ?? envTarget),
targetPath: targetPathDynamic ? null : (targetPath ?? envTargetPath),
dynamic: words.slice(firstAssignment ?? launcherStart).some(one => one.dynamic),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: An unreadable DBT_TARGET / DBT_TARGET_PATH in front of a prefix word is reported as 'none', not 'unknown'

firstAssignment is cleared again by every shell keyword and wrapper (lines 610-615), and dynamic is computed only from words.slice(firstAssignment ?? launcherStart). An assignment holding an expansion in front of a prefix word therefore drops out of dynamic, while line 599 has already set its value to null:

  • parseDbtCommand('DBT_TARGET=$T time dbt run') yields target: null, dynamic: false, which the docs on lines 32-47 define as 'no target given'. dbt does receive that target, from the environment.
  • DBT_TARGET=$T dbt run correctly yields dynamic: true.

A consumer (cost, defer/target) would act on target: null as if the command had no target. Keep the first dynamic assignment in the calculation - OR a running flag in when an assignment is dynamic, or start the slice at the command's first assignment even when a prefix word follows it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2c494ec. Any assignment that holds an expansion now sets dynamic, and a prefix word no longer clears that. DBT_TARGET=$T time dbt run and DBT_TARGET_PATH=$P nohup dbt run now give dynamic: true. DBT_TARGET=prod time dbt run still gives target: 'prod'. Regression cases are in dbt-command.test.ts.

// Wrapped, so a legitimate null value is told apart from the deadline's null.
const done = await steps.limit(Promise.resolve().then(run).then(value => ({ value })))
if (done) return done.value
steps.log(`tool chain · ${phase} did not finish within ${PHASE_TIMEOUT_MS} ms or failed: the call goes on unchanged`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: A throwing steps.limit / steps.log escapes bounded and skips the gate

Only the phase work is guarded (line 83). await steps.limit(...) and steps.log(...) are called unprotected, so if the deadline helper or the logger throws, bounded rejects instead of returning fallback - contrary to its own doc on line 80. beforeCall then rejects and installToolChain's catch (line 136) runs the call as it came with deny: null, so a gate that would have refused it (healthBlocksPush, a scan limit) never runs. $.ui.log is treated as throwable elsewhere in this PR (features/index.ts:150-153 wraps it in try/catch), and within calls $.clock.after inside the promise executor. Wrap the body of bounded in try/catch (or guard steps.log) so an infrastructure failure drops only that phase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2c494ec. bounded now guards steps.limit and steps.log too. A deadline or logger that throws drops only that phase and returns fallback, so the gate still runs. New test: "a deadline or a logger that throws drops only that phase: the gate after it still runs". In it the first phase's deadline throws and the logger throws, and the gate's deny still comes back.

expect(tool.test('Grep')).toBe(false)
// With every feature a stub, the chain hands the call on unchanged and passes its result back.
const seen: any[] = []
const result = await chains[0]!.handler({ fs: { read: async () => null }, clock: quick.clock, ui: { log: () => {} } }, { tool: 'Bash', command: 'dbt run -s orders' }, async (e: any) => (seen.push(e), ok))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: This test never reaches the stub path its comment describes

With quick.clock the deadline settles on the next microtask - the clock callback is queued before the phase's continuations - so every phase in this handler takes the timeout branch, and the pass-through assertions (lines 114-115) hold even if the chain never called a feature. Only registration and next propagation are actually covered. Use a clock whose deadline never fires (for example clock: { after: () => {} }), or one driven by mock.clock that fires after the stubs settle, and assert that no timeout was logged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2c494ec. The registration test now uses a clock whose deadline never fires, so every phase reaches its stub. It also asserts that no tool chain · timeout line was logged.

hkaltai and others added 2 commits November 17, 2026 07:05
…thing

An unquoted tilde, brace list or pathname pattern, and $- , make a word dynamic; $"..." is a quoted string; a launcher asked for its help or version reports no dbt call. The runTool write test can now fail, and the parser comments say what the code does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note moves out of the nine feature stubs, which return to their earlier content, so the packages that replace them do not each conflict on a comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
// No answer: a call that does reach the server falls back to the CLI.
call: async () => null,
},
clock: { now: async () => now },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[SUGGESTION]: The stand-in has no clock.after, so the "no answer" fallback this test claims to cover is never taken

The comment on line 17 says a call that reaches the server falls back to the CLI because it gets no answer. But within calls $.clock.after(ms, …) inside its promise executor (altimate-cli.ts:70), and this $ only has clock.now. So the read call on line 45 throws TypeError: $.clock.after is not a function; runTool's catch (altimate-cli.ts:170) swallows it and moves to the CLI. The if (!result) throw branch (altimate-cli.ts:150) is never reached, so the fallback this test names would still pass if the MCP-answer handling regressed. Add after: () => {} (or a timer that never fires) to the stand-in and assert the CLI argv of that second call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2c494ec. The stand-in now has clock.after with a deadline that never fires, so the MCP call returns null and takes the no-answer fallback. The test also counts that call and checks the second call's CLI argv (no --allow-write).

@hkaltai

hkaltai commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

review-loop: APPROVED at 176e8b5

Whole-PR review of origin/main...176e8b5babff7895ba75260418df6d22613f258c by two reviewers, claude -p and codex exec, each run as a separate process.

Round Head claude codex
1 9409397 REQUEST CHANGES COMMENT
2 e243a67 COMMENT, no blockers COMMENT, no blockers
3 830e784 APPROVE APPROVE
Confirm 176e8b5 APPROVE APPROVE

Fixed during the loop, each with a test:

  • Wrong literal values:
    • A backslash inside double quotes is now handled as bash does.
    • $'…' escapes are decoded.
    • $"…" is read as a plain quoted string.
    • Unquoted ~, {a,b}, globs and $- make the invocation dynamic instead of being reported as literals.
  • Phantom invocation: uv run --help dbt run no longer parses as a dbt call.
  • runTool write route: the new hooks/altimate-cli.test.ts tests it.
  • Phase deadline: a note beside PHASE_TIMEOUT_MS says the deadline is shared and that a gate that must hold bounds its own check. It is written once there, so the nine stub feature files are unchanged from 9409397.

Rebutted or deferred, with reasons:

  • Settings descriptions: they describe the final behaviour (see the thread on plugin.json).
  • Follow-ups outside the parser's contract: timeout/nice/sudo launchers, python -m dbt, and ~ after : in an assignment value. Each fails safe or is a nit.

Checks at 176e8b5babff7895ba75260418df6d22613f258c:

  • claude plugin test ./plugins/altimate-code: 346 pass, 0 fail.
  • tests/*.sh: all pass.
  • claude plugin validate: passes, with only main's missing-icon warning.
  • CI is green and the PR is mergeable.

For branches building on this: DbtInvocation has a new required dynamic field. When it is true, select, target and targetPath are unknown.

hkaltai and others added 2 commits November 17, 2026 09:51
…amic; a throwing deadline or logger drops only its phase

Also tighten two tests so they reach the paths they describe: the chain
registration test now runs every phase to its stub, and the MCP no-answer
fallback is taken instead of a missing clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

review-loop: APPROVED at 2c494ec (reviewers: gpt-6-astra high, gpt-6.1-sol high)

Whole-PR review of origin/main...2c494eccebe3c0b25722c6bea2304b2492343093. Each reviewer ran in its own fresh codex exec session, and both returned APPROVED with no CRITICAL or MAJOR findings. This head adds 2c494ec on top of the main merge 4c8add5. It fixes the two WARNINGs from Kilo (an expanded assignment ahead of a prefix word now marks the call dynamic, and a throwing deadline or logger drops only its phase) and tightens the two tests it flagged. claude plugin test . gives 350 passed, 0 failed.

@sahrizvi sahrizvi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Round 2 re-review of 2c494ec (panel: Claude and Codex, codex exec -s read-only; each side reviewed on its own first, then checked the other's findings, and both accept every finding below).

Decision: changes requested. One major is still open.

Most of round 1 is fixed:

  • Three of the four parser majors are resolved: quoted words, expanded values and redirections inside the span.
  • The merge with main is resolved. The branch contains current main (1.6.1) and merges cleanly. Main's lineage, task-impact, impact-report and report-graph tests are byte-identical and pass. The per-edit column lookup still goes through the CLI with its deadline. Main's integrations tests are all kept, and two were added.
  • The sync-throw guard and the phase deadline are fixed.

The four mutation checks I ran each fail their regression test, and a sync throw in a feature's sessionStart, bandLine or bashGate now drops only that feature.

What's open:

  • Major (inline): round-1 finding 1 is only partly fixed. Other prefix and launcher options still produce a static dbt run that never starts: command --help dbt run, env if dbt run, uv run -- --project x dbt run, nohup --help dbt run.
  • Minor (inline): within() leaves the phase's rejection unhandled when $.clock.after throws. Edge case; it needs a throwing clock.
  • Minor (inline): a backslash at the end of the line gives offsets past the end. Edge input.
  • Minor (inline): the setting descriptions still promise /allow-scan and push blocking. Unresolved; see the thread.
  • Minor: no version bump and no CHANGELOG entry. See the combined comment.

Suites at head vs main:

  • claude plugin validate and --strict: both pass at both; the only warning is main's missing icon.
  • claude plugin test: 350 pass at head, 307 at main.
  • tests/*.sh: 7/7 pass at both.
  • pytest: 65 pass at both.

A live pane check stopped at the login screen with an isolated HOME, so lineage parity rests on main's unchanged lineage suite passing at head.

firstAssignment = null
continue
}
if (unquoted && word.text.startsWith('-') && prefix !== null && optionsOpen) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: prefix and launcher options still produce a dbt run that never starts (Codex; reproduced. This is the part of round-1 finding 1 that is still open)

This branch skips any -… word after command, nohup, exec or time, and only command -v/-V and env -… are refused. A keyword after env is also taken as a keyword. All of these parse as a static run, dynamic: false:

  • command --help dbt run and command -x dbt run: bash prints usage and exits 2 (checked)
  • nohup --help dbt run, exec -x dbt run, time -x dbt run
  • env if dbt run, env then dbt run, env ! dbt run: env runs a program named if, so you get env: if: No such file or directory and exit 127 (checked)
  • uv run -- --project x dbt run and poetry run -- --foo dbt run (line 664): after --, the launcher runs --project, but the loop keeps reading options

A gate or rewrite would act on a call that never happens. Suggested fix:

  • Accept only the options each prefix really has (command -p, exec -a NAME/-c/-l, time -p, -- for all) and return null for any other option.
  • After env, treat the next word as a program name, never as a keyword.
  • Stop reading launcher options at --.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ac0d379 and 2c98769, following your suggestion. The parser now reads only options it knows. When it is unsure, it returns no invocation.

  • Prefix words: a table per prefix (PREFIX_OPTIONS). The only options read are command -p, exec -l, exec -a NAME and time -p, plus -- after command, exec, nohup or env. Any other option gives no invocation: command --help, command -x, command -pv, nohup --help, exec -x, time -x, time -f. In 2c98769, exec -c was also dropped, because it clears the environment, so the DBT_* assignments in front of it are not what dbt sees. Our own review gate found that one.
  • Keywords as program names: after a prefix command or an assignment, a keyword is a program name. env if dbt run, env ! dbt run, nohup ! dbt run and X=1 if dbt run give no invocation. So does command/exec after env/nohup. time is the exception, because the external time exists (X=1 time dbt run, nohup time dbt run).
  • Launchers: each launcher's run now has its own option table (RUNNER_OPTIONS), and any other option gives no invocation, including help and version. -- ends the launcher's options, and the next word must be dbt. So uv run -- --project x dbt run, poetry run -- --foo dbt run, uv run --ansi dbt run and pipenv run -q dbt run give no invocation.

Every input above is a case in dbt-command.test.ts: "a prefix or launcher option outside its grammar…" and "a keyword where it is a program name…". The supported-input contract at the top of dbt-command.ts lists these rules, to help calibrate further exotic-input findings.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not resolved, narrowed. Every input from this thread now gives [], and so do exec -c, env -i, command -pv and the unknown launcher options. Four prefix forms still report a static run for a line that never starts dbt: X=1 time DBT_TARGET=prod dbt run and exec exec dbt run, exec -a $NAME dbt run, time -p -p dbt run, and command -p dbt run. Details and a rule that closes the class are in the round-3 review's inline comments.

settled = true
resolve(value)
}
$.clock.after(ms, () => settle(null))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: a throwing deadline leaves the phase's own rejection unhandled (Codex; reproduced; edge case)

bounded() now catches a limit that throws, but within() throws from $.clock.after before it reaches work.then(settle, …). If the phase's work then rejects, nothing handles that rejection. Reproduced: with $.clock.after throwing and the work rejecting with rewrite failed, within throws clock failed and Bun also reports unhandledRejection: Error: rewrite failed. The gate after it still runs, so the call itself is fine. The new test only uses work that resolves.

Fix: attach work.then(settle, () => settle(null)) before calling $.clock.after, or wrap the after call in try/catch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ac0d379. within() now attaches work.then(settle, () => settle(null)) before it calls $.clock.after. The new test checks that the rejection handler is in place before the clock is called. It fails on the old order.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at d563dce. within() attaches work.then(settle, () => settle(null)) before $.clock.after. I reverted the two lines, and the new test fails ("within handles the work's rejection…"); restored, it passes. A throwing clock now rejects within() with the clock's error. tool-chain's attempt catches that, as its "a deadline or a logger that throws" test shows.

if (c === '\\') {
quote()
text += line[i + 1] ?? ''
i += 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: a backslash at the end of the line gives offsets past the end (Claude; Codex agrees; edge input)

With a backslash as the line's last character, i += 2 goes past the end, and the word's end, end and subcommandEnd come out as line.length + 1. For example, parseDbtCommand('DBT_TARGET=x dbt test\\') gives subcommandEnd 23 on a 22-character line. A feature that inserts --defer at subcommandEnd would produce dbt test\ --defer, which bash passes as the single word test --defer (checked with printf). Clamping the offset is not enough, because the inserted space would still be escaped. Treating a trailing backslash as an unreadable line fixes both problems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ac0d379. A backslash as the last character now makes the line unreadable, so it gives no invocation, as you suggested, and no offset can pass the end. Tests: DBT_TARGET=x dbt test\ and dbt run \ give []. A backslash-newline continuation still parses.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved at d563dce. dbt run \ and dbt run -t prod\ give []. A backslash-newline continuation (dbt run \⏎--target prod) still parses, with target prod.

@sahrizvi

Copy link
Copy Markdown
Collaborator

Round 2: findings not tied to a diff line, and nits (Claude + Codex, at 2c494ec; goes with the review above)

Round-1 findings that had no diff line

  • Merge with main (round 1, major 5): resolved.
    • main (087f425, 1.6.1) is the merge base, and git merge-tree against main is clean.
    • lineage.test.tsx, task-impact.test.tsx, impact-report.test.ts and report-graph.test.ts are byte-identical to main and pass. No test from main's integrations.test.tsx was dropped, and two were added.
    • The runTool that moved to altimate-cli.ts is main's code plus the write option. Every lineage and task-impact call site now passes { cliOnly: true[, until] }, so the per-edit column lookup still goes through the CLI with its deadline.
    • The lineage tool.call hook is unchanged against main.
  • Version and CHANGELOG (round 1, minor 10): not resolved, and not blocking.

Nits

  1. The shared phase deadline (Claude; Codex agrees):
    • All nine gates share one 5 s budget, so a slow early gate can make a later gate that must hold (cost, push health) fail open.
    • Work that timed out keeps running.
    • The features' session and turn hooks (featuresTurnComplete and the others in lineage.tsx) have no deadline.
    • All of this is stated or latent with the stubs. A per-feature budget would be clearer when the gates are built.
  2. Environment from elsewhere (Claude; Codex agrees): export DBT_TARGET=prod; dbt run and uv run --env-file .env dbt run give target: null with dynamic: false. One sentence in the DbtInvocation doc should say that null covers only what is written on this command, not inherited, earlier-exported or launcher-loaded values.
  3. Edge literals (Claude; Codex agrees):
    • DBT_TARGET=a:~ dbt run gives a:~. Bash expands the ~ after a : in an assignment; this was already deferred.
    • dbt run -s a -- -s b gives select [a, b], though dbt would reject the arguments after --.
  4. PR description (round-1 nit 11): it now says the lineage hook stays where it was, which is right. But it still says "matches main 1.6.0" and "346 pass". main is 1.6.1, and the suite has 350 tests.
  5. Round-1 nits 12 and 13: done. min values and a README Settings section were added; restricting healthConfigPath to the project is deferred to the first feature that reads it. clearStatusParts has its .catch, with a test.

Checks

  • Parser corpus: about 230 commands, covering round 1's ~80 plus the new probes.
    • The four round-1 inputs and every probe asked for now parse right, give no invocation, or come back dynamic. The exceptions are the inline major and the trailing backslash.
    • Probes: env -u X dbt run, env X=1 dbt run, X=$Y dbt run, "dbt" run, 'dbt' run, dbt\ run, --target "$T", --select "$(cat x)", 2>&1 | tee log, >out 2>err -s m, -s m &&dbt test, time dbt run, nohup dbt run &, backslash-newline, $'…', escaped \", a model name with spaces, and --vars '{"k": "v"}' / --vars "{k: $v}".
    • Fuzzing: 200,000 inputs, 0 throws, about 1.5 µs per parse.
  • Mutation checks (each fails its new test): removing the redirection guard, letting a quoted word be an assignment, a sync throw escaping attempt, and removing the phase deadline.
  • altimate-cli.ts:
    • argv goes to $.process.run with no shell.
    • until bounds both the MCP call and the CLI run.
    • No output is logged.
    • A write call goes straight to the CLI with --allow-write and never connects to MCP (the new test checks both).
    • "Launcher help runs nothing" is the parser change: uv run --help dbt run gives no invocation. The gap after -- is in the inline major.
  • Live check: with an isolated HOME, Claude Code stops at the login screen, so no session was run. Lineage parity rests on main's unchanged lineage suite passing at head.

…d settings

The dbt command parser now reads only the options each prefix word has
(command -p, exec -c/-l/-a NAME, time -p, and -- after command, exec,
nohup and env) and only known launcher options; anything else gives no
invocation, since what runs is not known. A launcher's -- ends its
options, a keyword after a prefix command or an assignment is a program
name, and a trailing backslash makes the line unreadable, so no offset
passes its end. Each case has a regression test.

within() handles the work's rejection before setting the deadline, so a
throwing clock leaves no unhandled rejection. The five settings now say
they are not used yet, since no feature reads them in this version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r option tables

`DBT_TARGET=prod exec -c dbt run` reported target prod, though exec -c
clears the environment dbt starts with; exec -c now gives no
invocation. Each launcher's run now reads only its own options, so an
option one launcher has and another rejects (uv run --ansi) gives no
invocation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hkaltai

hkaltai commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Reply to the round-2 notes (#30 (comment)). Fixes are in ac0d379 and 2c98769.

  • Version and CHANGELOG: unchanged on purpose. Under the build plan, the foundation and feature PRs don't bump the version or edit the CHANGELOG. A separate release PR does both once the foundation and the nine features have landed, and it will pick the version above whatever is on main then (so after 1.7.0 if feat: dbt helpers from dbt Power User in Claude Code sessions (1.6.0) #23 merges first). Until then, the settings now say they are not used yet (ac0d379), so a release cut early would not promise behaviour that isn't there.
  • Nit 1, shared phase deadline: noted for when the gates are built. A per-feature budget and cancelling timed-out work belong with the real gates. The stubs return at once.
  • Nit 2, environment from elsewhere: done in ac0d379. A comment above DbtInvocation now says that only what is written on the command is read, so a null target means "none written here", not "none" (exported, inherited and --env-file values are not seen).
  • Nit 3, edge literals: DBT_TARGET=a:~ stays a documented limitation, as deferred in round 1. dbt run -s a -- -s b is a command dbt itself rejects, so it is outside the supported inputs.
  • Nit 4, PR description: updated. It now says main 1.6.1 and 354 tests, and it describes the parser's supported-input contract.
  • Nit 5: thanks.

@hkaltai

hkaltai commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

review-loop: APPROVED at 2c98769 (reviewers: gpt-6-astra high, gpt-6.1-sol high)

# Conflicts:
#	plugins/altimate-code/hooks/integrations.tsx
@hkaltai

hkaltai commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

review-loop: APPROVED at d563dce (reviewers: gpt-6-astra high, gpt-6.1-sol high)

@sahrizvi sahrizvi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Round 3 re-review of d563dce: changes requested. Panel: Claude (lead) and Codex. Codex reviewed on its own first, then each side checked the other's findings. Every finding below was reproduced in bash 3.2 and uv 0.9.17, with a stand-in dbt on PATH.

R1 is narrowed but not resolved. All ten round-2 forms now give no invocation, and so do the new probes: env -i, env -u, env -S, env X=1 -- dbt run, exec -c, command -v, nohup --help, uv run -- --project x dbt run and the other unknown launcher options. The tables are the right approach. Four prefix forms still report a static dbt run (with a literal target and select) for a line that never starts dbt. Each one has an inline comment:

  1. time or exec used as an external program reopens assignment and prefix parsing: X=1 time DBT_TARGET=prod dbt run and exec exec dbt run -t prod (major, Codex).
  2. The value of exec -a is skipped even when it holds an expansion: exec -a $NAME dbt run -t prod (major, Codex).
  3. time -p is accepted more than once: time -p -p dbt run (major, Codex).
  4. command -p searches only the default system PATH, so a venv, ~/.local/bin or Homebrew dbt is not found: command -p dbt run -t prod (major, Claude; Codex agrees).

A rule that would close this class: after env, nohup, exec, or time used as an external program, accept only an unquoted dbt or launcher word as the program, with no NAME=value, keyword or builtin. Also treat a prefix-option value that holds an expansion as unreadable, and drop command -p.

Minors (inline, none blocking alone):

  • uv option values and option conflicts. uv run --with --help dbt run and uv run --locked --frozen dbt run report runs that uv rejects with a usage error. Codex rated both minor.
  • The uv table covers 30 of uv 0.9.17's 77 run options. Common ones such as --all-groups and --only-group now give no invocation where round 2 gave one. This fails open.

Resolved since round 2:

  • R2: within() handles the rejection before the clock is called. Reverting the order fails the new test.
  • R3: a trailing backslash now gives [].
  • The settings descriptions say "Not used yet". Nothing reads the settings.
  • The merge of main (1.7.0, #22) keeps startReviewNotices and main's integrations behaviour.

Checks at d563dce (main cc02d3b in brackets):

  • claude plugin validate and --strict pass [pass].
  • claude plugin test: 366 pass, 0 fail [319].
  • tests/*.sh: 7/7 [7/7].
  • pytest: 65 pass [65].

Nits and the version note are in the PR comment.

if (unquoted && (KEYWORDS.has(word.text) || WRAPPERS.has(word.text))) {
// After a prefix command or an assignment, a keyword is the name of a program to run (`env if`);
// only `time` is one that exists (`X=1 time dbt run` runs the external time).
if (KEYWORDS.has(word.text) && word.text !== 'time' && (wrapped || firstAssignment !== null)) return null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: time (or exec) run as an external program still reopens prefix parsing (Codex; reproduced)

Input Parser bash
X=1 time DBT_TARGET=prod dbt run -s orders dbt run, target prod, select [orders] time: DBT_TARGET=prod: No such file or directory
env time DBT_TARGET=prod dbt run / nohup time DBT_TARGET=prod dbt run dbt run, target prod same error
exec exec dbt run -t prod dbt run, target prod exec: exec: not found

After an assignment, or after env/nohup, time is /usr/bin/time. The external time treats the next word as the program, so DBT_TARGET=prod is the program's name and not an assignment. Setting prefix = 'time' here clears firstAssignment and re-reads the next word as an assignment. In the same way, exec runs only an external file, so exec exec and exec command (on Linux, where there is no /usr/bin/command) fail. The guard on the next line covers env/nohup but not exec.

Fix: once a prefix runs an external program (env, nohup, exec, or time after an assignment or a prefix), give [] unless the next word is an unquoted dbt or launcher word.

// sees, and `--help` prints usage, so none of them runs dbt as written.
const takes = PREFIX_OPTIONS[prefix]?.[word.text]
if (!takes) return null
if (takes === 'value') i++

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: an exec -a value that holds an expansion is skipped as if it were one word (Codex; reproduced)

exec -a $NAME dbt run -t prod -s orders gives dbt run, target prod, select [orders], dynamic false. With NAME unset or empty, bash drops the empty unquoted word. Then dbt becomes the -a value and run is the program: exec: run: not found. A value that splits (NAME='a b') shifts the words the same way. exec -a "$NAME" dbt run is fine (it runs dbt).

Fix: when takes === 'value' and the value word is dynamic and unquoted, give [] (or mark the invocation dynamic and leave the binary unknown).

command: { '-p': 'flag' },
// `exec -c` clears the environment dbt starts with: what it sees is not known, so it is not read.
exec: { '-l': 'flag', '-a': 'value' },
time: { '-p': 'flag' },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: time -p is accepted more than once (Codex; reproduced)

time -p -p dbt run -t prod -s orders gives dbt run, target prod. bash's time keyword takes -p once, as the word right after time. The second -p is the command: -p: command not found, and dbt never starts. Also, time -p -- dbt run already gives [], which is correct, since bash runs -- as a command.

Fix: accept a single -p only as the word right after time.

const WRAPPERS = new Set(['command', 'exec', 'nohup', 'env'])
// The options each prefix word has: whether one takes a value. Any other option gives no invocation.
const PREFIX_OPTIONS: Record<string, Record<string, 'flag' | 'value'>> = {
command: { '-p': 'flag' },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Major: command -p does not find a dbt installed the usual ways (Claude; Codex agrees)

command -p dbt run -t prod gives a static run with target prod. command -p searches only the default PATH from getconf PATH: /usr/bin:/bin:/usr/sbin:/sbin on macOS, /bin:/usr/bin on a typical Linux. So a dbt in a venv, in ~/.local/bin, from Homebrew or in /usr/local/bin is dbt: command not found. Reproduced with a fresh bash -c. (bash's command hash can find it after an earlier ordinary lookup in the same shell, but a Bash tool call starts a fresh shell.)

Fix: drop command -p from the table.

const options = RUNNER_OPTIONS[runner]!
// Repeated short flags (`-qq`, `-vv`) are read when the launcher has the single one.
const repeated = /^-([a-z])\1+$/.exec(flag)
if (options.values.has(name)) i += flag.includes('=') ? 1 : 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: a launcher option that takes a value accepts another option as the value (Codex; reproduced)

uv run --with --help dbt run -t prod -s orders gives binary uv run --with --help dbt, run, target prod. uv run --with -- dbt run also gives a run. uv 0.9.17 exits 2 for both: a value is required for '--with <WITH>' but none was supplied.

Fix: a separate value word that starts with - gives []. This is minor because uv stops with a usage error and nothing runs.

// Repeated short flags (`-qq`, `-vv`) are read when the launcher has the single one.
const repeated = /^-([a-z])\1+$/.exec(flag)
if (options.values.has(name)) i += flag.includes('=') ? 1 : 2
else if (!flag.includes('=') && (options.flags.has(flag) || (repeated && options.flags.has(`-${repeated[1]}`)))) i++

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: option conflicts and repeats that the launcher rejects still give a run (Codex; reproduced)

uv run --locked --frozen dbt run -t prod, uv run --frozen --frozen dbt run and uv run -q -v dbt run each give a static run. uv exits 2 with cannot be used with or cannot be used multiple times. It is minor because modelling clap's conflict rules goes beyond a table, and nothing runs. The cheap part is to reject a repeated long flag.

// the only launcher options read: an unknown one may take a value, so which word runs is not known.
const UV_RUN_FLAGS = ['-q', '--quiet', '-v', '--verbose', '--isolated', '--offline', '--refresh', '--native-tls', '--no-config', '--no-cache']
const UV_RUN_VALUES = ['--with', '--with-editable', '--with-requirements', '--python', '-p', '--directory', '--project', '--index', '--index-url', '--env-file']
const RUNNER_OPTIONS: Record<string, { flags: Set<string>; values: Set<string> }> = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: the uv table has 30 of uv 0.9.17's 77 run options, so common ones now give no invocation (Claude; Codex agrees)

Missing options include --all-groups, --only-group, --no-group, --no-default-groups, --upgrade, --reinstall, --no-progress, --color, --compile-bytecode, --no-editable, --default-index, --extra-index-url and --find-links. At round 2, uv run --all-groups dbt run -t prod was reported; now it gives []. That is the intended unsure direction (fail-open), so it doesn't block. But a future gate or rewrite will skip these runs.

Suggestion: build the tables from uv run --help (and poetry run --help) of the supported versions. Keep the semantic exclusions (--help, --version, --module, --script, --gui-script) giving []. Safe in a follow-up.

@sahrizvi

Copy link
Copy Markdown
Collaborator

Round 3 (d563dce): findings not tied to a diff line, and nits. Panel: Claude and Codex. The formal review above has the four majors and three minors inline.

Nits

  1. A function definition reports a run. f() { dbt run; } gives a static run, while function f { dbt run; } gives [], and neither runs dbt when it is defined. This has been there since round 1.
  2. The PR description is stale again. It says "matches main 1.6.1" and "354 pass across 11 files". main is now 1.7.0, and the head has 366 tests across 12 files.
  3. Version and CHANGELOG are unchanged, as planned. The merged tree carries main's 1.7.0 (plugin.json and marketplace.json), and nothing in this PR's text claims a version. A release cut straight from this head would ship different content under the already-released 1.7.0, with no CHANGELOG entry for it. Your release-PR plan (bump and entry once the features land, above whatever main has then, which is 1.8.0 if feat: dbt helpers from dbt Power User in Claude Code sessions (1.6.0) #23 lands first) covers that, so this doesn't block.
  4. Carried from round 2 and noted by you for the gates: the shared phase budget, timed-out work that isn't cancelled, and hooks without a deadline. Also DBT_TARGET=a:~, which is documented. -s a -- -s b being out of scope is fine.

Checked and fine

  • The merge resolution against feat: your skill and knowledge review requests in Claude Code — /altimate-code:rules, decision toasts, publish relays the review #22. integrations.tsx keeps startReviewNotices and main's session-start order, and adds the status-line part, featuresSessionStart, the feature band lines and installToolChain. git diff origin/main..d563dce92c touches only this PR's files. CHANGELOG, commands/rules.md, review-notices.ts, PRIVACY.md and tests/resolve-cli.sh are identical to main.
  • The settings. All five descriptions begin "Not used yet", and the README says none is used yet. Nothing in hooks/ or commands/ reads them; options is only passed through to the stubs.
  • The environment-clearing forms. exec -c and env -i give [], so DBT_TARGET in front of them is not read. bash confirms DBT_TARGET=a exec -c dbt run starts dbt with the target unset.
  • The parser corpus. About 190 forms were run at 2c494ec and d563dce. Every round-1 and round-2 case gives the same result as before, or the fixed one. The common forms still parse: uv run, uvx --from dbt-core, poetry run, pipenv run, ./dbt, "dbt" run, pipes, &&/; chains, here-strings and backslash-newline. Forms the parser declines, which is fine: nice, sudo, xargs, conda run, python -m dbt, pipx run, npx, ~/.local/bin/dbt, dbt\ run, $(dbt run), cat <<< "dbt run" and an unknown prefix option.

Your review-loop comments are not GitHub reviews. No reviewer has approved this head.

@sahrizvi sahrizvi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving d563dce92c (Claude + Codex panel), superseding the round-3 request for changes at the same head.

The round-2 findings are all resolved. The one item left from round 3 is the prefix class: four forms (X=1 time DBT_TARGET=prod dbt run, exec -a $NAME dbt run, time -p -p dbt run, command -p dbt run) still parse as a static dbt run for a line that never starts dbt. On reflection it does not block this PR: each form is exotic, each fails in the shell before dbt runs, and nothing acts on the parser's answer yet because the gates are not built. Please take the closing rule from the round-3 review (#30 (review)) as a follow-up before the first gate lands: after env, nohup, exec or time as an external program accept only an unquoted dbt or launcher word, treat a prefix-option value holding an expansion as unreadable, drop command -p, allow time -p once.

The three minors (uv option forms uv itself rejects, and the uv table covering 30 of 77 run options, which fails open) and the nits stay as noted. Merge order unchanged: after #23 ships as 1.8.0, rebased on it.

@hkaltai
hkaltai merged commit 2cf9b90 into main Nov 17, 2026
4 checks passed
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.

2 participants