fix(forms,storage): Crowdfunding history on stale replay + CFPORTAL/A inheritance + docs#135
Open
sroussey wants to merge 3 commits into
Open
fix(forms,storage): Crowdfunding history on stale replay + CFPORTAL/A inheritance + docs#135sroussey wants to merge 3 commits into
sroussey wants to merge 3 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 positionaloptions: { skipMutableUpdate?: boolean } | undefinedparameter tosaveCrowdfundingWithHistory. When set, append a closed-immediatelyCrowdfundingHistoryrow (valid_from === valid_to) and skip the mutablewrite and the
ChangeLogentry.src/sec/forms/exempt-offerings/Form_C.storage.ts: remove theif (!isStale)wrapper. Always build thecrowdfundingpayload (with theexisting
?? 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/Aamendment may omit identifying sections the registered portalstill carries (
nameOfPortal,otherNamesAndWebsiteUrls); the old logic onlyinherited those for
CFPORTAL-Wand would null them out on an amendment.src/sec/forms/portal/Form_CFPORTAL.storage.ts: treat absence (undefinedname; 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" paragraphThe crowdfunding tables now persist
progress_updateandnature_of_amendment(see
CrowdfundingSchemacolumns andForm_C.storage.tswhich populatesthem), so the "Known gap" note in
CLAUDE.mdis no longer accurate.Test plan
bun test src/storage/portal/CrowdfundingTemporalRepo.test.ts— 4/4 pass (includes a new focused unit test thatskipMutableUpdate: truewrites 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 aCFPORTAL/A-shape parse withdeleted identifying fields preserves the seededname/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