<aside> 👉🏻

Executive Summary

Five repos. Four agents. One coherent system. This article documents the integration architecture — the contracts, path agreements, and interface decisions — that let independently deployable components form a working PM intelligence loop without tight coupling or hidden dependencies.

</aside>


🎯 Objective

Building a multi-repo agentic system is not mainly a deployment problem. The harder problem is preserving judgment across tools that evolve independently: a pipeline engine that changes stages, a decision-context repo that refines prompts and rubrics, a wiki that accumulates cases, and an agent layer that handles human gates and operational routing.

This article explains those boundaries as an intentional system design. It shows what each component owns, what can cross between them, and where Human-in-the-loop approval remains a control point rather than an implementation detail. The goal is to show how market signals, structured evaluation, archived reasoning, and future PM learning stay traceable as one coherent system instead of fragmenting across separate tools.


🗂️ Why 6 Separate Repos

The stack could have been one monorepo. It wasn't, because each component has a fundamentally different change cadence and deployment surface:

Repo Changes when Deployed by
pm-intelligence-engine Pipeline logic, stage prompts, API endpoints launchd on ops host
pm-decision-context PM identity, rubrics, reasoning scaffolds Git pull (ops host)
product-management-wiki Raw sources, knowledge pages, completed run archives Git commit + push
hermes-control-plane Agent identity, skills, deployment scripts make <profile>-deploy
notion-cms-backup Notion page export → wiki raw sync GitHub Actions (cron)
pm-console Dashboard pages, integrity rules, drift views launchd on ops host

Coupling these would mean deploying all six whenever any one changes — or worse, letting one module's hot path silently depend on another's internal structure. Separate repos make the cost of coupling visible: if a change in one repo requires a change in another, that coordination is explicit, not accidental.

The tradeoff is coordination overhead at boundaries. The answer to that overhead is well-defined contracts.

flowchart TB
  classDef world fill:#eef6ff,stroke:#5b7fff,stroke-width:1.5px,color:#0f172a;
  classDef repo fill:#f8fafc,stroke:#64748b,stroke-width:1px,color:#0f172a;
  classDef engine fill:#ecfeff,stroke:#0891b2,stroke-width:1.5px,color:#0f172a;
  classDef stage fill:#f8fafc,stroke:#94a3b8,stroke-width:1px,color:#0f172a;
  classDef gate fill:#fff7ed,stroke:#ea580c,stroke-width:2px,color:#7c2d12;
  classDef human fill:#fefce8,stroke:#ca8a04,stroke-width:1.5px,color:#713f12;
  classDef archive fill:#f0fdf4,stroke:#16a34a,stroke-width:1.5px,color:#14532d;
  subgraph EW["External World"]
      direction LR
      WEB["Web / RSS / CVE / Competitors"]
      NOTION["Jack's Notion pages"]
  end
  RESEARCHER["[Agent] researcher\nExternal evidence intake"]
  INSIGHTS["Engine Insights"]
  DREQ["[Human] Human-in-the-loop\ndecision request: product + question"]
  NCB["notion-cms-backup"]
  RAW_NOTION["wiki/raw/from-notion/"]
  subgraph ENGINE["[Service] pm-intelligence-engine"]
      direction TB
      S1["S1 Signal Ingestion"]
      S2["S2 Insight Extraction"]
      G1["Gate 1 Direction"]
      S3["S3 Opportunity Framing"]
      S4["S4 Evaluation x4 personas"]
      G2["Gate 2 Evaluation"]
      AVATAR["[Agent] avatar"]
      S5["S5 Prioritization"]
      S6["S6A PoC / S6B PRD"]
      G3["Gate 3 Routing"]
      S7["S7 Final Report"]
      FINALIZER["run_finalizer"]
  end
  TG["Discord / Telegram gate notifications"]
  HITL["[Human] Human-in-the-loop"]
  ARCHIVE["pm-engine/archive/runs/"]
  EXPORT["[Agent] ops wiki-export"]
  RAW_DECISION["wiki/raw/from-pm-decision-context/\nprds/ | kills/ | poc-upgrades/"]
  INGEST["wiki /ingest"]
  WIKI["wiki/wiki/\nframeworks/ | cases/ | concepts/"]
  SYNC["[Agent] ops compiled-copy-review\nHuman approval before sync"]
  IDENTITY["decision-context/core/00-pm-identity.md\nLoaded by every stage"]
  PACK["decision-context/core/17-judgment-patterns.md\nLoaded at S3 and S5"]
  WEB --> RESEARCHER --> INSIGHTS --> DREQ --> S1
  NOTION --> NCB --> RAW_NOTION
  S1 --> S2 --> G1 --> S3 --> S4 --> G2 --> S5 --> S6 --> S7 --> FINALIZER
  S5 --> G3 --> S6
  G2 -. alongside .-> AVATAR
  G1 --> TG --> HITL
  G2 --> TG
  G3 --> TG
  RAW_NOTION --> INGEST
  FINALIZER --> ARCHIVE
  FINALIZER --> EXPORT --> RAW_DECISION --> INGEST --> WIKI --> SYNC --> IDENTITY
  SYNC --> PACK
  IDENTITY -.-> S1
  IDENTITY -.-> S2
  IDENTITY -.-> S3
  IDENTITY -.-> S4
  IDENTITY -.-> S5
  IDENTITY -.-> S6
  IDENTITY -.-> S7
  PACK -.-> S3
  PACK -.-> S5
  class WEB,NOTION world;
  class RESEARCHER,INSIGHTS,NCB,RAW_NOTION,EXPORT repo;
  class S1,S2,S3,S4,S5,S6,S7,FINALIZER,AVATAR stage;
  class G1,G2,G3 gate;
  class DREQ,TG,HITL human;
  class ARCHIVE,RAW_DECISION,WIKI,IDENTITY,PACK archive;
  class INGEST,SYNC repo;

image.png


🔗 The Five Interface Contracts

The integration model is built around five explicit interface contracts. Each one defines not just what can cross the boundary, but also what must stay isolated so individual repos and services can evolve without creating hidden coupling.

  1. Hermes ↔ pm-intelligence-engine: REST API only. Hermes polls gate queues, reads run state, and relays human decisions exclusively through HTTP endpoints such as GET /runs and the single POST /runs/{id}/decision. In insights mode, a person starts a run from an Insight by confirming the product and question through POST /insights/{id}/decision-requests. It never touches pm-engine's SQLite database or internal stage state directly.