Skip to content

Company and Name Frequency read the raw capture (Issue 20 L4) - #905

Merged
paulananth merged 22 commits into
mainfrom
claude/company-source-retirement
Oct 11, 2026
Merged

paulananth merged 22 commits into
mainfrom
claude/company-source-retirement

Conversation

@paulananth

@paulananth paulananth commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Company and Name Frequency read the raw capture; company_source.py retired (Issue 20 L4, draft)

Ticket (.planning/workstreams/whole-source-census/TICKET.md, Issue 20 L4).

What

  • Name Frequency counts the SEC population from the receipt-bound raw capture through rules/sources/sec.submissions.company/census-raw.yaml (each main document's cik, name, formerNames[].name), not landed parquet. A switched-on matching cascade is refused until a configured cascade reading exists (today's policy has it off).
  • Company preparation (prepare_company_bundle) reads the raw capture through the registered workers in-process: main documents by receipt key (census-main.yaml, 1–2 CIKs a unit), one census read narrowed to the bundle's name keys, one exchange-catalog read, combine-census.yaml per unit. Each record names its bronze document (_origin.bronze). verify_company_bundle rebuilds the records from every combine worker.
  • Batch cut: the bundle is cut as mdm.prepare cuts since MDM batches never fail on size at the end of a run #906 (at most limits.BATCH_RECORDS records and, past the first, limits.BATCH_RECORD_BYTES), through one shared limits.batches. It writes records.{n}.jsonl, one consumer, batch ids company:{bundle}:{n}, checkpoints n/n+1, one publication key.
  • Retired: edgar_warehouse/mdm/clean/company_source.py, the five landed contracts (landed-preparation.yaml, landed-address.yaml, census-landed-company.yaml, census-landed-former.yaml, combine-landed.yaml), the landed-only qualification scripts and their tests. The governance constants (SOURCE_CODE, CONTRACT, FIELDS, POLICY, …) live in mdm/clean/sec_company.py.
  • CLI: mdm name-census and mdm prepare-clean-company take --capture, --documents, --population.
  • Tests: tests/mdm/test_clean_company_preparation.py (15, on a raw capture fixture from tests/support/sec_capture.py); the installed-bundle caller test prepares from a raw capture and compares with the checkout.
  • Docs and skills: docs/specs/clean-mdm/local-operations.md, docs/specs/mdm/policy-language.md, the data-onboarding skill (FIELDS's home).

Evidence

Check Result
Company main reading, whole capture, vs the retained loader 76,230 documents, 76,230 Company rows, 8,065,661 filing rows, all equal
Name Frequency from raw vs cm27 census.json 43,338 filers, 43,245 entries, 0 differences
cm27 chunks 1–7 prepared from raw vs the landed bundles 6,726 rows equal, except _origin, last_synced_at and the census digest (by design)
Chunk 1 mastered, raw vs landed 919 Companies, 919 bindings, 47 reviews, golden fields equal
Affected tests MDM, unit, engine and architecture via testmon: 2,575 passed; locally only, 15 tests need jq and one starts Postgres with docker (CI has both)

Approved by the operator: Company main reading 18903901…, census-main reading f2ee7a31…, Dataset Contract 472295c9… ("all approved", 2026-10-10 19:25 ET; the contract's approval holds if the full proof matches), census-raw reading 96688655… ("approved, yes", 2026-10-11).

Full proof (passed)

The installed empty-store proof on the 7 raw-capture bundles with the batch cut, 12:13–12:42 ET 2026-10-11 (26.5 min): 6,414 Companies; GLEIF 3,716 records, 3,052 bound (2,861 by name and jurisdiction, 191 by name and postal code); bindings 9216cc18…, equal to the checkout replay; a killed worker's item recovered on attempt 2; the second pass changed nothing. Report .planning/workstreams/whole-source-census/evidence/installed-company-proof-raw-20261011.json.

Three-axis review (Standards, Spec, GoF) done; fixes in 7c9cb363 change no bundle byte (six real Companies prepared before and after give the same bundle).

Deferred (on the ticket): retained worker inputs (about 400 MB per ~960 Companies) before the first whole-capture run (20c); the landed-era provenance names in the approved contract go with the next SEC mapping.

🤖 Generated with Claude Code

Aneena Ananth and others added 14 commits October 11, 2026 06:47
--limit 0 reads every receipt-pinned submission; --shard k/n splits them
across processes; each source.read unit removes its own artifacts once
verified. A 10-submission shard gives the same evidence as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
… loader

All 76,230 pinned submissions, 76,230 Company rows and 8,065,661 filing rows,
every main table equal (4 shards, 17:51-18:43 ET). The ticket records the
landed-parquet finding and the remaining L4 parts; L6 closes with #904.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
One Company on the raw path costs 0.57 s with a census read per chunk; mastering
one bundle as one batch or one record per batch gives identical results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
…capture

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
… capture

Name Frequency counts a population of main submissions documents named by
receipt key, each read from the capture through the new census-raw.yaml
(two a unit) and checked against its receipt; the switched-off cascade is
refused when on. Company preparation reads its bundle's documents, the
census and the exchange catalog through census-main, census, catalog and
combine-census, every worker verified and retained. Both commands take the
capture in place of landing manifests.

Still in progress: the landed preparation tests are being rewritten for the
raw capture; the whole-population census and chunk comparisons are running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
The raw census equals cm27's census.json on 43,338 filers and 43,245
entries (entries, GLEIF, normalizers and version equal; 24 minutes).
The SEC capture fixture moves to tests/support/sec_capture.py. The
operator approved the Company main and census-main readings and the
Dataset Contract (2026-10-10 19:25 ET).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
verify_company_bundle re-built records from the last combine worker
only; it now re-builds them from every unit's combine output, with each
record's bronze origin, through the same helpers preparation uses.
cm27 chunk 1 from the raw capture: 966 rows equal to the landed ones;
mastered, 919 Companies, 919 bindings, 47 reviews, golden fields equal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
Fourteen tests prepare from a receipt-bound raw capture; the landed
preparation tests and their landed oracle are removed (equivalence is
held by the recorded whole-capture and chunk evidence). The installed
caller test prepares from a raw capture too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
The SEC Company governance constants live in mdm/clean/sec_company.py,
read by preparation and the tests. company_source.py, the five landed
contracts, the landed qualification scripts and the landed oracle tests
are deleted; the operations spec and the data-onboarding skill describe
the raw-capture preparation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
…harness

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
…d pipeline deferred to 20c

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFKdv4nqKXKM9d5Cf2hEFk
@paulananth
paulananth force-pushed the claude/company-source-retirement branch from 5fc0da6 to 8f3b0bb Compare October 11, 2026 10:48
Aneena Ananth and others added 8 commits October 11, 2026 09:06
A Company bundle held its up to 1,000 records in one batch (about 1.4 MB
for a real cm27 chunk). It is now cut by the same rule as mdm.prepare
(#906): at most limits.BATCH_RECORDS records and, past the first record,
limits.BATCH_RECORD_BYTES. The cut has one home, limits.batches(rows,
encode), used by both creators (GoF consult: extract one function, no
pattern).

The bundle writes records.{n}.jsonl, one consumer per bundle, batch ids
company:{bundle}:{n}, checkpoints n/n+1 and one publication key for every
batch. verify_company_bundle rebuilds the records from the workers and
compares every batch file with the same cut. The 1..1000 bound on the
documents list reads limits.BATCH_RECORDS.

Tests: the preparation tests read every batch; a new test cuts a bundle to
one record per batch and checks checkpoints, one consumer, one publication
key, verification and equal records; the limits tests call limits.batches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mes deferred to the next SEC mapping

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, dead code

Three-axis review (Standards, Spec, GoF) of #905:
- The raw capture was read twice (receipts, the bronze key check, the CIK
  from a key, the execute-then-verify of a source.read unit), and Company
  preparation imported Name Frequency's private helpers. One module,
  mdm/clean/raw_capture.py, now holds them; both callers use it.
- Company preparation refuses a batch file over limits.RECORDS_FILE_BYTES
  and a manifest over limits.MANIFEST_BYTES, as mdm.prepare does. The 32 MB
  manifest bound, written in three places, is limits.MANIFEST_BYTES.
- Dead code: the unused SourceRejected import and CATALOG_BYTES, a wrong
  noqa, write_name_frequency's unused policy parameter. ZERO is named
  CENSUS_DIGEST; the population bound is a named constant.
- The custom-parsing experiment compared configuration with
  company_source.py and gleif_source.py, both retired; it is removed and the
  dated results note says so. The source-contract spec cites source.yaml
  for the identifier example; the CLI help no longer says 1..1000; the
  local-operations doc names the capture folder one way.

Equal output: six real Companies prepared with f1508d9 and with this
commit into the same folder give the same bundle byte for byte. 82
preparation, Name Frequency, limits, worker-artifact and engine tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6,414 Companies; GLEIF 3,716 records, 3,052 bound; bindings 9216cc18, equal to the checkout replay; recovery on attempt 2; the second pass changed nothing (26.5 min). Report evidence/installed-company-proof-raw-20261011.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paulananth
paulananth marked this pull request as ready for review October 11, 2026 16:48
@paulananth
paulananth merged commit 25c9845 into main Oct 11, 2026
6 checks passed
@paulananth
paulananth deleted the claude/company-source-retirement branch October 11, 2026 18:00
paulananth added a commit that referenced this pull request Oct 11, 2026
…909)

* Company rules declare only runnable targets (Issue 20 20c)

The Company rules file declared a 12-step `company` target whose steps
named six operations, four of them Company-named (`company.expand`,
`company.silver`, `company.prepare`, `company.publish_expand`), none a
registered worker profile. Control validates only the target a run
selects and every test selected `capture`, so it was never checked or
run. Company preparation already reads the raw capture through the
configured `source.read` and `source.combine` workers (#880, #905), and
the `mdm` target merges its bundles.

- Delete the dead target; capture returns with the configured capture
  worker (L8). The mastering contract is unchanged.
- A unit test fails when any declared target in any rules source or
  pipeline names an unregistered worker profile.
- Rewrite docs/company-only-acquisition.md to today's route.
- Issue 20: 20c's checklist, with acquisition deferred to L8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address the 20c review: honest partial checklist, stale docs

- Issue 20: 20c is partial. Company preparation as Bookkeeping steps is
  its open part; planning and the attempt cap go to L8; the acquisition
  block stays as L8's feed authority.
- source-evidence spec and the bookkeeping and change-journal skills no
  longer say the Company route captures from SEC.
- The Company route keeps its recovery commands.
- Test imports at module level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Aneena Ananth <aneenaananth@MacBook-Air.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
paulananth pushed a commit that referenced this pull request Oct 11, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paulananth added a commit that referenced this pull request Oct 11, 2026
#913)

* Issue 20: #909 merged; Company preparation waits for Codex's join port

20c: #909's digest, review and merge recorded. Company preparation as
Bookkeeping steps waits for Codex's Rust join port (operator's ruling),
with the measurement: a whole-census reading is 17 MB and costs 0.68 s per
combine call against 0.008 s narrowed, about 11 more minutes per bundle; the
remaining gap is a fan-in input in Bookkeeping. L7 waits: mdm_merge.py is
in Codex's open Rust merging work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Issue 20: L4 done (#905); L7 callers rechecked

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Issue 20: correct a time stamp to the clock

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Aneena Ananth <aneenaananth@MacBook-Air.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
paulananth added a commit that referenced this pull request Oct 11, 2026
* Skill audit: skills state today's Company and GLEIF status

data-onboarding, refining-rules, READING.md and COMBINING.md no longer call
the installed proof, whole-capture equivalence and the older readers' deletion
open (#901, #904, #905, #907); they name what is open (in-process Company
preparation, adapters.py, capture). Prose says Name Frequency, file names
stay. The handoff's finished lines are ticked with evidence.
data-platform/SKILL.md waits for Codex's responsibility-map branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Skill audit: review fixes; one open-work list

READING.md and COMBINING.md: remaining census prose says Name Frequency,
stale status passages state today, a dated 2026-10-11 qualification
section, the retired builder and reader named. The open-work list lives in
data-onboarding; refining-rules points to it (GoF finding).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Aneena Ananth <aneenaananth@MacBook-Air.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant