Skip to content

release: prepare v0.2.17 — MLZOO-D + dogfood automation + cross-slice import pattern#266

Merged
w7-mgfcode merged 22 commits into
mainfrom
dev
May 20, 2026
Merged

release: prepare v0.2.17 — MLZOO-D + dogfood automation + cross-slice import pattern#266
w7-mgfcode merged 22 commits into
mainfrom
dev

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

@w7-mgfcode w7-mgfcode commented May 20, 2026

Summary

Cuts v0.2.17 for the 22-commit train queued on `dev` ahead of `main`.

Notable changes since v0.2.16

Browser dogfood evidence

PRP-31 Task 21 (scenarios 1-7) ran post-merge on `dev` — all 8 paths (S1–S7 incl. S6b) green. Verdict comment with per-scenario assertions and network-call evidence: #256 (comment)

Validation

  • 4 `dev` checks green at HEAD
  • The matching 4 `main` checks will run on this PR
  • Pre-1.0 bump rule: any `feat:` in the train → PATCH bump (release-please config `bump-patch-for-minor-pre-major: true`)

Test plan

  • 4 required `main` status checks green (Lint & Format, Type Check, Test, Migration Check)
  • Merge via the GitHub web UI (NOT `gh pr merge --merge` — see docs/_base/RUNBOOKS.md § "release-please skipped the bump after a dev → main merge")
  • release-please opens the `chore(main): release 0.2.17` PR
  • STOP and ask before merging the Release PR (tag push is irreversible)

Summary by CodeRabbit

  • New Features

    • Feature metadata endpoints for examining model feature importance across runs and jobs
    • Model family classification (baseline, tree, additive) with visual badges throughout the dashboard
    • Feature Importance panels in run details, comparisons, and forecast visualization pages
    • Extended model type support in backtesting (regression, lightgbm, xgboost, prophet_like)
  • Documentation

    • Updated user guides describing new model family and feature importance features
  • Bug Fixes

    • Improved error handling with standardized problem response format

Review Change Stack

w7-mgfcode and others added 22 commits May 19, 2026 23:31
chore(repo): back-merge main into dev after v0.2.16 release (#252)
…rror (#256)

Surface the v0.2.16 advanced-model metadata (LightGBM / XGBoost / regression
/ prophet_like) via two new read-only forecasting endpoints — the registry-
keyed twin of PRP-28's /explain/runs/{run_id} and the job-keyed twin of
/explain/jobs/{job_id}. Adds the computed model_family field on
RunResponse, the FeatureImportanceUnavailableError + UnprocessableEntityError
exception classes, and matching unit + route tests.

Backend additions:
- app/features/forecasting/feature_metadata.py — model_family_for,
  importance_type_for, extract_feature_importance. Pure-function;
  lightgbm / xgboost never imported at module scope (optional extras).
  Detects sklearn's HistGradientBoostingRegressor.feature_importances_
  gap and raises FeatureImportanceUnavailableError → 422.
  Detects the SimpleImputer-drops-all-NaN-columns case for prophet_like
  and pads ridge.coef_ back to the canonical 14-column width with 0.0
  (regression caught during dogfood; days_since_launch on a product with
  no launch date triggers it).
- app/features/forecasting/schemas.py — ModelFamily str enum,
  FeatureImportanceItem (signed importance for linear_coef kind),
  FeatureMetadataResponse.
- app/features/forecasting/service.py — get_feature_metadata_for_run +
  for_job. The two cross-slice imports (RegistryService, JobService) are
  LAZY (inside the methods) to break the registry ↔ forecasting cycle
  the computed field would otherwise close.
- app/features/forecasting/routes.py — GET /forecasting/runs/{run_id}/
  feature-metadata + GET /forecasting/jobs/{job_id}/feature-metadata.
  Mirror PRP-28's exception-flow contract: ForecastLabError subclasses
  flow through to forecastlab_exception_handler, SQLAlchemyError
  becomes DatabaseError. Also fixes the /train docstring drift — now
  lists xgboost, regression, prophet_like alongside lightgbm.
- app/core/exceptions.py + problem_details.py — UnprocessableEntityError
  (status_code=422, code='UNPROCESSABLE_ENTITY') and matching ERROR_TYPES
  entry. Distinct from ValidationError (code='VALIDATION_ERROR') so
  consumers can disambiguate state-prevented operations from input
  failures via the RFC 7807 type URI.
- app/features/registry/schemas.py — model_family computed_field on
  RunResponse (no DB column, no migration).

Tests (37 new): test_feature_metadata.py (17, including the
imputer-drop regression), test_routes_feature_metadata.py (20, full
matrix for both endpoints — 200 / 400 / 404 / 422 with mocked
RegistryService / JobService / load_model_bundle), and 10 new
RunResponse model_family cases in test_schemas.py.

Closes the MLZOO sequence backend gap.
Surface the new /forecasting/{runs,jobs}/{id}/feature-metadata endpoints
and the computed model_family field on every ModelRun across the
explorer + visualize pages. One panel, two display modes (tree: positive
bars; linear_coef: signed bars with direction colour + icon).

Frontend additions:
- types/api.ts — ModelFamily ('baseline' | 'tree' | 'additive');
  ModelRun.model_family; FeatureImportanceItem (signed importance);
  FeatureMetadataResponse.
- hooks/use-feature-metadata.ts — useRunFeatureMetadata +
  useJobFeatureMetadata sibling hooks. Mirror useRunExplanation /
  useJobExplanation exactly (retry: false; query-key shape).
- components/common/model-family-badge.tsx + test — pure derivation,
  no hooks: baseline → secondary + Activity, tree → default + TreePine,
  additive → outline + LineChart. data-family attr + testid.
- components/explainability/feature-importance-panel.tsx + test —
  one card, branches on FeatureImportanceItem.kind. Linear coef rows
  render with sign-coloured bars + TrendingUp / TrendingDown icons.
  Verbatim correlation-vs-causation caveat in the card footer.
  Neutral muted message for ApiError 400 (baseline family) and 422
  (no artifact / missing extra / HistGBR-no-importance). Destructive
  ErrorDisplay for unexpected.

Page wiring (additive, in-place edits only):
- explorer/runs.tsx — new 'Family' column with ModelFamilyBadge,
  MODEL_TYPES allow-list extended to regression / lightgbm / xgboost /
  prophet_like, csvColumns + Model filter dropdown extended.
- explorer/run-detail.tsx — ModelFamilyBadge in profile header + row,
  'Feature Metadata' card listing the 14 canonical feature columns,
  FeatureImportancePanel — all gated on model_family !== 'baseline'
  with enabled:false on the TanStack Query so baseline runs never
  trigger a 400 burst.
- explorer/run-compare.tsx — Family row in the profile table, new
  collapsible 'Feature Importance (Run A vs Run B)' card. Side-by-side
  panels only when both runs share a non-baseline family; cross-family
  pairs render a muted explanatory message and DO NOT fetch (enabled:
  false on both hooks).
- visualize/forecast.tsx — CRITICAL: uses useJobFeatureMetadata
  (NOT useRunFeatureMetadata). trainJob.result.run_id is the FORECAST
  ARTIFACT KEY (uuid.uuid4().hex[:12], see forecasting/service.py:270),
  NOT a registry UUID; calling the run-keyed hook would 404. Inline
  CRITICAL comment + memory cross-link to scenario-run-id-vs-registry-
  run-id. Collapsible defaultOpen=false to preserve scan flow.
- visualize/backtest.tsx — MODEL_OPTIONS extended to all seven types
  (B.2's feature-aware backtest is what makes the four advanced
  families reachable from the UI).

Tests (10 new): model-family-badge.test.tsx (3 cases),
feature-importance-panel.test.tsx (7 cases). Both use afterEach
(cleanup) because vitest is not configured for auto-cleanup.
…y-explainability

feat(forecast,ui): MLZOO-D frontend, registry, and explainability polish (#256)
feat(repo): add scripts/dogfood-browser.sh wrapper for snap-chromium playwright (#262)
docs(repo): name cross-slice read-only import pattern (#264)
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Sorry @w7-mgfcode, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

This PR implements PRP-31 to surface advanced ML model metadata: feature-importance extraction by model family (baseline/tree/additive), two new feature-metadata API endpoints (run- and job-keyed), computed model_family field on RunResponse, and a frontend Feature Importance panel with model-family-aware rendering. Includes RFC 7807 error standardization, schema definitions, service layer integration, and page-level UI wiring across explorer and visualization pages.

Changes

Backend Feature Metadata API

Layer / File(s) Summary
RFC 7807 exception handling
app/core/problem_details.py, app/core/exceptions.py
New UnprocessableEntityError class with 422 status and ERROR_TYPES mapping for RFC 7807 problem-details responses.
Feature importance extraction logic
app/features/forecasting/feature_metadata.py, app/features/forecasting/tests/test_feature_metadata.py
Pure-function utilities to extract feature importance from fitted forecasters: model_family_for mapping, FeatureImportanceUnavailableError for unsupported estimators, importance_type_for labeling, and extract_feature_importance core logic handling tree/linear coefficients with prophet-like pipeline alignment and coefficient realignment via imputer statistics.
API schemas and computed fields
app/features/forecasting/schemas.py, app/features/registry/schemas.py, app/features/registry/tests/test_schemas.py
ModelFamily enum and FeatureImportanceItem/FeatureMetadataResponse Pydantic models; computed model_family field on RunResponse with lazy import cycle avoidance.
Feature metadata service methods and HTTP routes
app/features/forecasting/service.py, app/features/forecasting/routes.py, app/features/forecasting/tests/test_routes_feature_metadata.py
ForecastingService methods for run- and job-keyed metadata extraction with artifact loading and error translation; two GET endpoints (/forecasting/runs/{run_id}/feature-metadata, /forecasting/jobs/{job_id}/feature-metadata) with comprehensive integration tests covering success/error paths and RFC 7807 responses.
Model dependency handling and error alignment
app/features/forecasting/models.py, app/features/backtesting/routes.py, app/features/backtesting/tests/test_routes_integration.py
Lazy imports for optional lightgbm/xgboost dependencies with ValueError on failure; aligned backtesting route error handling to use BadRequestError for consistency with RFC 7807 problem details.
Validation, documentation, and config
app/shared/feature_frames/rows.py, app/features/jobs/schemas.py, docs/_base/ARCHITECTURE.md, README.md
Stricter baseline_price validation in feature-frame row builders; expanded JobCreate schema documentation; documented cross-slice read-only import pattern; updated backtesting docs.

Frontend Feature Metadata UI

Layer / File(s) Summary
Frontend API type definitions
frontend/src/types/api.ts
Extended API types with ModelFamily union, model_family field on ModelRun, and FeatureImportanceItem/FeatureMetadataResponse interfaces.
Shared UI components
frontend/src/components/common/model-family-badge.tsx, frontend/src/components/common/model-family-badge.test.tsx, frontend/src/components/explainability/feature-importance-panel.tsx, frontend/src/components/explainability/feature-importance-panel.test.tsx
ModelFamilyBadge component with family-to-icon/variant/label mappings; FeatureImportancePanel with tree/linear coefficient rendering, loading/error states (400/422 handling), and family-aware descriptions; comprehensive Vitest coverage.
Data fetching hook
frontend/src/hooks/use-feature-metadata.ts
useRunFeatureMetadata and useJobFeatureMetadata TanStack Query hooks with enabled gating and retry: false for final error treatment.
Page-level UI integration
frontend/src/pages/explorer/runs.tsx, frontend/src/pages/explorer/run-detail.tsx, frontend/src/pages/explorer/run-compare.tsx, frontend/src/pages/visualize/forecast.tsx, frontend/src/pages/visualize/backtest.tsx
Integrated feature metadata display: Family column + model filter in runs explorer; Family badge + feature metadata card + importance panel in run detail (non-baseline only); Family field + side-by-side importance in run compare (same-family runs); collapsible model details in forecast page; expanded model options in backtest page.

Documentation and Configuration

Layer / File(s) Summary
User guide documentation
docs/user-guide/dashboard-guide.md, docs/user-guide/feature-reference.md, docs/user-guide/getting-started.md
Updated dashboard guide with Family badge column and feature-importance panel descriptions; expanded feature reference with advanced model metadata section and RFC 7807 error semantics; added dogfood troubleshooting instruction.
Example code blocks and helper scripts
examples/models/feature_frame_contract.md, examples/models/model_interface.md, scripts/dogfood-browser.sh
Updated Markdown code-fence syntax for feature-frame examples; added dogfood browser script for Playwright + Chromium validation.
PRP specifications and project configuration
PRPs/PRP-31-mlzoo-d-frontend-registry-explainability.md, PRPs/PRP-MLZOO-B.2-feature-aware-backtesting.md, PRPs/PRP-MLZOO-C2-prophet-like-additive-model.md, README.md, .gitignore
Full PRP-31 implementation specification; minor PRP formatting; updated backtesting and CI-log documentation.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant FrontendRoute
    participant APIEndpoint
    participant ForecastingService
    participant RegistryService
    participant ModelArtifact
    participant FeatureExtractor
    
    Browser->>FrontendRoute: GET /forecasting/runs/{run_id}/feature-metadata
    FrontendRoute->>APIEndpoint: HTTP Request (useRunFeatureMetadata)
    APIEndpoint->>ForecastingService: get_feature_metadata_for_run(db, run_id)
    ForecastingService->>RegistryService: get_run(run_id)
    RegistryService-->>ForecastingService: RunResponse (model_type, artifact_uri)
    ForecastingService->>ModelArtifact: load_model_bundle(artifact_uri)
    ModelArtifact-->>ForecastingService: ModelBundle
    ForecastingService->>FeatureExtractor: extract_feature_importance(bundle)
    FeatureExtractor-->>ForecastingService: FeatureImportanceItem[]
    ForecastingService-->>APIEndpoint: FeatureMetadataResponse
    APIEndpoint-->>FrontendRoute: 200 JSON
    FrontendRoute->>Browser: Render FeatureImportancePanel
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

Possibly related PRs

Suggested labels

autorelease: tagged

Suggested reviewers

  • w7-learn
  • w7-l7ab

Poem

🐰 A Feature Importance tale, told with care,
Tree splits and coefficients laid out bare,
The prophet's Ridge weights dance in additive grace,
While badges mark families across the interface,
And panels reveal what each model holds dear—
Advanced ML metadata, crystal clear! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 54.02% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary changes: a release preparation (v0.2.17) that includes MLZOO-D feature implementation, dogfood automation (dogfood-browser.sh), and a cross-slice import pattern architectural documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/features/forecasting/routes.py (1)

120-131: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace remaining bare HTTPException branches with ForecastLab errors.

train_model and predict still raise raw HTTPException for user-facing failures, which breaks your RFC 7807 consistency in app/**/*.py. Please map these to BadRequestError / NotFoundError (or other ForecastLabError subclasses) so responses always flow through problem_details handling.

As per coding guidelines, "Use RFC 7807 application/problem+json error responses via app/core/problem_details.py. Never use bare HTTPException with raw strings or ad-hoc error shapes."

Also applies to: 222-237

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/features/forecasting/routes.py` around lines 120 - 131, The code
currently raises bare HTTPException in the forecasting handlers (notably in
train_model, predict, and the ValueError except block shown) which bypasses the
RFC7807 problem_details pipeline; replace those HTTPException usages with the
appropriate ForecastLabError subclasses (e.g., raise BadRequestError for
input/validation issues and NotFoundError for missing resources) so responses
are emitted via app/core/problem_details.py; update the except ValueError block
to raise BadRequestError (including the original message and preserving
exception chaining) and scan the other HTTPException occurrences around the
predict/train_model code (lines ~222-237) to map them to ForecastLabError
subclasses accordingly.
🧹 Nitpick comments (2)
frontend/src/components/explainability/feature-importance-panel.tsx (1)

30-35: ⚡ Quick win

Strengthen FAMILY_DESCRIPTION type constraint to ModelFamily.

Currently Record<string, string> loses compile-time exhaustiveness checks. Typing as Record<ModelFamily, string> ensures the map remains in sync if model families are added or renamed. The family parameter is already constrained to ModelFamily, so this tightens the type consistency.

Proposed diff
-import type { FeatureImportanceItem, FeatureMetadataResponse } from '`@/types/api`'
+import type {
+  FeatureImportanceItem,
+  FeatureMetadataResponse,
+  ModelFamily,
+} from '`@/types/api`'
@@
-const FAMILY_DESCRIPTION: Record<string, string> = {
+const FAMILY_DESCRIPTION: Record<ModelFamily, string> = {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/explainability/feature-importance-panel.tsx` around
lines 30 - 35, FAMILY_DESCRIPTION is currently typed as Record<string, string>,
losing exhaustiveness checks; change its type to Record<ModelFamily, string> and
ensure ModelFamily is imported or referenced where this file uses it (the same
type used for the family parameter). Update the declaration of
FAMILY_DESCRIPTION to use ModelFamily so the compiler will catch missing or
renamed model families and keep the map in sync with the family parameter usage.
frontend/src/hooks/use-feature-metadata.ts (1)

15-21: ⚡ Quick win

Align both queryFn implementations with the async/await guideline.

Both hooks return promises implicitly; update them to use explicit async/await syntax as required by the coding guidelines.

Proposed diff
 export function useRunFeatureMetadata(runId: string, enabled = true) {
   return useQuery({
     queryKey: ['feature-metadata', 'run', runId],
-    queryFn: () =>
-      api<FeatureMetadataResponse>(`/forecasting/runs/${runId}/feature-metadata`),
+    queryFn: async () => {
+      return await api<FeatureMetadataResponse>(
+        `/forecasting/runs/${runId}/feature-metadata`,
+      )
+    },
     enabled: enabled && !!runId,
     retry: false,
   })
 }

 export function useJobFeatureMetadata(jobId: string, enabled = true) {
   return useQuery({
     queryKey: ['feature-metadata', 'job', jobId],
-    queryFn: () =>
-      api<FeatureMetadataResponse>(`/forecasting/jobs/${jobId}/feature-metadata`),
+    queryFn: async () => {
+      return await api<FeatureMetadataResponse>(
+        `/forecasting/jobs/${jobId}/feature-metadata`,
+      )
+    },
     enabled: enabled && !!jobId,
     retry: false,
   })
 }

Both lines 17-18 and 37-38 require this change per the guideline: "Use async/await for all promise handling in TypeScript/JavaScript code."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/hooks/use-feature-metadata.ts` around lines 15 - 21, The queryFn
currently returns the api(...) promise directly; change it to an async function
that awaits the API call to follow the project's async/await guideline. Update
each useQuery's queryFn (the handlers that call
api<FeatureMetadataResponse>(`/forecasting/runs/${runId}/feature-metadata`) and
the other similar queryFn later in the file) to be async () => { return await
api<FeatureMetadataResponse>(...) } (or simply const result = await api(...);
return result) so the promise is handled with explicit async/await rather than
an implicit returned promise.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/features/forecasting/service.py`:
- Around line 809-812: The code only checks truthiness of bundle_path_str (from
job.result["model_path"]) and can accept non-string truthy values; update the
validation around bundle_path_str in the function that handles job.result so it
enforces isinstance(bundle_path_str, str) and bundle_path_str.strip() and raise
UnprocessableEntityError when the check fails; specifically modify the block
using result = job.result or {} and bundle_path_str = result.get("model_path")
to validate type and non-empty string before proceeding to any bundle loading
logic.

In `@app/features/registry/schemas.py`:
- Around line 20-27: Current direct import of ModelFamily (and the related
model_family_for usage) in app/features/registry/schemas.py creates a
registry↔forecasting slice dependency; extract the ModelFamily type and the
model_family_for helper into a neutral shared module (e.g., app/core/models or
app/shared/models), update both slices to import ModelFamily and
model_family_for from that new module instead of
app.features.forecasting.schemas, and remove any direct forecasting imports from
registry.schemas (and from the other referenced usages around lines 155–166) so
both registry and forecasting depend only on the shared/core module.

In `@PRPs/PRP-31-mlzoo-d-frontend-registry-explainability.md`:
- Around line 17-18: The scope statement currently says “one new backend
endpoint” but the PRP actually defines two REST endpoints
(/runs/{run_id}/feature-metadata and /jobs/{job_id}/feature-metadata); update
the top-level scope sentence to accurately state two backend endpoints (or
rephrase to “one or more backend endpoints” and explicitly list the two paths)
so the scope matches the detailed specification and removes ambiguity.
- Around line 1206-1211: The error mapping under "Error semantics (RFC 7807
application/problem+json)" incorrectly lists missing bundle file as 500; update
that bullet so the missing/deleted artifact case uses 422 UNPROCESSABLE_ENTITY
to match the rest of the PRP and backend tests (change the line that reads "500
— bundle file missing on disk (storage corruption)" to "422 — bundle file
missing on disk (storage corruption)"); ensure any references to this mapping in
the document or tests that expect 422 remain consistent with the symbol "Error
semantics (RFC 7807 application/problem+json)" and the "bundle file missing"
bullet.

---

Outside diff comments:
In `@app/features/forecasting/routes.py`:
- Around line 120-131: The code currently raises bare HTTPException in the
forecasting handlers (notably in train_model, predict, and the ValueError except
block shown) which bypasses the RFC7807 problem_details pipeline; replace those
HTTPException usages with the appropriate ForecastLabError subclasses (e.g.,
raise BadRequestError for input/validation issues and NotFoundError for missing
resources) so responses are emitted via app/core/problem_details.py; update the
except ValueError block to raise BadRequestError (including the original message
and preserving exception chaining) and scan the other HTTPException occurrences
around the predict/train_model code (lines ~222-237) to map them to
ForecastLabError subclasses accordingly.

---

Nitpick comments:
In `@frontend/src/components/explainability/feature-importance-panel.tsx`:
- Around line 30-35: FAMILY_DESCRIPTION is currently typed as Record<string,
string>, losing exhaustiveness checks; change its type to Record<ModelFamily,
string> and ensure ModelFamily is imported or referenced where this file uses it
(the same type used for the family parameter). Update the declaration of
FAMILY_DESCRIPTION to use ModelFamily so the compiler will catch missing or
renamed model families and keep the map in sync with the family parameter usage.

In `@frontend/src/hooks/use-feature-metadata.ts`:
- Around line 15-21: The queryFn currently returns the api(...) promise
directly; change it to an async function that awaits the API call to follow the
project's async/await guideline. Update each useQuery's queryFn (the handlers
that call
api<FeatureMetadataResponse>(`/forecasting/runs/${runId}/feature-metadata`) and
the other similar queryFn later in the file) to be async () => { return await
api<FeatureMetadataResponse>(...) } (or simply const result = await api(...);
return result) so the promise is handled with explicit async/await rather than
an implicit returned promise.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9d4a8e9-7df6-4ce9-8bf6-b6dac6a4379b

📥 Commits

Reviewing files that changed from the base of the PR and between 7f7bd15 and 37b9885.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (38)
  • .gitignore
  • PRPs/PRP-31-mlzoo-d-frontend-registry-explainability.md
  • PRPs/PRP-MLZOO-B.2-feature-aware-backtesting.md
  • PRPs/PRP-MLZOO-C2-prophet-like-additive-model.md
  • README.md
  • app/core/exceptions.py
  • app/core/problem_details.py
  • app/features/backtesting/routes.py
  • app/features/backtesting/tests/test_routes_integration.py
  • app/features/forecasting/feature_metadata.py
  • app/features/forecasting/models.py
  • app/features/forecasting/routes.py
  • app/features/forecasting/schemas.py
  • app/features/forecasting/service.py
  • app/features/forecasting/tests/test_feature_metadata.py
  • app/features/forecasting/tests/test_routes_feature_metadata.py
  • app/features/jobs/schemas.py
  • app/features/registry/schemas.py
  • app/features/registry/tests/test_schemas.py
  • app/shared/feature_frames/rows.py
  • docs/_base/ARCHITECTURE.md
  • docs/user-guide/dashboard-guide.md
  • docs/user-guide/feature-reference.md
  • docs/user-guide/getting-started.md
  • examples/models/feature_frame_contract.md
  • examples/models/model_interface.md
  • frontend/src/components/common/model-family-badge.test.tsx
  • frontend/src/components/common/model-family-badge.tsx
  • frontend/src/components/explainability/feature-importance-panel.test.tsx
  • frontend/src/components/explainability/feature-importance-panel.tsx
  • frontend/src/hooks/use-feature-metadata.ts
  • frontend/src/pages/explorer/run-compare.tsx
  • frontend/src/pages/explorer/run-detail.tsx
  • frontend/src/pages/explorer/runs.tsx
  • frontend/src/pages/visualize/backtest.tsx
  • frontend/src/pages/visualize/forecast.tsx
  • frontend/src/types/api.ts
  • scripts/dogfood-browser.sh

Comment thread app/features/forecasting/service.py
Comment thread app/features/registry/schemas.py
Comment thread PRPs/PRP-31-mlzoo-d-frontend-registry-explainability.md
Comment thread PRPs/PRP-31-mlzoo-d-frontend-registry-explainability.md
@w7-mgfcode w7-mgfcode merged commit 59e477c into main May 20, 2026
13 checks passed
w7-mgfcode added a commit that referenced this pull request May 20, 2026
fix(forecast,docs): address CodeRabbit feedback on PR #266 (3 quick wins) (#267)
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.

1 participant