Repository navigation
feat: project health: new DataPilot issues on changed models, in the band, with an optional push gate - #33
Conversation
…nged, in the band, with an optional git push gate Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… reads edits spelled any way, and sees redirects, bash -c, cd and heredocs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ons as the shell does, and waits only when a model changed Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…a heredoc Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review round (independent Claude and Codex reviewers, then two attack-the-fix passes). Reply to each finding:
|
…s dbt folders by their place in the project, and matches model files through symlinked folders Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Final review round (independent
Staying draft because of these open items; no further review round was run after the fixes. |
…at has its own dbt_project.yml Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Verify gate: round 1 on 40deecc — codex APPROVED; claude REQUEST CHANGES: (1) files in installed dbt packages (own dbt_project.yml) were no longer skipped — fixed in beb0583, both reviewers APPROVED that fix; (2) a leading |
…, and matches a deleted or renamed model reached through a symlinked folder Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… before a redirect are an argument Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Confirm gate (2 rounds used, stopping): pushed 3538583 and d4020f9.
|
|
review-loop: APPROVED at d4020f9 Verify-only gate on 3538583..d4020f9: claude -p and codex exec both APPROVED, no MAJOR/CRITICAL. Remaining MINOR items are documented limitations of the heuristic redirect parser: |
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
The one commit since the previous review ( Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous Review Summaries (6 snapshots, latest commit 1aa54d6)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 1aa54d6)Status: 3 Issues Found | Recommendation: Address before merge Overview
The one commit since the previous review ( Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 9b9b05a)Status: 3 Issues Found | Recommendation: Address before merge Overview
The three commits since the previous review ( Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit eb8d48c)Status: 7 Issues Found | Recommendation: Address before merge Overview
The only change since the previous review ( Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 5c13dd1)Status: 5 Issues Found | Recommendation: Address before merge Overview
The only change since the previous review ( Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 01378cb)Status: 5 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Note: the incremental review covered Previous review (commit 9962fac)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Additional previous summary content was truncated to keep this comment within platform limits. Reviewed by deepseek-v4.1-flash-1017 · Input: 85.2K · Output: 19.3K · Cached: 672.3K |
…o Claude Code loads the hooks module The module imported node:fs, which the hooks sandbox rejects, so no feature of the plugin loaded. Folders are now resolved with the engine's fs.stat (resolve: true), keeping the symlink and deleted-path matching, and tests prove the module loads and the symlink flow still raises the band. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…esolved, so an edit that lands meanwhile is not folded into the baseline Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e its folders resolve Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
review-loop: APPROVED at 00f366a Hooks-sandbox fix on d4020f9..00f366a: health.tsx no longer imports node:fs (Claude Code rejects it, so the whole hooks module failed to load). Symlinked folders are resolved with the engine's fs.stat (resolve: true), with a nearest-existing-folder fallback for deleted paths. Review rounds found two real issues in the first version of this change (an edit landing during folder resolution, and a stale-session write after the await); both fixed with regression tests that fail without the fix. Final round: claude -p and codex exec both APPROVED. |
… keeps one feature's failed registration from skipping the rest, and leaves a check uncommitted when edits keep landing while folders resolve Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| expect(toasts).toEqual(['◆ 1 new health issue · stg_orders: hard coded references · /health']) | ||
| }) | ||
|
|
||
| test('an edit that keeps landing while the folders resolve is never folded into the baseline, however many tries it takes', async ($, on) => { |
There was a problem hiding this comment.
SUGGESTION: this test does not reach the retry cap it is named for
Four late edits are meant to "use up the tries", but a try is a pass of the inner loop, not a folder lookup. Each pass resolves the insight file's folder through the sequential fallback chain (/private/shop/models/staging -> /private/shop/models -> /private/shop -> /private, since only /repo/models/staging is in realFolders), and onStat holds every one of them. So all four edits land during the first attempt; the next attempt sees no new touched file and commits normally, and the new again branch (health.tsx:533) never runs. This test passes unchanged against 00f366a and repeats the coverage of the test at line 560.
Hold only one lookup per attempt (so one edit lands in each of the four passes) and assert the restart, e.g. expect(calls.map(c => c.tool)).toEqual(['dbt_health', 'dbt_health', 'dbt_health']) - with the current setup it is two calls.
There was a problem hiding this comment.
Not fixed: I tried to make the test reach the cap (holding only the first folder lookup of each pass, so every late edit lands in a different pass), and it still passed with the cap raised to 99, so it cannot tell the cap from no cap in this harness. The cap's behaviour (health.tsx:518-535) stays covered by reading only; I did not want to push a test that looks stronger than it is. I'll revisit with a seam that exposes the pass count.
|
|
||
| /** Registers every feature's own hooks; one feature's failure never skips the rest. */ | ||
| export function registerFeatures(on: On, context: FeatureContext) { | ||
| try { |
There was a problem hiding this comment.
SUGGESTION: the nine identical try/catch blocks can be one table and a loop
All nine registers share the signature (on: On, context: FeatureContext) => void, and no $ is passed here, so the header's reason for naming every feature ("the engine refuses $ handed to anything but a function it can name") does not apply to registration. A table of [id, register] pairs with a single try { register(on, context) } catch (error) { registerFailures.push([id, error]) } is equivalent in far fewer lines, and removes the risk of adding a tenth feature to the imports and the dispatchers but not to this list, which would silently drop its hooks.
There was a problem hiding this comment.
Declined: features/index.ts is the foundation file every sibling feature PR edits (each adds one line); turning it into a table here would conflict with all of them for no behaviour change. The nine explicit calls also keep each feature's registration greppable. Registration failures are already isolated per feature.
|
review-loop: APPROVED at de85ff6 |
…at/health # Conflicts: # plugins/altimate-code/hooks/features/index.ts
…and lineage tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| if (bash) { | ||
| const command = await bounded(steps, 'bashRewrite', bash.command, () => steps.bashRewrite(bash)) | ||
| if (command !== bash.command) e = { ...e, command } as ToolCallInput | ||
| const deny = await bounded(steps, 'bashGate', null, () => steps.bashGate({ ...bash, command })) |
There was a problem hiding this comment.
CRITICAL: the 5 s phase deadline silently releases the push gate this PR adds
bounded(steps, 'bashGate', null, ...) bounds the whole gate phase by PHASE_TIMEOUT_MS (5 s, line 47) and returns the null fallback when it expires - and a null gate means "no denial: run the call". Health's gate is written to wait for a running check: if ((await wantsCheck($, true)) || running?.generation === generation) await within($, CHECK_MS, kick($)) with CHECK_MS = 9 * 60_000 (features/health.tsx:26,673), and features/health.tsx:25 says the check "can take minutes". So a git push that arrives while the check is still running is released unchecked after 5 s, and the gate's hold('... did not finish in time') branch can never be reached in that case. The note added at lines 42-45 ("A gate that must hold the call therefore bounds its own check well inside this") describes something this gate does not do.
Either keep bashGate outside the phase deadline, or have health's gate stop well inside PHASE_TIMEOUT_MS and return { deny } when its own wait runs out. The same deadline also discards any bashAfter/editAfter that takes over 5 s, which silently drops the model edit health needs for the next check.
There was a problem hiding this comment.
Fixed earlier, still true at this head: the gate's wait is measured from its own last state read and stays inside the chain's 5 s deadline, so it holds with "did not finish in time" instead of being released by the phase timeout.
|
|
||
| /** Registers every feature's own hooks. */ | ||
| export function registerFeatures(on: On, context: FeatureContext) { | ||
| runsRegister(on, context) |
There was a problem hiding this comment.
WARNING: a feature whose register throws now stops every later registration and installToolChain
These nine calls are bare, and integrations.tsx:827-828 runs registerFeatures(on, { options }) immediately before installToolChain(on). Registration can throw: this file's own header (lines 4-6) says a second hook on an event without a matcher is refused, and every register calls on(...) (e.g. features/health.tsx:588). A synchronous throw from any one of them therefore skips the remaining features and installToolChain, so the session ends up with no tool.call hook at all - no bash rewrites, no push gate, no edit tracking - instead of the "logged and skipped" the header promises (line 7). The per-register try/catch and the test 'one feature that throws while registering does not stop the others' were both removed in this PR (commit c40f3b9); restoring them, or installing the tool chain before the features register, closes the hole.
There was a problem hiding this comment.
features/index.ts is the foundation's registration table, merged here unchanged and shared by every sibling PR. The per-register guard belongs to the foundation PR, so I did not change it here.
| expect(logs).toEqual(['runs · sessionStart failed: Error: at once', 'defer · bandLine failed: Error: later']) | ||
| }) | ||
|
|
||
| test('with every feature a stub, each phase runs through the features and logs nothing', async () => { |
There was a problem hiding this comment.
SUGGESTION: "with every feature a stub" is not what this test sets up
The features come from ./index and only health is implemented, so this runs one real feature plus eight stubs: nothing throws here and there is no per-feature call counter. It therefore passes unchanged if a phase loses its attempt(...) wrapper (lines 40-49 return the stub values either way) or if a feature call is dropped from index.ts - which is why the missing guard in registerFeatures (index.ts:169) is not caught either. Isolation is only unit-tested on attempt itself (lines 22-34).
Also, the health · filter at lines 50-51 would hide a new health failure in these phases.
There was a problem hiding this comment.
That test is the foundation's (features/index.test.ts), merged here unchanged. Declined for this PR.
|
review-loop: APPROVED at 9962fac (reviewers: gpt-6-astra high, gpt-6.1-sol high) |
sahrizvi
left a comment
There was a problem hiding this comment.
Consensus re-review, round 2 (panel: Claude as lead, Codex): request changes.
Head 9962fac. Scope: e10448ca66..9962fac86d (features/health.tsx, health.test.tsx, types/index.d.ts). No other plugin file differs from main.
One major is still open: the session-start write. In every interactive dbt session, the baseline still runs dbt_health --allow-write (dbt deps, writes target/, dbt_packages/, logs/), with no consent and no off switch. The README text that disclosed it was removed again by 4d2b7d5. At this head, README item 4 says calls are read-only, the Settings intro says no setting is used, and plugin.json says the health check "isn't in this version, so git push is never refused". Restoring that text in this PR resolves the block; an off switch can follow (inline on line 647).
Fixed since round 1:
- An unmatched YAML file no longer empties a late baseline. Repro'd with a sources-only file and a
.pre-commit-config.yaml. - A model dropped from a shared schema file is reported. Checked against real
dbt_healthoutput. - The whole gate decision is bounded at 4 s inside the chain's 5 s, and fails closed on timeout or on a throw.
- A result cut at the size limit (
truncated, always set by AltimateAI/altimate-code#1738 at c6e55379c0) is a failed check. - A session above the project, or a model in a nested or other project, no longer causes holds.
- The refusal tells Claude to report and stop.
healthConfigPathrejects absolute and..paths.validate --strictpasses.
Minors, none blocking (all inline except the last):
- A
#comment with an apostrophe hides a push. An unusual shell form. - YAML widening after a baseline. Edge case.
- A late baseline counts the edited models' existing issues as new. The PR's stated design; please document it.
clock.now()outside thetry. Edge case.- A lost wake-up at the end of the loop. Edge case; recovered at the next push.
- Test gaps: the late-baseline guard,
state.runningand the config wiring. - 15 tests in other files fail at head (0 at base) because their mocks were reset to main. Test-only; details in the PR comment.
The other round-1 minors are answered in their own threads; all are edge cases or follow-ups.
Measured with the CLI built from #1738's head on a scratch dbt-duckdb project:
- Baseline: 21.6 s cold, 3.6 s warm.
- Re-check after an edit: 2.2 to 2.6 s, inside the 4 s gate wait.
Merge order: AltimateAI/altimate-code#1738 first, then this.
| await $.command.register({ name: COMMAND, description: 'Show the project health issues Claude introduced' }) | ||
| // The baseline takes a while (the dbt adapter starts): nothing waits for it. A session with nobody at | ||
| // the prompt checks only when the push gate needs it. | ||
| eligible = e.isInteractive || options.healthBlocksPush === true || options.healthBlocksPush === 'true' |
There was a problem hiding this comment.
Major (round 1, still open; the doc fix was undone). In an interactive session in a dbt project, the baseline still runs dbt_health with --allow-write at session start, even with the gate off. Nobody is asked, and there is no off switch. The README text added in cc4d687 and eb08fe7 is gone at this head: 4d2b7d5 ("shared files match main") reset README.md and plugin.json to main. So at 9962fac:
- README "How it works" item 4 says again that calls are read-only unless you approve
--allow-write, with no exception for health. - The README Settings intro says "None is used yet … changing one changes nothing".
plugin.jsontitleshealthBlocksPush"Project health blocks git push (not used yet)" and says "the project health check isn't in this version, so git push is never refused". This PR makes both untrue.
Measured with the CLI built from AltimateAI/altimate-code#1738 (c6e55379c0) on a 3-model dbt-duckdb project: the cold baseline took 21.6 s and created target/, dbt_packages/, logs/ and .user.yml. Without --allow-write the tool refuses ("needs the dbt adapter … re-run with --allow-write"), so the write cannot be dropped.
On "documented, not gated": for a feature that runs dbt deps and writes into the project at every session start, the least acceptable is that the person is told. That means README item 4 names the exception, a README section describes the session-start check, and the settings say the feature is live. With that restored, this would no longer block. I still recommend an off switch (for example a healthCheck setting, on by default), but that can come in a follow-up. As shipped at this head, the person is told nothing, and the settings say the feature does not exist. Fix: restore the README and plugin.json text from eb08fe7 in this PR. It is health's own documentation, even though it sits in shared files.
There was a problem hiding this comment.
Fixed in 01378cb: same change as the first thread on this line. README "How it works" item 4, the Settings intro and the plugin.json titles/descriptions for healthBlocksPush and healthConfigPath disclose the write-without-asking at session start and that there is no separate off switch. An off switch remains an owner decision (it changes the shipped default and the settings schema).
There was a problem hiding this comment.
Resolved (round 3, f352d99). README item 4, the Settings intro and plugin.json now disclose what the code does: in an interactive session (or with the gate on) inside a dbt project, dbt_health runs with write at session start, without asking. It runs dbt deps and refreshes target/, and there is no separate off switch. plugin.json no longer says the check is missing. I checked this against sessionStart and check(), and against the real tool from AltimateAI/altimate-code#1738 (17bbc24b04): it created target/, dbt_packages/, logs/ and .user.yml. An off switch is still a reasonable follow-up.
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
| } | ||
| for (let i = 0; i < line.length; i++) { | ||
| const c = line[i]! | ||
| if (c === "'") { |
There was a problem hiding this comment.
Minor (new; Codex found it). A # comment that contains an apostrophe hides the push that follows it. simpleCommands has no comment handling, so the ' opens a quote that swallows the next line. isGitPush("# Push this branch's commits\ngit push origin HEAD") and isGitPush("git add -A # don't forget\ngit push") both return false, so with the gate on the push runs unchecked, even with new issues open. You listed this as open in your 14 Nov comment. It is an unusual form for a Claude Bash call, so it does not block. Suggested fix: treat an unquoted # at the start of a word as a comment to the end of the line. That also fixes the round-1 false hold on git push # done.
There was a problem hiding this comment.
Fixed in 01378cb: simpleCommands now treats an unquoted # at the start of a word as a comment to the end of the line, so # Push this branch's commits\ngit push and git add -A # don't forget\ngit push are both pushes, and echo x # ; git push is not. Test: "a comment never hides the push that follows it, and a push inside a comment is not a push" (fails on the previous code).
There was a problem hiding this comment.
Resolved (01378cb), with a test: a # at the start of a word now starts a comment. The new rule has its own edge input, echo ${#arr[@]}; git push, which reads as no push. I raised that as a separate minor on line 266. It does not block.
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
| // baseline, so every model counts. | ||
| const matched = new Set(run.insights.flatMap(i => [i.file, i.properties]).filter(Boolean).map(real)) | ||
| // Not when there is no baseline yet: counting every model as edited would make the baseline empty, and every existing issue new. | ||
| if (base.baseline !== null && base.touched.some(f => /\.ya?ml$/i.test(f) && !matched.has(real(f)))) for (const i of run.insights) edited.add(i.uniqueId) |
There was a problem hiding this comment.
Minor. Two parts.
(1) The round-1 fix, the base.baseline !== null guard, works. With a sources-only _sources.yml or a .pre-commit-config.yaml edited before the baseline lands, the baseline is no longer empty, nothing shows as new and the push runs. I checked this with real dbt_health output shapes: source insights carry an empty file and properties, so a sources file is never matched. But no test covers the guard. Removing base.baseline !== null && here leaves all 50 health tests passing. Removing the whole widening on this line also survives. Please add a late-baseline test with an unnamed YAML file.
(2) After a normal baseline, the widening still turns the changed-models filter off for the rest of the session. Once any .yml that no insight names is touched (line 563), every model's new pair counts. Once any .yml at all is touched (line 565), every model that has no properties file counts. Existing pairs stay suppressed, so this is much narrower than round 1. A new pair on a model Claude never touched (say, an edit the person made in their editor) can still be shown, and with the gate on it can hold the push. Edge case; it can be a follow-up.
There was a problem hiding this comment.
Fixed in 01378cb for (1): test "an unnamed YAML file edited before the baseline lands does not empty the baseline" (removing the base.baseline !== null guard fails it). (2) the widening after a baseline stays as documented in the README Settings table.
There was a problem hiding this comment.
Resolved for (1). Removing the base.baseline !== null guard now fails the new test. (2), the widening after a baseline, stays documented as designed. Its branch is still untested (a nit in the combined comment).
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
| } | ||
| // A baseline that lands after edits (the first run failed, or the project was opened above the dbt | ||
| // project) cannot tell the touched models' old issues from the new: all of theirs count as new. | ||
| const edited = modelsOfFiles(base.touched, seen, real) |
There was a problem hiding this comment.
Minor (design limit, please document it). A baseline that lands after an edit leaves the edited models' pairs out. All of their existing issues then count as new. In the kit: the first check fails (as on a cold start), Claude edits _staging.yml, the gate is on, and git push is held listing two issues the project already had. The cold baseline took 21.6 s on a 3-model project with the real CLI; on a real project with packages it takes longer. So an edit in the first minute of a session is enough to hit this. The reverse also happens: a model whose documentation is removed from a shared schema file before the baseline lands has properties: ''. Nothing matches it, so its new issue goes into the baseline and is never reported. The PR body states this as the design. The panel accepts it as a minor on that basis, but the README should say it, now that the README says nothing about health.
There was a problem hiding this comment.
Documented in 01378cb: the README healthBlocksPush row now says that when the first check lands after you changed a model, that model's existing issues count as new. The design itself is unchanged.
There was a problem hiding this comment.
Resolved. The README healthBlocksPush row now states both directions of the late-baseline limit. That matches the code.
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
|
|
||
| /** Asks altimate-code's dbt_health for the project's insights. */ | ||
| async function check($: EngineInterface): Promise<HealthRun> { | ||
| const until = (await $.clock.now()) + CHECK_MS |
There was a problem hiding this comment.
Minor (edge case). await $.clock.now() runs before the try. If it throws, loop has already moved the batch out of pending (line 521), and kick only logs the error. The state is left with no pending, no problem and no issues, and the next push runs unchecked. Moving this line inside the try, or putting the batch back in kick's catch, closes it. A failing clock is rare.
There was a problem hiding this comment.
Fixed in 01378cb: $.clock.now() now runs inside the try in check(), so a throwing clock becomes a reported problem instead of a dropped batch. Verified by the existing failed-check tests; I did not add a separate throwing-clock test.
There was a problem hiding this comment.
Resolved. clock.now() is inside the try in check(), so a throw becomes a reported problem and the batch goes back to pending. Codex reproduced that the pending files are kept.
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
|
|
||
| /** Starts the check loop unless one runs; resolves when the loop that is running ends. */ | ||
| function kick($: EngineInterface): Promise<void> { | ||
| if (running && running.generation === generation) return running.done |
There was a problem hiding this comment.
Minor (edge case; Codex found it). A lost wake-up. loop reads pending as empty and returns, but running is only cleared in the .then, after that. A turn.complete whose kick lands in that window joins the loop that is finishing, so the new edit stays pending and nothing checks it. A later push or /health recovers it (wantsCheck(retry)). The window is a few engine calls wide. Suggested fix: after the loop ends, check wantsCheck once more before resolving.
There was a problem hiding this comment.
Not changed: an edge case, a few engine calls wide, and the next push or /health recovers it through wantsCheck(retry), as you note.
There was a problem hiding this comment.
Not resolved; accepted as an edge case. The window is unchanged at f352d99, and the next push or /health recovers it through wantsCheck(retry). The gate never lets a push through because of it. I noted it again on line 589 as a non-blocking minor.
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
| } | ||
| const state = await read($, healthAtom) | ||
| // A check that failed or did not finish leaves the changes unchecked: a gate that fails open is no gate. | ||
| if (state && enabled && (state.running || state.pending.length > 0 || state.baseline === null)) |
There was a problem hiding this comment.
Minor (round 1, still open: test gap). Removing state.running || here still leaves all 50 health tests passing. I wrote the missing test: hold the second check and push. The push is held, but with the outer bound's text, "the check of the changes could not be read in time". The inner wait (line 714) and the outer within (line 696) both run out at GATE_WAIT_MS, and the outer one wins. So the "did not finish in time" text is in practice never shown. The push still fails closed. The config-path wiring has the same gap: removing if (badConfig) return { problem: badConfig } (line 473) survives, because only configPathProblem itself is tested.
There was a problem hiding this comment.
Fixed in 01378cb: added both tests, the push held while a second check runs and the config-path wiring (a config path outside the project runs no check and says so). As you found, the held push shows the outer bound's text; the test pins the fail-closed outcome.
There was a problem hiding this comment.
Partly resolved. The config-path wiring is now killed by a test. Removing state.running || still leaves all 588 tests passing, because the new test at health.test.tsx:521 sees the outer 4 s bound first. As you say, the clause is not separately observable that way. It is test-only and does not block.
There was a problem hiding this comment.
Noted, thank you for confirming. Nothing further to change in #33 (merged); anything still open is tracked for the follow-up PR.
|
Consensus re-review, round 2: findings not tied to a diff line, nits, and evidence (panel: Claude as lead, Codex; head 9962fac) Minor, not tied to a diff line
Nits
Round-1 findings at 9962fac
Push gate, measuredThese used real Timings with the real CLI
Without Gate outcomes (kit, real output shapes)
At session start, a person with the gate off sees nothing unless the check fails (one toast). At Suites (run one after another; head 9962fac vs base e10448c)
Mutation checks (the PR's 50 health tests)
I did not drive a |
… no batch, the write and baseline limits are documented again, and the guards have tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Round 2 re-review, point by point. The one open major (session-start write without consent) is answered in 01378cb by restoring the disclosure in README item 4, the Settings intro and |
| if (badConfig) return { problem: badConfig } | ||
| let result: Awaited<ReturnType<typeof runTool>> | ||
| try { | ||
| const until = (await $.clock.now()) + CHECK_MS |
There was a problem hiding this comment.
SUGGESTION: the moved clock read has no test, so the fix it makes is unpinned
until moved inside the try so that a $.clock.now() rejection comes back as { problem } instead of rejecting check after loop has already taken the batch out of pending (health.tsx:525). Nothing covers that path: the harness's mock.clock never throws, and no test overrides clock.now, so putting this line back above the try leaves the health suite green and the commit's "a throwing clock drops no batch" claim unverified. A test that makes clock.now throw once (a harness hook like onExists/holdStat) and asserts the problem is told and the edited file stays in pending would pin it.
There was a problem hiding this comment.
Not changed: the claim is a test gap, not a defect, and a throwing clock cannot be injected through the shared kit's mock.clock without changing the shared harness. The try placement is a one-line move and is covered by review.
…a schema file Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hell's folder, and the docs test ignores the health check's own tool call Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| const root = await $.session.root().catch(() => '') | ||
| // A relative name is relative to the folder the session's shell is in now: an earlier `cd` moved it. | ||
| const here = await shellFolder($) | ||
| for (const name of filesWrittenBy(e.command)) await markChanged($, name.startsWith('/') || /^[A-Za-z]:/.test(name) ? name : `${here}/${name}`, root) |
There was a problem hiding this comment.
SUGGESTION: the shell folder read here is the one after the command ran, so a command that cds and writes can get the folder applied twice
filesWrittenBy already resolves a cd inside the command into the name it returns (cd models && sed -i s/a/b/ x.sql -> models/x.sql, health.test.tsx:595), and this line then prefixes that with the shell's folder. In decide (line 711) the same composition reads session.cwd() before the command runs, so it is right there; here it runs after the command, and if the engine's folder has moved into models by then (the behaviour this fix relies on for an earlier cd, and what defer.tsx:439 documents), the path becomes /repo/models/models/x.sql. isModelFile does not stat the file, projectAbove still finds /repo by walking up, and modelsOfFiles (line 113) then matches no insight's file, so the real edit is recorded under a path nothing matches: the model's new issues stay unreported and the push gate does not hold. The added test uses one static cwd, so it cannot tell the two timings apart. Record both spellings, or read the folder once before the command, and pin it with a test whose session.cwd handler changes after the command.
There was a problem hiding this comment.
Fixed in ee73986: the gate now notes the shell's folder before a command that has its own cd/pushd, and bashAfter reads relative writes from that folder, so cd models && sed -i ... x.sql resolves once. Test: "a cd in the same Bash command is read from the folder the command started in, not the one it left the shell in" (fails on the previous code).
| async function decide($: EngineInterface, e: BashCall): Promise<{ deny: string } | 'run'> { | ||
| const startedAt = await $.clock.now() | ||
| // An edit in the same command would run before any check of it. | ||
| const here = await shellFolder($) |
There was a problem hiding this comment.
SUGGESTION: the gate's half of this fix has no test
The new test (health.test.tsx:523) covers bashAfter only: it runs a sed -i and asserts the band, with no git push. The edit-and-push tests (health.test.tsx:449) set no cwd, so shellFolder falls back to session.root() and this line behaves like the old $.session.root(). Replacing this line with await $.session.root() leaves every test green, so nothing pins that a push written from the folder an earlier cd left is held. A test with cwd: '/repo/models/staging', sed -i ... stg_orders.sql && git push and the gate on would cover it.
There was a problem hiding this comment.
Fixed in 9b9b05a: tests pin the gate's half: an edit-and-push from the folder an earlier cd left is held, and one from a dbt-internal folder is not a model edit. The second fails if the line is read from the session root instead.
…e command started in Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lder Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t from Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| const root = await $.session.root().catch(() => '') | ||
| // A relative name is relative to the folder the session's shell is in now: an earlier `cd` moved it. | ||
| // A command with its own `cd` is read from the folder it started in, which the gate noted. | ||
| const here = shellBefore ?? (await shellFolder($)) |
There was a problem hiding this comment.
SUGGESTION: shellBefore is tied to no command, and nothing clears it when the after-phase never runs
The gate sets this value for any command containing cd/pushd (line 699), but bashAfter is skipped whenever the call is denied: tool-chain.ts:149 returns the deny before afterCall, so a refusal from any gate that runs after health (sqlGraph, docs, cteProfile at features/index.ts:296-298) leaves the value set. It is also left set when the bounded after-phase is abandoned at PHASE_TIMEOUT_MS before line 742 (features/index.ts:310), since $.session.root() on line 738 is awaited first. And sessionStart (lines 638-643) resets generation, known, projects and drawn but not this value, so it can outlive the session that captured it.
A stale folder only changes the answer once the shell has moved since, but then a later relative write is resolved under the wrong folder: markChanged compares the two project folders (lines 751-756) and drops the edit, so the model is never marked changed and the push gate never learns of it.
Cheap fix: capture and clear before the first await in bashAfter (move lines 741-742 above line 738), and reset shellBefore = null in sessionStart with the rest of the per-session state. Storing { command, folder } and consuming it only for that command would make the coupling explicit.
There was a problem hiding this comment.
Fixed in f352d99: the note now carries its command and bashAfter uses it only for that same command, and sessionStart clears it, so a denied or abandoned call cannot leak a folder into a later command. No dedicated test: the chain-deadline and denied-by-a-later-gate paths cannot be driven through the harness's mock clock.
…ounded decision Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| return null | ||
| if (!(options.healthBlocksPush === true || options.healthBlocksPush === 'true') || !isGitPush(e.command)) { | ||
| // Where the shell is before this command runs: its own `cd`s are read from there, and `bashAfter` sees the folder after them. | ||
| if (CHANGES_FOLDER.test(e.command)) shellBefore = await within($, GATE_WAIT_MS, shellFolder($)) |
There was a problem hiding this comment.
[SUGGESTION]: On a deadline within yields null, so this assigns the same value as "no cd" and the write is then resolved from the folder the cd left
within resolves null when the wait expires (hooks/altimate-cli.ts:62-74), so a stalled session.cwd leaves shellBefore = null, which bashAfter cannot tell apart from a command without a cd. It then falls back to shellFolder($) (line 745) — the folder after the cd — while filesWrittenBy already keeps the cd target as a prefix (health.tsx:406). cd models/staging && sed -i 's/a/b/' stg_orders.sql is therefore recorded as <post-cd>/models/staging/stg_orders.sql: isModelFile accepts it as a project .sql, no insight names it, and the real model is never marked changed, so the check and the gate never see the edit — the fail-open this capture exists to prevent.
Keep the timeout distinguishable instead of nulling the value (e.g. mark the pre-command folder unknown and resolve those names against the session root), and pin it with a test: the new test stalls the lookup on a git push, which goes through decide, so replacing this within with a plain await shellFolder($) leaves the suite green.
There was a problem hiding this comment.
Fixed in f352d99: a timed-out lookup is recorded as unknown, and a command with its own cd whose start is unknown is read from the session's root (where it began) instead of the folder the cd left. No dedicated test for the timeout branch (the harness cannot drive the chain deadline).
| expect(allowed?.deny).toBeUndefined() | ||
| }) | ||
|
|
||
| test('with the push gate on, a push whose shell-folder lookup stalls is held, not let through', { options: { healthBlocksPush: true } }, async ($, on) => { |
There was a problem hiding this comment.
[SUGGESTION]: This stall is caught by the pre-existing outer wait, not by the line it was added for
The lookup stalls inside decide (health.tsx:715), and decide has been inside within($, GATE_WAIT_MS, decide($, e)) since before this PR, so the assertion is the same could not be read in time that the existing "a push while a re-check is still running is held" test (line 521) already makes. The branch this PR adds — the bounded capture for a cd that is not a push (health.tsx:700) — is never reached: no test runs a cd + non-push command against a stalled session.cwd, so reverting that within to a plain await keeps the suite green. Making this command a non-push one (e.g. cd models && sed -i 's/a/b/' models/staging/stg_orders.sql) would cover the new line instead.
There was a problem hiding this comment.
Acknowledged: that test pins the outer bounded decision, as the existing re-check test does. The cd + non-push capture bound is covered by review only, since a stalled session.cwd there needs the chain's real 5 s deadline, which the harness's mock clock does not drive.
…command, and an unknown start reads from the session root Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
review-loop: APPROVED at f352d99 (reviewers: gpt-6-astra high, gpt-6.1-sol high) |
| // A note belongs to its own command; a command with a `cd` whose start is unknown is read from the session's root, where it began. | ||
| const noted = shellBefore?.command === e.command ? shellBefore : null | ||
| shellBefore = null | ||
| const here = noted ? (noted.folder ?? root) : CHANGES_FOLDER.test(e.command) ? root : await shellFolder($) |
There was a problem hiding this comment.
SUGGESTION: the unknown-start fallback assumes the shell began at the session root
Both fallbacks here resolve relative writes against $.session.root(), but cwd legitimately differs from the root: this feature's own test at health.test.tsx:534 runs with cwd = ${ROOT}/models/staging, and shellFolder falls back to the root only when the host does not say.
So in a session whose shell an earlier cd models/staging moved, a command with its own cd whose gate lookup is given up at GATE_WAIT_MS (note folder null, line 733) is read from the root: cd seeds && sed -i 's/a/b/' x.sql is recorded as <root>/seeds/x.sql instead of <root>/models/staging/seeds/x.sql. isModelFile rejects it, touched stays empty, and decide returns 'run' at line 720 — the edit is never checked and the push is not held. The same happens for the noted === null branch if the gate phase is dropped before the note is written.
This narrows the fail-open the previous round raised (root is right when the shell has not moved) but does not close it. Recording the last folder the shell was known to be in, and using that rather than the root when the start is unknown, would.
There was a problem hiding this comment.
Not changed: this needs a stalled session.cwd (an engine fault; it answers in milliseconds) on a command that has its own cd, in a session whose shell an earlier call had already moved off the root. Reading from the session root is the stated fallback for an unknown start, and it is strictly narrower than before (previously the folder after the cd). Edge case beyond the supported input.
| return null | ||
| if (!(options.healthBlocksPush === true || options.healthBlocksPush === 'true') || !isGitPush(e.command)) { | ||
| // Where the shell is before this command runs: its own `cd`s are read from there, and `bashAfter` sees the folder after them. | ||
| if (CHANGES_FOLDER.test(e.command)) shellBefore = { command: e.command, folder: await within($, GATE_WAIT_MS, shellFolder($)) } |
There was a problem hiding this comment.
SUGGESTION: neither new fallback is exercised by a test
The bounded capture added here and the two new root fallbacks at line 750 have no test. Every holdCwd case (health.test.tsx:563) is a git push, so it goes through decide and times out in the outer within($, GATE_WAIT_MS, decide($, e)) at line 705; it never reaches this line or bashAfter. Reverting this line to a plain await shellFolder($), or collapsing line 750 back to await shellFolder($), leaves the suite green.
A non-push case, e.g. cd models && sed -i 's/a/b/' x.sql with holdCwd stalling, would pin the bounded capture and the unknown-start fallback together.
There was a problem hiding this comment.
Acknowledged, not added: a stalled session.cwd on a non-push command only reaches this line past the chain's real 5 s deadline, which the harness's mock clock cannot drive, so a test would be a 5 s wall-clock test. The same limit applies to the earlier thread on this fallback.
sahrizvi
left a comment
There was a problem hiding this comment.
Consensus review, round 3 (panel: Claude as lead, Codex): approve.
Reviewed 100897ce7a..f352d99a59 (the 8 commits since round 2 and the merge of main). No other plugin file differs from main except docs.test.tsx, whose mock now answers health's own dbt_health call. Both panel members finished and agree on approve.
The round-2 block is resolved. README "How it works" item 4, the Settings intro and plugin.json now say what the code does. In an interactive session inside a dbt project, or with healthBlocksPush on, the check runs dbt_health with write at session start, without asking. That runs dbt deps and refreshes target/, and there is no separate off switch. plugin.json no longer says the check is missing. I checked this against the code (sessionStart at line 652 and check() at line 480) and against the real tool from AltimateAI/altimate-code#1738 (17bbc24b04). A cold run created target/, dbt_packages/, logs/ and .user.yml in 15 s. Without --allow-write the tool refuses. A re-check after an edit took 2 s and named the new pair.
The shell-folder logic works on the ordinary flows. I ran 8 kit probes at head, all as expected:
- edit a model, then
git pushfrom the root: runs when clean, held with a new issue; cd models && git push: runs when clean;- a push from a folder an earlier
cdleft: held with a new issue; - a relative
echo >> stg_orders.sqlfrom that folder: tracked; cd staging && echo x >> stg_orders.sqlwith the gate off: tracked from the start folder;- no dbt project: nothing is checked and the push runs;
- an engine without
session.cwd: the session root is used.
The push decision, folder lookup included, is still bounded at 4 s and still fails closed. A stalled lookup gives a hold.
Remaining minors (inline). None blocks:
- Overlapping Bash calls clear the folder note (line 748). Edge case: it needs parallel subagents, and the result is a missed check.
cdinside a subshell leaks, andpushdis ignored (line 406). Edge case, open since round 1.${#var}hides a push that follows it (line 266). Edge input that fails open.- The gate acts in a session opened above the dbt project (line 718). Unusual layout.
- The lost wake-up (line 589). Edge case: the next push or
/healthrecovers it. - Test gaps: f352d99's two rules and
state.running(line 750). Test-only. - The
healthBlocksPushtext leaves out the holds on a failed or unfinished check (plugin.json). Wording only.
Nits are in the combined comment: no CHANGELOG entry, logs/ and .user.yml not named, and the unmatched-YAML widening still untested.
Checks at head vs base (run one after another):
claude plugin validate,--strict, and--strict .: pass at both.claude plugin test: 588 pass, 0 fail at head (529 pass, 0 fail at base). The 15 failures from round 2 are gone.tests/*.sh: 7 of 7 pass at both.- pytest: 65 pass at both.
No live claude --plugin-dir session: with an isolated HOME it stops at the login screen. The hooks ran through the kit, and the tool output came from the real CLI.
Merge order: AltimateAI/altimate-code#1738 first, then this PR.
| // A relative name is relative to the folder the session's shell is in now: an earlier `cd` moved it. | ||
| // A command with its own `cd` is read from the folder it started in, which the gate noted. | ||
| // A note belongs to its own command; a command with a `cd` whose start is unknown is read from the session's root, where it began. | ||
| const noted = shellBefore?.command === e.command ? shellBefore : null |
There was a problem hiding this comment.
Minor (edge case; Codex found it). shellBefore is one module-level slot, and any bashAfter clears it. Two Bash calls that overlap lose the start folder. For example, call A is cd staging && echo x > a.sql with the shell in /repo/models, and call B finishes in between (a subagent's call, say). A is then read from the session root, as /repo/staging/a.sql, and the real model goes unchecked. Claude Code runs a writing Bash command on its own, so this needs parallel subagents. The result is a missed check, not a wrong refusal. Safe in a follow-up: key the note by the tool call's id, if the chain has one.
There was a problem hiding this comment.
Thanks. This is a real but non-blocking edge case; #33 is merged now, so it goes into a follow-up PR on health.tsx rather than this one. The start folder will be keyed by call instead of one module slot.
There was a problem hiding this comment.
Fixed in #41: the start folder is kept per call (keyed by the call's tool_use_id, the command when it has none), so an overlapping Bash call no longer clears it. Test: 'a Bash call that finishes while another is running leaves the other its own start folder'.
| const at = leaderEnd(words) | ||
| const bin = (words[at] ?? '').split('/').pop() ?? '' | ||
| const args = words.slice(at + 1) | ||
| if (bin === 'cd') cwd = args[0] && !args[0].startsWith('-') && !args[0].startsWith('~') ? from(args[0]) : '' |
There was a problem hiding this comment.
Minor (edge case; open since round 1, raised again by Codex). filesWrittenBy keeps cwd after a subshell ends and ignores pushd. (cd models/staging && echo x > a.sql); echo y > models/marts/b.sql records models/staging/models/marts/b.sql, so b is never checked. This is a constructed cd chain that misses a check, and the author has acknowledged it as a known limit. It does not block.
There was a problem hiding this comment.
Thanks. This is a real but non-blocking edge case; #33 is merged now, so it goes into a follow-up PR on health.tsx rather than this one. Until then it stays a documented limit of the constructed-cd-chain parser (subshell scope and pushd are outside the supported input).
There was a problem hiding this comment.
Still open as a known limit (subshell cwd leak, pushd): not part of #41.
| } | ||
| for (let i = 0; i < line.length; i++) { | ||
| const c = line[i]! | ||
| if (c === '#' && !inWord) { |
There was a problem hiding this comment.
Minor (edge input; new with the comment rule). { ends the word (it is in OPERATORS), so the # of a parameter expansion starts a "comment". I ran it through the kit: isGitPush('echo ${#arr[@]}; git push') === false, so that push is not held. The gate fails open only on this unusual form, so it does not block. A fix is to treat # straight after ${ (and $#) as part of the word.
There was a problem hiding this comment.
Thanks. This is a real but non-blocking edge case; #33 is merged now, so it goes into a follow-up PR on health.tsx rather than this one. The tokenizer will treat # after
There was a problem hiding this comment.
Fixed in #41: the # of ${#name} is part of the word, not a comment; echo ${#arr[@]}; git push is a push. Test in 'a comment never hides the push...'.
| // An edit in the same command would run before any check of it. | ||
| const here = await shellFolder($) | ||
| if (CHANGES_FOLDER.test(e.command)) shellBefore = { command: e.command, folder: here } | ||
| for (const name of filesWrittenBy(e.command)) if (await isModelFile($, name.startsWith('/') || /^[A-Za-z]:/.test(name) ? name : `${here}/${name}`)) return hold(`this command changes the model file ${name} and pushes in one go, so the change is not checked first. Run them as separate commands.`) |
There was a problem hiding this comment.
Minor (unusual layout; Codex found it). decide runs before it checks enabled. In a session opened at /repo with the dbt project at /repo/dbt, health is off for the session, yet cd dbt && echo x > models/a.sql && git push is held and told to run /health, which cannot check anything there. Separately, bashGate looks up the shell folder (bounded at 4 s) for every Bash command that contains cd, even with health off or outside any dbt project. The engine answers that lookup in milliseconds, so it costs nothing in practice. Neither blocks. Returning early when !enabled would cover both.
There was a problem hiding this comment.
Thanks. This is a real but non-blocking edge case; #33 is merged now, so it goes into a follow-up PR on health.tsx rather than this one. decide will check enabled first and the cd lookup will be limited to commands that name a push.
There was a problem hiding this comment.
Fixed in #41: bashGate and bashAfter return at once when the session is not enabled (no dbt project above the session root), so no shell-folder lookup and no hold. Test: 'a session opened above its dbt project holds nothing'.
|
|
||
| /** Starts the check loop unless one runs; resolves when the loop that is running ends. */ | ||
| function kick($: EngineInterface): Promise<void> { | ||
| if (running && running.generation === generation) return running.done |
There was a problem hiding this comment.
Minor (edge case; unchanged since round 2). The lost wake-up is still there. An edit whose turn ends between the loop's last read and running = null gets the old done promise back from kick, and nothing re-checks it until the next push or /health. The gate recovers through wantsCheck(retry), so a push is never let through on it. The author has acknowledged it. It does not block.
There was a problem hiding this comment.
Agreed, accepted as a documented edge case: the next push or /health recovers it through wantsCheck(retry), so a push is never let through on it. Any change to the wake-up goes into the follow-up PR.
There was a problem hiding this comment.
Agreed, accepted as a documented edge case: the next push or /health recovers it through wantsCheck(retry), so a push is never let through on it. Any change to the wake-up goes into the follow-up PR.
There was a problem hiding this comment.
Still open as a known limit (lost wake-up; the next push or /health recovers it): not part of #41.
| // A note belongs to its own command; a command with a `cd` whose start is unknown is read from the session's root, where it began. | ||
| const noted = shellBefore?.command === e.command ? shellBefore : null | ||
| shellBefore = null | ||
| const here = noted ? (noted.folder ?? root) : CHANGES_FOLDER.test(e.command) ? root : await shellFolder($) |
There was a problem hiding this comment.
Minor (test-only). f352d99's two rules have no test. With const noted = shellBefore (no command match), or with this line's CHANGES_FOLDER.test(e.command) ? root : fallback removed, all 588 tests still pass. Removing state.running || at line 728 also still passes, because the test at health.test.tsx:521 sees the outer 4 s bound first. The unmatched-YAML widening after a baseline (line 567) is also untested. The author explained why the kit cannot drive the chain deadline. The note-matching rule can be pinned without the deadline, though: run a gated cd command, then a different command, and check which folder is used.
There was a problem hiding this comment.
Agreed on the three missing tests (noted-folder fallback, state.running clause, post-baseline YAML widening); they go into the follow-up PR with the code they cover.
There was a problem hiding this comment.
Partly fixed in #41. Added: the per-call note rule (overlap test), the null start folder read from the session root, and the unnamed-YAML widening after a baseline (health.tsx:567). Declined: the state.running || clause at health.tsx:735 and the CHANGES_FOLDER.test(e.command) ? root fallback at health.tsx:770. The first is not observable on its own because the chain's outer 4 s bound reports first; the second needs a call whose gate never ran, which the gate's own 4 s bound (under the chain's 5 s) makes unreachable. Both stay as defensive code.
| "title": "Project health blocks git push (not used yet)", | ||
| "description": "Not used yet: the project health check isn't in this version, so git push is never refused. When it ships, on refuses a push while the check finds new issues in the models you changed; off only shows them.", | ||
| "title": "Project health blocks git push", | ||
| "description": "On refuses a git push while the project health check finds new issues in the models you changed this session; off only shows them.", |
There was a problem hiding this comment.
Minor (wording; Codex found it). This says a push is refused "while the project health check finds new issues". After a model change, the gate also refuses when the check failed, did not finish within the 4 s wait, or has no baseline yet, even with zero issues (health.tsx:728). The README row at line 144 has the same gap. Adding one clause would match the code. It does not block, because the refusal text tells the user why.
There was a problem hiding this comment.
Agreed; the plugin.json and README wording will state that the push is also refused when the check failed, timed out or has no baseline. Follow-up PR.
There was a problem hiding this comment.
Already matches at main: plugin.json and the README row say the push is also held while the check cannot run or has not finished.
|
Consensus review, round 3: findings not tied to a diff line, nits, and evidence (panel: Claude as lead, Codex) Nits
Round-2 items: status at f352d99
Real CLI (AltimateAI/altimate-code#1738 at 17bbc24b04, built locally)I ran it on a scratch dbt-duckdb 1.12.7 + altimate-datapilot-cli project with 3 models, with an isolated HOME.
Shell-folder probes (kit, gate on unless noted)
Mutation checks (588-test suite)
Suites (one after another; head f352d99 vs base 100897c)
tsc is not configured in the repo; the validator's type check stands in for it. There was no live Codex accepted every minor at the severity above. It first rated the overlapping-call and subshell- |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the round-4 review. #33 is merged at ee9b55a, so the remaining minors (per-call start folder for the cd tracking, ${#arr} in the push scanner, decide before the enabled check, the three missing tests, and the gate wording in plugin.json/README) will go into a follow-up PR. The subshell/pushd cd chain and the lost wake-up window stay documented limits; the push is never let through on either. |
Summary
dbt_healthrun records every (model, insight) pair the project already has; nothing waits for it. A baseline that lands after edits cannot tell the edited models' old issues from new ones, so all of theirs count as new..sql,.yml) Claude changes (by an edit tool or a Bash write: redirects with or without spaces,sed -i,mv,bash -c, after acd) are tracked; paths are compared canonically. Atturn.completethe check runs again and the pairs the baseline lacks, on the changed models only, are the new issues. The band shows e.g.1 new health issue · orders: hardcoded_refs · /health, the status line shows a count,/healthshows the list.healthBlocksPushon,git pushis held while new issues exist, and also when the check of the changes failed, returned only stale insights, or did not finish in time (the push retries the check first). A command that edits a model file and pushes in one go is held: the edit cannot be checked first. Off by default (warn only).healthConfigPathpasses a DataPilot config to the tool.Depends on the altimate-code PR that adds the
dbt_healthtool; merge that first.Changes outside the feature's own files
hooks/lineage.test.tsx: its CLI mock answersdbt_health(the baseline now starts at session start) without recording it.types/index.d.ts:HealthState.Test plan
claude plugin test ./plugins/altimate-code: 245 pass, 0 fail (newhealth.test.tsx: baseline, new issue on a changed model, only changed models, properties files, symlink and./paths, push gate through the engine: failed, stale and unfinished checks, edit-and-push in one command, shell syntax: redirects,bash -c,cd, heredocs, here-strings, shifts).Known limit, for follow-up: the push gate reads shell text; constructs it cannot see (a script run from a file,
eval, variables holding a command) are not recognised as a push.Demo video (hosted)
P-06.mp4 — watch on Notion (Altimate workspace; recorded from the approved head of this PR).
🤖 Generated with Claude Code