This commit adds the read path (Cortex) to complement the write path (Spine): ## Crates - stemedb-api: HTTP API with axum + utoipa OpenAPI - /v1/assert, /v1/query, /v1/epoch, /v1/skeptic, /v1/trace, /v1/audit - Metered endpoints with quota enforcement - Ed25519 signature verification - stemedb-lens: Truth resolution lenses - RecencyLens, ConsensusLens, ConfidenceLens - VoteAwareConsensusLens (Ballot Box pattern) - TrustAwareAuthorityLens (The Hive pattern) - SkepticLens (conflict analysis) - EpochAwareLens (paradigm-safe queries) - stemedb-query: Query engine with materialized views ## Storage Extensions - VoteStore: Vote aggregation with cached counts - TrustRankStore: Agent reputation with decay - AuditStore: Query audit trail - IndexStore: SP/P/S index structures - SupersessionStore: Epoch supersession chains ## SDKs - sdk/go/steme: Go HTTP client with Ed25519 signing - sdk/go/adk: ADK-Go tools for AI agents ## Documentation - Updated CLAUDE.md, architecture.md, roadmap.md - New ai-lookup entries for all services - Use case docs for consumer health intelligence - Arena roadmap for simulation advancement Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
312 lines
8.7 KiB
YAML
312 lines
8.7 KiB
YAML
meta:
|
|
id: sec-analysis
|
|
title: "SEC Document Analysis"
|
|
subtitle: "Filing Intelligence with Episteme"
|
|
version: "1.0.0"
|
|
|
|
actors: {}
|
|
|
|
slides:
|
|
# ============================================
|
|
# TITLE
|
|
# ============================================
|
|
- type: title
|
|
id: title
|
|
|
|
# ============================================
|
|
# HOOK
|
|
# ============================================
|
|
- type: hook
|
|
id: hook
|
|
line: "Your filings contradict each other."
|
|
subline: "And every agent reading them gets a different answer."
|
|
|
|
# ============================================
|
|
# THE DRIFT - Revenue
|
|
# ============================================
|
|
- type: code
|
|
id: drift-revenue
|
|
title: "10-K: Annual revenue"
|
|
code: |
|
|
// Agent extracts from 10-K filing
|
|
// CIK: 0001234567, Filed: 2024-02-28
|
|
|
|
{
|
|
"subject": "ACME/revenue/annual",
|
|
"source": "10-K/2023",
|
|
"value": "$847M"
|
|
}
|
|
|
|
- type: code
|
|
id: drift-revenue-2
|
|
title: "10-Q: Quarterly revenue tells a different story"
|
|
code: |
|
|
// Agent extracts from Q4 10-Q filing
|
|
// Same company, same fiscal year
|
|
|
|
{
|
|
"subject": "ACME/revenue/Q4",
|
|
"source": "10-Q/2023-Q4",
|
|
"value": "$218M"
|
|
}
|
|
|
|
// Q1 + Q2 + Q3 + Q4 = $872M annualized
|
|
// 10-K says $847M
|
|
// Delta: $25M. Which is right?
|
|
|
|
# ============================================
|
|
# THE DRIFT - Amendments
|
|
# ============================================
|
|
- type: code
|
|
id: drift-amendment
|
|
title: "Original 10-K: No impairment"
|
|
code: |
|
|
// Filed: 2024-02-28
|
|
// Form: 10-K
|
|
|
|
{
|
|
"subject": "ACME/goodwill/impairment",
|
|
"source": "10-K/2023",
|
|
"value": "$0"
|
|
}
|
|
|
|
// Clean bill of health.
|
|
|
|
- type: code
|
|
id: drift-amendment-2
|
|
title: "10-K/A: $340M impairment appears"
|
|
code: |
|
|
// Filed: 2024-06-15 (amended filing)
|
|
// Form: 10-K/A
|
|
|
|
{
|
|
"subject": "ACME/goodwill/impairment",
|
|
"source": "10-K-A/2023",
|
|
"value": "$340M"
|
|
}
|
|
|
|
// The amendment supersedes the original.
|
|
// But which sections? All of them? Just Note 7?
|
|
// The rest of the 10-K -- still valid?
|
|
|
|
# ============================================
|
|
# THE SPIRAL
|
|
# ============================================
|
|
- type: code
|
|
id: spiral
|
|
title: "Same data, extracted 3 times, 3 answers"
|
|
code: |
|
|
// Q3 Revenue appears in:
|
|
"10-Q/2023-Q3" -> $213M // quarterly filing
|
|
"10-K/2023" -> $209M // annual summary table
|
|
"DEF 14A/2024" -> $211M // proxy exec comp section
|
|
|
|
// Two analysts read the same proxy statement
|
|
// Analyst A: CEO comp = $14.2M (includes options)
|
|
// Analyst B: CEO comp = $8.7M (base + bonus only)
|
|
|
|
// Both are "correct" -- different definitions
|
|
|
|
- type: hook
|
|
id: spiral-question
|
|
line: "Which extraction is correct?"
|
|
subline: "Depends on the filing, the section, and what you're measuring."
|
|
|
|
# ============================================
|
|
# THE CATASTROPHE
|
|
# ============================================
|
|
- type: code
|
|
id: catastrophe
|
|
title: "The Catastrophe"
|
|
code: |
|
|
// Agent builds a DCF model
|
|
// Revenue: pulled from 10-K/A -> $847M (amended)
|
|
// Cost of revenue: pulled from 10-K -> $612M (original)
|
|
//
|
|
// But the amendment changed cost allocations too.
|
|
// Actual cost of revenue post-amendment: $658M
|
|
//
|
|
// Gross margin: 27.7% (agent's model)
|
|
// Actual: 22.3%
|
|
//
|
|
// DCF valuation: off by $180M
|
|
//
|
|
// The model mixed amended and pre-amendment data
|
|
// because there was no way to track the amendment chain.
|
|
|
|
- type: code
|
|
id: catastrophe-why
|
|
title: "The Root Cause"
|
|
code: |
|
|
// Filings were stored as flat key-value pairs
|
|
// No amendment chain linking 10-K to 10-K/A
|
|
// No section-level tracking
|
|
// No way to know which data points were superseded
|
|
//
|
|
// The agent had no concept of "this number was restated"
|
|
// It just grabbed the first match for each field
|
|
//
|
|
// Garbage in, $180M garbage out.
|
|
|
|
# ============================================
|
|
# THE FIX - Episteme
|
|
# ============================================
|
|
- type: hook
|
|
id: fix-intro
|
|
line: "What if filings carried their own lineage?"
|
|
subline: "Every extraction linked to its source, section, and amendment chain."
|
|
|
|
- type: code
|
|
id: fix-store
|
|
title: "Store extractions with filing metadata"
|
|
code: |
|
|
episteme.assert({
|
|
subject: "ACME/revenue/annual/2023",
|
|
predicate: "value",
|
|
value: "$847M",
|
|
|
|
source: {
|
|
cik: "0001234567",
|
|
form: "10-K",
|
|
filed: "2024-02-28",
|
|
section: "Part II, Item 8",
|
|
accession: "0001234567-24-000042"
|
|
},
|
|
|
|
lifecycle: "current",
|
|
confidence: 0.95
|
|
});
|
|
|
|
- type: code
|
|
id: fix-amendment
|
|
title: "Amendments supersede cleanly"
|
|
code: |
|
|
// When the 10-K/A arrives:
|
|
episteme.assert({
|
|
subject: "ACME/goodwill/impairment/2023",
|
|
predicate: "value",
|
|
value: "$340M",
|
|
|
|
source: {
|
|
form: "10-K/A",
|
|
filed: "2024-06-15",
|
|
amends: "0001234567-24-000042", // links to original
|
|
sections_amended: ["Note 7", "Part II Item 8"]
|
|
},
|
|
|
|
lifecycle: "current",
|
|
supersedes: "ax7f3k9..." // the $0 assertion
|
|
});
|
|
|
|
// The original $0 assertion is now lifecycle: "superseded"
|
|
// Sections NOT in sections_amended remain valid
|
|
|
|
- type: code
|
|
id: fix-query
|
|
title: "Query with lifecycle: only current data"
|
|
code: |
|
|
// Agent building a DCF model queries:
|
|
const revenue = await episteme.query({
|
|
subject: "ACME/revenue/annual/2023",
|
|
lifecycle: "current"
|
|
});
|
|
// Returns $847M from 10-K/A (amended value)
|
|
|
|
const cost = await episteme.query({
|
|
subject: "ACME/cost-of-revenue/annual/2023",
|
|
lifecycle: "current"
|
|
});
|
|
// Returns $658M from 10-K/A (amended value)
|
|
|
|
// Both values from the same amendment.
|
|
// No mixing. No $180M error.
|
|
|
|
# ============================================
|
|
# TIME TRAVEL
|
|
# ============================================
|
|
- type: code
|
|
id: time-travel
|
|
title: "What did we believe before the restatement?"
|
|
code: |
|
|
// Audit question: what was our position on March 1?
|
|
// (before the 10-K/A was filed on June 15)
|
|
|
|
episteme.query({
|
|
subject: "ACME/goodwill/impairment/2023",
|
|
as_of: "2024-03-01T00:00:00Z"
|
|
});
|
|
|
|
// Returns: $0 (the original 10-K assertion)
|
|
// At that point, that WAS the truth.
|
|
|
|
episteme.diff({
|
|
subject: "ACME/goodwill/impairment/2023",
|
|
from: "2024-03-01",
|
|
to: "2024-07-01"
|
|
});
|
|
|
|
// Shows: 10-K/A filed June 15, impairment changed $0 -> $340M
|
|
// Full audit trail. No guessing.
|
|
|
|
# ============================================
|
|
# MULTI-ANALYST
|
|
# ============================================
|
|
- type: code
|
|
id: multi-analyst
|
|
title: "Competing extractions coexist"
|
|
code: |
|
|
// Analyst A extracts CEO comp from proxy (DEF 14A)
|
|
episteme.assert({
|
|
subject: "ACME/exec-comp/CEO/2023",
|
|
value: "$14.2M",
|
|
source: { form: "DEF 14A", section: "Summary Compensation" },
|
|
confidence: 0.9,
|
|
author: "analyst-A"
|
|
});
|
|
|
|
// Analyst B extracts from the same proxy
|
|
episteme.assert({
|
|
subject: "ACME/exec-comp/CEO/2023",
|
|
value: "$8.7M",
|
|
source: { form: "DEF 14A", section: "Summary Compensation" },
|
|
confidence: 0.85,
|
|
author: "analyst-B"
|
|
});
|
|
|
|
// Both assertions coexist. No overwrite.
|
|
|
|
- type: code
|
|
id: multi-analyst-resolve
|
|
title: "Lens resolves at query time"
|
|
code: |
|
|
// Default lens: highest confidence wins
|
|
episteme.query({
|
|
subject: "ACME/exec-comp/CEO/2023",
|
|
lens: "authority"
|
|
});
|
|
// Returns: $14.2M (analyst-A, confidence 0.9)
|
|
|
|
// But you can ask: show me all claims
|
|
episteme.query({
|
|
subject: "ACME/exec-comp/CEO/2023",
|
|
lens: "all"
|
|
});
|
|
// Returns both: $14.2M and $8.7M
|
|
// With full provenance on each
|
|
|
|
// The disagreement IS the signal.
|
|
// Someone needs to reconcile definitions.
|
|
|
|
# ============================================
|
|
# VISION
|
|
# ============================================
|
|
- type: vision
|
|
id: vision
|
|
title: "Episteme"
|
|
points:
|
|
- "Amendment chains, not flat overwrites."
|
|
- "Section-level provenance for every extraction."
|
|
- "Competing analyst reads coexist until resolved."
|
|
- "Time travel for audit and restatement analysis."
|
|
tagline: "Git for Truth"
|