Repository navigation
Commit 76ce370
fix: [#827] address consensus review — test determinism + error consistency + formatter completeness
Third-pass on PR #828 after follow-up code review. Three follow-ups
in scope.
1. Test determinism (MINOR per reviewer)
`test/altimate/schema-finops-dbt.test.ts` was reading the warehouse
resolver's error message verbatim ("not configured") to assert the
unknown-warehouse path. That message only appears when the registry
has at least one warehouse configured — if the test ran in a fresh
sandbox or hermetic CI, the resolver would return "...none are set
up..." and the assertion would silently fail. Added a beforeAll /
afterAll block that captures the prior registry state, pins a known
two-warehouse config for the test, and restores afterwards.
2. Error stringification consistency (MINOR)
The first PR commit upgraded most `catch (e) { error: String(e) }`
to `e instanceof Error ? e.message : String(e)`, but role-access.ts
was missed (three handlers). Normalized all three to match the
credit-analyzer / query-history pattern — driver errors now surface
as `"...message..."` rather than `"Error: ...message..."`.
3. Formatter completeness (NIT)
`finops-query-history.ts` formatter surfaced only avg_execution_time
even though the underlying handler emits total_execution_time_sec and
error_count too. Added both: total exec time always shown; error count
shown only when > 0 to avoid cluttering the typical 0-error case.
Validation
- `tsgo --noEmit`: pass.
- `bun test test/altimate/schema-finops-dbt.test.ts
test/altimate/finops-warehouse-resolver.test.ts
test/altimate/finops-recommendations.test.ts`: 95 pass / 0 fail.
- Marker check: pass (no upstream-shared files in these paths).
Reviewer note
- GPT-5.4 second-opinion was unavailable (OpenRouter credit exhaustion).
Single-reviewer Claude analysis.
Deferred to follow-up
- Surface auto-picked warehouse name in handler success metadata
(reviewer NIT — separate ROADMAP item already tracked).
- Restore role-access BigQuery-IAM / Databricks-Unity hints lost in the
resolver rewrite (reviewer NIT — would require per-operation `hint`
field on `ResolveOptions`, separate enhancement).
- Tool-level integration test for the auto-pick path (reviewer suggestion
— requires Dispatcher mock scaffolding).
Closes review feedback for PR #828 (third pass).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent ed6f247 commit 76ce370
3 files changed
Lines changed: 37 additions & 6 deletions
File tree
- packages/opencode
- src/altimate
- native/finops
- tools
- test/altimate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
648 | 674 | | |
649 | 675 | | |
650 | 676 | | |
| |||
665 | 691 | | |
666 | 692 | | |
667 | 693 | | |
668 | | - | |
669 | | - | |
670 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
671 | 698 | | |
672 | 699 | | |
673 | 700 | | |
| |||
0 commit comments