Imported from nimbly-dev/mcp-java-dev-tools (
skills/mcp-java-dev-tools-regression-suite/SKILL.md). Install upstream withnpx skills add nimbly-dev/mcp-java-dev-tools --skill mcp-java-dev-tools-regression-suite. Copyright stays with the author.
MCP JVM Regression Suite
Single-call execution skill for regression plans.
Intent Router
- Prompts like
run regression suite,execute regression suite, orusing executionProfile <name>MUST route here. - For
execution_profileintent, execute the runtime suite branch directly; do not route to execution-profile export. - Replay/export scripts are artifacts only and are not the suite executor.
- If an upstream flow attempts to use replay export for suite execution, fail closed with
reasonCode=execution_route_invalid.
Single-Call Execution Contract
- Required input:
project_name- exactly one of:
plan_name(single-plan branch)execution_profile(ordered runtime-suite branch)
- Authoritative phase order:
phase_0_load_planphase_1_project_contextphase_2_preflight_and_discoveryphase_3_strict_probe_gatephase_4_step_executionphase_5_watchersphase_6_external_verificationphase_7_artifact_persist_and_summary
- No phase skipping. Fail closed with deterministic reason and nextAction.
- In
phase_4_step_execution, evaluatesteps[].whenbefore transport execution. - Condition outcomes are deterministic:
true=> execute stepfalse=> markskipped_condition_falseand continue- invalid/ambiguous => fail closed (
blocked_invalid)
phase_5_watchersis mandatory whencontract.watchers[]is present:- execute only after trigger-step completion
- verify bounded downstream completion/readiness
- fail closed on timeout, invalid dependency, invalid provider, or unreachable target
- inherit
workspaces[].defaults.requestTimeoutMsandretryMaxunless the Watcher overrides them independently - treat
retryMaxas inclusive attempts; a required missingactualPathis retryable until that bound or the absolute deadline - return
watcher_actual_path_missing_retry_exhaustedfor retry exhaustion andwatcher_timeoutwhen the deadline wins - record an optional missing
actualPathasskipped_optional/optional_actual_path_missingwithout retry or failure
phase_6_external_verificationis mandatory whencontract.externalVerification[]is present:- execute only after trigger-step and watcher convergence
- verify downstream data validity against external HTTP or SQL targets
- preserve secret-safe runtime/project-owned provider configuration
Branch Router
execution_profilepresent =>runtime_suite_branch:- load workspace execution profile by
executionProfilethroughartifact_management(artifactType=project_context,action=read) using explicit typed input:{ "projectName": "<project_name>", "query": { "select": ["executionProfiles"] } } - validate ordered
plans[]and execution policy - load each ordered plan through
artifact_management(artifactType=regression_plan,action=read) with explicit pagination for windowable sections before execution - execute plans in order using suite policy
- load workspace execution profile by
plan_namepresent =>single_plan_branch:- execute one regression plan using phase pipeline below
- both
execution_profileandplan_namepresent => fail closed (execution_input_conflict) - neither present => fail closed (
execution_input_required)
FSM Router
This SKILL.md is a thin router. Execute phases in order and load only the needed reference/script for each phase.
phase_0_load_plan:- reference:
references/execution-fsm.md
- reference:
phase_1_project_context:- reference:
references/runtime-policy.md - script:
scripts/runtime-converge.js
- reference:
phase_2_preflight_and_discovery:- reference:
references/runtime-policy.md - script:
scripts/preflight-resolve.js
- reference:
phase_3_strict_probe_gate:- reference:
references/probe-verification-policy.md - script:
scripts/probe-gate-check.js
- reference:
phase_4_step_execution:- reference:
references/execution-fsm.md - script:
scripts/step-execution-check.js
- reference:
phase_5_watchers:- reference:
references/execution-fsm.md
- reference:
phase_6_external_verification:- reference:
references/execution-fsm.md
- reference:
phase_7_artifact_persist_and_summary:- reference:
references/artifact-contract.md - reference:
references/output-contract.md - script:
scripts/summarize-run.js - script:
scripts/cleanup-runtime.js
- reference:
Runtime suite branch (execution_profile) rules:
- Execute
plans[]strictly byorder. - Respect suite
executionPolicy:stop_on_failcontinue_on_fail
- Respect per-plan
onFailoverride:inheritstopcontinue
- Allow suite
runtimeConfigoverrides only for:requestTimeoutMsretryMax
- Do not accept unrecognized
runtimeConfigkeys. - For actual runtime suite execution, treat
artifact_managementas the canonical plan loader:- do not read
contract.json,metadata.json, orplan.mddirectly when the same data can be loaded throughartifact_management - do not use shell/file reads as the primary source for plan steps or prerequisites
- fail closed rather than bypassing
artifact_managementfor regression plan loading when MCP path is available
- do not read
- For each plan in
execution_profileorder, use a staged plan load:- first read
query.select=["summary","targets"] - then read
prerequisiteswith explicit{ "offset": ..., "limit": ... } - then read
stepswith explicit{ "offset": ..., "limit": ... } - continue windowing until all required plan sections are loaded
- first read
- Do not replace runtime-suite artifact paging with ad hoc small-enough full reads.
- For
execution_profileprompts, the maintained execution path MUST use resumable orchestration slices:- call
execution_orchestrationwithmaxPlansPerCall - if the tool returns
status="in_progress", re-callexecution_orchestrationwith the returnedsuiteRunId - continue the same run until terminal
pass,fail,blocked, orpartial_fail
- call
- Do not restart from the beginning when resumable progress exists:
- resume with the same
suiteRunId - record revision-safe operational progress in
.mcpjvm/<project_name>/run-state.sqlitewhile retaining the canonical suite-status Artifact as execution evidence and resume input - fail closed rather than rerunning already completed plans
- serialize overlapping resumes with the suite checkpoint lease; if another caller owns it, return
status="in_progress",reasonCode="suite_checkpoint_owner_active", andnextActionCode="resume_same_suite", then retry the samesuiteRunIdafter the active owner advances the checkpoint - renew the owning lease while an active Watcher polls; stale suite revisions or non-monotonic Watcher persistence must reload the SQLite checkpoint and return the same non-terminal resume conflict shape
- When a plan is still waiting inside
watchers[]orexternalVerification[], resumed orchestration must continue that same in-progress plan:
- use persisted
progressSummary.activePlan - continue the current phase (
watchersorexternal_verification) - do not reinterpret the wait as a fresh suite start
- Use project-owned resiliency defaults from
.mcpjvm/<project_name>/projects.json:
- require
workspaces[].defaults.orchestrator.resumePollMax - require
workspaces[].defaults.orchestrator.resumePollIntervalMs - require
workspaces[].defaults.orchestrator.resumePollTimeoutMs - fail closed rather than inventing plan-level or prompt-level resume policy
- Do not summarize a runtime-suite
execution_profilerun as completed until the terminal orchestration status is returned. - Do not treat a caller/tool-boundary timeout as the primary execution result when resumable progress is available:
- resume the same
suiteRunId - report the final terminal suite status instead of timeout-first narration
- Do not reuse a stale suite artifact as the result of a fresh execution request:
- the maintained workflow must correlate the final summary to the suite run started/resumed in the current request chain
- fail closed rather than attaching an older suite summary to a new prompt
- Long-running example patterns:
- watcher-heavy async workflow: trigger producer step, persist
status="in_progress"withprogressSummary.activePlan.phase="watchers", resume the samesuiteRunIduntil watcher convergence or bounded outer stop - external-verification-heavy workflow: trigger step plus watcher pass, persist
status="in_progress"withprogressSummary.activePlan.phase="external_verification", resume the samesuiteRunIduntil external verification reaches terminal status
Context and Read Budget
Extract scope and resumable context
contract.steps[].extract[] uses scope="plan" by default. Plan context is available to later steps, dependent Watchers, and external verification in that plan. A value intended for a later profile plan must use scope="suite" and secret=false; suite promotion is explicit and only occurs after the producer plan passes. Secret classification is explicit and is never inferred from output key names. A later plan that references an unpromoted suite key fails closed with suite_context_forward_reference, while secret suite promotion returns suite_context_secret_forbidden.
During resume, call execution_orchestration with the same suiteRunId. Continue the persisted active phase and preserve completed-step context; do not resend completed triggers. Secret values remain redacted from Artifacts, MCP output, SQLite summaries, and logs.
- Always use bounded or windowed reads for Artifact inspection, logs, and generated scripts.
- Do not switch to full Artifact reads based on artifact size; this workflow should use paged/windowed inspection by default.
- Never dump full
contract.json,execution.result.json,evidence.json, or export scripts into context when a bounded/windowed read can answer the question. - When a plan contains
watchersorexternalVerification, inspect those sections with the same bounded-read discipline used forsteps. - For
artifact_managementregression_planreads:- use
query.select - treat
targetsas full - treat
prerequisitesas windowable - treat
stepsas windowable
- use
- When inspecting regression plans, always prefer explicit windows such as:
query: { "select": ["summary", "prerequisites", "steps"], "prerequisites": { "offset": 0, "limit": 50 }, "steps": { "offset": 0, "limit": 25 } }
- For actual runtime suite execution, do not treat windowing as debug-only:
- the orchestrator should load runtime suite plan inputs through these paged
artifact_managementcalls as the maintained execution path - this applies even when a direct file read might seem cheaper
- the orchestrator should load runtime suite plan inputs through these paged
- For file/shell inspection outside MCP Artifact reads, always prefer bounded reads such as:
rgSelect-Object -First- targeted line/field extraction
- If a required investigation cannot be completed without Artifact inspection, read only the minimum slice needed and say which slice was inspected.
Source of Truth
Use these references/templates:
references/execution-contract.mdreferences/execution-fsm.mdreferences/runtime-policy.mdreferences/probe-verification-policy.mdreferences/reason-codes.mdreferences/artifact-contract.mdreferences/output-contract.mdtemplates/fail-closed.result.jsontemplates/needs-user-input.result.jsontemplates/run-summary.result.jsonartifact_managementMCP Tool (operational source) for artifact lifecycle reads/validations:
artifactType=project_context(read|validate|list)artifactType=regression_plan(read|validate|list)artifactType=run_result(list|read|rebuild)artifactType=run_result,action=cleanupfor bounded SQLite retention maintenance. Use explicitinput.projectNameand the optionalinput.retentionpolicy;dryRundefaults totrue.
- For orchestrated runtime-suite execution,
artifact_managementis the maintained read path for execution profile lookup and regression plan loading.
SQLite Retention Maintenance
Retention cleanup is an explicit maintenance operation, separate from runtime shutdown cleanup:
{
"artifactType": "run_result",
"action": "cleanup",
"input": {
"projectName": "<project_name>",
"retention": {
"terminalOlderThanDays": 90,
"keepMostRecentTerminalRuns": 1000,
"dryRun": true,
"maxDeleteBatch": 500
}
}
}
Run a dry run first. Age and count retention apply together; cleanup excludes active suites, active Watchers, unexpired leases, resumable state, and unsafe or missing canonical Artifact links. A project-scoped cleanup lease rejects concurrent invocations with state_store_retention_conflict. An applied cleanup removes only SQLite projections and linkage rows, never canonical Artifact files. When summary.batchLimited=true, repeat the same cleanup action until remainingEligibleRuns reaches zero. Fail closed on retention readiness, conflict, or Artifact-link safety reasons and follow nextActionCode.
Required Artifacts and Correlation
- Run artifacts are written under:
.mcpjvm/<project_name>/plans/regression/<plan>/runs/<run_id>/context.resolved.json.mcpjvm/<project_name>/plans/regression/<plan>/runs/<run_id>/execution.result.json.mcpjvm/<project_name>/plans/regression/<plan>/runs/<run_id>/evidence.json.mcpjvm/<project_name>/plans/regression/<plan>/runs/<run_id>/correlation/correlation.json
- Workspace index path:
.mcpjvm/<project_name>/run-state.sqliteis the writable operational correlation projection.- canonical per-run Artifacts remain execution evidence; do not write
correlation-index.jsonduring execution.
execution.result.jsonstep entries MUST includedurationMs.- Correlation uses canonical
correlationPolicy+correlationEvents. - Do not author
correlation.jsondirectly; use canonical artifact writer flow. - When
watchers[]execute, watcher outcome state is first-class Artifact data and must be preserved inexecution.result.jsonandevidence.json. - When
externalVerification[]execute, external-verification outcome state is first-class Artifact data and must be preserved inexecution.result.jsonandevidence.json. run_idMUST be canonical:MM-DD-YYYY-hh-mm-ssAM- example:
05-09-2026-08-33-41PM
- Never invent ad-hoc run IDs (for example
20260509T134827387Z-customers). - If run_id is non-canonical, fail closed before artifact write.
- Runtime suite branch additionally references runtime manifest semantics at:
.mcpjvm/<project_name>/projects.jsonwith matching workspaceexecutionProfiles[]
- In multi-project workspaces (multiple
.mcpjvm/*/projects.json), always pass explicitprojectNamein artifact reads to avoid ambiguity. - Persisted artifact access in this workflow should route through
artifact_managementwherever MCP path is available. - Treat persisted suite status as the canonical resumable state for long-running workflows:
suiteRunIdnextPlanOrderprogressSummary.activePlan- completed
planRuns[]
- SQLite operational state is never a replacement for canonical run Artifacts. Persist canonical evidence first, then persist the checkpoint; a checkpoint-persistence failure blocks safe continuation and must return deterministic recovery guidance.
- SQLite recovery is a maintenance workflow, not normal suite execution. Rebuild only from canonical run Artifacts through
artifact_managementwithartifactType=run_resultandaction=rebuild; do not use legacycorrelation-index.jsonor invent active checkpoint state. - Never invoke legacy JSON backfill during normal suite execution or as a post-cutover fallback; it is an explicit pre-cutover maintenance action only.
- Cutover is an explicit maintenance action; once complete, SQLite is required and no legacy correlation-index writer or query fallback is permitted.
- Correlation projection must preserve the same
runIdandcorrelationSessionId; a fresh suite run must not reuse a terminal Correlation result from an older run merely because its key matches. - Treat persisted Probe scope state as historical observation only. Live Sidecar Probe state and runtime-instance identity remain authoritative.
MCP-First and Wrapped Transport
- Mandatory MCP tools:
probe,artifact_management,route_synthesis. - HTTP execution uses
transport_execute(wrapped-only); no raw curl fallback. - Watchers must remain bounded and fail closed; do not replace watcher polling with unbounded sleeps or open-ended retries.
- External verification contracts must keep secret-bearing connection or credential material outside persisted plan defaults.
- If toolchain is unavailable:
reasonCode=toolchain_unavailablenextAction=enable_mcp_jvm_debugger_tools_then_rerun
- Wrapper script usage is optional implementation detail.
Runtime Rules
autoStart=true:- if app is down, start via
projects.jsonruntime context - if app is up but non-compliant (probe down / no sidecar), replace and restart via runtime context
- after runtime start/restart, wait for bounded required health-check convergence before continuing into
postRuntimescripts or strict probe verification
- if app is down, start via
autoStart=false:- do not start processes
- if runtime is not already compliant, fail closed
- If
metadata.execution.probeVerification=true, strict probe gate is mandatory. - Ad-hoc direct
java -jarfallback is non-compliant whenprojects.jsonruntime context exists. - Runtime context selection policy:
- if
runtimeContextNameis provided, use it exactly or fail closed when unknown - if
runtimeContextNameis not provided andterminal-cliexists, selectterminal-cli - otherwise if any terminal context exists, select terminal context
- if multiple non-terminal contexts exist and no explicit selection is provided, fail closed and require
runtimeContextName
- if
- Never attempt Docker convergence unless selected runtime context
mode=docker.
Discovery-First Orchestration
- Build preflight from plan + context.
- Resolve discoverable prerequisites before asking user input.
- Merge precedence: user-provided > discovered > non-secret defaults.
- Re-run preflight and continue only when ready.
- Validate
watchers[]andexternalVerification[]contracts during preflight; do not defer malformed capability contracts to best-effort runtime behavior.
Strict Probe Port Mapping
- For strict runtime verification, prefer
--probe-id <id>with registry resolution. - Use
--agent-port <port>only as explicit override. - Do not rely on auto-scanned probe port in strict mode.
Deterministic Fail-Closed Codes
external_healthcheck_failedruntime_auto_replace_required(intermediate converge signal; must auto-replace in same run whenautoStart=true)probe_gate_failedstep_condition_malformedstep_condition_operator_invalidstep_condition_forward_referencestep_condition_path_missingstep_condition_type_mismatchwatcher_dependency_invalidwatcher_provider_invalidwatcher_wait_policy_invalidwatcher_timeoutwatcher_target_unreachableexternal_verification_provider_invalidexternal_verification_request_invalidexternal_verification_target_unreachable
Watcher Checkpoint Persistence
When a Watcher executes, canonical run Artifacts are written first and the bounded operational projection is then upserted into .mcpjvm/<project_name>/run-state.sqlite.
- Preserve one
watcher_runsrow per Watcher execution and boundedwatcher_attemptsrows; never create one row per processed item or raw response. - Resume the same Watcher identity with its original absolute deadline, resolved timeout/retry policy, attempt count, continuation, and suiteRunId.
- Treat stale revisions, changed deadlines, decreasing attempts, terminal-state changes, invalid continuation, and checkpoint persistence failures as deterministic fail-closed outcomes.
- Do not rerun the dependent trigger when a valid Watcher continuation exists. A checkpoint failure while work is in progress blocks safe continuation.
- Persist only bounded sanitized observation/assertion summaries; never persist credentials, authorization headers, or raw response bodies.
SQL External Verification
SQL external verification supports SQLite and PostgreSQL. PostgreSQL connection context is project-owned under sql.connection.<connectionRef>.* (host, port, database, username, password, and explicit tls.mode). It runs through the Node pg provider with bound named parameters, bounded timeout/rows/response size, and secret-safe diagnostics. Do not configure JDBC URLs, drivers, classpaths, or ask callers to provide database passwords inline. For PostgreSQL MCP integration coverage, use an isolated ephemeral Docker database and report postgresql_it_docker_unavailable as the sole infrastructure result when Docker is unavailable.