Skip to content

Money rules ​

The rules the app's money math follows, each with an id (MR-###) and a worked example. Golden fixtures in packages/mocks/test/golden.test.ts run each example against packages/core. Rules without a fixture (illustrative examples) are listed there with the reason, and a guard fails when a new rule has neither.

What is built ​

All of these are pure functions in packages/core, tested in Node, with no database or network.

  • Built: dates and weeks, the bank calendar, schedules, entries and locks, owners, envelopes and note tags, the mortgage pot and lock window, the spend check, accounts and money movements, canonical merchants, and reconcile (matching, placement, the write plan, roll forward, the Reconcile page's items and buttons and its view) and undo. On top of them: the rolling 90-day forecast, Partner's page (partnerHome, partnerCheck, partnerAdd), the admin's dashboard (dashboardHome), freshness and the Lynx Ledger's view model (ledgerView, ledgerAddCheck).
  • Not built:
    • History import (needs real data at run time; it never goes in git).
    • Expected final amount on a pending entry (MR-031).
    • The canonical-merchant cleanup wizard (MR-098).
    • The hobby fallback and flags (Later).
    • Anything that writes: core only plans writes. The Worker applies them.
  • Kept from the Sheet on purpose: the forecast holds an open envelope's reserve on its first day (MR-054), so the balance is conservative inside the week; the verdict counts days below zero, not days under the cushion (MR-101); the bank's "transacted" date is ignored (MR-084).

Every example uses the fictional Addams household from packages/mocks:

  • People: Gomez is the admin, Morticia the member.
  • Cushion: $500.
  • Weekly envelopes: Groceries $225, Shopping $90, Eating out $75.
  • Paychecks: Gomez's mortgage paycheck every other Friday. Morticia's paycheck on the 15th, moved to the business day before when it lands on a closed day.

All amounts are made up. Dates are in 2026 unless shown. Some examples add made-up numbers that aren't in the mock data; those marked "illustrative" describe a case the mock data doesn't have.

Money ​

  • MR-001: Integer cents. Every amount is stored and computed as whole cents, and nothing else is accepted.
    • Example: $12.50 is 1250. 12.5 cents is refused.

Dates, weeks and the bank calendar ​

  • MR-010: Household dates. A moment becomes a date only in the household time zone. Day math works on calendar dates, so a daylight-saving change never shifts a day.
    • Example: the Addamses' clocks go forward on Sun Mar 8; two days after Sat Mar 7 is still Mon Mar 9. 03:30 UTC on Dec 4 is still Dec 3 in their time zone (UTC−5).
  • MR-011: Envelope weeks. Weeks run Tue–Mon from Tue Nov 24, and Mon–Sun before that. The week of Mon Nov 16 runs eight days, through the bridge Monday, Nov 23.
    • Example: Sun Nov 29 is in the week of Nov 24–30. Nov 23 is in the week of Nov 16–23. Nov 15 is in the week of Nov 9–15.
  • MR-012: Bank holidays. Federal Reserve holidays. A Sunday holiday is also off on the Monday after; a Saturday holiday isn't moved.
    • Example: Sat Jul 4 2026: the bank is open Fri Jul 3. Sun Dec 25 2022: Mon Dec 26 is off too.
  • MR-013: Business days and the clearing weekend. A business day is Mon–Fri and not a holiday. The clearing weekend is Sat, Sun, Mon and holidays.
    • Example: the day after Fri Jan 16, the next business day is Tue Jan 20 (Mon Jan 19 is a holiday). Mon Nov 30 is a business day but part of the clearing weekend.

Schedules ​

  • MR-020: Schedules. A unit (week / month / year), every N, a start, an optional end (both inclusive), and a weekday or a day of the month or "last". A day past the month's end lands on the last day.
    • Example: Crypt insurance on the "last" lands on Feb 28 2027 and Feb 29 2028. A bill on the 31st lands on Nov 30.
  • MR-021: Shift. A date on a closed bank day moves to the business day before or after, or stays put. Paychecks usually move before.
    • Example: Gomez's Friday paycheck due Fri Jan 1 2027 (a holiday) lands Thu Dec 31. A bill due Mon Sep 7 (a holiday) with shift after lands Tue Sep 8.
  • MR-022: Rule changes. A change ends the old rule the day before and starts the new one. There's no gap or overlap, and history keeps the old rule.
    • Example (illustrative): if the electric bill moved from the 20th to the 25th from Jan 1 2027, it would fall Dec 20, then Jan 25.

Entries ​

  • MR-030: Status. An entry is Planned, Charged, Pending or Posted.
    • A person can move an entry that is not locked to any other status by hand, both ways, because the bank is sometimes slow: Planned, Charged, Pending and Posted are all open to the edit form. A hand-set Posted is stored unconfirmed ("Awaiting the bank"): only reconcile confirms an entry.
    • The bank moves a Planned or Charged entry on to Pending or Posted when reconcile matches it, a Pending entry to Posted when it posts, and a Pending entry back to Charged when its bank item vanishes. It never moves an entry anywhere else (it never says a Planned entry has merely been Charged, and never takes a Posted one back).
    • A locked entry (Posted and confirmed) changes status for nobody.
    • A new entry today or earlier starts Charged; a future-dated one starts Planned.
    • Example: on Dec 3 Morticia adds Hemlock & Co. dated Dec 1: Charged. Gomez types a Dec 12 opera ticket: Planned. Gomez sets Hemlock & Co. to Posted by hand: it stays unconfirmed and editable, and he can set it back to Charged. The bank's pending charge that disappears goes back to Charged.
  • MR-031: Amount changed. Reconcile sets the bank's posted amount and keeps the typed amount as "was $X". If the bank goes back to the typed amount, the mark clears. Reconcile never changes a pending entry's amount (it waits for the posted amount); a pending entry can carry an expected final amount (a tip). Reconcile's write plan follows this; the expected final amount isn't built.
    • Example: The Raven's Roost typed as $26.50, posted at $31.80 with the tip: shows $31.80, was $26.50.
  • MR-032: Locks. A Posted entry confirmed by reconcile is locked: no edit, no move, no status change and reconcile never re-places it; only Private, and the note of an entry that needed one, can still change (MR-116). A Posted entry a person set by hand is not locked until the bank confirms it. A day is locked when it has entries, every one is locked, and its ending balance matches the bank's. Only the admin unlocks, and an unlocked entry relocks on the next match.
    • Example: Gomez unlocks Tuesday's grocer entry to fix its note; it relocks on the next run.

Owners ​

  • MR-040: Precedence. The first rule that applies wins:

    1. set by hand
    2. the alias's default owner
    3. matched to a recurring item → household
    4. the card rules
    5. household

    The reason is computed with the owner and never stored.

    • Example: Model Rail Emporium tagged by hand for Gomez stays Gomez's, even when paid on Morticia's card.
  • MR-041: Card rules.

    • A virtual-card charge goes to the admin.
    • A credit-card payment from checking goes to the household.
    • A debit purchase goes by the Cards registry on that date.
    • A card that isn't registered gives no card owner (household) and a "whose card is this?" flag.
    • Example: card 0666 is Morticia's through Sep 30; card 1031 is hers from Oct 1. Card 0666 on Oct 1 → household, flagged.
  • MR-042: Creator owns. An entry made in the app starts with its creator as the hand-set owner, and can be changed.

    • Example: Morticia adds a charge: owner Morticia.

Envelopes ​

  • MR-050: Spent. A weekly envelope's spent is its share of charges dated in the week, up to today. Pending charges count; refunds and money in don't. The amount is the one in force on the period's first day, and nothing rolls over.

    • Example: the week of Dec 1: grocer $87.40 + $30.00 of a split = $117.40 spent of $225.
  • MR-051: Moves. Money moves between weekly envelopes only within the week it's made in. A move of $0 or less, or into the same envelope, is a problem and doesn't count.

    • Example: Gomez moves $20 from Shopping to Groceries on Wed Dec 2: Groceries $225 + $20 − $117.40 = $127.60 left.
    • Partner's "Move money" form checks this before it sends anything, so each mistake sits on its own field: nothing picked in From or To, the same envelope twice, an amount that can't be read or isn't more than $0, more than From has left (an over-spent envelope has nothing left; one with no weekly amount has none to give), and stale numbers (MR-102). It offers only the open weekly envelopes the person may use, never another person's private one, and the move is dated today, in today's week. The Worker runs the same rules again on its own numbers before it writes.
    • Example: with Shopping at $58.00 left, moving $58.00 to Groceries is fine; $58.01 says "Shopping only has $58.00 left." on the amount field; picking Shopping twice says "Pick a different envelope to put it in." on To.
  • MR-052: Splits and tags.

    • A lone tag puts the whole charge in that envelope.
    • #a:62 #b splits it, with one part taking the rest.
    • #none takes the charge, or a part of it, out of the envelopes.
    • The parts must add up to the cent.
    • Tags win over the alias's default envelope. A bad split blocks a save in the app. In the history import it goes on the review list, and until it's fixed the alias decides.
    • Example: Hemlock & Co. $42.00 #groceries:30 #shopping → Groceries $30, Shopping $12.
  • MR-053: Look-alike tags. A tag within one letter of a known tag (two for tags of 8+ letters) gets a "did you mean" warning. It never blocks a save.

    • Example: #grocreies → "did you mean #groceries?"
  • MR-054: Envelope reserve. The forecast holds back, on the period's first day:

    • the full amount before the period starts.
    • what's left (0 when over) while it's open.
    • 0 once it's closed.

    A weekly period stays open through the first Wednesday after it ends.

    • Example: Groceries for the week of Dec 1, with $127.60 left on Thu Dec 3, holds back $127.60. On Thu Dec 10 it holds back $0.
    • The Open total (the envelope cards' collapsed line on a phone, "Open $258.50"): this period's reserve of every envelope that has a card, added up. An over-spent envelope adds $0, never less; an envelope with no amount adds $0; a move between envelopes changes nothing (it only shifts what each has left); a custom envelope that has not started adds its full amount. It counts the cards' own period only, so last week's leftover, which the forecast holds until Wednesday, is not in it. While a weekly period is open it is exactly the sum of the cards' "left" (the card's left includes moves; a custom envelope that has not started adds its full budget, and a move can't name one). Everyone sees the same total, because every card shows its amount to both people: another person's private envelope (MR-056) is on its card as "Private" with its amount, so it is in the total, and nothing the cards do not show is.
  • MR-055: Custom and fund envelopes.

    • A custom envelope runs from a start to an end date, for one total.
    • It counts charges minus refunds from its start, including late ones after it ends or closes.
    • It closes by itself at 0 left, and can be closed or reopened by hand.
    • Example: Halloween 2026, $666 from Oct 1–31, closed Nov 2. A late $20 refund on Nov 5 still shows in its history.
  • MR-056: Private envelopes. Only the creator sees the name. Everyone sees that it exists and its amounts.

    • Example: Morticia sees "Gomez created a private envelope: $400, $129 spent".
    • Nobody else can add to it: it is not in the "Which envelope?" list, and a charge or move that names it is refused like an envelope that doesn't exist.

Spend check ​

  • MR-060: Horizon. A purchase on the 1st–14th is checked through that month's 15th; on the 15th or later, through next month's 15th. A purchase dated in the past is checked from today.
    • Example: Dec 3 → Dec 15. Dec 15 → Jan 15.
  • MR-061: Cash flow. The purchase comes off the forecast balances through the horizon.
    • Yes: no day goes under the cushion (exactly the cushion is fine).
    • No: a dip falls in the lock window, or that day's pot can't cover it.
    • Ask: every dip is outside the lock window and that day's pot covers it.
    • Unknown: the forecast doesn't reach the horizon.
    • Example (illustrative balances): a $100 purchase on Dec 3 that drops only Dec 12 to $300, every other day staying at or above $500. The $200 shortfall falls outside the lock window, and the pot is $725 (Dec 4's set-aside) → Ask.
  • MR-062: With an envelope. Cash flow comes first: anything but Yes is the answer, and no pull is offered. Only the part beyond what's left (plus an accepted pull) goes through cash flow.
    • Over this week: offer a pull from an envelope that covers the shortfall alone. "No thanks" or no pull gives Yes, since cash flow took the extra.
    • A future week: no pull.
    • A past week: no check, just logged.
    • Add it re-checks the pull, and Check never moves money.
    • Example: on Dec 3 Groceries has $127.60 left. A $150 grocery run is $22.40 short; Shopping ($58 left) and Eating out ($48.50 left) can each cover it, so both are offered, most left first.
  • MR-063: Stale data. When the numbers are stale, the check answers Ask.
    • Stale is defined in MR-102.
    • Example: no live reconcile in 36 hours → Ask.

Mortgage pot and lock ​

  • MR-070: Pot. Set-asides − borrows + paybacks, from the 1st of the month through the day. Each month starts at 0, and it's never the raw trust balance.
    • Example: set-asides of $725 on Dec 4 and Dec 18, a $150 borrow on Dec 16 and a $150 payback on Dec 23 → $1,450 on Dec 31.
  • MR-071: Shifted paydays. A set-aside on a mortgage payday shifted into another month counts toward its scheduled month, from its scheduled date.
    • Example: the Fri Jan 1 2027 payday paid Thu Dec 31: its $725 counts toward January, not December.
  • MR-072: Lock window. From the month's last mortgage payday to the day before next month's first, counting each payday on the day it's actually paid. A shifted payday opens the window on its paid date, even though its set-aside counts toward its scheduled month (MR-071). A month with no mortgage payday is locked throughout.
    • Example: paydays Dec 4, Dec 18 and Dec 31 (shifted): locked Dec 1–3 and from Dec 31, unlocked Dec 4–30.

Pending lifecycle and reconcile ​

Matching (MR-081, MR-084) is in packages/core/src/reconcile.ts, placement on the posted day (MR-085) in packages/core/src/placement.ts, the write plan (MR-080: adding missing items, Pending → Posted) in packages/core/src/writes.ts, and roll forward (MR-082, MR-083) in packages/core/src/roll.ts.

  • MR-080: Pending. A pending bank charge missing from the record is added on today as Pending. When it posts, it becomes Posted, with Amount changed if the amount differs.

    • Example: the Raven's Roost shows pending $26.50 on Wed Dec 2, so it's added on Dec 2 as Pending. It posts Thu Dec 3 at $31.80 and becomes Posted, $31.80, was $26.50.
    • Whenever reconcile adds or posts an entry it also keeps the day the bank posted it (postedOn), wherever placement put the entry. It is a fact for display (the Ledger's "Posted Wed Dec 2" note): it changes no balance, lock or placement. A locked entry is never touched, so one written before this was kept has none.
  • MR-081: Reposted. A pending charge reposted under a new id is matched by amount, merchant and date, and never added twice.

    • Example: Graveside Grocer's pending $87.40 vanishes and reposts the next day under a new id, same amount and merchant. The existing entry matches it; no second entry is added.
  • MR-082: Vanished. A vanished pending charge goes back to Charged and keeps rolling forward. It's never deleted by itself; after 7 days it asks "Drop this?", which archives it and never deletes it.

    • Example: a $12 Hemlock & Co. pending vanishes on Dec 2 and never posts. It's Charged again, and on Dec 9 Gomez is asked "Drop this?".
  • MR-083: Roll forward. Unposted entries move to the next day when matched to a pending charge (kept within a day of today), or the next business day when nothing matches, for up to roll_cap_days business days (default 3). After that they stay put and are listed as "Didn't post". Paychecks don't use the roll cap: a missing paycheck waits one business day, then is listed for the admin.

    • Example: a $35 manicure on Sat Dec 5 with no bank item rolls, as the bank posts Monday and Tuesday, to Tue Dec 8 and then Wed Dec 9, three business days (Mon to Wed) from where it started. When the bank posts Wednesday and it still hasn't posted, it stays on Dec 9 and is listed as "Didn't post".
  • MR-084: Matching. Four passes within ±3 days of the bank item's posted date (today while it's pending) or a card line's purchase date, one-to-one (the bank's "transacted" date isn't used; it's often just the posted date): amount + merchant, amount only, a 2–3 part split from one source adding up to the cent, then the same merchant with a different amount. Passes 1, 2 and 4 take the closest dates first; the split pass takes entries in record order. A source is a trust or savings transfer's account (for the trust, also whether the memo has a mortgage word), a money movement, an alias's merchant, or else the first three words of a card line's merchant part, or of any other line its first three words without digits. So any other lines that share their first three words, such as transfers from accounts not in the Accounts list, count as one source.

    • Example: a $3,100 dividends entry matches two bank deposits from the same source of $2,000 and $1,100 (a split). A $42 Hemlock & Co. entry matches a $42 Hemlock & Co. line two days later.
  • MR-085: Placement on the posted day. (Changed: placed on the bank's posted day; a card line used to go on its purchase day when that was in another envelope week.) A posted bank line goes on the day the bank posted it, as a bank statement lists it, whatever purchase date a card line says ("authorized on MM/DD"); the bank's "transacted" date isn't used either. The one exception is a post on a day that covers closed days (a weekend or a holiday): those are spread by count over the closed days and the posted day, in the bank's order, the earlier days taking the extra ones. Paychecks (money in with a paycheck word from settings in the bank line or the matched note) and splits stay on the posted date. Matching (MR-084) still counts a card line's purchase date, so an entry typed on the purchase day is found; it's placement that ignores it. Entries already written are not moved again.

    • Example: 7 charges posting Mon → 3 / 2 / 2 over Sat / Sun / Mon. A card line that says "authorized on 12/07" and posts Wed Dec 9 goes on Wed Dec 9, though Dec 7 is in the week before.
  • MR-103: Reconcile items. The Reconcile page lists what needs the admin, worked out from the entries and what the last live run kept (a dry run writes nothing, so it can't say which entries were missed). Didn't post: an unposted entry that rolled, with no vanished bank item, once it has waited more than roll_cap_days business days since the day it started (a paycheck: more than one). Drop this?: an unposted entry whose bank item vanished 7 or more days ago. Not at bank: a typed, Posted, never-confirmed entry dated inside the newest live run's window, at least 4 days before the window's end (the matching tolerance plus one) and added before that run started. Amount differs and Not at bank show the entry and offer no button. Buttons: Didn't post offers Still coming (the roll cap starts over from today), Skip this one (archive the entry; its recurring item carries on) and Ended (archive the entry and end its recurring item the day before the occurrence it stands for: its scheduled day, else the schedule's occurrence on the day it started rolling, so a shifted day counts; an item that ended on its first occurrence is archived instead); Drop this? archives. A button only works on an item that is still waiting, never on a locked entry, and never deletes.

    • Example: the $35 manicure that started rolling on Sat Dec 5 has waited 3 business days on Wed Dec 9 (not listed) and 4 on Thu Dec 10 (Didn't post). Still coming on Dec 10 starts the count over from Dec 10. Ended on its Dec 5 occurrence ends the manicure item on Dec 4.
  • MR-104: Undo. Whoever added an entry (or the admin) can undo it while it is still unlocked and unchanged since it was added: typed by a person, Planned or Charged, never touched (its last-changed moment is its added moment, no later audit line) and not archived. Undo archives the entry, and the move an accepted pull made, and never deletes. Anything else is refused in plain words: not yours, locked (Posted and confirmed), changed since, from the bank or a schedule, already undone.

    • Example: Morticia adds $15.00 for socks on Dec 3. She and Gomez can undo it. After she saves a different note, or reconcile posts it, nobody can; Gomez can't undo it for her once it's locked, and a Member can't undo Gomez's entry.
  • MR-105: Recently added. Partner's page lists what the household added through the app, so it can be seen and undone: the entries a person typed (Add it, or a charge on the dashboard) in the last 14 days (today and the 14 days before it, on the household's clock), newest first, at most 10. Each row has the day, what it was for, the amount, the envelope (another person's private envelope reads "Private", and so does what it was for, since a #tag in the note could spell its name; other notes show without their #tags), who added it, when, and either an Undo button (MR-104 says yes to the person reading) or the plain-words reason it can't be undone, written beside the row. Entries from the bank or a schedule never show; an undone entry is archived, so it leaves the list.

    • Example: on Thu Dec 3 at 10:00, Morticia's $15.00 socks (added 9:00 today, untouched) lead the list with Undo; Gomez's tea from yesterday evening shows to her without Undo ("Only the person who added this, or the admin, can undo it."); a lunch the bank has posted and reconcile locked says it can't be undone; a bus pass changed after it was added says so; an entry added 15 days ago is not listed.
  • MR-106: The Reconcile page. Admin only, on a wide screen. It shows the last run (when, live or dry run, whether it worked, its counts and its balance check), what needs the admin (MR-103's lists: Didn't post and Drop this?, each item with its reason in words, how long it has waited and only the buttons its kind offers), the entries with no button (Not at bank, Amount differs) under "For your information", the run history with a filter, and the bank pulls. Only entries with a button count in "N items need you"; the ones under "For your information" never do, so "Nothing needs you." is reachable. Every list words an entry's age one way: "Dated today.", "Dated 3 days ago." or (a day ahead) "Dated in 3 days.". A dry run that worked counts as a warning (it wrote nothing); a run that failed says only "The latest bank pull failed." (or "The bank connection needs a new login."), never what the bank said. The history shows the newest 25 runs and the pulls of those runs only; "Show more" adds 25 more, and the status line says "Showing 25 of 60 runs." (of the runs under the filter). The filter only narrows the history and the pulls: All, Live (every live run, failed ones too), Dry runs (every dry run, failed ones too), Failed (every run that did not work, either mode); the last run and the lists of entries never change with it. Drop this? asks "Yes, drop it" or "No, keep it" before it goes through. Nothing is deleted: every run and pull stays in the list. Money is only formatted, in whole cents; money in shows with a plus.

    • Example: on Thu Dec 3 at 10:00, a live run that started at 3:00 AM and worked reads "today, 3:00 AM", "It worked.", and "The bank is $12.50 lower than the record." when the check is off by -1250 cents. A dry run from yesterday afternoon reads "yesterday, 3:00 PM" and is marked "Dry run". The $35.00 manicure that was expected Mon, Nov 23 reads "Waiting 6 business days." with Still coming, Skip this one and Ended; the $142.18 electric bill that was $140.00 shows both amounts and no button, under "For your information", and the page says "3 items need you." (the manicure, the dividends and the subscription box), not 5.
  • MR-118: The Aliases page. Admin only. It lists the aliases (Match, canonical merchant, usual envelope, usual owner, whether it is a card payment, notes) in Match order, and each row says how many of the recent lines it wins. The list can be narrowed by words typed in the Match, merchant or notes; the counts and "N need fixing" always cover the whole table. A row needs fixing when its Match repeats another row's, its envelope or owner isn't one that exists, or it has no Match or merchant; a Match that a money movement also uses is a warning (the movement wins). The form checks each field before anything is sent: the Match must hold real words (not just the bank's own words such as "Card", not only "and" or "the", more than one letter; a store number is fine) and not repeat another row's words (case, spaces and punctuation ignored); the canonical merchant must be a real name (letters, two or more, not just the bank's words); the envelope and owner must be ones the list offers (another person's private envelope is never offered); the Match and the name are at most 80 characters and the notes 200. The server checks again on its own rows. What a Match catches: the draft goes into the table (replacing the row being edited) and every recent line is read the way reconcile reads it, with the table as saved and as it would be; a line the draft's words fit is listed with what it becomes ("Becomes X"), or why not: a longer alias wins, two aliases for different merchants tie (nothing is guessed), or a money movement wins. A line counts as changed when it reads as something else today. Try a bank line reads one pasted line the same way and says the alias (with its envelope and owner), the money movement, the tie, or that no alias fits and what reconcile would call it. Removing an alias archives it: it stops matching, and nothing is deleted. Saving an alias does not rewrite earlier entries.

    • Example: with Graveside → Graveside Grocer and Graveside Fuel → Graveside Fuel, a new alias "Cobweb" → Cobweb Subscription Box catches the recent line "Purchase authorized on 12/04 COBWEB SUBSCRIPTION BOX …" and reads "Becomes Cobweb Subscription Box."; today that line reads as its own words. Editing "Graveside" shows the fuel line as "Another alias wins: Graveside Fuel."

Money movement ​

In packages/core: matching.ts (notes and card lines) and accounts.ts (accounts and transfer lines).

  • MR-090: Canonical names. The rules are built in and sign-aware. They name money movements: mortgage borrow and payback, hobby transfer, trust return, family loan in and payback, savings in and out, and the overdraft cases. A money movement has no envelope. The rules live in code; the words they match (people, banks, accounts) come from settings.
    • Example: a +$150 transfer whose memo says "borrow mortgage" is a mortgage borrow; −$150 back is a mortgage payback. Neither touches an envelope.
  • MR-091: Allowance. A kid's allowance is money out only.
    • Example: Pugsley's $10 every Sunday.
  • MR-092: Aliases. Whole words; the longest match wins; case and punctuation are ignored ("&" = "and"). An alias row gives the canonical merchant, a default envelope and a default owner.
    • Example: aliases "Graveside" (→ Graveside Grocer, Groceries) and "Graveside Fuel" (no envelope): the line "GRAVESIDE FUEL 0012" matches the longer alias, so it has no envelope.
  • MR-093: Cash. An ATM withdrawal is "Cash", with no envelope.
    • Example: a $60 ATM withdrawal is "Cash", in no envelope.
  • MR-094: Accounts. The Accounts list names checking, savings and the trust at most once each, by last 4 digits. The bank may give savings and the trust the same name, so on a checking transfer line the last 4 decide; the account's own words count on any transfer line, even one with other digits. The trust is checked first; its digits lose only to the savings digits. A transfer misread as savings has no savings-account line, so the savings transfer check reports it (MR-097).
    • Example: "Online transfer to Vault Savings xxxxxx9903" for −$50 is a hobby transfer to the trust; with xxxxxx7702 it's savings out. "Online transfer from trust" for +$20 is a trust return.
  • MR-095: Trust memos. On a trust transfer, a mortgage word in the memo makes money out a mortgage set-aside and money in a mortgage borrow. Without one, it's a hobby transfer or a trust return.
    • Example: Dec 4, −$725, "…9903 Mortgage" is the set-aside; Dec 16, +$150, "…9903 borrow mortgage" is a mortgage borrow.
  • MR-096: Mortgage notes. A note the Money movements table reads as a mortgage borrow or payback counts as that in the pot. Any other money-out note with a mortgage word (typos are in the word list) is a set-aside. Other money movements don't count.
    • Example: "Mortage" for −$725 is a set-aside; "to mortgage" for −$150 is a payback.
  • MR-097: Savings transfer check. Each posted savings in or out on checking needs a savings-account line of the opposite amount within 3 days. Each savings line confirms one transfer, the nearest-dated first; the rest are reported.
    • Example: Dec 2, −$100 to savings is confirmed by +$100 in savings on Dec 3. Dec 9, +$200 from savings has no savings line, so it's reported.
  • MR-098: Canonical merchants. Every bank line and every note resolves to one canonical merchant wherever an alias or a money movement says what it is, and reconcile compares those names: when both sides have one, equal is the same merchant and different is not, whatever the words say. The word matching only runs when either side resolved to nothing, and never for a note whose name is useless: a lone "&" or "and", just the bank's own word ("Card"), no letters, or one letter. A note like "H&M" has to match all its words, not just "and". What resolves to nothing, to a useless name, or to aliases for different merchants that tie goes on a cleanup list, one entry per distinct name, so each is mapped once (the cleanup wizard isn't built).
    • Example: the note "Hemlock & Company" and the line "Purchase authorized on 12/02 Hemlock & Comp Gloomsville NJ Card 1031" both list as unmatched until the aliases "Hemlock & Comp" and "Hemlock & Company" (both → Hemlock & Co.) exist; then they pair by name, so a run doesn't add the charge a second time. A note of just "Card" never pairs with a card line.

Forecast, verdict and freshness ​

In packages/core: forecast.ts, dashboard.ts and freshness.ts. Partner's page and the dashboard both read the forecast and nothing else for the future.

  • MR-100: Forecast. A rolling 90 days from today, computed from the entries, recurring items, settings and envelopes and never stored. A day's ending balance is the day before's plus its lines. Today starts from the bank's posted balance less what hasn't posted:
    • entries not yet posted count on their date, and any dated before today count today;
    • a recurring item counts on each date it falls, unless an entry already stands for that date;
    • the set-aside counts at the set_aside setting in force;
    • each envelope's reserve (MR-054) lands on its period's first day (today when that has passed).
    • Example: the bank says $6,124.00 on Thu Dec 3. Two unposted entries ($26.50 and $129.00) and the reserves (Groceries $127.60, Shopping $58.00, Eating out $48.50, the train set $271.00, the gift fund $250.00) come off, so Dec 3 ends at $5,213.40. The series ends Tue Mar 2.
  • MR-101: Verdict. The page's headline follows the days from today the balance ends below zero: none is good, 1–2 is tight, 3 or more is bad. Days under the cushion are shown beside it and don't change it. Words and an icon, never colour alone. When there is nothing to judge, there is no verdict: the headline is "Nothing to judge yet" with a question mark, and the reason says what is missing. Three causes, in this order. (1) The bank has never been read: no live reconcile has ever worked ("The bank hasn't been read yet, so there is nothing to judge. This fills in after the first bank pull."). This holds even when the opening balance is below zero, because that number was never the bank's. (2) Only dry-run pulls have worked, so no live run has: "No live bank pull has worked yet, so there is nothing to judge. A pull that only reports (dry-run) doesn't update the numbers." (Partner's small facts can't tell this from (1), so she sees (1).) (3) No payday is in the forecast, by the same rule as the Next payday tile (a paycheck that ends before today or starts after the 90 days counts as none): "No paycheck is set up yet, so there is nothing to judge. The chart shows only what is already planned." A forecast of bills alone says nothing about whether the household is okay, so this one stays neutral even when the bills alone dip below zero later. A household that is already overdrawn today (Checking today below zero) keeps its real verdict and reason under (3), whatever its income: that is a fact, not a forecast. The tiles and the chart still show what they have, and numbers that are merely out of date (the bank was read once) still get their verdict, with the amber banner.
    • Example: Dec 3 below zero for one day (the "tight" scenario) is "It's tight"; below zero until Dec 17 is "Not okay"; never below zero through Mar 2 is "You're okay"; a household with no paycheck set up is "Nothing to judge yet" (even when its bills alone would end below zero later), unless it is overdrawn today, when it is "Not okay".
  • MR-102: Freshness and job health. The numbers are stale when any of these hold: reconcile is off, the bank needs a new login, there has been no live reconcile (a dry run doesn't count) or the last one is 36 hours old or more, or checking's bank-updated date is before the previous business day (so a weekend never raises a false alarm). The admin's job-health line warns on any of those, on dry-run, on a failed latest pull, and when the last good pull is 26 hours old or more, and, in its Settings warnings, when the mortgage set-aside amount in force today isn't filled in (a whole number of cents above zero). A Member's line only says whether the numbers are up to date, a little late (26 hours or more) or may be out of date (stale); the mode, the login state, failures and the last good pull stay on the server. Stale numbers show a banner, dim the figures and make the spend check answer Ask (MR-063).
    • Example: a live run 35 hours ago is fresh; 36 hours is stale. A good pull 25 hours ago is fine; 26 hours warns "No bank pull has worked in 26 hours." The Member's line says "Bank numbers are a little late." at 26 hours and "Bank numbers may be out of date." at 36. A set-aside of $0 warns the Admin "The mortgage set-aside amount isn't filled in. Add it in Settings."

The Lynx Ledger ​

In packages/core: ledger.ts (the snapshot and Private), ledger-days.ts (the calendar), ledger-columns.ts (a day column), ledger-view.ts (the header, the danger list, the envelope strip and the navigation) ledger-add.ts (the add form) and ledger-edit.ts (edit, Private and remove). The page only renders what ledgerView(snapshot, now, focusDate?) returns; it does no money math. The examples use the Addams ledger (ledgerSnapshot() in packages/mocks) read at Thu Dec 3 10:00.

  • MR-107: Day columns. One column per bank business day. A closed day (Saturday, Sunday, a bank holiday) is folded into the next business day, because the bank posts it then; the column says what it folded in and who is in it. A column's tags, in order: Today, Day posted and locked, Weekend folded in, Payday, and the folded holiday's name. A wide screen shows five columns with the focus in the middle (two each side, held inside the ledger's ends); a phone shows only the focus column. Today on a closed day is in the next business day's column, with a note saying so. The ledger runs 28 days back to 120 days ahead (the dashboard's "Pick a day"); Last week and Next week move five columns, Day before and Day after one (Yesterday and Tomorrow on today), Today comes back, and an end that can't be passed is unavailable with its reason in words.
    • Example: Thu Nov 26 (Thanksgiving) is in Fri Nov 27's column: "Includes Thu Nov 26. The bank posts it on Fri.", tagged Thanksgiving Day. Sat Nov 28 and Sun Nov 29 are in Mon Nov 30's column, tagged Weekend folded in. Read on Sat Dec 5, today is in Mon Dec 7's column: "Today is Sat Dec 5. The bank is closed, so it shows in this column, Mon Dec 7." From the first column, Last week says "The ledger starts Thu Nov 5, 28 days before today."
  • MR-108: Balances and tones. "Checking today" is the forecast's end-of-day balance for today (MR-100). A column shows the end-of-day balance of its last day: the forecast's, or, for a day before today, the record's worked back from the bank's balance (no envelope reserves in it); a day past the forecast has entries and no balance. Each balance has a tone, in words and an icon, never colour alone: at or above the cushion is ok, below the cushion is "Under the cushion" (amber), below zero is "Below zero" (red). Exactly the cushion is not under it ("At the cushion"). A column is barred amber or red when any day it holds ends under the cushion or below zero, and says so when a folded day dips lower than the end of day. A column shows In (money in) and Out (money out) and never Open: what the envelopes hold back is in the balance and in the envelope strip (MR-112), not in the day.
    • Example: Thu Dec 3 ends at $907.40, above the cushion. A day ending at exactly $500.00 is "At the cushion"; $499.99 is under; -$0.01 is below zero. Mon Dec 7 holds Sat Dec 5 and Sun Dec 6 and shows $510.20 out in all.
  • MR-109: An entry. Each entry shows its signed amount ("-$58.30", "+$3,100.00") and, for screen readers, "Money out" or "Money in"; its status (Planned, Charged, Pending, Posted); the lock when it is Posted and confirmed by reconcile (read aloud "Locked."); the clock when it is Pending ("Pending."); "Awaiting the bank" when it was set to Posted by hand and the bank hasn't confirmed it (no lock, still editable); From the bank; Recurring; Private; its envelope(s) (another person's private envelope reads "Private"); its owner (hidden for the household); who made it; "Amount changed to the bank's. Was -$62.00." when reconcile set the bank's amount; Needs a note for a bare Venmo; and, for a bank entry the bank posted on a day that differs from both the day and the column it sits in, "Posted Wed Dec 9" (the bank's posted day, when it is known; reconcile places a bank entry on that day, so this is a safety net for older data, a line moved by hand or imported history; only words, it changes no balance, lock or placement; a typed entry never has it, and a Private entry keeps it, being a date only). A recurring occurrence no entry stands for yet shows as a Planned row with no entry behind it. Entries sort by day, money in first.
    • Example: on Mon Nov 30, the Graveside Grocer row "-$64.90" is Posted, locked, was -$62.00; the Venmo for -$18.00 is locked and needs a note; Fester's Bulb Barn -$18.75 is Posted, Awaiting the bank (a bank row reconcile hasn't confirmed yet), no lock; the Raven's Roost on Dec 2 is Pending with the clock. The Friday Nov 27 Graveside Grocer row is a line left on Fri Nov 27 that the bank posted Wed Dec 2, so it says "Posted Wed Dec 2"; opened (it is locked, so read-only), its facts list "Bank posted it: Wed Dec 2". The Sunday pharmacy folded into Monday, posted that Monday, says nothing.
  • MR-110: Danger zone. The days from today on that end under the cushion (MR-100's daysUnder). The button's words count calendar days, as the dashboard does ("3 days under the $500.00 cushion"). The list has one item per column, and an item names every day of the column that is under the cushion, each with its balance and state: "Thu Dec 3: $483.38 (under the cushion)" or "(below zero)", and for a column that folds in a weekend "Sat Dec 12: $273.15 (under the cushion); Sun Dec 13: $145.80 (under the cushion); Mon Dec 14: -$335.05 (below zero)" (a dip on a folded day that recovers by Monday is not lost). A jump goes to the column and announces its lowest day. The button is red when any listed day is below zero and yellow otherwise; with no day under the cushion it is hidden and a line says "No day in the next 90 days goes under the $500.00 cushion." Each press jumps to the first listed day, then the next one after the column last jumped to, then back to the first, announcing "Danger zone 1 of 2: ..." with how far under the cushion the day is. Exactly the cushion is not listed.
    • Example: the Addams ledger lists Mon Dec 14 ($364.95), Thu Jan 14 ($266.85) and Thu Feb 11 ($473.75), all "under the cushion", so the button reads "3 days under the $500.00 cushion" in yellow. With a $700 roof repair on Dec 10 the button says "17 days under the $500.00 cushion, at least one below zero" and lists fifteen columns; Mon Dec 14's names Sat Dec 12, Sun Dec 13 and Mon Dec 14 (-$335.05, "below zero"), so the button is red. With no entries, bills or paychecks the button is hidden.
  • MR-111: Day lock. A column shows "Day posted and locked" when it has entries, every one is Posted and confirmed by reconcile (MR-032), it holds no recurring occurrence that no entry stands for yet and no envelope reserve (those aren't posted money), and its end-of-day balance matches the bank's. The bank's balance for a day is worked back from today's posted balance (snapshot.ledger.openingCents) by taking off the bank's own Posted amounts dated after that day, up to today (a Posted entry the bank brought in or reconcile confirmed); the record's balance is the same sum over every Posted entry dated up to today plus the unposted ones on or before the day (MR-032). So a day does not lock while any unposted entry sits on or before it, or while a hand-set Posted entry that the bank hasn't confirmed is dated after it and on or before today: those aren't in the bank's balance. A day after today has no bank balance yet and never locks, so a weekend or holiday column that folds into a later business day locks only once that day has arrived (on a Saturday, the column keyed on Monday stays open). The code is bankBalanceForDayLock in core's ledger-columns.ts, the same rule as the Worker's own day lock. A locked day takes nothing new: it has no Add a transaction button.
    • Example: Tue Dec 1 (the grocer and Hemlock & Co. rows, both the bank's and confirmed) is posted and locked. Fri Nov 27, which folds in Thanksgiving's Thursday, is locked because both days' rows are. Mon Nov 30 is not: Fester's Bulb Barn is Posted but only Awaiting the bank.
  • MR-112: Open total. The envelope strip's "Open $832.50" is what the forecast still holds back for the envelopes whose cards are shown: the sum of envelopeReserve (MR-054) over those cards' envelopes, each for the period its card shows (this week for a weekly envelope, its own range for a custom one). That is what each has left, 0 when over or with no amount set, so while the week is open it equals the sum of the cards' "left". It counts exactly the cards the viewer sees, another person's private envelope included (its card shows as "Private" with its amount, MR-056, so Open shows nothing the cards don't), and no closed envelope. The previous week's reserve, which the forecast keeps through its first Wednesday for late posts, has no card and is not in it.
    • Example: with $137.60 left in Groceries, $15.90 in Shopping, $29.00 in Eating out and the train set and the gift fund untouched, Open is $832.50. Once Groceries is $12.40 over, it holds nothing back and Open is $694.90.
  • MR-113: Private. A person can mark any transaction Private. It hides only the description: everyone but the person who ticked it sees "Private transaction", with the amount, the day, the status, the envelope and who made it still shown, and no "Needs a note". Not even the admin sees it. redactLedgerFor(snapshot, viewerId) withholds the whole note (so a #tag can't give it away) and is what the server runs before a snapshot leaves it; the view model never shows a withheld description whatever it is given. The bank's posted-day note (MR-109) stays on a Private entry: it is a date only.
    • Example: Morticia's Birthday present for Gomez (-$48.00 on Fri Dec 4, Shopping) is "Birthday present for Gomez" to her and "Private transaction" to Gomez, who still sees -$48.00, Planned and Shopping.
  • MR-114: Add a transaction. One form takes a charge (money out) or income (money in), with the dashboard's limits: an amount of whole cents above zero and under the size cap, a note (at most 100 characters), a day from 28 days back to 120 ahead, an envelope that covers the day (income has none), tags that agree with the envelope. Income ignores a note's envelope tags and their splits ("Refund #groceries:500" is fine), but an owner tag is still read and its problems still block. Each problem is worded on its own field, in the form's order (amount, note, day, envelope), and a day that is posted and locked (the column holding it) is refused: "Fri Nov 27 is posted and locked, so nothing can be added to it. Pick another day." The write is Charged for today or earlier and Planned for a later day, owned by the person adding it (unless the note has an owner tag), marked Private by that person when ticked. These are the checks of Partner's Add it and the dashboard's Add a charge (one function), with no spend check and no pull.
    • Example: on Thu Dec 3 Gomez adds "Coffee" for 12.50 today: Charged, -$12.50. Adding 1,200.00 income "Paycheck" on Fri Dec 18: Planned, +$1,200.00, no envelope. Adding on Fri Nov 27: refused. An amount of 0, a blank note and a day of Nov 4 give three problems, one on each field.
  • MR-115: Edit a transaction. Click a transaction to open it. An entry that is not locked (Planned, Charged, Pending, or Posted and not yet confirmed) opens its amount, what it is, day, envelope, status (any of the four, by hand: MR-030) and Private. The checks are the add form's (MR-114, one function): an amount of whole cents above zero and under the cap (held to it only when the amount is changed: an amount left as it was, such as a big bank charge or a split, is never refused for size, so its status, note and Private can still be saved), a note, a day from 28 days back to 120 ahead, an envelope that covers the day, tags that agree. A day that is posted and locked takes nothing moved onto it: "Tue Dec 1 is posted and locked, so nothing can be moved onto it. Pick another day." The bank sets a bank-sourced entry's amount, so that field is read-only (whatever is typed is ignored). Income has no envelope. Which way the money goes is not changed by editing (remove it and add it again). An entry a recurring item placed changes that one entry only. An entry split across envelopes keeps its split, so its amount and envelope are read-only. Who the entry belongs to and who made it do not change. Each problem is worded on its own field, in the form's order, with a summary and focus on the first.
    • Example: on Thu Dec 3 Gomez edits Lurch Hardware (-$32.10, Charged, Shopping) to 35.00 and Posted: "Saved. Lurch Hardware, -$35.00, Posted. It locks once the bank confirms it." The Raven's Roost (Pending, from the bank) keeps its -$26.50 whatever is typed, and can be set back to Charged. Moving either to Tue Dec 1 is refused.
  • MR-116: Locked and Private. A locked entry (Posted and confirmed) opens read-only with its reason and who can unlock it; Private is always open to the person who may change it, with its own Save, and the note is open only on an entry that needed one (a bare Venmo), and stays open after it is filled in, in case it was filled in wrong. The new note can't be blank, over 100 characters, still say nothing ("Venmo payment") or add or drop a #tag; filling in a real note ends "Needs a note". Anyone can tick Private; only the person who ticked it can untick it. Someone else's Private entry opens read-only as "Private transaction" (the amount, day, status, envelope and who made it still show) and says only that person can undo it; it can't be edited, made public or removed by anyone else, the admin included.
    • Example: Gomez saves "Venmo - birthday cake" on Sun Nov 29's Venmo: "Saved. Venmo - birthday cake. It no longer needs a note." Its note stays open. Gomez opens Morticia's Private gift: read-only, "Only Morticia can undo it."
  • MR-117: Remove. Only a Planned or Charged transaction can be removed, and it is deleted for good: no archive, no copy. A Pending or Posted one has no Remove and is told to set it back to Charged first; a bank-confirmed Posted one is never deleted. Remove asks first ("Remove Lurch Hardware, -$32.10?"), then offers Undo right after, which puts back exactly what was deleted, and only until that entry is written to again (later, no). The audit log records only that a change happened, never what it held.
    • Example: Gomez removes Lurch Hardware: "Removed. Lurch Hardware is out of the balance. It is deleted for good." The Raven's Roost (Pending) can't be removed.