Skip to content

docs(prp): refresh prp37 after model zoo contracts#304

Merged
w7-mgfcode merged 1 commit into
devfrom
docs/refresh-prp37-after-prp36
May 26, 2026
Merged

docs(prp): refresh prp37 after model zoo contracts#304
w7-mgfcode merged 1 commit into
devfrom
docs/refresh-prp37-after-prp36

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

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

Summary

Refreshes PRPs/PRP-37-forecast-intelligence-C-interactive-ui.md against the final PRP-35 + PRP-36 backend contracts now live on dev (PR #299 + PR #303), and lands the PRP-37 Task 1 Contract Probe report. Docs-only — no UI implementation code, no backend code. PRP-37 has NOT been executed yet.

What this PR contains

  1. PRPs/ai_docs/prp-37-contract-probe-report.md (new) — Task 1 Contract Probe output. Verifies every PRP-35 / PRP-36 field PRP-37 wires UI to is present on dev at 0e2ad9e, with file:line cites. Verdict: GO with patches — 0 task DEFERRED, every [gate:PRP-35] and [gate:PRP-36] gate satisfied.

  2. PRPs/PRP-37-forecast-intelligence-C-interactive-ui.md (patched) — 4 drift items the probe surfaced.

Drifts patched in PRP-37

Drift #1 — backend-field naming (mechanical)

  • bucketed_aggregate_metricsbucketed_aggregated_metrics (backend ships the past-participle form on ModelBacktestResult, app/features/backtesting/schemas.py:206). 9 occurrences renamed.
  • aggregate_metrics.rmseaggregated_metrics["rmse"]aggregated_metrics is a dict[str, float] and RMSE is a key inside it; there is no AggregateMetrics Pydantic class (app/features/backtesting/metrics.py:349). 4 occurrences renamed.
  • TypeScript code block at L688-695 — the invented AggregateMetrics interface dropped; surface RMSE as aggregated_metrics["rmse"] per backend's flat-dict shape.

Drift #2ModelHealthEntry.n_comparable_runs does not exist

  • The actual contract is ModelHealthEntry.run_count: int (app/features/ops/schemas.py:313). 3 occurrences updated (Goal section, User-visible-behaviour /ops bullet, Task 21 INSERT step). UI pill relabelled "N runs evaluated" rather than "comparable runs"; a future PRP may add a filtered count.

Drift #3 — invented is_known_future flag dropped from scope

  • No is_known_future field exists on any of PriceAssumption / PromotionAssumption / HolidayAssumption / InventoryAssumption / LifecycleAssumption (app/features/scenarios/schemas.py:37-119). Every planner assumption is hypothetical by definition. The "known future input vs hypothetical" per-row pill is dropped from Task 18 + Success Criteria + the desired-tree comment + the planner.tsx file note (6 prose locations). The method badge (model_exogenous vs heuristic) — already backed by ScenarioComparison.method — remains as the supported UX signal.

Drift #4 — contract-probe report filename standardized

  • Task 1 commit-as line + Final-validation checklist line now both cite PRPs/ai_docs/prp-37-contract-probe-report.md (matches the prefixed convention already used by PRPs/ai_docs/prp-35-final-contract-snapshot.md).

Why this lands separately from PRP-37 execution

The probe report is the gate the PRP itself defines: Task 1 must verify every cited field before Task 2+ can scaffold UI on top of it. Landing the probe + the docs patch first means the implementation branch starts with a self-consistent PRP and an in-repo, RAG-indexable probe report.

Issue reference

Commit-message scope

The commit lands as docs(forecast) rather than docs(prp) — the prp scope is not in .claude/rules/commit-format.md's allow-list and the PreToolUse hook rejects it; the closest semantically-accurate scope in the allow-list is forecast (the affected epic).

Verification

  • Only the two intended files touched: git diff --stat shows PRPs/PRP-37-...md (+39/-40) and the new PRPs/ai_docs/prp-37-contract-probe-report.md (+185).
  • git diff --check clean (no whitespace errors).
  • No backend code touched (git diff app/ alembic/ frontend/ empty).
  • qwen3 stash untouched: stash@{0}: On dev: local qwen3 rag demo changes before prp-35.
  • No implementation tests required for this PR (zero code change).
  • No PRP-37 execution; no implementation branch.

Next step after merge

Branch feat/forecast-interactive-ui off dev to execute PRP-37 Task 2+ against the cleaned contract.

Summary by Sourcery

Refresh PRP-37 forecast-interactive-UI design docs to match the finalized PRP-35/36 backend contracts and add the PRP-37 Task 1 contract probe report.

Documentation:

  • Update PRP-37 specification to align field names and planner/ops behaviour with the live PRP-35/36 backend schemas, including dropping unsupported UI elements and clarifying metrics wiring.
  • Add a detailed PRP-37 contract probe report documenting the verified backend fields and required doc patches before UI implementation begins.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 26, 2026

Reviewer's Guide

Docs-only PR that (1) adds a detailed PRP-37 contract probe report verifying PRP-35/36 backend contracts on dev and (2) updates the PRP-37 spec to match the actual backend field names and capabilities (metrics dict shape, model health fields, planner assumptions, and probe filename).

Flow diagram for PRP-37 contract probe and docs refresh

flowchart TD
  A[Task 1: run PRP-37 contract probe] --> B[Read PRP-35/36 backend schemas]
  B --> C[Compare backend fields to PRP-37 spec]
  C --> D{Drifts found}
  D -- Yes --> E[Record drifts in prp-37-contract-probe-report.md]
  E --> F[Patch PRP-37 doc field names and scope]
  F --> G[Use updated spec for future implementation branch]
  D -- No --> H[Keep PRP-37 spec unchanged]
  H --> G
Loading

File-Level Changes

Change Details Files
Add a PRP-37 contract probe report documenting presence/absence of all PRP-35/36 fields and required PRP-37 doc patches before UI implementation starts.
  • Introduces a new ai_docs markdown report for PRP-37 Task 1 describing probe scope, methodology, and verdict against dev at commit 0e2ad9e.
  • Enumerates all PRP-35 feature-frame and PRP-36 model/metrics/ops fields with PRESENT/ABSENT verdicts and file:line citations.
  • Calls out four categories of drift between PRP-37 and backend (metrics naming, ModelHealthEntry run counts, planner known-future flag, and report filename) and recommends how to patch PRP-37.
  • Provides a per-task gate table indicating for each PRP-37 task whether it can proceed, needs a docs patch first, or would be deferred (none deferred).
PRPs/ai_docs/prp-37-contract-probe-report.md
Align PRP-37 interactive UI spec with actual backend contracts for backtest metrics, ops model health, planner assumptions, and probe report path.
  • Rename all references to backtest metrics from bucketed_aggregate_metrics to bucketed_aggregated_metrics and from aggregate_metrics.rmse to aggregated_metrics["rmse"], and drop the invented AggregateMetrics interface in favor of a flat aggregated_metrics dict.
  • Update ops/ModelHealthEntry references from the nonexistent n_comparable_runs field to the actual run_count field, clarifying the UI pill should read "N runs evaluated" and not imply comparability semantics that don’t exist.
  • Remove the invented is_known_future flag and the associated "known future input vs hypothetical" pill from planner-related goals, tasks, and success criteria, leaving only the method badge driven by ScenarioComparison.method.
  • Standardize the Task 1 report path and final checklist references to PRPs/ai_docs/prp-37-contract-probe-report.md, consistent with the naming convention used by other PRP docs.
PRPs/PRP-37-forecast-intelligence-C-interactive-ui.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 04261d70-9f05-44fc-9b92-5968d7b29e2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/refresh-prp37-after-prp36

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

@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.

Hey - I've left some high level feedback:

  • The contract probe report still mentions the old checklist target path (PRPs/ai_docs/contract-probe-report.md) in its header block even though the PRP now points at PRPs/ai_docs/prp-37-contract-probe-report.md; consider updating that note so the filename is consistent everywhere.
  • The "Pre-execution housekeeping" section in the probe report includes transient local-environment details (DB revision, unstashed changes) that will age quickly; consider trimming or moving those to a more ephemeral channel (e.g., HANDOFF or an issue comment) to keep this report focused on stable contract facts.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The contract probe report still mentions the old checklist target path (`PRPs/ai_docs/contract-probe-report.md`) in its header block even though the PRP now points at `PRPs/ai_docs/prp-37-contract-probe-report.md`; consider updating that note so the filename is consistent everywhere.
- The "Pre-execution housekeeping" section in the probe report includes transient local-environment details (DB revision, unstashed changes) that will age quickly; consider trimming or moving those to a more ephemeral channel (e.g., HANDOFF or an issue comment) to keep this report focused on stable contract facts.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@w7-mgfcode w7-mgfcode merged commit c0aea20 into dev May 26, 2026
8 checks passed
@w7-mgfcode w7-mgfcode deleted the docs/refresh-prp37-after-prp36 branch May 26, 2026 06:54
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