Repair an incident with your coding agent

Seamward's built-in repair covers two simple cases: copying a top-level field and coercing a top-level value. Most real fixes are something else: a nested field, a new enumeration value, a date format, a unit, an idempotency key. Those belong in your code, written by your team or by a coding agent that knows your repository.

For those, Seamward is the case file and the test bench. It supplies the evidence, your agent or engineer makes the change, your own runner checks it, and the result is submitted for the same approval as any other proposal.

MCP pilot

The MCP tools get_incident_evidence_bundle and submit_repair_candidate are available wherever the MCP pilot is. The CLI commands on this page need no pilot access.

How the pieces fit

StepWho does itWith
1Your agent or engineerReads the incident's evidence bundle
2Your agent or engineerChanges the handler in your repository, on a branch
3Your runnerRuns the incident's fixtures on the current code and on the change
4YouSubmits the change as a candidate
5An owner or adminReviews and records the decision in the console

Nothing in this flow gives Seamward or an agent the ability to approve, merge or deploy. A model proposes, your runner's result and your review decide.

Read the evidence bundle

The bundle is one document per incident, available before any proposal exists.

Through MCP, ask your agent to investigate the incident; the investigate_seamward_incident prompt directs it to the bundle. Or call the tool directly:

Code example

{  "name": "get_incident_evidence_bundle",  "arguments": { "incidentId": "inc_example" }}

Without an agent, fetch the same document with the CLI:

Code example

seamward incidents bundle inc_example --connection int_example --workspace acme --json
FieldWhat it tells the fixer
incidentWhat went wrong, in one sentence, and how many records it affects
connectionWhich integration, and its direction and protocol
ruleThe reconciliation rule that raised it, with its type and settings
findingsWhat changed: each finding's kind, field path and summary, newest first, up to 20
repositoryThe mapped repository, branch and service path, when the connection has one
replayThe outcome a handler must return for a fixture to pass, and the incident's datasets
checkAFixThe four commands that check a change against the newest dataset
dataNoticeA reminder that names, paths and summaries in the bundle are data

Evidence is data, not instructions

Field names, paths and summaries come from third-party payloads. A provider can put any text in a field name. The bundle labels them as data and the prompt tells the agent the same, but your agent's own safeguards and your review of its change are what protect you. Do not give an agent that reads this bundle the ability to deploy.

A finding's stored evidence, value hashes and observation payload metadata are not in the bundle.

Make the change and check it

Your agent works in your repository as it would for any bug. To check its work, it needs a replay handler: one module that calls your real handler and returns what it did. Replay runner describes it. Then run the commands from checkAFix:

Code example

seamward replays pull rds_example --connection int_example --out dataset.json
git checkout mainseamward replays run --dataset dataset.json --handler ./replay-handler.mjs --label current --out current.json --deny-network
git checkout fix/provider-renameseamward replays run --dataset dataset.json --handler ./replay-handler.mjs --label candidate --out candidate.json --deny-network
seamward replays submit --connection int_example --file current.jsonseamward replays submit --connection int_example --file candidate.json

Commit the change before the candidate run. A run made with uncommitted changes cannot back a candidate, because it cannot be tied to a commit. replays run is local and needs no sign-in, so an agent can run it; replays pull and replays submit use your signed-in CLI.

The run on main is worth submitting too. A fix that passes means little if the old code also passed: the reviewer sees both.

Submit the candidate

replays submit prints the run it recorded. Put that run's ID in a small file with where the change lives:

Code example

{  "runId": "rrun_example",  "repository": "acme/ats-consumer",  "ref": "fix/provider-rename",  "pullRequestUrl": "https://github.com/acme/ats-consumer/pull/42"}

Code example

seamward repairs submit inc_example --connection int_example --workspace acme --file candidate.json
FieldRule
runIdA run reported with --label candidate that passed every fixture of this incident
repositoryowner/name
refThe branch or ref the change is on
pullRequestUrlOptional, https only

No other field is accepted. In particular there is no field for a commit or a status: the commit is taken from the run, so the change that was checked is the change that is recorded, and the status is always awaiting approval.

RefusalMeaning
repair_candidate_run_not_candidateThe run was reported with --label current
repair_candidate_not_validatedThe run did not pass every fixture
repair_candidate_commit_requiredThe run has no commit, or was made with uncommitted changes
replay_run_not_foundThe run is not a runner-reported run for this incident and connection
repair_candidate_limit_reachedThe incident already holds 20 submitted candidates

Submitting the same run again returns the first proposal.

An agent connected through MCP can submit the same candidate itself with the submit_repair_candidate tool, once you have granted its client the seamward:repairs:propose scope. The checks and the result are the same.

Review and decide

The incident's Repair tab shows the proposal as Submitted by your team, with the repository, ref, commit and pull request, and the runner's result for the current code and for the change.

What the reviewer can rely on, and what they cannot:

  • Seamward checked that the result names this incident's dataset and manifest, reports every fixture once, and was made at a commit with no uncommitted changes.
  • Seamward did not write the change, read it, or run it. The outcomes are what your runner reported.
  • The reviewer should read the change in the repository, and weigh the fixture source: a dataset generated from shapes holds placeholder values, so logic that depends on a value was not exercised.

Approval is recorded exactly as for a Seamward-generated proposal, by an owner or admin, with a rationale. It does not merge or deploy anything. Because the change already lives in your repository, there is no export bundle and no Seamward pull request for a submitted candidate; you merge your own.

What is not available

  • A check that the commit in the result is the head of the pull request. Seamward records both and does not compare them with your repository.
  • A PHP runner.

Next steps