Skip to content

I4000 — A repeated executions.start with the same key answers one execution

Give executions.start an optional idempotency key; ExecutionStore::create returns the existing execution id for a key it has already seen instead of creating a second execution (Mission Control B1).

READY wave 0 · p1 · implementation profile · parallel safe

Part of a-session-proceeds-through-the-mesh — A session proceeds through the mesh: it finds the work, claims it once, runs it watched and stops when the intent is met.

Ready. Every dependency is done, so majordomus plan start I4000 will be accepted.

Objective

Give executions.start an optional idempotency key; ExecutionStore::create returns the existing execution id for a key it has already seen instead of creating a second execution (Mission Control B1).

Why

A double click or a retried client starts two executions of the same capability today; nothing in ExecutionStore::create recognises a repeat.

Current state

Not built: this issue is planned by the milestone a-session-proceeds-through-the-mesh and nothing of it exists.

Desired state

The acceptance criteria below hold and case 4000 proves them.

Scope

  • apps/majordomus-cli/src/execution/store.rs
  • apps/majordomus-cli/src/capability/builtin/executions.rs
  • docs/EXECUTIONS.md
  • test/cases/4000_executions_start_takes_an_idempotency_key.sh
  • .ai/repo/project/issues/I4000.yaml

Dependencies

None. This issue is a root of the graph.

What waits on this

Acceptance criteria

  • A repeated executions.start with the same key answers the same execution id and starts no second execution
  • A different key, or no key, behaves as before
  • The key lives in the execution's own record: no new store

Validation

  • env -u MAJORDOMUS_SHARE -u MAJORDOMUS_HTTP_HOST -u MJ_ROOT bash test/run.sh 4000_executions_start_takes_an_idempotency_key

Evidence required

  • case_4000_executions_start_takes_an_idempotency_key

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I4000.yaml. Read it back with majordomus plan show I4000.

Searches the titles and descriptions of every page this site publishes.