Skip to content

🌊 Wave 2026-07-10 · fix(build): зелёная библиотека + отчёт волны (closes-partial #58)#59

Draft
gHashTag wants to merge 8 commits into
mainfrom
feat/wave-report-2026-07-10
Draft

🌊 Wave 2026-07-10 · fix(build): зелёная библиотека + отчёт волны (closes-partial #58)#59
gHashTag wants to merge 8 commits into
mainfrom
feat/wave-report-2026-07-10

Conversation

@gHashTag

@gHashTag gHashTag commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Draft — не мержить автоматически (human-only per docs/AUTONOMOUS.md). Ссылается на #58.

Что делает этот PR

Возвращает зелёную библиотеку на ветке и добавляет датированный волновой отчёт. main не собирается с чистого клона с 2026-07-07 (воспроизведено: cargo build падает на HEAD 6850649).

Изменения кода (3 хирургические правки)

  1. build.rs:27-30 — кривой .map_or(0, |m| m.modified().ok()) (микс Option<SystemTime> с integer-дефолтом) → корректная and_then-цепочка. Убирает 4 ошибки build-скрипта.
  2. gen/rust/wire.rs — восстановлен из последнего зелёного 2b28312; используется src/wire.rs (7 символов: be_byte, u32_be, header_byte, frame_kind_valid, parse_accepts, HEADER_LEN, KIND_DATA), компилируется чисто.
  3. src/lib.rs — 9 сгенерированных re-export-модулей с нулём call-sites временно отвязаны (закомментированы с пометкой) — они и ломали билд. Вернуть после фикса t27c-эмиттера (PR W7.1 investigation — E0425 root cause is dropped let statements in t27c Rust emitter (findings-only) #44).

Проверка (на чистом дереве ветки)

cargo build --lib   # Finished
cargo test  --lib   # 101 passed; 0 failed

Границы честности

  • Бинарники trios_meshd, smoke_m1 НЕ чинились: они отстали от переписанного API src/ (StaticKey::from_seed, Delivery::Local, Hello::parse/authenticated, trait Transport::send/recv — которых больше нет). Это P0b / E1.3, требует знания целевого API демона, а не слепой правки. Полная сборка --bins остаётся красной.
  • gen/ не регенерировался правильным t27c (эмиттер сам баганут — Линия A / PR W7.1 investigation — E0425 root cause is dropped let statements in t27c Rust emitter (findings-only) #44).
  • Никакие -hw пункты не тронуты.

Документ

docs/WAVE_REPORT_2026-07-10.md — преамбула честности, снимок реальности hw/-sim, тепловая карта (N1–N13, только новое), наука→рецепты (свежие arXiv), 4-спринтовый план, «что дальше для TRI-NET», 3 линии сотрудничества, границы.

phi^2 + phi^-2 = 3

main has not built from a clean clone since 2026-07-07: build.rs had 4
type errors and f608dad regenerated gen/rust/*.rs with a broken t27c
(let;, return () in -> u8 fns). Reproduced: cargo build fails, 0 tests
runnable at HEAD 6850649.

Surgical green fix (lib + 101 tests):
- build.rs: replace malformed .map_or(0, Option<SystemTime>) with and_then chain
- gen/rust/wire.rs: restore from last-green 2b28312 (used by src/wire.rs)
- src/lib.rs: unwire 9 generated re-export modules with ZERO call sites,
  pending t27c emitter fix (PR #44)

Verified on branch: cargo build --lib OK; cargo test --lib = 101 passed.
Binaries (trios_meshd, smoke_m1) remain stale vs the rewritten src API
(documented as P0b, not fixed blind).

Full audit, heatmap, science, 4-sprint plan, next-steps and 3 cooperation
lanes: docs/WAVE_REPORT_2026-07-10.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
Iteration 2 of the 2026-07-10 wave. smoke_m1.rs — the harness whose exact
output lines are quoted in docs/W12_M1_HW_RESULTS.md — did not compile
against the current lib: it uses Handshake/Node/MeshError, which exist in
src/crypto.rs and src/daemon.rs but were never re-exported at the crate
root (lib.rs had zero `pub use`). So the flagship M1 hw-evidence harness
was unbuildable from main.

Fix (purely additive, zero logic change):
- lib.rs: `pub use crypto::{Handshake, MeshError, Session}; pub use daemon::Node;`

Verified: cargo test --lib = 101 passed; cargo build --bin smoke-m1 OK;
`cargo run --bin smoke-m1` prints the full M1 PASS sequence (X25519 +
ChaCha20-Poly1305, tamper + replay rejected). Ground-truth on-wire size is
44 -> 83 bytes, resolving the doc-drift discrepancy (44->79 doc is stale).

Still open: trios_meshd (13 errors) needs the root shadow stubs removed
(Delivery struct vs router::Delivery enum; StaticKey/Hello stubs; two
Transport traits with different method sets) — an API-canonicalization
call best made together with the Sprint-2 crypto hardening (same file).

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
Iteration 3 of the 2026-07-10 wave. Completes the P0 build fix end-to-end.

lib.rs held empty root "shadow stubs" (struct Delivery without variants,
struct Hello without parse/authenticated, struct StaticKey without from_seed,
a second Transport trait with send_to/recv_from) that shadowed the real
crypto::/discovery::/router::/daemon:: types. These stubs were dead (zero call
sites in src/; router.rs and modem.rs already use daemon::Transport), and they
were the sole reason trios_meshd could not compile.

Fix: remove the 5 dead stubs, re-export the real types:
  pub use crypto::{Handshake, MeshError, Session, StaticKey};
  pub use daemon::{Node, Transport};
  pub use discovery::Hello;
  pub use router::{Delivery, DropReason, MeshRouter};

Verified on a clean branch tree:
  cargo build --all-targets  -> Finished
  cargo test                 -> 101 passed; 0 failed
  cargo run --bin smoke-m1   -> full M1 PASS sequence
Both binaries (trios_meshd, smoke-m1) now build.

Correction to the report N2b framing: the types did NOT "no longer exist" —
they were shadowed. Report updated (heatmap N2b, E1.3, §7).

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
Iteration 4 of the 2026-07-10 wave — light doc-drift cleanup, facts only.

Corrected against ground truth (verified 2026-07-10):
- #[test] blocks 110 -> 101 (tests/ dir removed 2026-07-07); command src tests -> src
- Rust source lines 4 463 -> 4 544
- "T27 ported: 1" clarified to "68 in tree / 1 wired into src" (the cited
  command returns 68, contradicting the 1)
- build snippet comment 110 -> 101, все в src/

Relinked moved files (now under docs/archive/): STRENGTHEN.md,
WAVE_N3_AUDITABILITY_GAP, W7_WEAK_POINTS_STRUCTURAL.

De-linked files not on main (live in unmerged PR #29): WAVE_DEPIN,
_recon/DEPIN_COMPETITORS — annotated as such.

Added a note that radio/README.md was deleted 2026-07-07; current
reproducible RF evidence is docs/W12_E2E_RF_TEST_RESULTS.md (30/30).

No broken relative links remain in README. No code touched.

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
Iteration 5 of the 2026-07-10 wave. CI-integrity, mechanical, no design.

1. lefthook pre-push `cargo-build` was a no-op gate: `cargo build | tail -3`
   makes `$?` the exit code of `tail` (always 0), so a failed build passed
   the pre-push check. This is precisely how the broken 2026-07-07 build was
   pushed to main. Fixed to check cargo's exit directly (`if ! cargo build`).

2. Added a `cargo-audit` job (rustsec/audit-check@v2) so dependency
   advisories gate CI. Separate job — surfaces advisories without blocking
   build/test.

Accuracy note (anti-anchor): ci.yml already ran fmt + clippy -D warnings +
build + test, so the recon's "CI has no gates" was imprecise; the real hole
was the always-passing lefthook gate + no audit + no branch protection on
main (a GitHub setting, not a repo file — flagged for the owner).

Not touched: spec-drift-guard.yml still diffs deleted gen/zig + gen/c; that
guard is entangled with the t27c emitter fix (Lane A / PR #44) and should be
reduced to the rust backend only once t27c regenerates cleanly.

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
Iteration 6 of the 2026-07-10 wave. Local-DoS hardening, bounded, no crypto.

The daemon read a hardcoded world-writable /tmp/mesh.drop on every tick and
treated any node id found there as link-failed. On a shared host, any local
user could write ids into that file and drop arbitrary mesh links on a
running node.

Fix (matches the existing TRIOS_WATCH / TRIOS_GATEWAY env-var idiom):
the M5 self-heal demo hook is now opt-in via TRIOS_SIM_DROPS, which names an
operator-chosen file. Unset (default) => no file is read, drop set is empty.
The demo still works: set TRIOS_SIM_DROPS=/path/you/control.

Verified: cargo build --all-targets OK; cargo test = 101 passed; no
hardcoded /tmp/mesh.drop path remains in code.

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
Iteration 7 of the 2026-07-10 wave. Amplification-DoS hardening, bounded,
no crypto, no new deps.

The M4 gateway spawned a thread + an outbound TCP connect for every FETCH_REQ
with no bound. A flood of requests (or a Sybil) made the gateway spawn
unbounded threads and outbound connections.

Fix:
- MAX_INFLIGHT_FETCHES = 4, tracked with an AtomicUsize; a request over the
  cap is refused (logged) instead of spawning.
- fetch_public_ip now uses connect_timeout (4s) so a hung/unreachable host
  cannot pin a fetch slot indefinitely and defeat the cap (it already had a
  6s read timeout).

Verified: cargo build --all-targets OK; cargo test = 101 passed.

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
…w-1)

Iteration 8 of the 2026-07-10 wave. Fresh audit of the previously-unexamined
routing module found a real P1 forwarding bug.

handle_frame selected the next hop with no exclusion of the neighbor the frame
arrived from, and no guard against a frame this node originated looping back.
With a node pair (A—C) whose only route toward the destination is via each
other, a packet ping-pongs A->C->A->C... until TTL is burned, making zero
forward progress — TTL was the only backstop.

Fix:
- drop a frame whose end-to-end src == self.id (looped back to origin)
- split-horizon: if the chosen next hop == `from`, drop instead of bouncing
- new DropReason::Loop for both (no exhaustive DropReason matches exist, so
  the added variant is safe)

Tests: +2 regression tests (frame_looped_back_to_origin_is_dropped,
split_horizon_no_bounce_back_to_sender). Suite 101 -> 103 passed;
cargo build --all-targets green.

Noted but NOT changed (semantically debatable, would alter max reach by one
hop): TTL is checked-then-decremented, so a fully-travelled packet spends its
last transmission on a ttl==0 frame the next hop always discards. Left for a
decision by the routing owner.

Refs #58, #59.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

phi^2 + phi^-2 = 3
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