Skip to content

Nexora v0.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 17:51
· 284 commits to main since this release
e988694

Added

Core Engine

  • Execution cancellation - NexoraEngine.cancel(executionId) returns CompletableFuture<Boolean> (true if cancelled, false if already finished; fails with ExecutionNotFoundException for unknown ids). Pending steps are never started, running steps are interrupted, the execution is persisted as CANCELLED, and PlanCancelledEvent fires. Saga compensation runs for completed steps when enabled. Cancelled executions are not dead-lettered. New ExecutionStatus.CANCELLED and ExecutionState.CANCELLED (#33)

Observability

  • NexoraEngine.submit(intent) - Starts an execution and returns an ExecutionHandle (executionId + result future) immediately, so the id is known before the run finishes (#33)
  • OpenAPI specification for the observe server - A hand-maintained OpenAPI 3.1 document covering every endpoint, with schemas and success and error examples, served at GET /openapi.yaml. Swagger UI is served at GET /docs from the bundled org.webjars:swagger-ui assets under a strict Content-Security-Policy, with no CDN or validator calls. CI lints the document with Redocly CLI, and OpenApiSpecTest fails the build when a route is added without documenting it or the document describes a route the server does not serve (#46)
  • Execution replay - NexoraEngine.replay(executionId) re-runs a FAILED, TIMED_OUT, CANCELLED or COMPENSATED execution with the same goal and context under a new execution id; the original id is in the replay's context as _replayOf. Steps that completed reuse their original idempotency key so idempotent capabilities skip repeated side effects; failed steps, and every step of a compensated execution, get fresh keys. Exposed as POST /api/executions/{id}/replay (202, 404, 409 with the current state), nexora replay <executionId>, and a Replay button in the history panel. Dead letter replay now delegates to it (#37)
  • Execution history REST API - GET /api/executions lists executions newest first with keyset (cursor) pagination and status, goal, from / to, limit filters, responding {"data": [...], "cursor": "...", "total": N}. GET /api/executions/{id} returns one execution with its step records. ExecutionStore gains findByFilter(ExecutionFilter) and count(ExecutionFilter); the JDBC store builds both with bound parameters only and adds an index on (started_at, execution_id). The observe UI and the payment pipeline demo get an Execution History panel with status and goal filters, cursor-based Load more, and click-to-expand step detail (#34)
  • Cancel REST API, CLI, and UI - POST /api/execute and DLQ replay now return the new executionId. The observe UI has a Cancel button on running executions, and the payment pipeline demo adds a cancellation scenario and a "Slow payment" preset. DELETE /api/executions/{id} on the observe server (200 cancelled, 404 unknown, 409 already finished) and nexora cancel <executionId> [--server URL]. New nexora_plan_cancelled_total counter; cancels are not counted as failures (#33)
  • Health check endpoints - GET /health/live (liveness), GET /health/ready (readiness: persistence, plugins, executor; 503 with a per-check breakdown when any is DOWN), and GET /health (summary with version, checks, and capability circuit states). All three are unauthenticated. New nexora_ready gauge and NexoraNotReady alert (#31)

Changed

  • Code formatting enforced - All Java code is formatted with palantir-java-format via the Spotless Maven plugin. mvn verify fails on unformatted code; run mvn spotless:apply to fix

  • /health/ready semantics - Readiness now reflects the engine's own dependencies instead of capability circuit state. An OPEN circuit no longer returns 503; circuit states moved to the capabilities field of GET /health (#31)

  • PluginManager.loadPlugin(Path) returns the plugin id - Previously void. Source compatible; code compiled against an older nexora-plugin-loader must be recompiled (#140)

  • DagStepScheduler.schedule(Plan, ExecutionContext, AtomicBoolean) replaced by schedule(Plan, ExecutionContext, HaltSignal) - HaltSignal carries why the execution stopped (DEADLINE or CANCELLED) so the scheduler can report TIMED_OUT or CANCELLED. Deadline behaviour is unchanged (#33)

  • Default webhook events include CANCELLED - Intents without explicit webhookEvents are now notified when cancelled (#33)

Fixed

  • Step records could be persisted out of order - Step persistence ran as asynchronous event-bus handlers with no ordering, so a step's completion could be written before its start (leaving it RUNNING), and step rows could still be missing when the execution's result completed. Step persistence now uses the new ExecutionEventBus.subscribeSync, which runs inline in publish order; the step-start row, with its idempotency key, is written before the capability runs (#37)
  • Execution state write failures were silent - JdbcExecutionStore.updateExecution swallowed SQL errors, so a failed terminal write could leave a record stuck at COMPENSATING (blocking replay) or at FAILED after compensation. It now throws, and the engine retries state writes up to three times. The engine also keeps an execution tracked until saga compensation has finished, so replay and cancel never act on a half-written record (#37)
  • Step idempotency keys were erased on completion - JdbcExecutionStore.upsertStep replaced the whole row, and completion and failure updates carry no key, so the key recorded at step start was lost as soon as the step finished. Updates without a key now keep the recorded one (#37)
  • findById reported database errors as "not found" - JdbcExecutionStore.findById swallowed query failures and returned empty, so a database outage surfaced as 404 from the detail endpoint and as NOT_FOUND from cancel. It now throws IllegalStateException; both endpoints answer 500 (#34)
  • Observe server failed to serialize java.time values - nexora-cli lacked jackson-datatype-jsr310, so any response containing an Instant or Duration threw instead of responding: GET /api/dead-letters with entries, webhook delivery records, and GET /health once capabilities were registered. Instants serialize as ISO-8601 timestamps and durations as ISO-8601 durations (PT0.25S) (#34)
  • Timed-out capabilities kept running - TimeoutInterceptor used CompletableFuture.cancel(true), which does not interrupt the worker, so a capability that exceeded its timeout carried on in the background. It now runs on a FutureTask and is interrupted on timeout (#33)
  • Retries after interruption - RetryInterceptor no longer starts another attempt once the step thread has been interrupted (#33)
  • Plugin jars never activated - NexoraEngine.Builder.withPluginJar() loaded the jar but never activated the plugin, so its capabilities and planners were never registered and executions failed with CAPABILITY_NOT_FOUND. build() now activates jar plugins after inline plugins, in the order added, and fails with PluginInitializationException if activation fails (#140)