Skip to content

fix(witan-core): classify omnigraph 0.13's failures as measured - #466

Merged
blarghmatey merged 2 commits into
mainfrom
omnigraph-013-error-classification
Oct 8, 2026
Merged

blarghmatey merged 2 commits into
mainfrom
omnigraph-013-error-classification

Conversation

@blarghmatey

@blarghmatey blarghmatey commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A (witan task tk-re-derive-witan-core-s-error-classification-agai-a6d8da, part of the omnigraph 0.13 upgrade, spec in #461 D7)

Description (What does it do?)

witan-core classifies omnigraph failures by CLI text and HTTP status. I ran the released 0.13.0 binary and a scratch omnigraph-server --cluster through each failure in the argument shapes we use (reads with --format json, writes with --quiet) and several no longer look the way the classifier expects. Every change here is additive, so 0.11 behaves as before.

  • omnigraph version prints internal-schema 14 (serves v14 to v14). reported_internal_schema() took the last token as the number and raised ValueError, which would fail bin/check_omnigraph_format.py at the pin bump.
  • A server-backed read prints its failure as a JSON object on stdout and leaves stderr empty. We classified stderr only, so an unknown graph, a blocked graph and an unreachable server were all fatal, with no message. The CLI attempt now reads an error object off stdout. Stdout that is not an error object is never matched against the marker tables, because it can be rows whose text is user content.
  • An unreachable server is now server discovery connection failed (DNS, TCP, proxy, or TLS); … this data request was not sent. It contains neither tcp connect error nor dns error, so the CLI path would not have waited out a restart.
  • A blocked graph answers 503 graph_unavailable, and the server does not retry it until its next restart. Over HTTP every 503 waited out the 150s restart budget. It is fatal now on both transports. A loading or transitioning graph answers with the same status and code and different prose, and is still waited for.
  • CLI exit code 75 means a 429 refused before any effect, so it is the admission cap. A read reports the same 429 as an error object, matched by its too_many_requests code.
  • The CLI reports a data response it found unstamped as this request's effects are unknown. That is CONTRACT_VIOLATION now, so a write over the CLI raises WriteIndeterminate as one over HTTP does.
  • An unknown graph is graph not found, without the quoted id that witan-code's _NOT_FOUND_RE required, so a missing cluster graph was reported as an unreachable cluster.

A second, small commit makes the commit id parser from #463 refuse a history-block slot of 16384 or more, which omnigraph cannot emit. It was raised in review here after #463 had merged.

test_binary_contract.py gains a format-14 row. Every surface it measures came out the same as format 9's.

Not in this PR, because removing them would change behaviour on 0.11 while it is pinned: the auto-repair on NEEDS_REPAIR (repair --confirm --force is a usage error on 0.13) and the OCC-sidecar quarantine markers, which no longer appear in upstream's source. They belong with the pin bump. The remaining CLI-path gaps I know of are listed on the task.

What I did not verify on the binary and took from upstream's source at v0.13.0: the loading and transitioning 503 wordings, server discovery timed out, and what triggers exit 75.

How can this be tested?

  • On omnigraph 0.11.0, this branch as pushed (rebased on main after fix(witan-core): write timestamps at millisecond precision #462 to fix(witan): stop defaulting cleanup to --keep 10 ahead of omnigraph 0.13 #465 merged): just test-witan-core 758 passed, just test-witan-council 1450 passed, just test-witan-code 684 passed.
  • Against the 0.13.0 binary, with the pin set to 0.13.0 / format 14 locally. These runs were of fix(witan-core): write timestamps at millisecond precision #462 to feat(witan-core): send and check the Omnigraph-Http-Api contract header #464 merged together, before the classifier changes, which is how the breaks above were found:
    • packages/witan-core: 718 passed, with 1 failure and 11 errors all in test_binary_contract.py (the version-line parse and the missing format-14 row). With those fixed, that file passes (29 passed, 1 skipped).
    • mcp/servers/witan-code: 681 passed, 1 failed. The failure is test_rebuild_refuses_a_path_that_is_not_the_repo_root, which also fails on 0.11 when TMPDIR is a long path and passes with the default one.
    • mcp/servers/witan: 1444 passed, 2 failed. test_pre_upgrade_candidates_exclude_the_current_binary found the second binary my harness puts on PATH. test_apply_schema_upgrades_an_old_store failed once with an empty CLI message and passed on rerun; I did not find out why.
  • I did not rerun the full suites on 0.13 after the classifier changes. The new tests are fakes built from the captured 0.13.0 output, verbatim.

https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A

@blarghmatey
blarghmatey marked this pull request as ready for review October 8, 2026 19:15
Copilot AI balanced review requested due to automatic review settings October 8, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Commit validation accepts invalid slots, and CLI contract violations lose indeterminate-write semantics.

2 open findings
What changed in this PR

This stacked PR prepares Witan components for OmniGraph 0.13 while retaining 0.11 compatibility.

Changes:

  • Updates timestamps, schema parsing, HTTP contracts, and failure classification.
  • Correctly orders history-block commit IDs and recognizes missing graphs.
  • Adds regression tests, documentation, and changelog fragments.
File Description
packages/​witan-core/​witan_core/​timeutil.py Emits millisecond timestamps.
packages/​witan-core/​witan_core/​omnigraph.py Updates CLI failure handling and retry policy.
packages/​witan-core/​witan_core/​omnigraph_install.py Parses expanded schema-version output.
packages/​witan-core/​witan_core/​omnigraph_http.py Implements HTTP contract validation and graph-state classification.
packages/​witan-core/​tests/​test_timeutil.py Tests timestamp precision.
packages/​witan-core/​tests/​test_omnigraph.py Tests OmniGraph 0.13 CLI failures.
packages/​witan-core/​tests/​test_omnigraph_install.py Tests schema parsing.
packages/​witan-core/​tests/​test_omnigraph_http.py Tests HTTP contracts and failures.
packages/​witan-core/​tests/​test_binary_contract.py Adds storage format 14 expectations.
packages/​witan-core/​changelog.d/​20261008_142113_blarghmatey_omnigraph_013_error_classification.md Records classifier fixes.
packages/​witan-core/​changelog.d/​20261008_133544_blarghmatey_omnigraph_013_http_api_header.md Records HTTP contract support.
packages/​witan-core/​changelog.d/​20261008_131307_blarghmatey_omnigraph_013_datetime_millis.md Records timestamp changes.
mcp/​servers/​witan/​witan/​server.py Uses parsed commit ordering for claim verification.
mcp/​servers/​witan/​witan/​commit_ids.py Adds commit-ID parsing and comparison.
mcp/​servers/​witan/​tests/​test_tasks.py Updates claim-verification tests.
mcp/​servers/​witan/​tests/​test_commit_ids.py Tests commit ordering.
mcp/​servers/​witan/​changelog.d/​20261008_132356_blarghmatey_omnigraph_013_commit_id_order.md Records commit-ordering fix.
mcp/​servers/​witan-code/​witan_code/​store.py Recognizes unquoted missing-graph errors.
mcp/​servers/​witan-code/​tests/​test_store.py Tests both missing-graph wordings.
mcp/​servers/​witan-code/​changelog.d/​20261008_142114_blarghmatey_omnigraph_013_error_classification.md Records missing-graph fix.
docs/​glossary.md Documents history-block commit IDs.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread mcp/servers/witan/witan/commit_ids.py
Comment thread packages/witan-core/witan_core/omnigraph.py
The commit id parser accepted any non-negative slot. Upstream caps a block at 16384 slots and refuses an id at or above that, so such an id did not come from omnigraph. Parsed, it would have ordered as a real, newer commit and satisfied the catch-up check instead of taking the unknown-id path.

Claude-Session: https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A
Run against the 0.13.0 binary, several failures no longer look the way
witan-core's classifier expects. Each change below is additive, so 0.11
behaves as before.

- `omnigraph version` prints `internal-schema 14 (serves v14 to v14)`.
  reported_internal_schema() took the last token and raised ValueError,
  which would fail bin/check_omnigraph_format.py at the pin bump.
- A server-backed read with `--format json` prints its failure as JSON on
  stdout and leaves stderr empty. Classifying stderr alone made an unknown
  graph, a blocked graph and an unreachable server all fatal, with an
  empty message. The CLI attempt now reads an error object off stdout.
  Stdout that is not one (rows from a read that died) is never matched
  against the marker tables.
- An unreachable server is "server discovery connection failed … this data
  request was not sent", which contains neither `tcp connect error` nor
  `dns error`, so the CLI path would not have waited out a restart.
- A blocked graph answers 503 graph_unavailable and is not retried by the
  server until its next restart. Over HTTP every 503 waited out the
  restart budget. It is fatal now on both transports. The loading and
  transitioning 503s share the status and code, differ only in prose, and
  are still waited for.
- CLI exit code 75 means a 429 refused before any effect: admission cap.
  A read reports the same 429 as an error object, matched by its
  too_many_requests code.
- The CLI reports a data response it found unstamped as "this request's
  effects are unknown". That is CONTRACT_VIOLATION now, so a write over the
  CLI raises WriteIndeterminate as one over HTTP does.
- An unknown graph is `graph not found`, without the quoted id that
  witan-code's `_NOT_FOUND_RE` required, so a missing cluster graph was
  reported as an unreachable cluster.

test_binary_contract gains a format-14 row. Every surface it measures came
out as format 9's on 0.13.0.

Left for the pin bump, because removing them would change 0.11: the
auto-repair on NEEDS_REPAIR (`repair --confirm --force` is a usage error on
0.13) and the OCC-sidecar quarantine markers.

Claude-Session: https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A
@blarghmatey
blarghmatey force-pushed the omnigraph-013-error-classification branch from e3af3b7 to 7aa4b25 Compare October 8, 2026 19:53
@blarghmatey
blarghmatey merged commit 89d8ab4 into main Oct 8, 2026
20 checks passed
@blarghmatey
blarghmatey deleted the omnigraph-013-error-classification branch October 8, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants