stemedb/docs/presentations/scripts/combine.ts
jordan 1ce4004807 feat: Complete Phase 2 (The Cortex) - query, lens, and API layers
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>
2026-02-01 13:22:44 -07:00

54 lines
1.3 KiB
TypeScript

#!/usr/bin/env npx tsx
/**
* Combine individual deck JSONs into a single multi-deck presentation.
*
* Usage:
* npx tsx scripts/combine.ts [deck-id ...]
*
* If deck IDs are provided, they define the order.
* Otherwise, all JSONs in generated/ are combined alphabetically.
*/
import * as fs from 'fs';
import * as path from 'path';
const generatedDir = path.resolve(__dirname, '..', 'generated');
const args = process.argv.slice(2);
let deckIds: string[];
if (args.length > 0) {
deckIds = args;
} else {
deckIds = fs.readdirSync(generatedDir)
.filter(f => f.endsWith('.json') && f !== 'stemedb.json')
.map(f => f.replace('.json', ''))
.sort();
}
if (deckIds.length === 0) {
console.error('No deck JSON files found in generated/');
process.exit(1);
}
const decks = [];
for (const id of deckIds) {
const filePath = path.join(generatedDir, `${id}.json`);
if (!fs.existsSync(filePath)) {
console.error(`Deck not found: ${filePath}`);
process.exit(1);
}
const content = fs.readFileSync(filePath, 'utf-8');
decks.push(JSON.parse(content));
}
const combined = {
combined: true,
meta: { id: 'stemedb', title: 'stemedb' },
decks,
};
const outputPath = path.join(generatedDir, 'stemedb.json');
fs.writeFileSync(outputPath, JSON.stringify(combined, null, 2));
console.log(`Generated: ${outputPath} (${decks.length} decks)`);