Living document. Last updated 2026-07-28. Latest version at
mars_feed/WELCOME_TO_THE_MANDATE.md (source of truth) and
kee.staticpipe.com/mars/welcome-to-the-mandate.html (shareable render).
For: teams that have been running independently and now need to integrate with the MARS platform. If your work touches a company, person, deal, filing, or any structured entity — this doc applies to you.
How to read this: the contracts section is non-negotiable. Every new vertical accepts them by sending the acceptance note on team-mail. Everything else is context you need to be productive.
MARS is the shared platform underneath every kscope data product.
Verticals (reit / bios / flare / credit / lp_data / insurance / signals /
prospects / insider / donor / sedar / sections / crown / ...) all write
to the same canonical entity substrate under mars.*_v2 in Postgres.
companies_v2. One canonical row per real company, UUID
company_id. Every vertical writes here through a single mint API.persons_v2. Same shape for real people.investors_v2, institutions_v2, funds_v2, advisors_v2.
Same shape for the other entity kinds.funding_deals_v2,
merger_deals_v2, real_estate_deals_v2, private_credit_deals_v2,
thermal_events_v2, form_4_transactions_v2, signals_v2, ...)
but every row FKs back to the shared entity canonicals.The moat is the entity graph across all verticals. Not any single
vertical. The reason cross-vertical queries work — "who worked at Merrill
now runs an RIA managing > $1B AUM," "was the target of this merger
raised on private credit first," "insider sold days after Form D close"
— is that every vertical writes to the same company_id / person_id.
Non-negotiable. Full text in mars_feed/MARS_PLATFORM_CONTRACTS.md.
Summary:
company_id. Mint via mars_entity_mint HTTP API.
Never mint into companies_v2 directly.integrity_tier on every deal / event row. verified / vouched
/ warn. Consumers filter IN ('verified','vouched').funding_stage_mapping.py / industry_mapping.py.*_v2 deal/event table. Namespaced (real_estate_deals_v2,
credit_bankruptcy_filings_v2, etc.). Not on the shared canonicals.mars.*_v2 in Postgres.health.py email. If it's broken, the health check must fire.s3://kscope-team-mail/{slug}/inbox/. No Slack, no direct email for
coordination.CONTRACT.md + SCHEMA.md + SOURCES.md + README.md + CLAUDE.md
(ops guide). See bios_pipeline/ or reit_pipeline/ for the shape.Full text: https://kee.staticpipe.com/mars/platform-contracts.html
(source: mars_feed/MARS_PLATFORM_CONTRACTS.md).
How you accept: send an acceptance note from your team-mail slug to
mars. That's the handshake.
The most common bug in the mars ecosystem is a vertical writing a
duplicate entity because it didn't check for matches first. The
MINTING_ENTITIES.md doctrine (in mars_feed/) covers all 5 canonical
tables. Full details there; the 5-rule discipline:
companies_v2.name_variants[] is populated
with historical aliases (Facebook → Meta). Check GIN-indexed
@> lookup BEFORE trigram match.is_sentinel_name / is_role_not_name
/ is_placeholder_crd — never mint "Unknown Target" / "TBD" / "N/A" /
"CEO" as a name.identity_decisions_v2. Decision + methodology
+ metadata. Reversible.Full text: https://kee.staticpipe.com/mars/minting-entities.html
(source: mars_feed/MINTING_ENTITIES.md).
For persons specifically, see bios_pipeline/MINTING_PEOPLE.md — 10
persons-side rules with drop-in code.
Use the mint API, don't hand-write minting logic.
POST https://mint.staticpipe.com/companies (or /persons)from mars_feed.mint import mars_entity_mintThe rule: Qwen is reliable whenever the answer is IN THE TEXT you give it. Grok / Brave are only needed when the decision requires WORLD KNOWLEDGE.
Concretely:
| Task | Model | Cost |
|---|---|---|
| Extract fields from an article you gave it | Qwen 3-30B | ~$0.0002/article |
| Classify a title into a role bucket | Qwen | ~$0 |
| Yes/no on "does this text mention X" | Qwen | ~$0 |
| "Is Blackstone Europe RE the same entity as Blackstone Real Estate Partners?" | Grok-web (world knowledge) | $0.08/pair |
| "What CIK is Nova Southeastern University?" | Brave Search + Qwen | $0.004/query |
| Entity resolution across sources | Brave + Qwen | ~20× cheaper than Grok-web |
The trap Qwen falls into: same-brand-different-vehicle. "Blackstone Real Estate Partners" vs "Blackstone Europe Real Estate" reads as the same to Qwen because both strings contain "Blackstone Real Estate." The answer requires WORLD KNOWLEDGE (which fund vehicle exists, which is a regional sub-fund) that isn't in the strings you passed.
Fix pattern: for entity resolution where only the NAME links two rows, use Grok-web OR the newer Brave+Qwen tier. Never Qwen alone.
Brave+Qwen tier chain (new 2026-07-28):
1. Brave Search API returns candidate URLs
2. Qwen reads the top-3 URL summaries to verify
3. ~20× cheaper than Grok-web for the same accuracy
4. Endpoint: via Inferno HTTP API — see ref-brave-qwen-replaces-grokweb
memory or ask mars
5. Currently in bios B-17 calibration; wider rollout after that clears
Every consumer query MUST apply these 3 filters (or explicitly document why not):
WHERE integrity_tier IN ('verified','vouched') -- not 'warn'
AND amount_usd_converted IS NOT NULL -- for FX comparability
AND NOT is_placeholder -- on investors_v2 side
Additional performance notes:
lower(col) LIKE lower(:pat), never ILIKE (130ms → 17ms; the
trigram GIN doesn't kick in for ILIKE).WITH found AS MATERIALIZED (... LIMIT 1) to avoid the
GIN+LIMIT-1 seq-scan trap on small tables.bios_current_firm_v2, not persons_v2
directly (planner mis-estimates the methodology filter 38×).URL: https://api-dev.kscope.io/kbrain/mcp (MCP endpoint).
What kbrain is for: durable reference. Entity models, source-of-truth documentation, doctrines, API contracts, concepts. Things that will still be true 6 months from now.
What kbrain is NOT for: transient state. Task lists. Progress trackers. Current-status pages. Things that decay and mislead future readers.
MARS's kbrain footprint: 6 notes live there today (created by mars
on adrian's kbrain):
- Projects/MARS.md — top-level project doc
- Reference/MARS entity graph v2.md — the canonical shape
- Reference/MARS data sources.md — where each vertical sources from
- Reference/mars_entity_mint API.md — mint API contract
- Concepts/MARS query patterns.md — consumer patterns
- Concepts/Consumer contract filter.md — the 3-filter rule above
Sync obligation: when substrate / contract / sources / mint changes, mars updates kbrain. Contract change → kbrain edit within same session.
For your team: if you want your team's docs in kbrain, submit them via team-mail to mars — we'll seed on your behalf. Adrian owns the vault so all writes go through us.
The async coordination channel.
s3://kscope-team-mail/s3://kscope-team-mail/{your-slug}/inbox/mars_feed/teammsg.py — copy to your repo or use directlypython3 teammsg.py send {recipient-slug} "subject" --file body.mdaws s3 ls s3://kscope-team-mail/{your-slug}/inbox/ --recursiveActive slugs (2026-07-28): mars · mars-ui · futures · rss ·
bios · reit · credit · insurance · intl · lp · signals ·
prospects · insider · donor · flare · sedar · sections ·
inferno · crown · instagram · argos · power-sec.
Establishing a new slug: first inbound message to
s3://kscope-team-mail/{slug}/inbox/ creates it.
mars_entity_mint HTTP API — https://mint.staticpipe.com/companies
and /persons. Standard minting with all 5 rules baked in. Accepts
optional CIK / CRD / ticker / domain hints to speed up resolution.https://inferno.staticpipe.com/jobs. Batch
Qwen at ~$0.0002/item. Auto-shard 100 items/shard. Body limit ~1MB
(~5-6K items per submission).merge_entities.py — atomic entity merger with dynamic FK
discovery from pg_catalog. Handles all 5 canonicals + JSONB additive
merge. Never write your own merge code.mars-linkage-sweep.timer (Sun 09:00 UTC).
7 deterministic FK re-sweeps that catch write-time misses. Free.mars-refresh-views.timer (daily 06:15 UTC).
Add your MVs / serving tables via refresh_materialized_views.py.Things that have bitten us hard. If your vertical touches any of these patterns, read the corresponding memory / doctrine before shipping.
merge_entities.py used
COALESCE(keep, drop) on JSONB, silently dropping additive keys.
Fixed 07-28. Any merge tool MUST handle JSONB additively.ref-franken-person-taxonomy memory. Fix in
MINTING_PEOPLE Rule 1a + 2 + 3.check_ingest caught this class 07-14.ref-legacy-substrate-inheritance-doctrine.nohup / setsid blocked here. Use run_in_background if you're
scripting via Claude. If shell, use systemd.INSERT INTO mars.*_v2 needs the sentinel guard. Every mint
path. extract_2b_bios guarded, link_employers was NOT — re-leaked
in a loop. Grep every INSERT.| Vertical | Slug | Status | Owner |
|---|---|---|---|
| reit (real estate) | reit | LIVE | kee/Claude |
| bios (advisor bios) | bios | LIVE | kee/Claude, consumer Robin |
| flare (thermal registry) | flare | LIVE | kee/Claude, consumer crown |
| lp_data (LP commitments) | lp | LIVE Phase 2 | kee/Claude |
| credit (private credit + bankruptcy) | credit | LIVE | credit team |
| insider (Form 4 mint into persons_v2) | insider | LIVE | adrian's ETL |
| prospects (person liquidity scoring) | prospects | scaffolded | kee/Claude, awaits Form 4 |
| signals (8 event categories) | signals | scaffolded standalone | awaits owner |
| intl (international regional) | intl | scaffolded | awaits owner |
| insurance | insurance | scaffolded | awaits owner |
| sedar (Canadian mining) | sedar | LIVE Phase 1 | sedar team |
| sections (SEC 10-K sections) | sections | LIVE | sections team |
| power-sec | power-sec | integrating (this doc for you) | your team |
| mars-ui (front end) | mars-ui | LIVE | adrian |
mars_feed/MARS_PLATFORM_CONTRACTS.md in full.mars_feed/MINTING_ENTITIES.md in full.mars. Format:
"we've read the mandate + contracts + minting doctrine; here's what
we're doing; here's our proposed table shape; here's our target ship
date."*_v2 table under your slug's methodology tag prefix (e.g.,
power-sec-*).check_{vertical}
function to mars_feed/health.py that fires on real signals (freshness,
coverage, integrity_tier mix). Route it through the daily 13:00 UTC
email.{your_pipeline}/CONTRACT.md, SCHEMA.md,
SOURCES.md, README.md, CLAUDE.md. Copy shape from
reit_pipeline/ or bios_pipeline/.This doc is the running doctrine for platform-wide learnings. When something changes:
MARS_PLATFORM_CONTRACTS.md + append to
section 2 here.The mars team maintains this doc. Contributions welcome — send an edit-suggestion on team-mail and we'll integrate.
If you're onboarding fresh, this is the order (all available as hosted HTML for teams without repo access):
kee.staticpipe.com/mars/welcome-to-the-mandate.htmlkee.staticpipe.com/mars/platform-contracts.htmlkee.staticpipe.com/mars/minting-entities.htmlbios_pipeline/MINTING_PEOPLE.md (if your vertical mints persons —
ping bios team for hosted URL if needed)mars_feed/mcp_specs/ (if you're a consumer)mars_feed/PRODUCTION_READINESS_V2.md (if you're building a consumer
product)That's ~2 hours of reading. Everything else is available on team-mail or by asking mars directly.
— mars