Extension registries + extract accredited-portal to embarc-data#205
Open
sroussey wants to merge 13 commits into
Open
Extension registries + extract accredited-portal to embarc-data#205sroussey wants to merge 13 commits into
sroussey wants to merge 13 commits into
Conversation
…egistry Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
Replace the static RESOLVER_IDS array and hardcoded per-kind switches with the runtime ResolverExtensionRegistry everywhere. ResolverId becomes a runtime-validated string; coverage and drop-previous dispatch through the registered kind's closures. Wire registerSecResolvers() into the CLI bootstrap and into the tests that enumerate resolver kinds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
…on bootstrap setupAllDatabases() -> bootstrapComponentVersions() now enumerates the ResolverExtensionRegistry, and this path also runs from `init` (which skips the preAction hook that calls registerSecResolvers). Register idempotently here so resolver component-version rows are seeded on every setup path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
…le-instance DI/schemas
…data) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
- databaseExtensions: add registerDatabaseSetupHook/runDatabaseSetupHooks; setupAllDatabases runs them after EnvToDI/Sqlite.init so a downstream package's tables + resolver kinds materialize on the `init` path too (which bypasses the CLI preAction hook), not only `db setup`. - ResolverCoverage: split the coverage guard so a non-family resolver kind without a coverage closure is no longer mislabeled "family-tier"; wrap the over-length import. - barrel: export registerDatabaseSetupHook, setupAllDatabases, Sqlite, computeResolverCoverage (needed by the downstream init-path + dispatch tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM
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.
What & why
@workglow/secshould hold only SEC-sourced data and the logic that produces it. The accredited-investor portal feature — curated portal records + fingerprint signals, plus Form D → portal attribution (a value computed on top of SEC data) — is extracted into the private embarc-data superset (companion PR). This PR is thesechalf.To make that clean and reusable (this is the first of many such extractions), sec gains two general extension registries that its own code uses too:
registerResolverExtension(src/resolver/resolverExtensions.ts) — every resolver kind registers through it: sec's ownperson/company/sponsor-family/underwriter-family(viaregisterSecResolvers), plus downstream kinds like embarc-data'sportal-attributor. It backs the unifiedversion resolver <kind>ceremonies (coverage+drop-previousdispatch to the registered kind),componentRegistry, andresolverIds.ResolverIdbecomes a runtime-validated string.registerDatabaseExtension+registerDatabaseSetupHook(src/config/databaseExtensions.ts) — downstream repo tokens are created/dropped bydb setup/db resetafter the built-in SEC tables, and the setup hook fires insidesetupAllDatabases()(afterEnvToDI) so a superset's tables + resolver kinds also materialize on theinitpath, not justdb setup.Changes
componentRegistry,ResolverCoverage,ceremoniesdispatch by registry, no hardcoded per-kind branches).DatabaseExtensionRegistry+ setup-hook wired intosetupAllDatabases/resetAllDatabases.src/index.ts) with the DI/versioning/observation/normalization internals a downstream feature needs — routed through the barrel so a consumer shares sec's singleglobalServiceRegistryand TypeBox instance.processFormD(ingestion now only produces observations; attribution is a batch pass in embarc-data).sec db setupno longer creates the three portal tables.Testing
tscclean;bun run buildclean.bun i→bun run build→bun test) green.Design docs
prd/docs/superpowers/specs/2026-07-17-accredited-portal-extraction-to-embarc-data-design.mdprd/docs/superpowers/plans/2026-07-17-accredited-portal-extraction-to-embarc-data.mdCompanion: embarc-data
accredited-portalbranch (hosts the moved feature).🤖 Generated with Claude Code
https://claude.ai/code/session_01SN7APmki7GFHYYyhBd8ZFM