@martinloop/mcp 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +137 -175
  2. package/dist/arcade/resource.js +20 -20
  3. package/dist/package-version.d.ts +1 -1
  4. package/dist/package-version.js +1 -1
  5. package/dist/resources.js +148 -160
  6. package/dist/server.js +192 -43
  7. package/dist/tools/execution-policy.js +1 -1
  8. package/dist/tools/get-status.d.ts +2 -4
  9. package/dist/tools/get-status.js +6 -3
  10. package/dist/tools/preflight.d.ts +1 -1
  11. package/dist/tools/run-loop.d.ts +1 -1
  12. package/dist/tools/run-loop.js +3 -1
  13. package/dist/tools/run-store.js +1 -1
  14. package/dist/tools/tool-support.d.ts +3 -2
  15. package/dist/tools/tool-support.js +9 -2
  16. package/dist/tools/workflow-governance.d.ts +1 -1
  17. package/dist/tools/workflow-governance.js +1 -1
  18. package/dist/vendor/adapters/openai-compatible.js +6 -6
  19. package/dist/vendor/adapters/verifier-only.js +1 -1
  20. package/dist/vendor/contracts/execution-policy.js +1 -1
  21. package/dist/vendor/contracts/exits.d.ts +1 -1
  22. package/dist/vendor/contracts/governance.d.ts +1 -1
  23. package/dist/vendor/contracts/index.d.ts +1 -1
  24. package/dist/vendor/contracts/index.js +1 -2
  25. package/dist/vendor/contracts/operator.d.ts +1 -1
  26. package/dist/vendor/contracts/operator.js +1 -2
  27. package/dist/vendor/core/compiler.d.ts +2 -2
  28. package/dist/vendor/core/compiler.js +3 -1
  29. package/dist/vendor/core/exits.js +9 -4
  30. package/dist/vendor/core/grounding.d.ts +1 -0
  31. package/dist/vendor/core/grounding.js +28 -1
  32. package/dist/vendor/core/index.d.ts +2 -2
  33. package/dist/vendor/core/index.js +3 -1
  34. package/dist/vendor/core/policy-compiler.js +17 -1
  35. package/dist/vendor/core/policy.d.ts +1 -1
  36. package/dist/vendor/core/policy.js +7 -5
  37. package/dist/vendor/presentation/motion.js +0 -4
  38. package/dist/workflow-state.js +1 -1
  39. package/package.json +90 -81
  40. package/server.json +21 -21
package/dist/resources.js CHANGED
@@ -37,16 +37,6 @@ export const MARTIN_STATIC_RESOURCE_URIS = {
37
37
  modeStatus: "martin://agent/mode-status",
38
38
  memorySummary: "martin://agent/memory-summary"
39
39
  };
40
- function formatRecordedCost(usd, provenance) {
41
- if (provenance === "unavailable")
42
- return "unavailable";
43
- if (provenance === "actual")
44
- return `$${usd.toFixed(2)} provider-settled actual`;
45
- if (provenance === "calculated") {
46
- return `$${usd.toFixed(2)} calculated from observed usage`;
47
- }
48
- return `$${usd.toFixed(2)} estimated`;
49
- }
50
40
  export const MARTIN_RESOURCE_TEMPLATES = [
51
41
  {
52
42
  name: "martin_run_record",
@@ -414,7 +404,6 @@ async function buildLatestSummaryResource(runsRoot) {
414
404
  budget: loop.budget,
415
405
  cost: {
416
406
  actualUsd: loop.cost.actualUsd,
417
- provenance: loop.cost.provenance ?? "unavailable",
418
407
  avoidedUsdEstimate: loop.cost.avoidedUsd ?? 0,
419
408
  tokensIn: loop.cost.tokensIn,
420
409
  tokensOut: loop.cost.tokensOut,
@@ -450,7 +439,6 @@ async function buildLatestBudgetStatusResource(runsRoot) {
450
439
  budget: loop.budget,
451
440
  cost: {
452
441
  actualUsd: loop.cost.actualUsd,
453
- provenance: loop.cost.provenance ?? "unavailable",
454
442
  avoidedUsdEstimate: loop.cost.avoidedUsd ?? 0,
455
443
  tokensIn: loop.cost.tokensIn,
456
444
  tokensOut: loop.cost.tokensOut,
@@ -587,7 +575,7 @@ async function buildLatestProofCardResource(runsRoot) {
587
575
  `Run: \`${loop.loopId}\``,
588
576
  `Status: ${loop.status} / ${loop.lifecycleState}`,
589
577
  `Attempts: ${loop.attempts.length}`,
590
- `Spend: ${formatRecordedCost(loop.cost.actualUsd, loop.cost.provenance ?? "unavailable")}, $${(loop.cost.avoidedUsd ?? 0).toFixed(2)} avoided estimate`,
578
+ `Spend: $${loop.cost.actualUsd.toFixed(2)} actual, $${(loop.cost.avoidedUsd ?? 0).toFixed(2)} avoided estimate`,
591
579
  `Tokens: ${loop.cost.tokensIn} in / ${loop.cost.tokensOut} out`,
592
580
  `Verifier: ${verifierStatus}`,
593
581
  "",
@@ -760,173 +748,173 @@ function inferAgentNextStep(loop, verification) {
760
748
  }
761
749
  function buildMcpUsageGuide(runsRoot) {
762
750
  const metadata = buildMartinDiscoveryMetadata(MARTIN_MCP_PACKAGE_VERSION);
763
- return `# Martin Loop MCP Usage
764
-
765
- Discovery revision: \`${metadata.discoveryRevision}\`
766
- Server version: \`${metadata.serverVersion}\`
767
- Runs root: \`${runsRoot}\`
768
-
769
- Martin Loop exposes governed coding workflows over MCP. Use the server health and run-store views to decide when to preflight, execute, inspect, or escalate.
770
-
771
- ## Recommended Flow
772
-
773
- 1. Read \`${MARTIN_STATIC_RESOURCE_URIS.serverHealth}\` or call \`martin_doctor\` to confirm the environment and run-store visibility.
774
- 2. Use the \`martin_governed_coding_kickoff\` prompt to frame a governed coding request.
775
- 3. Call \`martin_preflight\` before \`martin_run\` when the task or safety envelope is non-trivial.
776
- 4. After execution, inspect \`${MARTIN_STATIC_RESOURCE_URIS.recentRuns}\`, \`martin://runs/{loopId}\`, and \`martin://runs/{loopId}/verification\`.
777
- 5. For low-context agents, read \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\`, or \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\` before asking for full JSON.
778
- 6. Read \`${MARTIN_STATIC_RESOURCE_URIS.triage}\` or call \`martin_triage_runs\` to prioritize which run needs attention first.
779
- 7. Use \`martin_debug_failed_run\` when a loop exits failed, budget-bound, or escalated.
780
-
781
- ## Current Martin MCP Surface
782
-
783
- - Tools: \`martin_run\`, \`martin_inspect\`, \`martin_status\`, \`martin_doctor\`, \`martin_preflight\`, \`martin_list_runs\`, \`martin_triage_runs\`, \`martin_get_run\`, \`martin_get_attempt\`, \`martin_get_verification_results\`, \`martin_run_dossier\`
784
- - Static resources: \`${MARTIN_STATIC_RESOURCE_URIS.serverHealth}\`, \`${MARTIN_STATIC_RESOURCE_URIS.recentRuns}\`, \`${MARTIN_STATIC_RESOURCE_URIS.triage}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestBudgetStatus}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestVerifierEvidence}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestRollbackEvidence}\`, \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\`, \`${MARTIN_STATIC_RESOURCE_URIS.governanceStatus}\`, \`${MARTIN_STATIC_RESOURCE_URIS.modeStatus}\`, \`${MARTIN_STATIC_RESOURCE_URIS.memorySummary}\`, \`${MARTIN_STATIC_RESOURCE_URIS.mcpUsageGuide}\`, \`${MARTIN_STATIC_RESOURCE_URIS.agentStartGuide}\`, \`${MARTIN_STATIC_RESOURCE_URIS.publishReadinessGuide}\`
785
- - Resource templates: \`martin://runs/{loopId}\`, \`martin://runs/{loopId}/attempts/{attemptIndex}\`, \`martin://runs/{loopId}/verification\`
786
- - Prompts: \`martin_start\`, \`martin_preflight\`, \`martin_triage\`, \`martin_resume\`, \`martin_prove\`, \`martin_release_check\`, \`martin_governed_coding_kickoff\`, \`martin_debug_failed_run\`, \`martin_publish_readiness_review\`, \`martin_triage_run_store\`
787
-
788
- ## Notes
789
-
790
- - Discovery helpers read the existing Martin run-store; they do not create new schema.
791
- - Verification history is derived from persisted \`verification.completed\` evidence in loop records and ledgers.
792
- - Attempt inspection stays aligned with the same loop selectors used by \`martin_status\` and \`martin_inspect\`.
751
+ return `# Martin Loop MCP Usage
752
+
753
+ Discovery revision: \`${metadata.discoveryRevision}\`
754
+ Server version: \`${metadata.serverVersion}\`
755
+ Runs root: \`${runsRoot}\`
756
+
757
+ Martin Loop exposes governed coding workflows over MCP. Use the server health and run-store views to decide when to preflight, execute, inspect, or escalate.
758
+
759
+ ## Recommended Flow
760
+
761
+ 1. Read \`${MARTIN_STATIC_RESOURCE_URIS.serverHealth}\` or call \`martin_doctor\` to confirm the environment and run-store visibility.
762
+ 2. Use the \`martin_governed_coding_kickoff\` prompt to frame a governed coding request.
763
+ 3. Call \`martin_preflight\` before \`martin_run\` when the task or safety envelope is non-trivial.
764
+ 4. After execution, inspect \`${MARTIN_STATIC_RESOURCE_URIS.recentRuns}\`, \`martin://runs/{loopId}\`, and \`martin://runs/{loopId}/verification\`.
765
+ 5. For low-context agents, read \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\`, or \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\` before asking for full JSON.
766
+ 6. Read \`${MARTIN_STATIC_RESOURCE_URIS.triage}\` or call \`martin_triage_runs\` to prioritize which run needs attention first.
767
+ 7. Use \`martin_debug_failed_run\` when a loop exits failed, budget-bound, or escalated.
768
+
769
+ ## Current Martin MCP Surface
770
+
771
+ - Tools: \`martin_run\`, \`martin_inspect\`, \`martin_status\`, \`martin_doctor\`, \`martin_preflight\`, \`martin_list_runs\`, \`martin_triage_runs\`, \`martin_get_run\`, \`martin_get_attempt\`, \`martin_get_verification_results\`, \`martin_run_dossier\`
772
+ - Static resources: \`${MARTIN_STATIC_RESOURCE_URIS.serverHealth}\`, \`${MARTIN_STATIC_RESOURCE_URIS.recentRuns}\`, \`${MARTIN_STATIC_RESOURCE_URIS.triage}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestBudgetStatus}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestVerifierEvidence}\`, \`${MARTIN_STATIC_RESOURCE_URIS.latestRollbackEvidence}\`, \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\`, \`${MARTIN_STATIC_RESOURCE_URIS.governanceStatus}\`, \`${MARTIN_STATIC_RESOURCE_URIS.modeStatus}\`, \`${MARTIN_STATIC_RESOURCE_URIS.memorySummary}\`, \`${MARTIN_STATIC_RESOURCE_URIS.mcpUsageGuide}\`, \`${MARTIN_STATIC_RESOURCE_URIS.agentStartGuide}\`, \`${MARTIN_STATIC_RESOURCE_URIS.publishReadinessGuide}\`
773
+ - Resource templates: \`martin://runs/{loopId}\`, \`martin://runs/{loopId}/attempts/{attemptIndex}\`, \`martin://runs/{loopId}/verification\`
774
+ - Prompts: \`martin_start\`, \`martin_preflight\`, \`martin_triage\`, \`martin_resume\`, \`martin_prove\`, \`martin_release_check\`, \`martin_governed_coding_kickoff\`, \`martin_debug_failed_run\`, \`martin_publish_readiness_review\`, \`martin_triage_run_store\`
775
+
776
+ ## Notes
777
+
778
+ - Discovery helpers read the existing Martin run-store; they do not create new schema.
779
+ - Verification history is derived from persisted \`verification.completed\` evidence in loop records and ledgers.
780
+ - Attempt inspection stays aligned with the same loop selectors used by \`martin_status\` and \`martin_inspect\`.
793
781
  `;
794
782
  }
795
783
  function buildAgentStartGuide(runsRoot) {
796
784
  const metadata = buildMartinDiscoveryMetadata(MARTIN_MCP_PACKAGE_VERSION);
797
- return `# Agent Start Here
798
-
799
- Discovery revision: \`${metadata.discoveryRevision}\`
800
- Server version: \`${metadata.serverVersion}\`
801
- Runs root: \`${runsRoot}\`
802
-
803
- Use Martin Loop as the local governor before you spend agent tokens or retry a failed coding loop.
804
-
805
- ## Cheap Default Flow
806
-
807
- 1. Read \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\` first. It is the smallest "what should I do now?" payload.
808
- 2. If no runs exist, call \`martin_doctor\`, then \`martin_preflight\`.
809
- 3. If a run exists, read \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\` before reading full run JSON.
810
- 4. If the verifier failed, use prompt \`martin_debug_failed_run\` or \`martin_triage\`.
811
- 5. If you need a shareable receipt, read \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\`.
812
-
813
- ## Install Profiles
814
-
815
- - \`minimal\` (default): doctor, preflight, list, triage, dossier. Good for low tool bloat.
816
- - \`diagnostic\`: read-only inspection tools for debugging without execution.
817
- - \`full-local\`: all local tools, including \`martin_run\`.
818
- - \`github-review\`: review-oriented local profile for PR drafting and reviewer evidence.
819
- - \`starter\` and \`full\`: compatibility aliases.
820
-
821
- ## Copy-Paste Agent Rule
822
-
823
- Before running or retrying an autonomous coding task, call Martin. Prefer compact resources first, then full dossiers only when the compact receipt says more evidence is needed. Never claim success unless Martin shows verifier-backed completion or a clear blocked reason.
785
+ return `# Agent Start Here
786
+
787
+ Discovery revision: \`${metadata.discoveryRevision}\`
788
+ Server version: \`${metadata.serverVersion}\`
789
+ Runs root: \`${runsRoot}\`
790
+
791
+ Use Martin Loop as the local governor before you spend agent tokens or retry a failed coding loop.
792
+
793
+ ## Cheap Default Flow
794
+
795
+ 1. Read \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\` first. It is the smallest "what should I do now?" payload.
796
+ 2. If no runs exist, call \`martin_doctor\`, then \`martin_preflight\`.
797
+ 3. If a run exists, read \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\` before reading full run JSON.
798
+ 4. If the verifier failed, use prompt \`martin_debug_failed_run\` or \`martin_triage\`.
799
+ 5. If you need a shareable receipt, read \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\`.
800
+
801
+ ## Install Profiles
802
+
803
+ - \`minimal\` (default): doctor, preflight, list, triage, dossier. Good for low tool bloat.
804
+ - \`diagnostic\`: read-only inspection tools for debugging without execution.
805
+ - \`full-local\`: all local tools, including \`martin_run\`.
806
+ - \`github-review\`: review-oriented local profile for PR drafting and reviewer evidence.
807
+ - \`starter\` and \`full\`: compatibility aliases.
808
+
809
+ ## Copy-Paste Agent Rule
810
+
811
+ Before running or retrying an autonomous coding task, call Martin. Prefer compact resources first, then full dossiers only when the compact receipt says more evidence is needed. Never claim success unless Martin shows verifier-backed completion or a clear blocked reason.
824
812
  `;
825
813
  }
826
814
  function buildCommandMapGuide(runsRoot) {
827
815
  const metadata = buildMartinDiscoveryMetadata(MARTIN_MCP_PACKAGE_VERSION);
828
- return `# Martin Command Map
829
-
830
- Discovery revision: \`${metadata.discoveryRevision}\`
831
- Server version: \`${metadata.serverVersion}\`
832
- Runs root: \`${runsRoot}\`
833
-
834
- Use this guide when an IDE or agent needs to know which Martin surface to call next.
835
-
836
- ## Default Governed Sequence
837
-
838
- 1. \`martin_doctor\` — confirm environment and visibility.
839
- 2. \`martin_plan\` — propose the bounded approach without spending a run.
840
- 3. \`martin_preflight\` — turn the plan into an explicit contract.
841
- 4. \`martin_run\` — execute only after the contract is safe.
842
- 5. \`martin_dossier\` — inspect what happened and what Martin prevented.
843
- 6. \`martin_eval\` — convert the result into review posture when needed.
844
-
845
- ## When To Use Which Surface
846
-
847
- - Need the smallest next action: \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\`
848
- - Need a quick receipt: \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\`
849
- - Need a shareable proof object: \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\`
850
- - Need a full run review: \`martin_dossier\`
851
- - Need to decide whether to retry: \`martin_triage_runs\`
852
- - Need IDE setup guidance: \`${MARTIN_STATIC_RESOURCE_URIS.ideOnboardingGuide}\`
816
+ return `# Martin Command Map
817
+
818
+ Discovery revision: \`${metadata.discoveryRevision}\`
819
+ Server version: \`${metadata.serverVersion}\`
820
+ Runs root: \`${runsRoot}\`
821
+
822
+ Use this guide when an IDE or agent needs to know which Martin surface to call next.
823
+
824
+ ## Default Governed Sequence
825
+
826
+ 1. \`martin_doctor\` — confirm environment and visibility.
827
+ 2. \`martin_plan\` — propose the bounded approach without spending a run.
828
+ 3. \`martin_preflight\` — turn the plan into an explicit contract.
829
+ 4. \`martin_run\` — execute only after the contract is safe.
830
+ 5. \`martin_dossier\` — inspect what happened and what Martin prevented.
831
+ 6. \`martin_eval\` — convert the result into review posture when needed.
832
+
833
+ ## When To Use Which Surface
834
+
835
+ - Need the smallest next action: \`${MARTIN_STATIC_RESOURCE_URIS.agentNextStep}\`
836
+ - Need a quick receipt: \`${MARTIN_STATIC_RESOURCE_URIS.latestSummary}\`
837
+ - Need a shareable proof object: \`${MARTIN_STATIC_RESOURCE_URIS.latestProofCard}\`
838
+ - Need a full run review: \`martin_dossier\`
839
+ - Need to decide whether to retry: \`martin_triage_runs\`
840
+ - Need IDE setup guidance: \`${MARTIN_STATIC_RESOURCE_URIS.ideOnboardingGuide}\`
853
841
  `;
854
842
  }
855
843
  function buildIdeOnboardingGuide(runsRoot) {
856
844
  const metadata = buildMartinDiscoveryMetadata(MARTIN_MCP_PACKAGE_VERSION);
857
- return `# Martin IDE Onboarding
858
-
859
- Discovery revision: \`${metadata.discoveryRevision}\`
860
- Server version: \`${metadata.serverVersion}\`
861
- Runs root: \`${runsRoot}\`
862
-
863
- Use this guide after the MCP server is installed so the host naturally uses MartinLoop during real work.
864
-
865
- ## IDE Default Flow
866
-
867
- 1. Read \`${MARTIN_STATIC_RESOURCE_URIS.agentStartGuide}\`
868
- 2. Read \`${MARTIN_STATIC_RESOURCE_URIS.operatingRulesGuide}\`
869
- 3. Use prompt \`martin_start\` or \`martin_governed_coding_kickoff\`
870
- 4. Call \`martin_doctor\`
871
- 5. Call \`martin_plan\`
872
- 6. Call \`martin_preflight\`
873
- 7. Only then call \`martin_run\`
874
-
875
- ## Goal
876
-
877
- MartinLoop should become the normal path for coding work in the host, not a manual extra step the human has to remember.
845
+ return `# Martin IDE Onboarding
846
+
847
+ Discovery revision: \`${metadata.discoveryRevision}\`
848
+ Server version: \`${metadata.serverVersion}\`
849
+ Runs root: \`${runsRoot}\`
850
+
851
+ Use this guide after the MCP server is installed so the host naturally uses MartinLoop during real work.
852
+
853
+ ## IDE Default Flow
854
+
855
+ 1. Read \`${MARTIN_STATIC_RESOURCE_URIS.agentStartGuide}\`
856
+ 2. Read \`${MARTIN_STATIC_RESOURCE_URIS.operatingRulesGuide}\`
857
+ 3. Use prompt \`martin_start\` or \`martin_governed_coding_kickoff\`
858
+ 4. Call \`martin_doctor\`
859
+ 5. Call \`martin_plan\`
860
+ 6. Call \`martin_preflight\`
861
+ 7. Only then call \`martin_run\`
862
+
863
+ ## Goal
864
+
865
+ MartinLoop should become the normal path for coding work in the host, not a manual extra step the human has to remember.
878
866
  `;
879
867
  }
880
868
  function buildOperatingRulesGuide(runsRoot) {
881
869
  const metadata = buildMartinDiscoveryMetadata(MARTIN_MCP_PACKAGE_VERSION);
882
- return `# Martin Operating Rules
883
-
884
- Discovery revision: \`${metadata.discoveryRevision}\`
885
- Server version: \`${metadata.serverVersion}\`
886
- Runs root: \`${runsRoot}\`
887
-
888
- Use these rules inside the IDE or MCP host as the default MartinLoop operating posture.
889
-
890
- ## Required Sequence Before Real Work
891
-
892
- 1. \`martin_doctor\`
893
- 2. \`martin_plan\`
894
- 3. \`martin_preflight\`
895
- 4. \`martin_run\`
896
- 5. \`martin_dossier\`
897
-
898
- ## Enforcement Rule
899
-
900
- Do not execute real coding work through MartinLoop until doctor and preflight have both been used for the current task.
901
-
902
- ## Completion Rule
903
-
904
- Do not claim success until MartinLoop shows verifier-backed completion or an explicit blocked reason backed by evidence.
870
+ return `# Martin Operating Rules
871
+
872
+ Discovery revision: \`${metadata.discoveryRevision}\`
873
+ Server version: \`${metadata.serverVersion}\`
874
+ Runs root: \`${runsRoot}\`
875
+
876
+ Use these rules inside the IDE or MCP host as the default MartinLoop operating posture.
877
+
878
+ ## Required Sequence Before Real Work
879
+
880
+ 1. \`martin_doctor\`
881
+ 2. \`martin_plan\`
882
+ 3. \`martin_preflight\`
883
+ 4. \`martin_run\`
884
+ 5. \`martin_dossier\`
885
+
886
+ ## Enforcement Rule
887
+
888
+ Do not execute real coding work through MartinLoop until doctor and preflight have both been used for the current task.
889
+
890
+ ## Completion Rule
891
+
892
+ Do not claim success until MartinLoop shows verifier-backed completion or an explicit blocked reason backed by evidence.
905
893
  `;
906
894
  }
907
895
  function buildPublishReadinessGuide(runsRoot) {
908
896
  const metadata = buildMartinDiscoveryMetadata(MARTIN_MCP_PACKAGE_VERSION);
909
- return `# Martin MCP Publish Readiness
910
-
911
- Discovery revision: \`${metadata.discoveryRevision}\`
912
- Server version: \`${metadata.serverVersion}\`
913
- Runs root: \`${runsRoot}\`
914
-
915
- Use this guide when reviewing whether the public MCP package is ready to publish, promote, or hand off for registry submission.
916
-
917
- ## Review Areas
918
-
919
- 1. Environment health: confirm \`${MARTIN_STATIC_RESOURCE_URIS.serverHealth}\` shows a sane working directory, runs root, and engine availability for the target mode.
920
- 2. Discovery surface: verify tools, prompts, static resources, and resource templates are all discoverable and named consistently.
921
- 3. Run evidence: inspect \`${MARTIN_STATIC_RESOURCE_URIS.recentRuns}\` and, when relevant, \`martin://runs/{loopId}/verification\` to confirm verification outcomes are explainable from persisted data.
922
- 4. Packaging lane: run the MCP package test, build, and smoke-pack commands before calling the package publish-ready.
923
- 5. Findings-first reporting: call out missing schema, integration gaps, triage-critical runs, and verification blockers before summarizing strengths.
924
-
925
- ## Evidence Expectations
926
-
927
- - Prefer concrete run IDs, attempt indices, and verification summaries over vague statements.
928
- - Distinguish local package validation from live registry readiness.
929
- - If a discovery helper exists but is not yet wired into the server, report that as an integration gap instead of treating the capability as fully shipped.
897
+ return `# Martin MCP Publish Readiness
898
+
899
+ Discovery revision: \`${metadata.discoveryRevision}\`
900
+ Server version: \`${metadata.serverVersion}\`
901
+ Runs root: \`${runsRoot}\`
902
+
903
+ Use this guide when reviewing whether the public MCP package is ready to publish, promote, or hand off for registry submission.
904
+
905
+ ## Review Areas
906
+
907
+ 1. Environment health: confirm \`${MARTIN_STATIC_RESOURCE_URIS.serverHealth}\` shows a sane working directory, runs root, and engine availability for the target mode.
908
+ 2. Discovery surface: verify tools, prompts, static resources, and resource templates are all discoverable and named consistently.
909
+ 3. Run evidence: inspect \`${MARTIN_STATIC_RESOURCE_URIS.recentRuns}\` and, when relevant, \`martin://runs/{loopId}/verification\` to confirm verification outcomes are explainable from persisted data.
910
+ 4. Packaging lane: run the MCP package test, build, and smoke-pack commands before calling the package publish-ready.
911
+ 5. Findings-first reporting: call out missing schema, integration gaps, triage-critical runs, and verification blockers before summarizing strengths.
912
+
913
+ ## Evidence Expectations
914
+
915
+ - Prefer concrete run IDs, attempt indices, and verification summaries over vague statements.
916
+ - Distinguish local package validation from live registry readiness.
917
+ - If a discovery helper exists but is not yet wired into the server, report that as an integration gap instead of treating the capability as fully shipped.
930
918
  `;
931
919
  }
932
920
  function withDiscoveryMetadata(value, runsRoot) {