Merge upstream/main into main (weekly sync, 2026-09-26)

Merged
JA
2mo ago
+18770-1488

Summary

The weekly upstream sync that #118 ("Staying in sync", duty 1) requires. The last one was #185 on 2026-09-18, which left fork main 23 commits behind mirror/upstream-main. This PR brings it level with we-promise/sure 7cc6aa0 (2026-09-25).

It is one merge commit with both parents (fe7c36d fork main, 7cc6aa0 mirror). Merge it with a merge commit, not a squash, per #118 duty 4.

Scope and dependencies

  • Issue: #118 (weekly sync duty)
  • Parent PR/branch, if stacked: none; base is main at fe7c36d
  • Intentionally out of scope: no fork-side changes beyond conflict resolution. The OpenAPI drift noted below is left alone, and so are cubic's findings on upstream code (see the PR comment).

Upstream changes of note

  • we-promise/sure#3608, asset classification schema: this is the fork's drop 0.6 landing upstream. db/migrate/20260916120000_add_classification_to_securities.rb is byte-identical on both sides, so nothing runs twice.
  • we-promise/sure#3611, money-weighted return calculator: the fork's Portfolio::Xirr back-port (#186) already matched it, and it merged without conflict.
  • Also included: Plaid member-owned connections (#3613), Jev categorisation provider (#3660), FinanceKit publisher (#3633, #3678, #3684), Enable Banking consent duration (#3038), and others.

Conflicts and resolutions (6 files)

FileResolution
db/schema.rbNot hand-resolved (duty 2). Loaded fork main's schema, ran the 10 migrations upstream added, and committed the dump. Compared against both parents, see below.
app/models/security.rbBoth sides carried the #3608 taxonomy constants, so git produced two copies. Kept one block, the fork's, which also holds REGIONS/REGION_KEYS, and folded in upstream's two extra comment paragraphs (migration duplication, and why sector/industry stay free text). Kept the fork's region inclusion validation.
test/models/security_test.rbTook upstream's two added tests (sector/industry free text; no DB check on region) and its wording of the constraint-scan comment.
test/controllers/accounts_controller_test.rbKept both sides. Upstream's member-owned connection tests sit before the fork's private helpers.
.github/workflows/ci.ymlKept the fork's system-test setup (#216, which uses the runner image's paired Chrome and chromedriver) over upstream's install-then-delete-chromedriver approach.
docs/api/openapi.yamlKept both sides' added schemas; the YAML parses.

Schema check

After normalising dump formatting, the regenerated schema.rb differs from upstream's in exactly three places. All three are drift in upstream's own file:

  • accounts.account_providers_count: no migration creates it and no code reads it.
  • ibkr_* raw_activities_payload / raw_cash_report_payload: upstream's dump drops null: false, but migration 20260512210600 declares it.

Every fork-only table and index survives: security_constituents, security_classification_proposals, constituents_fetched_at, index_taggings_unique.

Evidence checklist

  • Each issue in this PR has its own acceptance criteria and no unrelated issue work is included. This is a sync only.
  • Contract rows touched by this change name existing tests. Not applicable: no contract rows change.
  • Any gate test has an observed failing mutation transcript attached. Not applicable.
  • Fixtures used as evidence assert internal consistency. Not applicable.
  • Financial calculations use BigDecimal and documented rounding points. Not applicable.
  • De-identification uses token-shape allowlists; no personal data is included.
  • Files changed, decisions, tests/runtime, risks, and next unblocked issue are documented below.

Validation

  • The staged tree equals git merge-tree of the two parents, except in the six resolved files.
  • CI on b085735 (Ruby 3.4.9): test_unit, test_system, lint, lint_js, scan_ruby, scan_js, CodeQL and helm checks are all green. security-scan is red on a false positive in upstream code; the PR comment has the details and options.
  • Local bin/rails test: 10518 runs, 4 failures, 3 errors, 33 skips, on Ruby 3.3.6 (the environment could not download 3.4.9). All 7 also fail on unmerged fe7c36d in the same environment, and CI on 3.4.9 passes them.
  • bin/rubocop: 2866 files, no offences.
  • erb_lint --lint-all: 2 errors in app/views/loans/_form.html.erb (autocomplete attribute). That file is untouched by this merge.
  • bin/brakeman: 0 warnings.

Risks, blockers, and follow-up

  • security-scan: needs the owner's call; three options are in the PR comment.
  • OpenAPI drift on fork main. Regenerating with rswag:specs:swaggerize changes the fork-only loan amortisation text: the committed copy doesn't match its specs. That predates this sync and is left alone here, but it wants its own small fix.
  • Single-copy check. app/models/security.rb still differs from the mirror in layout: the fork's taxonomy block sits higher, next to REGIONS. Any drop 3 pre-flight that touches this file has to declare that, or cut from the mirror's layout (#233 does the latter).