# My Neighbours: scenario and agent guide

Explore three constructed Nova Scotia households for 2027. This is an independent model estimate, not a forecast for a real household. [Methodology and sources](./methodology.html).

## Deep links

Scenarios are addressed by query parameters, for example:

```text
/budget/neighbours/?household=countryside-family&cut.restaurants=100&cut.recreation=50
/budget/neighbours/?household=halifax-renter&preset=bus
```

`household` selects `halifax-renter`, `countryside-family`, or `kentville-senior`. Halifax has `car` (default) and `no-car` variants; the other households use `default`. Changing household or variant starts its baseline. `preset` applies `lower`, `larger`, `larger-drives`, or `bus` (Halifax only). Explicit parameters override a preset. Shared links expand presets into their choices.

| Parameter | Unit / meaning |
| --- | --- |
| `cut.LINE_ID` | Annual Canadian dollars cut from that expense. `100` means $100/year, not $100/month or 100 cents. Zero removes the cut. |
| `drives` | Whole annual kilometres of driving avoided. |
| `commute` | 0/1: transit-to-work swap where available. |
| `bus` | Whole annual return bus trips where available. |
| `if` | Comma-separated circumstance IDs. Empty string clears them. |
| `guard` | 0/1: limit choices to researched amounts. |
| `model`, `data` | Versions that produced the link; all scenarios use the current model and data. |

Share and the address bar produce canonical queries. Invalid links are repaired with a visible notice. Links always start from the selected baseline; agent patches preserve unspecified choices. Available expense IDs and limits depend on the household, variant, guardrails, and transport choices.

## Live JavaScript API

Available after the page data loads:

```js
const api = window.householdBudget.app;
api.listChoices(); // households, variants, presets, current inputs, bounds and units
api.getState(); // internal normalized state; cuts are integer cents
api.getResult(); // model metadata, income, expenses, balance and tradeoffs, in cents
api.setChoices({"cut.restaurants": 100}); // patch current scenario; annual dollars
api.setChoices({"cut.recreation": 50}); // keeps household and restaurant cut
api.replaceChoices({household: "kentville-senior"}); // explicit full replacement
api.getShareUrl(); // current scenario URL, immediately reflecting edits
api.exportScenario("json"); // object
api.exportScenario("csv"); // text
```

`setChoices` preserves unspecified choices. Changing household or variant starts that household/variant's baseline. Supplying a preset replaces choices for the selected household. `replaceChoices` always starts from a baseline, even if the household is unchanged. Invalid IDs, unavailable controls, misspelled parameters and malformed values throw before the visible state changes. Valid amounts above limits are clamped; the returned `adjustments` describe the effective values, and the page shows an adjustment notice.

Use `listChoices().currentChoices` for input-shaped parameters; `getState()` exposes internal names and cents and is not an input for `setChoices`. Discovery bounds use annual dollars for cuts. Discovery preset states use the internal state format.

## Browser agent tools

Where WebMCP is available, the page registers `get_household_result`, `set_household_choices`, `replace_household_choices`, `list_household_choices`, `export_household_scenario`, and `get_household_share_url`. These operate on the visible scenario and have JSON input schemas. WebMCP requires a compatible browser and a visit to the page. Links and the JavaScript API work independently of WebMCP.
