# Integration tests known to fail, gated by scripts/check_integration_baseline.py.
#
# READ THIS BEFORE ADDING A LINE.
#
# This file exists because of a measurement failure, not a quality decision.
# The integration suite could never run: conftest.py's
# `start_epistemic_graph_server` falls back to `cargo build --features full`
# inside a fixture, and fixture setup runs inside pytest-timeout's per-test 60s
# window, so a cold cargo target produced ~500 `Timeout (>60.0s)` errors. Every
# one was about the build. None was about the code. Building the engine before
# pytest (see the `pytest` hook in .config/pre-commit.yaml) made the suite
# execute for the first time on 2026-08-21: 513 passed, 17 failed.
#
# Those 17 were then diffed against origin/main file by file. Every failing test
# module, and every source it exercises, was byte-identical there — the sole
# difference in that area, src/server/mutation_batch.rs, is pure rustfmt. They
# are pre-existing debt the timeouts had been masking, so gating every push on
# them blocks releases on a backlog no branch introduced. That is the same
# situation the merge queue already answers by gating differentially against a
# base ref, and this file is the same shape as protocol_unbound_baseline.txt.
#
# The gate is NOT a mute button:
#   - a test failing that is NOT listed here fails the gate (regression),
#   - a test listed here that starts PASSING fails the gate until its line is
#     removed (the ratchet only tightens),
#   - an entry past its review-by date fails the gate.
# Its one honest limitation: it tracks WHICH tests fail, never why, so a
# baselined test whose failure mode changes stays baselined.
#
# Format, one per line:
#   <pytest-node-id>  # owner=@handle review-by=YYYY-MM-DD [note=tag]

# --- Durable-mutation ownership (5) -----------------------------------------
# `is_work_item_method` (src/server/mutation_batch.rs) claims SubmitWorkItem and
# SubmitWorkItems; `is_durable_mutation` (src/mutation_apply.rs) does not list
# them and `apply` does not handle them, so the contract gate reports
# stale=['SubmitWorkItem','SubmitWorkItems']. Identical at origin/main. Fixing it
# is a real ownership decision — either they become deterministically appliable
# durable mutations, or they leave is_work_item_method — not a test edit.
tests/test_persisted_mutation_contract.py::test_persisted_mutation_contract_gate  # owner=@genius review-by=2026-09-19 note=SubmitWorkItem-durable-ownership
tests/test_persisted_mutation_contract.py::test_live_mutation_inventory_contract  # owner=@genius review-by=2026-09-19 note=SubmitWorkItem-durable-ownership
# Its three parametrised drift cases fail from the same cause (the gate is
# already erroring, so their expected-message regexes cannot match). Listed
# without brackets, which covers every parametrisation — their ids embed
# multi-line source snippets and would be brittle written out verbatim.
tests/test_persisted_mutation_contract.py::test_inventory_drift_fails_closed  # owner=@genius review-by=2026-09-19 note=SubmitWorkItem-durable-ownership

# --- Viz client ⇄ engine encoding (5) ---------------------------------------
# Every viz round-trip is refused by the live engine with
# `INVALID_ARGUMENT: invalid request encoding` (epistemic_graph/client.py:13353).
# tests/test_viz_client.py, src/server/viz.rs and the client's viz methods are
# all unchanged since origin/main, so this is the V4 viz integration landing
# incomplete rather than anything on this branch.
tests/test_viz_client.py::test_capability_matrix_round_trip  # owner=@genius review-by=2026-09-19 note=viz-invalid-request-encoding
tests/test_viz_client.py::test_inline_columns_scatter_renders_a_real_png  # owner=@genius review-by=2026-09-19 note=viz-invalid-request-encoding
tests/test_viz_client.py::test_synthetic_scatter_clusters_forces_density_tier  # owner=@genius review-by=2026-09-19 note=viz-invalid-request-encoding
tests/test_viz_client.py::test_synthetic_graph_small_renders_at_direct_tier  # owner=@genius review-by=2026-09-19 note=viz-invalid-request-encoding
tests/test_viz_client.py::test_synthetic_graph_large_forces_density_tier  # owner=@genius review-by=2026-09-19 note=viz-invalid-request-encoding

# --- SQL request shape (2) ---------------------------------------------------
# The client sends {'query': ..., 'params_msgpack': b''}; the test asserts the
# older {'query': ...} shape. `params_msgpack` appears 9 times in client.py at
# origin/main and 9 times now — neither side moved on this branch.
tests/test_query_sql.py::test_sql_sends_rpc_and_zips_rows  # owner=@genius review-by=2026-09-19 note=params_msgpack-shape-drift
tests/test_query_sql.py::test_sql_empty_result  # owner=@genius review-by=2026-09-19 note=params_msgpack-shape-drift

# --- Concept registry (1) ----------------------------------------------------
# CONCEPT:NE-046 is cited in src/server/handlers/rdf.rs, sqlite_file.rs and
# sql_catalog_acl.rs but absent from docs/concepts.md. Both conditions already
# hold at origin/main. A one-line doc fix, owned by whoever reserved NE-046.

# --- Gate self-tests drifted from their own scripts (4) ----------------------
# Each asserts a literal that its subject script no longer contains
# (e.g. `def bounded_test()` in constrained_parallelism_gate.sh). Tests and
# scripts alike are unchanged since origin/main.
tests/test_bounded_test_runner_contract.py::test_constrained_gate_routes_every_test_phase_through_runner  # owner=@genius review-by=2026-09-19 note=gate-selftest-drift
tests/test_push_gate_evidence.py::test_subset_reuse_is_only_the_declared_clippy_proof  # owner=@genius review-by=2026-09-19 note=gate-selftest-drift
tests/test_check_wheel_completeness.py::test_static_wheel_suite_selection_does_not_start_engine  # owner=@genius review-by=2026-09-19 note=gate-selftest-drift
