Merge upstream/main into main (weekly sync, refreshed 2026-10-20) #464
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.52) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #464"
general
weight: 0.35
jaysbeekay
Refreshed 2026-10-20 (head
40c4be22c)Upstream
mainmerged again at9884e617b, five more commits: we-promise/sure#4299 (rejected statements stay in the vault inbox), #4177 (an investment transfer counted as a plain transfer), #3987 (category structure lock), #4089 (rule text operators) and #4235 (cache invalidation on currency change and account deletion).| Commit | What |
| --- | --- |
|
1ab736326| Merge upstreammain. 11 conflicted files, resolved as below. ||
40c4be22c| Upstream's new currency cache test given the fork's totals shape (fees). |Conflict resolutions in
1ab736326:Rule,Rule::Action,Rule::Condition,Rule::ConditionFilter,Rule::SafeRegexand three test files): forkmaincarried an earlier version of #4089. Upstream's merged version is taken throughout. It is a superset here, already holding the ordered-run and timeout tests.IncomeStatement#family_statsandInvestmentStatement#totals_querycache keys: the fork's extra parts (excluded kinds, date range,totals_query/v5) kept, with upstream'scache_freshness_keyandfamily.currencyfrom #4235.investment_statement_test: both sides kept.Checks:
1ab736326: 14,090 runs, 0 failures, 1 error, which was the stub fixed in40c4be22c. The investment and income statement tests then ran 172 runs, 0 failures. Droppingfamily.currencyfrom the totals key fails the new test.test_systemfailure was Docker Hub rate-limiting the image pull (toomanyrequests), not a test.holding.rbSQL interpolates only a constant fragment and a sanitised bind.---
Refreshed 2026-10-18 (head
faa3f52c2)The branch now also carries today's fork
main(67dea25b2, after jaysbeekay/sure#433, jaysbeekay/sure#432 and jaysbeekay/sure#359 merged) and upstreammainate913d1d71(77 more upstream commits). Merging both brings in the upstream fixes for jaysbeekay/sure#462, jaysbeekay/sure#445, jaysbeekay/sure#416, jaysbeekay/sure#426, jaysbeekay/sure#422, jaysbeekay/sure#386, jaysbeekay/sure#235, jaysbeekay/sure#455, the Bills part of jaysbeekay/sure#467, and jaysbeekay/sure#350.| Commit | What |
| --- | --- |
|
79b29324a| Merge forkmain(clean). ||
2ea8d2867| Merge upstreammain. 16 conflicted files, resolved as below. ||
a0f70dc57| Fork migration renumbered to20261015090001, plus guarded20261018090000. ||
faa3f52c2| Restores a fork period test the resolution had spliced with upstream's tail. |Conflict resolutions in
2ea8d2867:Account.create_and_sync: the loan's start date dates the opening anchor only when it is on or before today (fork, jaysbeekay/sure#432) and afterEntry.min_supported_date(upstream, we-promise/sure#4174). The fork'sLoandoes not yet reject a future start date, as upstream's does. For the same reason, upstream's test "create_and_sync rejects a loan with a future start date" is left out; jaysbeekay/sure#478 brings the validation.Accountprivate methods,HoldingsController(includes(:account, :security)),IncomeStatement(upstream's new daily expense methods plus the fork'sfamily_statssignature), the loans locale (both sets of keys, one duplicate pair dropped): both sides kept.data_helpersandholdings_processor: upstream's version, a superset of the fork's (addsprovider_rowfor remapped holdings), with its tests.period.rb: comment only; upstream wording.family_testandperiod_test: the fork's tests for the earliest-activity anchor, which cover upstream's cases and more. Upstream's non-conflicting tests are kept.Cargo.lock: upstream.Migration version collision. Upstream's
20261015090000_add_session_expires_at_to_trade_republic_itemshas the same version as the fork's rule migration, so nothing could migrate. A fork database (the demo included) has already recorded20261015090000for the fork's migration.20261015090001. It returns early oncerules.priorityis gone, so it runs again as a no-op.20261018090000_ensure_trade_republic_session_expires_atadds it when missing. Tested both ways.Verification at
a0f70dc57plus the test fix:faa3f52c2; its file and the migration tests then ran 97 runs, 0 failures.Still merge with a merge commit, not a squash. The sections below describe the 15 Oct sync; where they name
20261015090000_convert_rule_priority_to_position, read20261015090001.---
Summary
Brings jaysbeekay/sure's
mainup to we-promise/sure'smainhead (a3bb5d991, "2883: Fix unidentified card holds", we-promise/sure#4162). Forkmain(8d4842986, after jaysbeekay/sure#429) was 125 commits behind; the merge base iseb34c06f0, the head jaysbeekay/sure#332 merged.mirror/upstream-mainis at the same upstream commit.Owner-approved weekly sync. It also carries the jaysbeekay/sure#448 port, as that issue's order A requires (jaysbeekay/sure#384 merged first, as
6e97cdf05).Head branch:
sync/upstream-2026-10-15Commits on the branch:
| Commit | What |
| --- | --- |
|
679c16725| The merge. Parents8d4842986(forkmain) anda3bb5d991(upstream). 91 conflicted files, each listed below. ||
9082f803c| Three fork tests stored a zero exchange rate to reach the conversion guards; we-promise/sure#3790 now refuses one in the model and the database. The guards stay, and the tests hand them the rate directly. ||
4ac18ac4e| Records that investment income is now summed signed (we-promise/sure#4082): methodology P24/P26, the contract gate, and the cache-key test attotals_query/v5. ||
ab3f8a127| Fork-only migration20261015090000: carries each family's rule outcome frompriorityintoposition, then dropspriority. ||
eafa42835,948a0175e,390d47330| jaysbeekay/sure#448's port, cherry-picked fromup/net-contributions-model(f87a751af,8fc7f6aed,1fb0df306). ||
2da501fe2| A stale-valuation card is expired by status, not throughInsight.visible, which we-promise/sure#4061 made hide exactly the card that removing a share must expire (found by the full suite). ||
821b548c5| A fork FinanceKit test still counted the retiredApplyAllRulesJob; the downstream now queuesApplyRulesJob(we-promise/sure#4013). ||
9bbcc19ac| The rules rake test (from we-promise/sure#4013) loads onlyrules.rake, so it no longer flakes on test order (comment 6211978487). ||
80ce7dfda| The rule-order migration keeps dependent chains in the fork's order and reverses only conflicts (see below; answers the 15 Oct nightly review). |Merge it with a merge commit, not a squash, per jaysbeekay/sure#118 duty 4.
Rules ordering: owner decision, option A (converge on we-promise/sure#4013)
The two designs could not both stand:
| | Fork (jaysbeekay/sure#292) | Upstream (we-promise/sure#4013) |
| --- | --- | --- |
| Column |
rules.priority(20261001090000, seeded bycreated_at) |rules.position+stop_processing(20261006140000, seeded A-Z by name) || Order |
Rule.prioritised:(priority, created_at, id)ascending |Rule.ordered:(position, created_at, id)ascending || Who wins a contested field | the last rule (each overwrites the one before) | the first rule (it claims the field) |
| Runner |
ApplyAllRulesJob(active_only:, ignore_attribute_locks:)|Rule::Runner,ApplyRulesJobafter sync,ApplyAllRulesJobfrom the page || UI | up/down arrows, priority sort | drag to reorder (
reorder_rules_path), "Stop processing" switch |This PR takes upstream's design everywhere and retires the fork's priority code: the
prioritisedscope,assign_priority,Rule#moveandMOVE_DIRECTIONS,Rule.apply_in_priority_order, themoveaction and route, the up/down arrows, the priority sort and direction toggle, the "lower one wins" hint, thepriorityAPI field, the importer'srules_priority_base, andtest/models/rule/priority_test.rb. A finalgit grepforprioritised,apply_in_priority_order,assign_priority,move_rule,rules_priority,priority_hintand "lower one wins" acrossapp,lib,config,test,specanddocsreturns nothing.Kept (fork-only, unrelated to ordering): the
starts_with,ends_withandmatches_regexoperators andRule::SafeRegex(both on forkmainsince jaysbeekay/sure#292). Upstream madeRule#matching_scopepublic and the runner calls it once per rule, so the regex is resolved there, under the statement timeout, and handed on as ids throughscope_for_transaction_ids(an array parameter, not a bind per id). The display counts still read a timed-out pattern as zero. The fork's per-apply@regex_matchesmemo is gone:applynow receives its scope once from the runner.Parity of the runs: the nightly pass was
ApplyAllRulesJob(active_only: true, ignore_attribute_locks: false)and is nowApplyRulesJob(active rules, locks respected). "Apply all" wasApplyAllRulesJob(every rule, locks ignored) and still is.The migration:
20261015090000_convert_rule_priority_to_position(fork only)Upstream's migration numbers existing rules A-Z by name. On a fork database that can change which rule wins, or break a chain of rules. This migration runs after it and renumbers each family's rules pair by pair (
80ce7dfda, answering the 15 Oct nightly review, comment 6204131222):transaction_name), category, merchant, tags, or kind (a transfer, read bytransaction_type). Both runners let a rule see what earlier rules wrote, so the two run in the order they ran on the fork. This covers a rename followed by a rule matching the new name, and the mirror case: a rule that matched a name before a later rule renamed it.It is a topological sort: chain edges always point forward in the fork's order, so they never form a cycle, and a conflict edge is added only when it does not close one. Among the rules free to go next, the one latest in the fork's order goes first. Compound conditions are read through their sub-conditions.
auto_categorizeandauto_detect_merchantsrun in background jobs after the run, so they create no chain.A pair that is both a chain and a conflict (B matches A's rename, and both set the category) cannot keep both. The chain wins: reversed, B would miss the renamed rows and lose every action it has on them, not just the category. On rows both match, A's category now wins. The migration prints each such pair ("Rule X now runs before rule Y to keep a chain...").
Down re-adds
priority(with its index) and backfills it fromposition, reversed, so the top rule runs last again. A chain thatupkept in the fork's order comes back reversed, becausepositiondoes not record which pairs were chains; the migration says so.Proof (
test/migrations/convert_rule_priority_to_position_migration_test.rb, 10 tests, 30 assertions). The test rebuilds a fork database's state: it addspriorityback and numberspositionA-Z as upstream's migration does. The three original tests (a conflict keeps its winner, every tie-break key reversed per family, down) are unchanged. New:1. "a rule matching a name an earlier rule wrote still runs after it". A renames
AMZN…toAmazon; B matchesamazonand sets Groceries. Under the fork the transaction ends up Groceries (asserted); after the migrationApplyAllRulesJobgives Groceries again. Against the old migration it came out uncategorised (nil): the reviewed bug, reproduced.2. "a rule matching a name a later rule rewrites still runs before it": the mirror case, same assertions.
3. "a conflict is still reversed when a chain holds one of its rules back": rename, then a rule on the account setting Dining, then the matcher setting Groceries. Expected order rename, matcher, middle, and Groceries.
4. "a chain through a compound condition is kept".
5. "every written field keeps a chain to the condition that reads it": category, merchant, tags and transfer, each with its reading condition.
6. "rules with no chain or conflict between them are reversed": two tag rules on the account.
7. "a chain that also conflicts keeps the chain", and the migration's report names the pair.
Fail-first: tests 1, 2, 4, 5 and 7 were written first and all failed against the old migration. Tests 3 and 6 came after, once the first mutation run showed nothing pinned the conflict edges or the tie-break; the mutations below prove them. Mutations, each on the committed migration and restored with
git checkout --:| Mutation | Result |
| --- | --- |
| Drop the mirror direction (
writes[j] & reads[i]) | test 2 fails || Ignore sub-conditions | test 4 fails |
| Drop conflict edges | test 3 fails |
| Tie-break forward (
ready.min) | test 6 fails || No report for an unkept conflict | test 7 fails |
| Tags not counted as a write | test 5 fails |
On real databases (run on the first version of this migration,
ab3f8a127, before the chain change; not repeated since).db:drop db:create db:migrateon an empty database runs every migration, mine last. A freshdb:schema:dumpmatches the committeddb/schema.rb, apart from how PostgreSQL 16 prints fiveARRAY[...]check constraints, which is cosmetic and unchanged here.main(8d4842986, schema2026_10_08_100000), seeded with two families' rules, thendb:migrateon this branch. It ran the 11 upstream migrations,20261006140000among them, then20261015090000.- Family A (Alpha p1, Zulu p2 older, unnamed p2 newer, Mike p3) came out Mike 1, unnamed 2, Zulu 3, Alpha 4.
- Family B (Bravo p1, Able p2) came out Able 1, Bravo 2.
-
prioritywas gone.db:rollbackrestored Alpha 1, Zulu 2, unnamed 3, Mike 4 and Bravo 1, Able 2, and migrating again succeeded.db:schema:loadfrom the pre-syncschema.rbcannot be used for this check. Schema load marks every migration file older than the schema version as run, upstream's20261006140000included, sopositionnever gets added. Real installs only record the migrations they actually ran, so they are not affected.Export/import. A pre-sync fork NDJSON export carries
priorityand noposition. Upstream's importer ignorespriorityand appends such rules in file order.Conflict resolutions (91 files)
Every file git reported as conflicted, grouped by how it was resolved.
Rules ordering (owner decision: option A, converge on we-promise/sure#4013)
| File | Resolution |
| --- | --- |
|
app/models/rule.rb| Upstream's:position,assign_next_position(advisory lock),ordered,update_positions!,active_rules_above,scope_for_transaction_ids,apply(scope:, claimed_ids:), publicmatching_scope. Retired the fork'spriorityscopeprioritised,assign_priority,move,MOVE_DIRECTIONS,apply_in_priority_orderand the@regex_matchesmemo. Kept the fork's text operators andRule::SafeRegex:matching_scoperesolves a regex condition's ids under the statement timeout (throughscope_for_transaction_ids, so no bind-per-id), andaffected_resource_count/total_affected_resource_countstill read a timeout as zero. ||
app/controllers/rules_controller.rb| Upstream'srequire_non_guest!,orderedindex,reorder,render_invalid_rule. Retiredmove, the priority sort and the sort/direction params. Kept the fork'sauto_categorize_estimatedelegating toFamily#auto_categorize_estimate(the batch suggestion page shares it).config/routes.rb: removed the fork'spatch :movemember route (merged cleanly, would have pointed at a deleted action). ||
app/jobs/apply_all_rules_job.rb| Upstream's (oneRule::Runnerpass,retry_on LockBusy). Retired the fork'sactive_only:/ignore_attribute_locks:keywords and its own advisory lock. ||
app/models/family/syncer.rb| Upstream'sApplyRulesJob.perform_later(family)(active rules, locks respected: the same inputs the fork passed). ||
app/models/financekit/downstream.rb| Same as the syncer. ||
app/views/rules/index.html.erb| Upstream's drag-to-reorder list. Removed the fork's sort selector and its "lower rule wins" hint, which merged cleanly above the conflict.app/views/rules/_rule.html.erb(merged cleanly with the fork's up/down arrows) taken as upstream's. ||
app/views/api/v1/rules/_rule.json.jbuilder| Upstream'spositionandstop_processing. ||
config/locales/views/rules/en.yml| Upstream'sorder_hintandreorder_rule. Removed the fork'ssort_,priority_hint,toggle_sort_direction,move_upandmove_down. Kept the fork'sstarts_with/ends_with/matches_regexoperator labels. ||
docs/api/openapi.yaml,spec/swagger_helper.rb| Upstream'spositionandstop_processing. ||
test/controllers/rules_controller_test.rb| Both new tests kept (the fork's cost-estimate test and upstream's "confirm says the active rules above run first"). Removed the fork's six priority/move tests. ||
test/controllers/api/v1/rules_controller_test.rb| Upstream's position assertions. ||
test/models/family/syncer_test.rb| Upstream's. ||
db/schema.rb| Version andrulestable per upstream plus the follow-up migration; theloanshunk keeps the fork's constraints (the fork has no down-payment or insurance columns, jaysbeekay/sure#184). Checked by migrating from scratch: the only difference from a freshdb:schema:dumpis how PostgreSQL prints fiveARRAY[...]check constraints. ||
app/models/family/data_exporter.rb,app/models/family/data_importer.rb,test/models/family/data_importer_test.rb| Upstream'sposition/stop_processingexport and import. Removed the fork'srules_priority_baseand the priority assignment (merged cleanly below the conflict) and its three import tests; also removed the fork's export test forpriorityintest/models/family/data_exporter_test.rb(upstream's export test assertsposition). ||
test/models/rule/priority_test.rb| Deleted: every test exercised the retiredpriority/move/ApplyAllRulesJob(active_only:)code. The behaviour it pinned is covered by upstream'sRule::RunnerTest(top rule wins, stop processing, failures do not stop later rules, one lock per family) and by the new migration test below. |The fork's own features, converged on upstream's reviewed versions
| File | Upstream PR | Resolution |
| --- | --- | --- |
|
app/models/security/split.rb(add/add),app/models/holding/portfolio_cache.rb,app/models/holding/reverse_calculator.rb| we-promise/sure#3850 | Upstream's (QTY_SCALErounding,split_factor_between,starting_portfolio). All three are now byte-identical to upstream. ||
test/models/holding/forward_calculator_test.rb,test/models/holding/reverse_calculator_test.rb| we-promise/sure#3850 | Upstream's added tests. ||
app/models/holding/cost_basis_tracker.rb| we-promise/sure#4033 | Upstream's comment. ||
app/models/balance_sheet/net_worth_velocity.rb,test/models/balance_sheet/net_worth_velocity_test.rb(add/add) | we-promise/sure#4083 | Upstream's (account_start_datesreads balances as well as entries). Identical to upstream. ||
app/models/portfolio/flow_classifier.rb,test/models/portfolio/flow_classifier_test.rb,test/support/portfolio_flow_test_helper.rb(add/add) | we-promise/sure#3557 | Code identical to upstream; kept the fork's header comments, which point atdocs/portfolio/methodology.mdand the contract gate that binds these test names. ||
app/models/investment_statement/totals.rb| we-promise/sure#4082 | Composed. Upstream's signed income (-SUM(amount), so a reversal or a charge labelled as income reduces it) on the fork's aggregation, which keeps its fork-only fees column,income_or_fee_sql, labels read fromPortfolio::FlowClassifierand the classifier's pending rule. ||
app/models/investment_statement.rb| we-promise/sure#4082 | Cache keytotals_query/v5(the fork was at v4, upstream at v2): signed income changes what the columns mean. ||
test/models/investment_statement_test.rb| we-promise/sure#4082 | Upstream's-120for the relabelled buy, and its new "income nets by sign" test. Its other three new tests duplicate fork tests of the same name and were not added again, and its duplicate private helpers were dropped (the fork's come fromPortfolioFlowTestHelper). || The 24 provider cards (
akahu,binance,brex,coinbase,coinspot,coinstats,enable_banking,fio,ibkr,indexa_capital,kraken,lunchflow,mercury,monobank,plaid,questrade,redbark,simplefin,snaptrade,sophtron,trade_republic,trading212,up,wise_items/__item.html.erb) | we-promise/sure#4046, we-promise/sure#4048 | Upstream's:visible_accounts:is required, the stale-rate lists are filtered to it, and the comments cite we-promise/sure#3630. ||
app/components/provider_sync_summary.rb,app/controllers/accounts_controller.rb,app/jobs/indexa_capital_activities_fetch_job.rb,app/jobs/questrade_activities_fetch_job.rb,app/jobs/simplefin_item/balances_only_job.rb,app/models/simplefin_item/syncer.rb,app/models/coinspot_item/sync_complete_event.rb,app/models/kraken_item/sync_complete_event.rb| we-promise/sure#4046, we-promise/sure#4050 | Comment only: upstream's issue reference. ||
app/models/enable_banking_item/sync_complete_event.rb| we-promise/sure#4044 | Upstream's: the panel is no longer streamed to the family. ||
test/controllers/accounts_controller_test.rb| we-promise/sure#4046, we-promise/sure#4048 | Upstream's comments and its two new partial-sharing tests; kept the fork's loan helpers (variable_rate_loan_account,on_schedule_loan_account, the extra-repayments helpers). ||
test/integration/trading212_item_broadcast_render_test.rb(add/add),test/models/kraken_item/sync_complete_event_test.rb(add/add),test/models/plaid_item/sync_complete_event_test.rb(add/add),test/models/ibkr_item/sync_complete_event_test.rb| we-promise/sure#4046 | Upstream's (passesvisible_accounts:; comments). ||
test/lib/tasks/simplefin_pending_cleanup_test.rb(add/add) | we-promise/sure#3557 | Upstream's; identical to upstream. ||
test/models/simplefin_item/importer_stale_unmatched_pending_test.rb(add/add) | we-promise/sure#3557 | Kept the fork-only negative test ("does not re-count an entry a previous sync excluded"). ||
app/javascript/controllers/sortable_list_controller.js(renamed from the fork'sreports_sortable_controller.js) | we-promise/sure#4013 | Upstream's. Itsurlandparamvalues already express the fork'surl/preferenceKey(param=preferences.<key>_section_order), so the fork's values fold into them.app/views/portfolios/show.html.erb(merged cleanly, still wired to the deletedreports-sortable) now usessortable-listwithpreferences.portfolio_section_orderand the Reports page's 800 ms hold;test/controllers/portfolios_controller_test.rband the fork's Reports defaults test assert the new attributes. ||
docs/api/rails_provider_generator.md| upstreamf715e06d5,e76057b43,4b1d282d9(the fork's jaysbeekay/sure#176 doc, as reviewed upstream) | Upstream's wording. |Composed: both sides kept
| File | Resolution |
| --- | --- |
|
app/models/account/market_data_importer.rb| Upstream's price windows (we-promise/sure#3888:window.start_date/window.end_date, replacing the fork's end-date logic) plus the fork'simport_provider_details(include_classification: true, include_constituents: true)and its comment. ||
app/models/market_data_importer.rb| Upstream's separateSecurity.online.find_eachdetails pass, calling it with the fork's classification and constituent flags. ||
test/models/account/market_data_importer_test.rb| Kept the fork's "asks for classification" test; took upstream's rewritten "caps a sold security at its closing trade" in place of the fork's older version of the same test. ||
app/models/security.rb| Kept the fork's taggings, constituents and classification-proposal associations next to upstream'ssplits. ||
app/models/plaid_account/processor.rb| Upstream'sBalanceErrorplus the fork'sas_ofreader (loan rate-change dating). ||
app/views/layouts/application.html.erb| The fork'sportfolio_nav_itemplus upstream's assistant item gated onassistant_enabled(we-promise/sure#4147). ||
app/views/properties/tabs/_overview.html.erb| Both: the fork'sUI::Account::CollateralPosition, then upstream's Chimnie valuation source and refresh button (we-promise/sure#4135). ||
test/controllers/properties_controller_test.rb| Both: the fork's collateral tests and upstream's Chimnie tests. ||
test/controllers/reports_controller_test.rb| Both: upstream's two new tests (the sortable id test, and "index provides the download toasts the desktop app shows", which jaysbeekay/sure#332 flagged as missing since jaysbeekay/sure#185 and now returns). ||
test/controllers/loans_controller_test.rb| Kept the fork's offset tests; added upstream's "a create that fails on the opening valuation still re-renders the form" and "a late create failure renders the loan's fields even when the form sent none" (we-promise/sure#3733). Both pass on the fork's loan engine. ||
test/models/account/provider_import_adapter_test.rb| Both: the fork's updated_at stamping test and upstream's three carry-forward tests, plus upstream's private helpers. ||
test/models/goal_test.rb| Both: the fork's milestone tests and upstream's colourless-ring test (we-promise/sure#4032). ||
test/models/snaptrade_account/activities_processor_test.rb| Both: the fork's duplicate-ticker test and upstream's option tests (we-promise/sure#3744). ||
test/models/trade_test.rb| Both includes, upstream's fee and preload tests. Four upstream tests share a name with the fork's tests of the same behaviour; the fork's versions are kept because they also assertrealized_gain_loss_unavailable_reason. |Loans (jaysbeekay/sure#184): fork side kept
| File | Resolution |
| --- | --- |
|
app/models/loan/payoff_chart.rb,test/models/loan/payoff_chart_test.rb(modify/delete) | Kept the fork's deletion, as jaysbeekay/sure#185, jaysbeekay/sure#232, jaysbeekay/sure#272 and jaysbeekay/sure#332 did. Nothing referencesLoan::PayoffCharton the merged tree. Known gap: upstream's edits to it (we-promise/sure#4006, the tooltip's principal/interest split) are not taken; the fork's own chart has had the same split since jaysbeekay/sure#209. ||
app/javascript/controllers/loan_payoff_chart_controller.js,test/system/loan_payoff_chart_test.rb| Fork's, byte-identical to forkmain. Upstream's versions drawLoan::PayoffChart's payload, which the fork does not produce. Upstream's new system test "the tooltip splits a scheduled payment into principal and interest" is therefore not carried; it is the only upstream test name in this range that this merge drops (see Dropped tests). |Other fallout from the merge
9082f803c). we-promise/sure#3790 refuses a zero, negative, NaN or infinite rate, both inExchangeRateand in a database check (20261006210000, which first deletes any such rows). The guards against such a rate stay inTradeandPortfolio::RealizedGains. Three fork tests used to store one to reach them, and now raised during setup. They now hand the guard its rate directly:-
Tradethroughpreloaded_exchange_rates;-
Portfolio::RealizedGains(the hub test and the Reports card test) through itsrates_by_datebatch.Mutating either guard to
return nil if rate.nil?fails all four of these tests (upstream's own test included).4ac18ac4e). Taking we-promise/sure#4082 intoTotalschanges what the dividends and interest columns mean. So the cache key moves to v5, methodology P24 states the sign rule and binds upstream's netting test, and P26 and its test name the new version.portfolio:verify_contract_coverage(41 + 18 rows) andloans:verify_contract_coverage(16 rows) pass. Mutating the two income sums back toABS(...)fails two tests.2da501fe2). The full suite at390d47330showed 2 failures, both silent interactions with no textual conflict. The first isAccountShareTest"removing a share expires that account's stale-valuation insight". The fork'sInsight.expire_stale_valuation_for!selected throughvisible, and we-promise/sure#4061 madevisiblealso hide a card about an account no longer shared with every member. So the expiry, which runs after the share is removed, found nothing. It now selectsstatus: [active, read]. A new test, "leaves an acknowledged stale-valuation insight acknowledged", pins the status bound. Mutations: reverting to.visiblefails the original test, and dropping the status bound fails the new one. Sibling grep:Insight.visiblehas no other writer in the fork (the mark-all-read inInsightsControlleris upstream's).821b548c5).Financekit::InboxTest"downstream work queues one ordered rules pass" countedApplyAllRulesJob. It now countsApplyRulesJob. A sibling grep found no other reference to the retired call shape.app/views/portfolios/show.html.erbmerged cleanly but still pointed at the deletedreports-sortablecontroller. It now usessortable-list(see the conflict table).jaysbeekay/sure#448's port (order A)
jaysbeekay/sure#384 merged as
6e97cdf05before this sync, so this PR carries the port, as jaysbeekay/sure#448's plan requires.eafa42835←f87a751af: the three restatements. On the merged tree, before the cherry-pick, these three failed exactly as jaysbeekay/sure#448 predicted. The value lines were[0, 1900],[0, 900]and[1000, 1900]where the old tests expected[1600, 1900],[600, 900]and[1600, 1900].8fc7f6aedalone. The equal-value test "a linked account whose reset anchor point equals the day's close still opens before the activity" failed withExpected: [1000, 1800] Actual: [1500, 1800]. The rewritten anchor-point unit test also failed ("even when its value differs from the close").948a0175e←8fc7f6aed:Balance::LinkedInvestmentSeriesNormalizer#resets_point_on?, used bynormalize, and byAccount::Chartable#value_point_before_activity?in place of comparing values.390d47330←1fb0df306: the normalizer test that pins the supported-start check.chartable_test.rbandlinked_investment_series_normalizer_test.rb: 41 runs, 0 failures.Mutations (jaysbeekay/sure#448's list; each restored with
git checkout HEAD --):| Mutation | Caught by |
| --- | --- |
| Chartable reads the reset by value (
close.nil? \|\| close.value != point.value) | the equal-value test and the anchor-point unit test (2 failures) ||
resets_point_on?drops the first-activity check | theresets_point_on?test, "keeps first point when inception comes from holdings", and the chartable "history starts at its holdings" test (3 failures) ||
resets_point_on?drops the supported-start check | theresets_point_on?test (1 failure) || The prepended point is not recognised (the
builder.balance_series.values.none?disjunct dropped) | the anchor-point unit test, which carries the coarse/prepended case (1 failure) |Migrations
Eleven from upstream, in order:
20260927142423fix Kraken trade entry signs20260927200000reset kinds of pending transfer matches20261003100000Lunchflow available-credit flag20261005120000tool callextra_content20261006140000rulesposition/stop_processing20261006210000and20261006210001: positive exchange-rate check. It deletes non-positive rates, then validates.20261008090000rescale Trade Republic bond prices20261008120000Trade Republic timeline cursors20261011090000Chimnie on properties20261011151000Sophtron balance sign override20260928100000_create_security_splitsis identical on both sides, so it is not new here.One fork-only migration:
20261015090000, above. It must run after20261006140000, and its timestamp guarantees that. NoGemfile,package.jsonor workflow changes are in the range.Dropped tests (jaysbeekay/sure#279 check)
test/andspec/file list against the pre-sync survey (tests-before.txt, 1,261 files). The only file removed istest/models/rule/priority_test.rb, a fork file retired with the priority code. 64 files are added.test "..."name in every test file this upstream range adds or modifies againstHEAD.- All but one of the names missing at
HEADwere already missing from forkmainbefore this sync: the loan controller, accounts, system-chart, goal and investment-statement tests removed by the jaysbeekay/sure#184 resolutions since jaysbeekay/sure#185. The jaysbeekay/sure#332 gap "the card preloads the rates its disposals need" also stays missing.- The one name this merge drops:
test/system/loan_payoff_chart_test.rb"the tooltip splits a scheduled payment into principal and interest" (we-promise/sure#4006). It drives upstream'sLoan::PayoffChart, which the fork does not have. The fork's chart has shown the same split since jaysbeekay/sure#209.jaysbeekay/sure#184 check
we-promise/sure#3639 and we-promise/sure#4088 are both still open and unmerged (checked 2026-10-15), so jaysbeekay/sure#184's reconciliation trigger has not fired. The loan files stay fork-side.
Known gaps
app/models/loan/payoff_chart.rband its test stay deleted, as in every sync since jaysbeekay/sure#185. Upstream's later edits to them (including we-promise/sure#4006) are not taken.Rule::Runnerkeys its advisory lock with MD5, as upstream wrote it. The fork moved its own rules lock to SHA-256 for Codacy (jaysbeekay/sure#243) and kept FinanceKit's on MD5 (jaysbeekay/sure#245). Both of those were non-cryptographic uses. This one is left as upstream has it.npm run lint) is clean.biome checkalso reports format differences in four changed controllers:- three are byte-identical to upstream (
category_select,plaid,sortable_list);-
time_series_charthas upstream's comment alignment from we-promise/sure#3906.They are left as upstream wrote them.
Local validation
Ruby 3.4.9, PostgreSQL 16 and Redis in private containers,
RAILS_ENV=test.bin/rails testat the exact head80ce7dfda: 13,507 runs, 62,505 assertions, 0 failures, 0 errors, 36 skips.821b548c5, under the cross-track suite lock: 13,500 runs, 62,487 assertions, 0 failures, 0 errors, 36 skips. The first run at390d47330had 2 failures (13,499 runs), both fixed by2da501fe2and821b548c5above.portfolio:verify_contract_coverageandloans:verify_contract_coverage: pass.bin/rubocop: 3,153 files, no offenses.bundle exec erb_linton the 97 ERB files this PR changes: no errors.npx biome lint: clean (see Known gaps for format).bin/brakeman --no-pager -q: 0 warnings (9 ignored, unchanged).Issues
Weekly sync per jaysbeekay/sure#118's "Staying in sync while building locally", duty 1. The jaysbeekay/sure#118 sync log can record it once this merges.
Closes #448
Closes #428
<!-- This is an auto-generated description by cubic. -->
<a href="https://cubic.dev/pr/jaysbeekay/sure/pull/464?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/jaysbeekay/sure/464?returnTo=https%3A%2F%2Fgithub.com%2Fjaysbeekay%2Fsure%2Fpull%2F464&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->