Add SPAC consolidated report with lifecycle tracking#164
Merged
Conversation
The ARRAY.map(Type.Literal) form left status/outcome/event_type inferring as never; TypeStringEnum (the repo's existing enum helper) fixes inference and lets the consumer-side casts in spacRollup and SpacRepo be removed.
…ac_tickers to full series Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PX4WhF4uDmZKdYiG2hFq6t
…ge, CLI guards - snapshot(): guarantee strictly-increasing history valid_from so two writes in the same millisecond can't collide on (cik, valid_from) and overwrite a just-closed snapshot (data loss); detect open row with == null. - buildSpacRow pick(): treat an explicit null patch value like an absent field so a newer filing that carries no value can't erase an existing non-null one. - recordIpo(): guard empty ticker array so it stores null, not '[]'. - sec spac report/history: reject non-numeric CIK args instead of querying NaN. - simplify deriveStatus (dead hasRegistration branch) and nextAsOf (dead arms). - add regression tests for the history collision and ticker non-clobber.
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
Introduces a comprehensive SPAC (Special Purpose Acquisition Company) consolidated reporting system that tracks the full lifecycle of SPACs from registration through IPO, deal announcement, merger completion, or liquidation. The system uses append-only event and deal tables to derive a mutable consolidated row with out-of-order filing replay protection.
Key Changes
SPAC Schema & Storage (
SpacSchema.ts,SpacDealSchema.ts,SpacEventSchema.ts,SpacHistorySchema.ts)spacrow (one per CIK), append-onlyspac_dealandspac_eventtables, and versionedspac_historysnapshotsspac_*), post-merger (post_merger_*), and current (current_*) names/SIC/tickersregistered→ipo→searching→deal_announced→proxy→completed(orliquidated/withdrawn)ipo_proceeds,trust_amount,pipe_amount,total_redemption_amountRow Rollup Logic (
spacRollup.ts)buildSpacRow()derives the consolidated row from append-only deals/events plus a filing-sourced patchas_ofguard)Report Writer (
SpacReportWriter.ts)recordRegistration()andrecordIpo()are the primary entry points from form processorsvalid_fromForm Processor Integration
Form_S_1.storage.ts: detects SPAC registrations (SIC 6770) and callsrecordRegistration()Form_424.storage.ts: detects priced 424B4s with SPAC unit terms and callsrecordIpo(), extracting tickers from the offering modelCLI Command (
commands/spac.ts)spac report <cik>assembles consolidated report: row + deals + events + sponsor/underwriter countsspac history <cik>shows versioned snapshots with valid_from/valid_to windows--format jsonfor programmatic accessDependency Injection (
DefaultDI.ts,TestingDI.ts)InMemoryTabularStorageTests
spacRollup.test.ts: unit tests for row derivation logic (status transitions, deal selection, event aggregation)SpacReportWriter.test.ts: integration tests for registration→IPO flow, out-of-order replay, history coherenceForm_S_1.spac-report.test.ts: S-1 registration detection and row creationForm_424.spac-report.test.ts: 424B4 IPO detection with ticker extraction and SPAC-specific unit termsSpacRepo.test.ts: repository query orderingspacStorage.smoke.test.ts: round-trip persistencecommands/spac.test.ts: CLI report assemblyNotable Implementation Details
https://claude.ai/code/session_01PX4WhF4uDmZKdYiG2hFq6t