fix(dbt-tools): say when schema-verify's verdict rests on a stale manifest

RA
13h ago
+170-12

Issue for this PR

Closes AltimateAI/altimate-code#1367 (follow-ups from the review of AltimateAI/altimate-code#1368).

Type of change

  • Bug fix

What does this PR do?

For when the dbt project check fails and dbt-tools answers from the manifest of the last successful parse:

  • The schema-verify validator says so. Its message to the agent leads with that note; only the parse time comes from the answer, quoted through sanitizeForPrompt.
  • USAGE gives the stale shape of children and parents: { stale_manifest, models } instead of a list.
  • The lineage check reads the started adapter when there is one, so a dbt-integration that defines getModelLineage as an instance field isn't mistaken for one without it.

The next @altimateai/dbt-integration bump joins this PR once it clears the 3-day minimum release age.

Claims:

  • C1: When the validator fails and any answer carries stale_manifest, fixHint opens with the note. When none does, reason and fixHint are as on main.
  • C2: Of stale_manifest, only written_at reaches the message, flattened and quoted.
  • C3: dbtAdapterHasLineage() starts nothing, and is true for a started adapter whose getModelLineage is an own property.
  • R1: before any adapter starts, an instance-field getModelLineage goes unseen: only the prototype can be read.

How did you verify your code works?

Each change has a test that fails on main. Locally: bun turbo typecheck 13/13; dbt-tools 114 pass; opencode validators, dbt lineage and sql-query-deadline 868 pass, 0 fail. Tracker-leak check clean.

Cost side effects

None.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"

Complexity delta (touched functions): cognitive unchanged; dbtAdapterHasLineage CCN 3 → 5; one new helper, cognitive 2.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEmKQx8gR7vd6ettA3mWjP

Summary by CodeRabbit

  • Improvements
    • Lineage support is now detected against the active dbt integration, including integrations that expose support at runtime.
  • Clarity
    • Help for the children and parents commands explains when results may include stale-manifest data.
    • Schema verification results now flag when they use the last successful parse’s manifest and include its timestamp when available. Current-manifest results remain unchanged.