Add comprehensive reference documentation for SPAC, extraction, identity, fetch, and eval - #328
Merged
Merged
Conversation
CLAUDE.md had grown to 3,062 lines / 197KB — loaded in full at the start of
every session, and mostly not about how to work in the repo. It was a running
log of extraction findings, corpus measurements and bug retrospectives, with
the actual conventions scattered between them.
CLAUDE.md is now 295 lines: overview, commands, packaging, architecture layers,
the cross-cutting rules that apply to any change, env vars, and conventions.
The rest moves to docs/, condensed, and is read on demand:
docs/fetch-and-storage.md fetch layer, EDGAR rate-limit ladder, Feed
tarballs, db setup/reset schema passes
docs/extraction.md models, dead letters, per-extractor sections,
segmentation, backfill
docs/identity.md observation/canonical/link/junction tiers,
normalizers, versioning, re-key ceremony
docs/spac.md lifecycle model, proxy gate, deregistration,
candidate screen
docs/eval.md eval harnesses, scoring, golden truth
Total is 2,701 lines against 3,062, so this is mostly relocation plus about
12% trimming — the point is what a session loads by default, which drops ~90%.
Removed rather than moved: prose restating what a function's own comments
already say. The dead-letter reason codes each carry their rationale in
ExtractionDeadLetterSchema.ts, so the doc now lists the vocabulary and points
there.
Corrected along the way: ExtractionDeadLetterSchema.ts is in
src/storage/dead-letter/, not src/storage/versioning/.
No rule or measurement was lost; the identifier sweep over the old file leaves
only code-level names their own comments cover.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZS3ko2CqaJY9tcWdKfakg
Rebasing onto main surfaced two claims the condensed docs had inherited from the pre-rebase CLAUDE.md and that are now wrong: - The in-job retry loop is gone. Retries throw RetryableJobError with retryDate and re-enter through the queue, so each one re-claims Concurrency + EvenlySpaced + the cluster RateLimiter. retrySpread() no longer exists anywhere in src, so the section documenting its jitter, the deterministic backoffDelay and the cap-then-spread ordering described removed code. Replaced with why the loop was removed, so it does not get re-added. - SEC_FETCH_MAX_PER_SEC and SEC_FETCH_MAX_CONCURRENT both default to 4 now (were 8 and 16), and the concurrency cap binds at one second of latency rather than two. Also: signalSecFetchThrottle's return now feeds RetryableJobError.retryDate, and a blocked job throws rather than sleeping the cooldown while holding its limiter token. Verified against src/config/Constants.ts and src/task/fetch/SecFetchJob.ts rather than against main's prose. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZS3ko2CqaJY9tcWdKfakg
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
This PR adds five new reference documentation files covering major subsystems of the SEC CLI tool. These docs provide detailed technical references for developers working with the codebase, complementing the existing CLAUDE.md project conventions guide.
Changes
docs/spac.md (678 lines): Complete reference for the SPAC lifecycle model, including:
spacconsolidated report and its append-only source tables (spac_deal,spac_event)docs/extraction.md (594 lines): Reference for the AI extraction pipeline:
docs/identity.md (420 lines): Reference for observation, resolution, and identity linking:
EntityObserverentry point and resolver dispatchdocs/fetch-and-storage.md (397 lines): Reference for the fetch layer and database setup:
SecCachedFetchTaskandresponse_typehandlingSecFetchFileOutputCacheand cache miss detectiondocs/eval.md (341 lines): Reference for model comparison harnesses:
sec eval extractfor comparing models on correctness, speed, and costsec eval s1for S-1 section extraction evaluationsec eval unit-termsfor offering terms evaluationCLAUDE.md (modified): Reduced from 3005 to 252 lines by moving detailed subsystem documentation to dedicated reference files while retaining project overview, command reference, and key architectural notes.
Implementation Details
These docs are extracted from detailed inline comments and design specs in the codebase and the PRD repository. They serve as the authoritative reference for:
The docs are structured to be both readable as a narrative and scannable as a reference, with tables, code examples, and cross-references between related sections.
https://claude.ai/code/session_01AZS3ko2CqaJY9tcWdKfakg