# Synchronize Vessel state and definitions
Source: https://docs.maelstrom-ai.co/agents/prompts/maelstrom-state-sync/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

[Agent prompts](https://docs.maelstrom-ai.co/agents/prompts/) / Synchronize Vessel state and definitions

CURRENT PROMPT

Copy or download the canonical Markdown body. Frontmatter and page metadata are not included.

## Prompt details

Prompt version

0.1.0

SDK compatibility

`@maelstrom-co/client` `0.1.0-alpha.4` `@maelstrom-co/protocol` `0.1.0-alpha.4`

## Prompt body

### Synchronize Vessel state and definitions

```

Diagnose and, if authorized, implement the correct Maelstrom Vessel definition or
runtime-state update path for this case.

Vessel / Instance: [ID OR PATH]
Registration: [FACTORY-DECLARED | RUNTIME-REGISTERED | UNKNOWN]
External state source: [STORE / API / PROPS / OTHER]
Observed conflict or desired change: [DETAILS]
Implementation authorized: [YES / NO]

## Inspect ownership and state

Read the application owner of each relevant value, registration site, installed
SDK version and the matching update API/types/source/tests. Determine whether the
request changes an Instance's Variant/props, republishes a definition, changes
layout, or combines these. Record whether removed Variants or Actions are used by
live Instances, and whether requests/updates may be in flight. Keep unknown
ownership or policy as explicit questions.

## Select the supported path

- The client owns layout state; do not treat the Engine as the source of
  application data or overwrite its decisions as a reconciliation loop.
- Use the inspected factory-aware path for factory-declared Vessels and the
  inspected registration handle/update path for runtime-registered Vessels.
  Confirm method names and return/conflict behavior in the installed version.
- Handle live Variant/Action and in-flight update conflicts explicitly. Do not
  drop or force an update unless the application has an authorized policy.
- Preserve UpdateCoordinator's supported batching; do not reproduce its internals
  unless the app intentionally uses the lower-level client API.
- When processing an Engine response, preserve atomic command order: apply
  `set_layout` before `execute_actions`, so actions may target newly placed
  Instances. Do not add inline size/overflow reconciliation; a changed Chart
  dimension is handled by the existing resize request path.

If implementation is authorized, make the smallest change within the supplied
scope; otherwise make no edits. Add deterministic tests for the selected update
path and conflict behavior. Run affected checks and report exact commands and
outcomes; do not claim live Engine verification from a test double.

Return an ownership map, observed registration/update mechanism with source
anchors, conflict/race handling, changed files or plan, test results, and
unresolved policy questions.
```
