Which importer Bots ship in v1, and where do they run? #67

Closed
opened 2026-11-24 22:17:38 -05:00 by bobby · 1 comment
Owner

Part of #44

Question

Given the Finance ingest contract (resolution on #59) and the source findings (#65, #66): which importer Bots ship with v1 (e.g. a SimpleFIN Bot for the joint Accounts, an OFX/QFX file importer, the Apple Card export path), which repo they live in, where and how often they run (in-cluster CronJob vs a home machine, sharing ADR-0004's connection budget only if in-cluster), how each gets its Token and grant/Binding, where source credentials (e.g. the SimpleFIN access URL) live per ADR-0008, how they map source accounts to Financial Account ids, and how they report failure (ADR-0009 Kuma push)?

From the SimpleFIN check: SimpleFIN gives no purchase date for Capital One or Fulton (transacted_at = posted date). Decide what a SimpleFIN Bot sends as occurred_on: the posted date (which amends the Finance MVP's "occurred_on = purchase date"), a flag, or merging dates from file exports. History via SimpleFIN is only about 45–90 days, so decide the backfill path too. Apple Card shows up in SimpleFIN's search, so decide whether to try connecting it.

Part of #44 ## Question Given the Finance ingest contract (resolution on #59) and the source findings (#65, #66): which importer Bots ship with v1 (e.g. a SimpleFIN Bot for the joint Accounts, an OFX/QFX file importer, the Apple Card export path), which repo they live in, where and how often they run (in-cluster CronJob vs a home machine, sharing ADR-0004's connection budget only if in-cluster), how each gets its Token and grant/Binding, where source credentials (e.g. the SimpleFIN access URL) live per ADR-0008, how they map source accounts to Financial Account ids, and how they report failure (ADR-0009 Kuma push)? **From the SimpleFIN check:** SimpleFIN gives **no purchase date** for Capital One or Fulton (`transacted_at` = posted date). Decide what a SimpleFIN Bot sends as `occurred_on`: the posted date (which amends the Finance MVP's "`occurred_on` = purchase date"), a flag, or merging dates from file exports. History via SimpleFIN is only about 45–90 days, so decide the backfill path too. Apple Card shows up in SimpleFIN's search, so decide whether to try connecting it.
bobby added the wayfinder:grilling label 2026-11-24 22:17:38 -05:00
bobby self-assigned this 2026-11-27 14:11:40 -05:00
Author
Owner

Resolution: importer Bots in v1

One importer, the SimpleFIN Bot, for the Household Accounts only. It runs in-cluster. occurred_on becomes an editable best-known date. The platform side is in ADR-0011.

Scope

  • v1: the SimpleFIN Bot for the joint Capital One card and Fulton checking (Household data).
  • No backfill, no file importer. Each Account's tracked_from is the first budgeted month (e.g. 2026-12-01), which SimpleFIN history already covers. If an OFX/QFX importer ever comes back, it may only send dates before an Account's first SimpleFIN date, because OFX FITIDs and SimpleFIN TRN-… ids differ and overlapping imports would duplicate.
  • v2: the Owner's Personal Accounts (Chase, Diamond CU) through the same Bot with an Owner Binding, including trying Apple Card via SimpleFIN. Other Persons' Personal Accounts never go through Owner-held secrets (ADR-0001).

The Bot

  • Code: bots/simplefin/ in this repo, with its own image. It talks to hAPI over HTTP only (import-linter enforced) and has no shared Bot library.
  • Runs: a CronJob in the bots namespace, every 6 h, start-date = now − 14 d, concurrencyPolicy: Forbid. It calls the in-cluster hAPI Service with its Token.
  • Field mapping: external_id = SimpleFIN id, posted_on = posted as a UTC date, amount_minor from the decimal amount, payee_raw = description. It never sends occurred_on.
  • Principal: simplefin-importer, with one Household grant of finance:write and no Bindings.
  • Secrets: a single SOPS secret bot-simplefin (Token, Access URL, {simplefin_account_id → financial_account_id} mapping, Kuma push URL), mounted as files. Vaultwarden "SimpleFIN Access URL" stays the source of truth. Unmapped accounts are skipped with a warning.
  • Failure: a SimpleFIN transport error, non-2xx, a non-empty errors array, or a failed ingest exits non-zero. A clean run pings a Kuma push monitor (13 h window). "An Account went quiet" stays in the Notifications fog.
  • Network: default-deny. Egress is allowed only to DNS, the hAPI app port, and (toFQDNs) the SimpleFIN bridge and Kuma push hosts on 443. Non-root, read-only root filesystem, no service-account token.
  • Build-time check: SimpleFIN's daily request quota (4 runs/day expected to fit).

Finance MVP amendments (dates)

  • occurred_on = best-known date (purchase date if the source gives one, otherwise the posted date). It's editable on imported Transactions within posted_on − 31 d … posted_on. Amount, posted_on, raw payee and external_id stay read-only. Re-imports still never overwrite edits.
  • New field dated_by = source | posted | manual, mirroring categorized_by. In ingest, occurred_on becomes optional, and posted_on is required when it's absent. If it's omitted, hAPI copies posted_on (posted). A Person's edit sets manual.
  • Date review: a Transaction is flagged when dated_by = posted and posted_on falls on days 1–5 of its month (fixed rule). It shows up as a date_review filter on GET /transactions and as a count in the previous month's summary. A PATCH clears it; sending the same date counts as confirming it.
## Resolution: importer Bots in v1 **One importer, the SimpleFIN Bot, for the Household Accounts only. It runs in-cluster. `occurred_on` becomes an editable best-known date.** The platform side is in [ADR-0011](https://git.bobbypalko.com/bobby/hapi/src/branch/main/docs/adr/0011-in-cluster-importer-bots.md). ### Scope - **v1:** the SimpleFIN Bot for the joint **Capital One** card and **Fulton** checking (Household data). - **No backfill, no file importer.** Each Account's `tracked_from` is the first budgeted month (e.g. 2026-12-01), which SimpleFIN history already covers. If an OFX/QFX importer ever comes back, it may only send dates **before an Account's first SimpleFIN date**, because OFX FITIDs and SimpleFIN `TRN-…` ids differ and overlapping imports would duplicate. - **v2:** the Owner's Personal Accounts (Chase, Diamond CU) through the same Bot with an Owner Binding, including trying **Apple Card** via SimpleFIN. Other Persons' Personal Accounts never go through Owner-held secrets (ADR-0001). ### The Bot - **Code:** `bots/simplefin/` in this repo, with its own image. It talks to hAPI over HTTP only (import-linter enforced) and has no shared Bot library. - **Runs:** a CronJob in the `bots` namespace, **every 6 h**, `start-date = now − 14 d`, `concurrencyPolicy: Forbid`. It calls the **in-cluster hAPI Service** with its Token. - **Field mapping:** `external_id` = SimpleFIN `id`, `posted_on` = `posted` as a UTC date, `amount_minor` from the decimal `amount`, `payee_raw` = `description`. **It never sends `occurred_on`.** - **Principal:** `simplefin-importer`, with one Household grant of `finance:write` and no Bindings. - **Secrets:** a single SOPS secret `bot-simplefin` (Token, Access URL, `{simplefin_account_id → financial_account_id}` mapping, Kuma push URL), mounted as files. Vaultwarden "SimpleFIN Access URL" stays the source of truth. Unmapped accounts are skipped with a warning. - **Failure:** a SimpleFIN transport error, non-2xx, a non-empty `errors` array, or a failed ingest exits non-zero. A clean run pings a **Kuma push monitor (13 h window)**. "An Account went quiet" stays in the Notifications fog. - **Network:** default-deny. Egress is allowed only to DNS, the hAPI app port, and (`toFQDNs`) the SimpleFIN bridge and Kuma push hosts on 443. Non-root, read-only root filesystem, no service-account token. - **Build-time check:** SimpleFIN's daily request quota (4 runs/day expected to fit). ### Finance MVP amendments (dates) - **`occurred_on` = best-known date** (purchase date if the source gives one, otherwise the posted date). It's **editable on imported Transactions** within `posted_on − 31 d … posted_on`. Amount, `posted_on`, raw payee and `external_id` stay read-only. Re-imports still never overwrite edits. - **New field `dated_by` = `source | posted | manual`**, mirroring `categorized_by`. In ingest, `occurred_on` becomes **optional**, and `posted_on` is required when it's absent. If it's omitted, hAPI copies `posted_on` (`posted`). A Person's edit sets `manual`. - **Date review:** a Transaction is flagged when `dated_by = posted` and `posted_on` falls on **days 1–5** of its month (fixed rule). It shows up as a `date_review` filter on `GET /transactions` and as a count in the **previous** month's summary. A PATCH clears it; sending the same date counts as confirming it.
bobby closed this issue 2026-11-27 14:38:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: bobby/hapi#67