You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

3.0 KiB

Upstream broker import assessment

Base: official ghostfolio/ghostfolio main at 23312d192. The NG integration worktree and its commits remain untouched. No root CONTRIBUTING.md, PR template or governing AGENTS.md exists in this checkout; DEVELOPMENT.md and the existing NestJS import/validation/security patterns were reviewed.

The existing /import endpoint accepts Ghostfolio accounts, activities, profiles, tags and platforms and offers dryRun. Activity creation uses Order with BUY, SELL, DIVIDEND, FEE, INTEREST and LIABILITY. Commission is fee; there is no tax field, deposit/withdrawal activity or NG cash ledger. Account balances are separate checkpoints. The existing importer validates before writes but does not provide an atomic broker provenance transaction. Its heuristic duplicate matching cannot replace stable account-scoped broker identities.

Reuse the NG Directa parser, anonymous fixtures and strict compatible-cost rules. Reuse only small listing-proof helpers and the existing Yahoo provider for discovery/quotes, without importing the NG ETF-enrichment system. Add a generic broker registry, planner, preview digest and a dedicated atomic writer, preserving future-dated activity tagging and portfolio invalidation. New broker parsers will implement the adapter contract rather than edit persistence.

An additive broker provenance table is justified for overlapping-file deduplication, corrected sources and edited/deleted output detection. It will store hashes, source dates and references to activities, never the raw statement, account name or transaction references. It is not a cash ledger. Account deletion removes provenance; activity deletion retains a tombstone so reimport cannot silently recreate it. Generic Ghostfolio JSON backups do not carry this table, a documented cross-installation limitation.

Supported scope: tax-free BUY/SELL with reliably attached trading commissions, and dividends without withholding. Taxes are not fees: any group with withholding is blocked as a complete group. Deposits, withdrawals, stamp duties and standalone taxes are explicitly unsupported. A partial import requires explicit whole-group exclusions and separate acknowledgement. It will not update account balances or claim a complete cash reconciliation.

Open PR searches for Directa and import adapters found no matching active implementation. The broad broker-import search found #8462 (numeric-symbol validation), which this work does not duplicate. Related issues #4139 (listing/source currency) and #7728 (account-scoped duplicates) inform currency and identity safeguards. Related discussion #6004 requests an extensible native CSV importer; #6714 discusses broker plugins. This implementation offers an initial adapter contract, not a runtime plugin loader. NG's successful 356-row qualification is prior art, not proof that this upstream implementation passes; validation will run separately against upstream's schema and model.