Agent loop
Agents often treat a clean mfdoctor check as a full green bill of health. That
is wrong. Offline check is tier 1 (config / static). Tier 2 is plugin
emit on a real build plus the workspace gate. Claim green only after both tiers
pass, and never treat incomplete analysis as a pass.
Two tiers
Hard rule: do not claim green from mfdoctor check alone.
Intended loop
-
Discover the versioned CLI contract (no project config, no network):
-
Run tier 1 and keep machine-readable artifacts (do not scrape ANSI terminal output):
-
Load structured fix guidance when needed:
Prefer
findings[].suggestionin the JSON report and SARIFproperties.fix/runs[0].properties.incompleteReasons[].fixover scraping engine stderr. A failed run that already wrotereport.jsonprints the structured report instead of a duplicatecould not completedump. -
Apply a narrow fix for that finding. Rebuild with a mfdoctor adapter so emit evidence exists, then re-run tier 1 as needed.
-
Before claiming green, finish tier 2:
Quiet success prints nothing. Exit codes: 0 policy passed, 1 policy failed,
2 analysis incomplete.
doctor/partial-analysis is not green
doctor/partial-analysis means mfdoctor
lacked facts it needed, missing MF options, unresolved dynamic imports, unread
sources, budget-limited projects, omitted workspace projects, or missing emit
capabilities (for example Vite without manifest: true).
Treat it as incomplete analysis, not a soft warning you can ignore:
- Do not claim green while a non-suppressed
doctor/partial-analysisremains. - Exit code
2means analysis incomplete, same rule: not a pass. - Prefer restoring evidence (pass
moduleFederation, enable emit/manifests, fix source reads, raise budgets, or use an opt-in runtime trace) over muting the rule. Suppress only when the user asked for intentional governance.
Rules that depend on absent evidence stay honest: for example unresolved
package-capable dynamics suppress false shared/unused certainty in favor of
partial analysis. See the
capability matrix.
Who this helps
Out of scope (do not invent)
mfdoctor does not ship, and agents must not invent:
- HTML UI /
--uidashboard - In-browser doctor or runtime agent injection
- A general
--fixthat mutates the project without a finding-driven change - MCP servers, VS Code problem matchers, or
check --watch(tracked separately) - A Next.js (
@module-federation/nextjs-mf) adapter, unsupported; prefer Rsbuild or Modern.js (limitations)
For Module Federation concepts (shared, remotes, Bridge, observability), use the
upstream mf skill. For mfdoctor commands, formats, and exit codes, see the
CLI reference and Get started.