@lssm-tech/lib.voiceops-runtime
v0.1.0
Published
Canonical run engine for CompanyOS VoiceOps. Turns a transcript into a redacted, policy-checked, approval-aware run record plus a 16-key evidence receipt with a stable SHA-256 replay hash.
Readme
@lssm-tech/lib.voiceops-runtime
Canonical run engine for CompanyOS VoiceOps. Turns a transcript into a redacted, policy-checked, approval-aware run record plus a 16-key evidence receipt with a stable SHA-256 replay hash.
What it does
- Load a transcript via
loadTranscript(mock STT by default, real adapters via@lssm-tech/integration.provider-voice). - Extract the operating signal (pain, gap, urgency, sensitive data, proposed actions).
- Redact sensitive identifiers using
voiceops-policy. - Decide policy per action class — external customer commitments are blocked, internal work routes to PM approval.
- Project the run into a CompanyOS operating graph and a deterministic replay bundle.
- Emit a canonical run record and 16-key receipt with
productionWrites=false,externalCalls=false, and a 64-char hexreplayHash.
Key exports
| Symbol | Purpose |
| --- | --- |
| runVoiceOpsDemo(input) | End-to-end canonical run. Returns { runRecord, graph, replay, receipt, harness }. |
| loadTranscript(opts) | Voice-source loader. Mock STT by default; pluggable STTProvider. |
| DEFAULT_VOICEOPS_TRANSCRIPT | The Voice-to-Product-Gap demo transcript. |
| stableStringify(value) | Order-stable JSON used for the replay hash; runtime-independent. |
| assertHackathonProvidersAvailable() | Smoke check that the provider registry can hand out adapters for all six hackathon capabilities. |
| selectHackathonProvider(key, registry) | ContractSpec-keyed provider lookup. |
| buildSlngVoiceContext(...) / buildGradiumVoiceContext(...) / buildFalVoiceContext(...) | Adapter contexts wired through a SecretProvider. |
| buildHackathonTavilyClient(...) | Tavily REST/SDK/MCP client (mock-first). |
| createPioneerAdapter(...) | Pioneer self-improvement adapter (feature-flagged by PIONEER_AI_ADAPTER). |
| HackathonInMemorySecretProvider | Test/demo SecretProvider — never reads or writes real env vars. |
File layout
src/
├── canonical/ # run.ts (the engine), harness.ts, types.ts
├── providers/ # registry.ts, wiring.ts, secret-stub.ts (+ tests)
├── voice-source.ts # loadTranscript + TranscriptSource discriminant
├── runtime.test.ts # end-to-end canonical run assertions
└── index.ts # re-exports the three subpackagesHow to use it
import { runVoiceOpsDemo, DEFAULT_VOICEOPS_TRANSCRIPT } from '@lssm-tech/lib.voiceops-runtime';
const result = await runVoiceOpsDemo({
transcript: DEFAULT_VOICEOPS_TRANSCRIPT,
approval: { approverRole: 'pm', decision: 'approved_internal_only' },
});
console.log(result.receipt.replayHash); // 64-char hex SHA-256
console.log(result.runRecord.policyVerdicts); // blocked + allowed verdictsSee ARCHITECTURE.md for the end-to-end data flow and runtime.test.ts for the canonical assertions.
Safety posture
- No live audio is captured by default; STT is mocked through
HackathonInMemorySecretProvider. - No external HTTP unless a
SecretProviderresolves a real key at call time. - No secret values are ever written to source, tests, fixtures, traces, or telemetry.
- Receipts always claim
productionWrites=falseandexternalCalls=falsefor the hackathon path.
