Maintenance creation + the research run [Flow]
Source path: knowledge-base/diagrams/flows/maintenance-run.md
# Maintenance creation + the research run `[Flow]`
Reminders and research cycles are created the same way across Domain, Constellation, and Onboarding — a method chooser, **one shared planned→record converter**, then the cycle runs on cadence.
```mermaid
flowchart LR
Menu["MethodMenu"]
Menu -->|AI plan| A["suggestResearchPlan /<br/>suggestReminderPlan"]
Menu -->|AI prompt| B["suggest…FromPrompt"]
Menu -->|custom| C["CustomForm /<br/>ReminderEditorModal"]
A & B & C --> Conv["**plannedLoopToCycle /<br/>plannedReminderToDomainReminder**"]
Conv --> Rec["ADD_RESEARCH_CYCLE /<br/>UPSERT_DOMAIN_REMINDER"]
Rec -->|fires on cadence| Run
subgraph Run["Research run · research/firecrawl.ts + ingest.ts"]
direction LR
r1["expandLoopToJobs<br/>monitor/discover/track → jobs"]
r2["fetch + parse<br/>→ provider hits"]
rI["Article identity gate<br/>canonical URL + prose copy check"]
r3["novel Articles only<br/>→ Stream priors"]
r1 --> r2 --> rI --> r3
end
Run -->|"evidence for the Program"| Prog(["Research → Opinion"])
```
- **One converter each is the invariant.** AI plan, AI prompt, custom, onboarding, and the headless op all route through `plannedLoopToCycle` / `plannedReminderToDomainReminder` (`lib/engine/research/program.ts`), so a record built one way is identical to a record built another. Ids come from `newId()` / `ctx.newId()`, never a hand-rolled timestamp.
- **Breadth** (articles per source) defaults to **focused = 3** (`DEFAULT_ARTICLES_PER_SOURCE`; net labels minimal·focused·steady·broad·wide·exhaustive → 1·3·5·10·20·40), as a preset default or per-item override.
- **Article novelty precedes capacity and belief movement.** Tracking URLs, unchanged recaptures, mirrors,
and conservative near-copies of the prose are one Article and contribute no new evidence. Independently
written reporting remains distinct even when it covers the same event. A zero-novel-Article cycle is a
successful, silent cycle; duplicate and capacity-deferred counts stay in the run audit, not Stories or errors.
- The synthesised priors feed the [Program loop](../concepts/program-loop.md); the cadence itself is driven by the scheduler in [engine-pipeline](engine-pipeline.md).
Open on GitHubRaw Markdown source