pipeline-orchestration-notes.md
PRISM Pipeline Orchestration Notes
This note consolidates the PRISM-specific material previously sitting inside WorkOS-WIP.
Origin
PRISM is the SaaS/product conversion of the algolia-search-audit skill system.
The original skill system automates prospect research and search audit for Algolia sales teams. It is production-grade but fragile because it relies on many isolated agents, file gates, manual shepherding, and strict evidence discipline.
Current PRISM v2 State
Known from the recovered WorkOS-WIP notes:
- FastAPI + Temporal backend exists.
- Next.js frontend with copilot UI exists.
- 7 of 20 modules were registered in v2 at the time of capture.
- Not feature-complete.
This should be re-verified before making current implementation decisions.
Pipeline Shape
Wave 1: parallel intel modules
-> company
-> tech stack
-> traffic
-> competitors
-> financial profile
-> investor intelligence
-> hiring, social, news signals
-> partner and industry intel
Wave 2: query generation
Layer 2: browser audit with Playwright
Layer 3: synthesis
-> business case
-> sales plays
-> audit report and SPA
-> ABX campaign assets
Layer 4: quality gate
-> factcheck
-> evaluation
Evidence Discipline
Every data point should carry provenance:
FACT: authoritative or directly fetched source.ESTIMATE: clearly marked estimate with source and date.WEBFETCH: page fetched directly.WEBSEARCH: search query surfaced the source.NO_SOURCE: drop from final output.
Hierarchy:
AUTHENTIC > WEBFETCH > WEBSEARCH > NO_SOURCE
Known Fragility
The old flow can take 4-6 hours because:
- Agents run in isolated contexts.
- Agents communicate through files.
- Gates check file counts, byte sizes, and JSON validity.
- Failed modules must be rerun.
- Context exhaustion happens if too much research is loaded into one agent.
- The browser audit needs real rendering, screenshots, and strict artifact generation.
Failures That Shaped The Design
- Costco workspace overwrite: test/prod isolation must be explicit.
- DSW SPA missing brand CSS: reports must use the render pipeline, not hand-written one-offs.
- Context overload: split research across role/team boundaries and use context caches.
Coordinator To Build
The coordinator should replace manual shepherding.
It should:
- Accept a domain or target account.
- Dispatch modules in the correct wave order.
- Run gates automatically.
- Rerun failed modules when safe.
- Store research data.
- Generate AE-facing artifacts.
- Provide interactive sales coaching.
- Report status conversationally.
Discovery OS Link
PRISM should not stop at audit output.
It should translate audit findings into:
- Personalized discovery questions.
- Objection handling strategy.
- Deep-dive areas.
- Sales pitch and positioning.
- AE coaching.
Next Move
Before building more, verify the current PRISM repo state and produce a focused project overview using the My OS flow:
project overview -> ELT critique -> Arijit review -> workspace execution team