Phase 3 adds correlation propagation, idempotency for mesh task creation and scheduling, optional result handles for completed tasks, and a minimal result download path on the director host.
Depends on: MeshPhase0NorthStar.md, MeshPhase1ControlPlane.md, MeshPhase2TransportAndAuth.md.
X-Ashlar-Correlation-Id— If the client omits it on/api/mesh/*orPOST /api/bricks/*/execute,MeshCorrelationMiddlewaregenerates one and echoes it on the response. The value is also used when creating/updating mesh tasks ifCorrelationIdis not set in the JSON body.- Task state stores
CorrelationId; placement updates it when a non-empty correlation is passed to schedule/retry.
| Operation | Behavior |
|---|---|
POST /api/mesh/tasks with IdempotencyKey |
Returns the existing task with the same key (HTTP 200, same taskId). |
POST /api/mesh/tasks/{id}/schedule with ScheduleIdempotencyKey |
If the task is already Assigned and the key matches LastScheduleIdempotencyKey, returns the same assignment (no second placement). If the task is Assigned but a different key is sent, returns 409 Conflict with the current task body. |
POST .../retry |
Same schedule key semantics after reassignment. |
Request bodies for schedule/retry are optional JSON: { "scheduleIdempotencyKey": "...", "correlationId": "...", "leaseSeconds": 600 } (Phase 6 leaseSeconds optional, 60–86400).
Task responses include Phase 6 lease fields when assigned: leaseToken, leaseOwnerPeerId, leaseExpiresUtc, checkpointHandle (see MeshPhase6LeasesAndCheckpoints.md).
PATCH /api/mesh/tasks/{id}/statusaccepts optionalresultSummaryandresultHandlewhen moving to Succeeded or Failed. When the task is Assigned or Running and has aleaseToken, the body must include a matchingleaseToken(otherwise 409 Conflict).GET /api/mesh/tasks/{id}/result— IfresultHandleis an absolute file path on the director host and the file exists, streams it asapplication/octet-stream. This is a convenience for small artifacts; large blobs should use object storage outside Ashlar (Phase 3 scope).
- Knowledge replication — see MeshPhase4KnowledgeSync.md for adaptation + pattern sync between peers.
- Automatic brick execution from the director after schedule (caller still dispatches to
assignedApiBaseUrl). - Distributed idempotency or correlation store (in-memory only).
- Brick execute request body correlation injection (clients should forward
X-Ashlar-Correlation-Idto workers).
| Date | Change |
|---|---|
| 2026-04-22 | Initial Phase 3 doc and API extensions. |