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.
- Type: System Integration Design / Agentic Architecture
- Context: Part of a 5-repo PM AI stack running on a personal iMac + MacBook setup
- Focus: Cross-repo contracts, agent-to-service boundaries, and intentional coupling decisions
🎯 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;
🔗 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.
- 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 /runsand the singlePOST /runs/{id}/decision. Ininsightsmode, a person starts a run from an Insight by confirming the product and question throughPOST /insights/{id}/decision-requests. It never touches pm-engine's SQLite database or internal stage state directly.
- pm-intelligence-engine ↔ pm-decision-context: read reasoning inputs, write run archives. pm-engine reads PM identity, product context, and stage prompts from
pm-decision-context, then writes completed run traces to its own archive path. This keeps live reasoning inputs separate from execution artifacts.
- Hermes ↔ product-management-wiki: raw-layer export only. Hermes writes completed PRD / PoC / kill cases into the wiki's
raw/from-pm-decision-context/layer. It does not write canonical wiki pages directly; promotion into long-term knowledge stays inside the wiki's own ingest workflow.
- notion-cms-backup ↔ product-management-wiki: Notion-to-raw sync contract. A scheduled GitHub Actions export and the wiki repo's post-merge sync move Notion CMS content into
raw/from-notion/. This path is intentionally indirect: pm-engine does not talk to Notion through this workflow.
- Hermes → PM Console: operational visibility contract. Hermes does not power the dashboard itself. Instead, it links to PM Console's operational views: when ops or publisher reports run status, gate state, or portfolio drift, it points the PM to the matching live view. PM Console is read-only for observability data; gated actions go through the owning system's interface. This keeps Hermes focused on orchestration and communication, while PM Console remains the dedicated surface for monitoring and gate handling.
① Hermes ↔ pm-engine: REST API Only
The most load-bearing contract in the stack. Hermes ([Agent] ops in particular) is the human-facing layer — it receives PM commands via Discord and Telegram, evaluates the pipeline state, and takes gate actions. pm-engine is the execution layer — it runs 7 sequential stages and exposes the results.
What crosses the boundary:
- Gate commands:
POST /runs/{run_id}/decision— the preferred single endpoint for direction, evaluation, and routing actions; the older per-action endpoints remain transitional.
- State queries:
GET /runs,GET /runs/{run_id}?include_outputs=true,GET /runs/{run_id}/artifacts
- Run initiation (
insightsmode): a human decision request viaPOST /insights/{id}/decision-requestsconfirms the product and question and starts the run.POST /signalsremains an engine endpoint, but is not the Insight-to-run start path.
What never crosses:
- Direct SQLite access — Hermes has no db path and no SQLite client
- Internal stage state — Hermes sees run status and typed outputs, never
current_stageinternals
- Schema assumptions — Hermes does not parse pm-engine's Pydantic models directly
The key principle is that Hermes consumes pm-engine outputs, not pm-engine internals. This means pm-engine stages can be refactored — prompts changed, models swapped, stages added — without touching Hermes as long as the API surface stays stable.
Gate polling pattern: Hermes does not subscribe to pm-engine events. It polls: at session start (read MEMORY.md), on explicit PM command, and on cron trigger. This is intentional — event subscriptions would create a stateful dependency that breaks across restarts.
② pm-engine ↔ pm-decision-context: Read/Write Path Contract
pm-decision-context is where PM reasoning lives: identity (
00-pm-identity.md), product definitions, evaluation rubrics, and the 4-persona scoring framework. pm-engine reads from it at stage runtime.Read paths (pm-engine reads at stage execution):
DECISION_CONTEXT_ROOT/core/00-pm-identity.md— PM identity for stage prompts
DECISION_CONTEXT_ROOT/products/<product_id>/— product-specific context
DECISION_CONTEXT_ROOT/evaluation/— rubrics for S4 (Explorer, Strategist, Builder, Skeptic)
Write path (pm-intelligence-engine, for eligible completed runs):
PM_ENGINE_ROOT/archive/runs/<product_id>/<YYYY-MM-DD>-<slug>/— canonical run trace inside thepm-intelligence-enginerepo; wiki export is a separate ops step.
The ownership rule:
pm-intelligence-engine reads decision-context for reasoning inputs and writes run traces to its own archive, never to DECISION_CONTEXT_ROOT. Canonical PM identity and rubrics remain PM-owned.③ Hermes ↔ wiki: Completion Event → Raw Layer Sync
The wiki is the long-term knowledge store. After pm-engine completes a run, Hermes ([Agent] ops) is responsible for exporting the results to the wiki's raw input layer.
The sync flow:
- pm-engine run reaches
completedorkilledstatus
- [Agent] ops polls for wiki-eligible runs (mode=decide, routing=prd|poc|kill)
- Ops reads the run artifacts via API
- Ops writes to
WIKI_ROOT/raw/from-pm-decision-context/{prds,poc-upgrades,kills}/
- State is recorded in
$HERMES_HOME/state/wiki-synced.jsonto prevent double-export
What Hermes never does:
- Write to
WIKI_ROOT/wiki/directly — canonical wiki pages are managed by the wiki's own ingest workflow
- Overwrite an existing export file without PM confirmation
- Write files whose frontmatter doesn't match the wiki's CLAUDE.md schema
The division of responsibility: Hermes owns the export trigger and the raw write; the wiki's own ingest workflow owns the promotion from raw → canonical wiki page.
🔄 The Emergent Loop
These contracts do more than keep the repos separated. Together, they create a feedback loop in which each decision becomes input for better future decisions.
Insight → Human decision request → [pm-engine S1–S7] → Run Archive → Wiki Raw Layer → Wiki Ingest
↑ ↓
└──────────── refined PM identity and accumulated knowledge ──────┘- [Agent] researcher curates external evidence into engine Insights. A person confirms the product and question in a decision request, which starts the run at S1.
- pm-engine runs the signal through its staged evaluation process and writes the completed reasoning chain to the run archive.
- Stage 1 works from the run input created from that Insight-linked decision request, not from a wiki sensing file.
- Hermes exports the outcome into the wiki's raw layer, where it becomes eligible for long-term knowledge ingestion rather than remaining a one-off execution artifact.
- The wiki ingest flow promotes that material into durable PM knowledge. After human approval,
compiled-copy-reviewcan resync two copies inpm-decision-context/core/:00-pm-identity.md, loaded by every stage, and17-judgment-patterns.md, loaded at S3 and S5.
- Future runs then start with a better reasoning foundation: not just the latest signal, but the accumulated context of earlier decisions.
What matters is that no single repo “owns” this loop by itself. It emerges from the contracts between execution, archive, export, knowledge curation, and identity refinement. In other words, engine Insights hold intake evidence, a human decision request defines the product question that starts a run, and run lifecycle state lives separately in
WorkflowRun. The wiki raw layer is the destination for exported outcomes, not the current signal-intake path. The result is a system where PM judgment is not only applied to one run, but gradually externalized, preserved, and reused.📍 Cross-Repo Path Contracts
Several filesystem locations are shared across repos. On the ops host,
~ refers to the account running the service, not a fixed username. Changing a location requires updating all its consumers.Variable | Path on the ops host | Used by |
WIKI_ROOT | ~/workspace/ai-assets/jackhpark-product-management-wiki | hermes-control-plane, pm-intelligence-engine |
DECISION_CONTEXT_ROOT | ~/workspace/ai-assets/jackhpark-pm-decision-context | pm-intelligence-engine |
[Agent] ops runtime | ~/.hermes/profiles/ops | hermes-control-plane |
Wiki raw output | ~/workspace/ai-assets/jackhpark-product-management-wiki/raw/from-pm-decision-context/{prds,kills,poc-upgrades}/ | hermes-control-plane (writer), pm-intelligence-engine (sync) |
The complete cross-repo path contract and its consumers are documented in
hermes-control-plane/docs/overview/system-overview.md §10. These locations are account-relative on the ops host rather than tied to the retired iMac's home directory.🔌 The publisher Profile: Why a CLI, Not an API
The publisher profile exists to make Notion publishing reviewable, section-scoped, and difficult to do accidentally. Its review workflow compares source changes with the live page and brings specific section rewrites for human approval. The
project-publisher CLI targets the configured production page for a write; it does not require a drift check before every write.What direct API calls make too easy:
- writing to the wrong page when a page ID is merely “in context”
- replacing too much content at once instead of one approved section at a time
- losing a clear record of which section was written and who approved it
What the CLI adds as a contract:
- section-level targeting through heading-aware commands like
--sectionand--write-section-by-heading, so the write path matches the same section resolver used by the drift report
- review tools such as
--json-report,--read-page-full, and--show-sources; the agent uses them to assess source changes and record the reason and supporting docs in its proposal, not automatically in the write log
- explicit human approval gates through flags like
--approved-by-humanand--approved-by, making production writes harder to trigger casually
- automatic staleness baseline recording after a successful publish, so later drift reflects real source changes instead of vague editorial memory
The result is not just a safer wrapper around the Notion API. It is an integration boundary: the CLI enforces targeting and approval flags and records the write, while the review workflow supplies editorial judgment and source-grounded rationale. For a portfolio system where the risk is not only weak prose but publishing the wrong content to the wrong live page, that boundary is worth the extra tooling.
⚖️ Design Trade-offs
This system accepts extra operational complexity in exchange for clearer ownership boundaries. Splitting the stack across six repos adds coordination overhead, but it prevents prompt changes, wiki growth,
pm-intelligence-engine schema changes, and Hermes behavior tuning from being deployed as if they were one inseparable surface.It also prefers narrow contracts over convenient shortcuts. Hermes talks to
pm-intelligence-engine through HTTP endpoints rather than shared SQLite access, which adds an extra hop but keeps the execution engine free to evolve its storage and stage internals without silently breaking the agent layer. The same logic shows up in publishing: a dedicated CLI is slower to build and maintain than direct Notion API calls, but it makes page targeting, auditability, and human approval harder to bypass by accident.A similar trade-off appears in runtime operations. Hermes owns polling, notifications, routing, and wiki sync as an external ops plane instead of baking those concerns into
pm-intelligence-engine itself. That separation creates more moving parts, but it keeps pm-intelligence-engine focused on execution while preserving a cleaner boundary around scheduling, chat delivery, and human gate handling.At the filesystem level, the stack still relies on a few stable absolute-path contracts rather than a dynamic discovery layer. That is less flexible when environments move, but it avoids introducing another always-on coordination service just to let the repos find each other. Taken together, these are not incidental constraints; they are deliberate choices to make coupling visible, keep authority legible, and reduce the chance that one subsystem quietly starts owning another subsystem’s job.
🧠 PM Learning Outcomes
This project clarified that integration design is not just an engineering coordination problem. It is also a product judgment problem about where authority should live, which decisions must stay human-controlled, and how much operational complexity is worth accepting to preserve those boundaries.
Working across
pm-intelligence-engine, pm-decision-context, product-management-wiki, and Hermes made that especially concrete. A system becomes much harder to reason about when one layer quietly reaches into another layer’s internals, or when execution state, long-term knowledge, and human approval logic start blending together. What looks like implementation convenience in the short term often becomes ownership confusion later.It also reinforced that safer AI operations come less from well-written prompts alone than from deliberate control surfaces: narrow APIs, explicit handoff rules, section-scoped CLIs, and human gates that are treated as real product constraints rather than temporary safeguards. In other words, trust is not something to add after the system works; it is something the architecture has to make visible and enforceable from the start.
From a PM perspective, the most valuable takeaway was that scaling an AI system is partly about scaling clarity. Clear repo boundaries, readable interface contracts, and explicit approval points do more than reduce technical risk — they make the system easier for humans to inspect, govern, and improve over time.
