tractor/ai
Gud Boi 7e20585f59 Reconcile plan 01 w/ the live-kernel findings
Per contract §0 ("if this doc disagrees with the code, the code
wins; fix it in the same PR"), fold the step-0 probe results and
the as-landed impl back into `01_tipc_backend.md`.

Settled the two claims §9 flagged as unverified,
- `SO_ACCEPTCONN` on `AF_TIPC` **works** (answers `1`); we never
  needed trio's `except OSError` carve-out.
- dup-name bind → **silent crosstalk is real**: both binds
  succeed and dials alternate strictly, so a `.get_random()`
  clash is never `EADDRINUSE`.

Corrections where the plan was wrong,
- §5.2's `tipc_event` is **48B not 40B** (`4+4+4+8+28`), and
  python exposes `TIPC_WAIT_FOREVER` as `-1` so it needs masking
  before packing as `'I'`.
- §7.2's pytest mark goes in `_testing/pytest.py::
  pytest_configure()`, NOT `pyproject.toml` — the repo has no
  `markers` ini table.
- §7.4's "10k → 10k distinct" is a ~1.2% flaky assert by
  birthday bound on a 32b instance space; use `>= n-2` w/ the
  arithmetic documented.
- §2.2's `unwrapped_type` and §3.2's `from_addr()` sketch still
  showed the 2-tuple + the `'tipc:<stype>:<scope>'` prefix hack
  that §2.2 itself had already withdrawn.

Two hazards the plan never anticipated, now recorded in §9,
- an unpublished-name dial answers `EHOSTUNREACH` which python
  maps to a **bare `OSError`**, NOT a `ConnectionError` subtype,
  so the `_reraise_as_connerr()` wrap is contract-§4 mandatory.
- a connect-then-drop peer answers `ENOTCONN` from
  `getpeername()`, which — since `.get_stream_addrs()` runs
  BEFORE the handshake — used to kill the whole actor.

Also withdraw §9's "fold a 6-byte digest into `(stype_low,
instance)`" escalation: varying `_stype` per-actor would need
65536 topology subscriptions and kills layer B outright.

(this patch was generated in some part by `claude-code` using `claude-opus-5` (`anthropic`))
2026-08-14 22:13:52 -04:00
..
conc-anal Bump trio depth=3 cancel timeout 6→12s 2026-06-17 17:39:44 -04:00
prompt-io Log prompt-io for the tpt-backend planning arc 2026-08-12 20:36:03 -04:00
tooling-todos Add `logspec` leaf-mod Route B follow-up doc 2026-06-17 15:47:07 -04:00
tpt-backends Reconcile plan 01 w/ the live-kernel findings 2026-08-14 22:13:52 -04:00