Skip to content

fix(forms,storage): Crowdfunding history on stale replay + CFPORTAL/A inheritance + docs#135

Open
sroussey wants to merge 3 commits into
mainfrom
claude/wonderful-hypatia-tyiymq
Open

fix(forms,storage): Crowdfunding history on stale replay + CFPORTAL/A inheritance + docs#135
sroussey wants to merge 3 commits into
mainfrom
claude/wonderful-hypatia-tyiymq

Conversation

@sroussey

Copy link
Copy Markdown
Contributor

Summary

Three high-priority fixes to the EDGAR form processors and docs.

Fix A — Always write CrowdfundingHistory; gate only the mutable update on staleness

A back-catalog replay of an older Form C filing previously skipped both the
mutable row update and the history snapshot, so the older filing silently
disappeared from the time series even though it is still real data.

  • src/storage/portal/CrowdfundingTemporalRepo.ts: add a third positional
    options: { skipMutableUpdate?: boolean } | undefined parameter to
    saveCrowdfundingWithHistory. When set, append a closed-immediately
    CrowdfundingHistory row (valid_from === valid_to) and skip the mutable
    write and the ChangeLog entry.
  • src/sec/forms/exempt-offerings/Form_C.storage.ts: remove the
    if (!isStale) wrapper. Always build the crowdfunding payload (with the
    existing ?? existing?.… merge fallbacks so the snapshot is meaningful)
    and always call the temporal repo, passing skipMutableUpdate: isStale.

Fix B — CFPORTAL/A field inheritance on absent sections

A CFPORTAL/A amendment may omit identifying sections the registered portal
still carries (nameOfPortal, otherNamesAndWebsiteUrls); the old logic only
inherited those for CFPORTAL-W and would null them out on an amendment.

  • src/sec/forms/portal/Form_CFPORTAL.storage.ts: treat absence (undefined
    name; no matching alias entry) as "inherit from existing"; a fresh CFPORTAL
    with no existing row keeps fields null.

Fix C — Remove stale CLAUDE.md "Known gap" paragraph

The crowdfunding tables now persist progress_update and nature_of_amendment
(see CrowdfundingSchema columns and Form_C.storage.ts which populates
them), so the "Known gap" note in CLAUDE.md is no longer accurate.

Test plan

  • bun test src/storage/portal/CrowdfundingTemporalRepo.test.ts — 4/4 pass (includes a new focused unit test that skipMutableUpdate: true writes a closed history row, no mutable row, no ChangeLog).
  • bun test src/sec/forms/exempt-offerings/Form_C_postoffering.pipeline.test.ts — 19/19 pass (includes two new tests: stale older filing writes a closed history row without regressing the mutable row; fresh forward filing leaves the open history record open).
  • bun test src/sec/forms/portal/Form_CFPORTAL.storage.test.ts — 3/3 pass (includes a new test that a CFPORTAL/A-shape parse with deleted identifying fields preserves the seeded name/brand/url).
  • bun test src/sec/forms/exempt-offerings — 162/162 pass.
  • bun test src/sec/forms/portal — 6/6 pass.
  • bun run build — clean.

https://claude.ai/code/session_017TXwbp2GD6jvXrELz6msZW


Generated by Claude Code

claude added 3 commits June 11, 2026 08:28
Stale Form C replays (older filing_date than the current mutable row)
previously skipped both the mutable update and the history snapshot,
silently dropping the older filing from the time series. Add a
skipMutableUpdate option to saveCrowdfundingWithHistory that writes a
closed-immediately (valid_from === valid_to) history snapshot without
touching the mutable row or ChangeLog. Form C now always builds and
writes the snapshot, gating only the mutable update on staleness.

https://claude.ai/code/session_017TXwbp2GD6jvXrELz6msZW
…g portal row

A CFPORTAL/A amendment may omit identifying info (name, alias, URL) the
registered portal still carries; the old logic only inherited those on
withdrawals and would null them out on amendments. Treat any absent
field as "inherit from existing", so partial amendments preserve the
registered identity. Fresh CFPORTAL filings with no existing row stay
null.

https://claude.ai/code/session_017TXwbp2GD6jvXrELz6msZW
The crowdfunding tables now persist progress_update and
nature_of_amendment (see CrowdfundingSchema columns and Form_C.storage
which populates them), so the "Known gap" note is no longer accurate.

https://claude.ai/code/session_017TXwbp2GD6jvXrELz6msZW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants