omnigraph/docs/errors.md
Ragnor Comerford a61e82f47a
MR-794 step 2: docs — runs/invariants/architecture/execution + cleanup
Refresh user-facing and agent-facing docs for the staged-write rewire
and clean up stale Run-state-machine references that survived MR-771.

MR-794-specific updates:
* docs/runs.md — remove "Known limitation: mid-query partial failure"
  section; document the in-memory accumulator + D₂ rule + the
  LoadMode::Overwrite residual.
* docs/invariants.md §VI.25 — flip from aspirational/open to
  upheld for inserts/updates. Within-query read-your-writes is now
  load-bearing for the publisher CAS contract.
* docs/architecture.md — add "Mutation atomicity — in-memory
  accumulator (MR-794)" subsection with per-op flow; refresh the
  engine + state diagrams to drop RunRegistry and add MutationStaging.
* docs/execution.md — rewrite the mutation flow sequence diagram
  for the staged-write path; updated the LoadMode table to call
  out per-mode commit semantics; rewrote load vs ingest.
* docs/query-language.md — document the D₂ parse-time rule.
* docs/errors.md — add the D₂ BadRequest rejection path.
* docs/testing.md — extend the runs.rs row to cover the new MR-794
  contract tests; add the staged_writes.rs row.
* docs/releases/v0.4.1.md (new) — release note covering the rewire,
  test additions, residuals, and files changed.
* AGENTS.md (CLAUDE.md symlink) — update the atomic-per-query
  description and the L2 capability matrix row.

Stale-reference cleanup (MR-771 leftovers):
* docs/storage.md — drop live _graph_runs.lance / _graph_run_actors.lance
  from the layout diagram and prose; mark legacy.
* docs/branches-commits.md — move __run__<id> to a legacy note;
  remove publish_run from the publish-trigger list.
* docs/audit.md — refresh _as API list (drop begin_run_as / publish_run_as);
  legacy RunRecord.actor_id moved to a historical note.
* docs/constants.md — mark run registry / branch-prefix rows as legacy.
* docs/cli.md — replace the legacy omnigraph run * quickstart block
  with omnigraph commit list/show.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 10:43:19 +02:00

1.9 KiB

Errors and Result Serialization

Error taxonomy (omnigraph::error::OmniError)

  • Compiler(...) — schema/query parse/typecheck errors
  • Lance(String) — storage layer
  • DataFusion(String) — execution layer
  • Io(io::Error)
  • Manifest(ManifestError { kind: BadRequest|NotFound|Conflict|Internal, details: Option<ManifestConflictDetails>, … })
    • ManifestConflictDetails::ExpectedVersionMismatch { table_key, expected, actual } — caller's expected_table_versions did not match the manifest's current latest non-tombstoned version (set by OmniError::manifest_expected_version_mismatch).
    • ManifestConflictDetails::RowLevelCasContention — Lance row-level CAS rejected the publish because a concurrent writer landed the same object_id. Retried internally by the publisher; only surfaces if the retry budget exhausts.
    • D₂ parse-time rejection (MR-794): a single mutation query that mixes inserts/updates with deletes errors out before any I/O with kind BadRequest. Message: mutation '<name>' on the same query mixes inserts/updates and deletes; split into separate mutations: (1) inserts and updates, then (2) deletes. See docs/query-language.md for the rule and docs/runs.md for the underlying staged-write rationale.
  • MergeConflicts(Vec<MergeConflict>)

Compiler-side NanoError covers parse / catalog / type / storage / plan / execution / arrow / lance / IO / manifest / unique-constraint, each with structured spans (SourceSpan { start, end }) for ariadne-style diagnostics.

Result serialization (omnigraph_compiler::result::QueryResult)

  • to_arrow_ipc() — efficient binary
  • to_sdk_json() — JS-safe JSON (large i64 wrapped in metadata)
  • to_rust_json() — Rust-friendly JSON
  • batches() — direct Arrow RecordBatch access

Mutation results: { affectedNodes: usize, affectedEdges: usize } (also exposed as a tiny Arrow batch).