Skip to content

Add VideoKnowledgeBase blackboard scaffolding and pipeline-side population#116

Draft
htekdev with Copilot wants to merge 3 commits into
mainfrom
copilot/blackboard-pattern-two-phase-video-analysis
Draft

Add VideoKnowledgeBase blackboard scaffolding and pipeline-side population#116
htekdev with Copilot wants to merge 3 commits into
mainfrom
copilot/blackboard-pattern-two-phase-video-analysis

Conversation

Copilot AI commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

VidPipe’s current stage-by-stage pipeline keeps analysis outputs siloed and forces repeated detection work. This PR introduces an additive blackboard foundation (VideoKnowledgeBase) so analysis artifacts can be shared across stages/agents without disrupting current execution flow.

  • Blackboard contract (typed, additive)

    • Added VideoKnowledgeBase and related domain types in src/L0-pure/types/index.ts.
    • Extended PipelineResult with optional knowledgeBase to expose shared analysis state to downstream consumers.
    • Exported VideoKnowledgeBase from src/index.ts for SDK/public usage.
  • KB persistence module

    • Added src/L6-pipeline/knowledgeBase.ts with:
      • createVideoKnowledgeBase(video)
      • writeVideoKnowledgeBase(videoDir, kb)
      • readVideoKnowledgeBase(videoDir)
    • Standardized persistence target as knowledge-base.json in each video directory.
  • Pipeline integration (backward-compatible)

    • processVideo() now initializes KB post-ingestion and incrementally populates available fields (layout metadata, transcript, shorts, medium clips) alongside existing outputs.
    • KB is persisted at pipeline end with non-fatal error handling to avoid changing existing failure semantics.
    • processVideo() returns the populated knowledgeBase in PipelineResult.
  • Focused test coverage

    • Added src/__tests__/unit/L6-pipeline/knowledgeBase.test.ts for KB init + read/write behavior.
    • Updated src/__tests__/unit/L6-pipeline/pipeline.test.ts to assert PipelineResult.knowledgeBase content.
// New shared contract exposed in pipeline output
const result = await processVideo('/videos/test.mp4')

result.knowledgeBase?.transcript?.merged   // normalized transcript source for downstream agents
result.knowledgeBase?.layout.webcam        // single detected webcam region
// persisted to: <videoDir>/knowledge-base.json

Copilot AI review requested due to automatic review settings June 1, 2026 13:21
Copilot AI removed the request for review from Copilot June 1, 2026 13:21
Copilot AI linked an issue Jun 1, 2026 that may be closed by this pull request
5 tasks
Copilot AI requested review from Copilot and removed request for Copilot June 1, 2026 13:23
Copilot AI changed the title [WIP] Update architecture for two-phase video analysis using blackboard pattern Add VideoKnowledgeBase blackboard scaffolding and pipeline-side population Jun 1, 2026
Copilot AI requested review from Copilot and removed request for Copilot June 1, 2026 13:34
Copilot AI requested a review from htekdev June 1, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Architecture: Blackboard Pattern - Two-Phase Video Analysis + Production

2 participants