Skip to content

Adapters: forward obr #90 labels, label the DEFINE parameter mismatch, deprecate recommend_model's horizon - #289

Open
vahid-ahmadi wants to merge 2 commits into
mainfrom
vahid/r7-backend
Open

vahid-ahmadi wants to merge 2 commits into
mainfrom
vahid/r7-backend

Conversation

@vahid-ahmadi

@vahid-ahmadi vahid-ahmadi commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Four small backend changes that follow from round-1 PRs in the model repositories. No published number changes, and no pin moves.

1. obr_shock forwards three more model labels

obr-macroeconomic-model #90 sets df.attrs["subsidy_residual_warning"], ["procurement_residual_warning"] and uses ["nominal_consistent_legs"]. An MCP caller never sees the frame, so the adapter now copies them into the payload when they are present (.get, so it works at the current pin 0e44ec8 and after a re-pin).

  • At the current pin only nominal_consistent_legs is set, for CGG (["CGGPS", "CGGPSPSF", "PSCE"]), so a CGG payload gains that one key today. The two warnings arrive with the re-pin.
  • Tests use a mocked frame, with and without the attrs.

2. define_scenario labels BaselineParameterMismatch

define-uk-model #36 adds BaselineParameterMismatch(ValueError). It fell into the generic ValueError branch, whose hint is about a cached run with no departure from baseline. It now returns "refused": "baseline parameter mismatch" with a hint that says what the problem is, like the stock-flow refusal.

  • The class is matched by name over the exception's MRO, so macro does not need the new DEFINE package, and a subclass still matches.
  • define_scenario_incidence passes the refusal through unchanged (it already does this for any payload with refused).

3. recommend_model: horizon is deprecated (#210)

Decision: deprecate, do not add a vocabulary.

  • horizon stays in the tool schema and is still echoed back, so no existing caller breaks.
  • When it is passed, the result carries horizon_note (and Python callers get a DeprecationWarning) saying it was ignored and pointing at each candidate's own horizon under details. The note has its own key because warning is None whenever a model is recommended.
  • Why not a short_run / medium_term / long_run vocabulary: the registry's horizon fields are free text, so matching would need a new per-model classification, which is a new suitability claim for eight models. It would also have to reject or silently ignore the free-text values callers can pass today. That is a larger decision than this PR should take.
  • Removing the argument is left for a later release.

4. Drift canary hank_25bp_easing: description, not a rename

The id is kept. It appears in the report tables of the closed drift issue #264, and #287 edits the same canary. A new description field states the unit: 25bp per quarter on the Taylor-rule intercept, about 100bp annualised, and not a 25bp cut in the policy rate. The checker ignores unknown keys; test_committed_canaries_are_valid passes.

Relation to the open round-1 PRs

Based on main. A trial merge (git merge-tree) with each of #283, #284, #285, #287 and #288 conflicts only in CHANGELOG.md, where every PR adds a section at the top. core.py, mcp_server.py and canaries.json merge cleanly.

Tests

  • integration/tests: 495 passed, 85 skipped.
  • Root tests: 3,281 passed, 87 skipped.

🤖 Generated with Claude Code

Update (27 Nov, e9a6b93): also forwards obr-macroeconomic-model #95's labels (la_borrowing_identity, la_borrowing_note, investment_total_warning, procurement_offset_note, procurement_offset_m) with .get. The hank_shock text now says that at the default persistence of 0.9 an easing raises the policy rate on impact (us-hank-model #22); the default is unchanged. New tests are in test_wiring.py and test_hank.py.

…precate recommend_model horizon

- obr_shock forwards subsidy_residual_warning, procurement_residual_warning
  and nominal_consistent_legs when the model sets them (obr #90).
- define_scenario reports BaselineParameterMismatch (define-uk-model #36) as
  its own refusal, matched by class name.
- recommend_model: horizon stays in the schema, is echoed, and now returns
  horizon_note and a DeprecationWarning (#210).
- Drift canary hank_25bp_easing gains a description of its unit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
macromod Ready Ready Preview Nov 27, 2026 1:25am UTC

Request Review

…ng raises the policy rate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — e9a6b931 Deployed Nov 27, 2026 by vercel[bot]
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