J167: machine names follow D339 (reported hostname, os-id fallback, stable collision suffix) (#331) #337

Open
opened 2026-11-04 04:31:25 +00:00 by kayg · 3 comments
Owner

Job J167. Parent: #331 (J150 removed the unnamed-<id> projection). Owner D339: machine names are always the reported hostname; only an empty name or localhost falls back to <os>-<first 6 chars of host id>; collisions get a short stable suffix (raspberrypi-2); a machine gets its mesh DNS name as soon as it has a real one.

Scope: replace the stored unnamed / unnamed-<n> labels (store.rs, migration 0029) and the remote inventory unnamed display fallback with the D339 rule, server-side and in the UI; hand-picked names always win; migrate stored unnamed-<n>; stable collision suffixes; no DNS record for a fallback-only name; tests for each rule.
Branch: machine-names-j167, base origin/dev 226a569ac.

Job J167. Parent: #331 (J150 removed the `unnamed-<id>` projection). Owner D339: machine names are always the reported hostname; only an empty name or `localhost` falls back to `<os>-<first 6 chars of host id>`; collisions get a short stable suffix (`raspberrypi-2`); a machine gets its mesh DNS name as soon as it has a real one. Scope: replace the stored `unnamed` / `unnamed-<n>` labels (store.rs, migration 0029) and the remote inventory `unnamed` display fallback with the D339 rule, server-side and in the UI; hand-picked names always win; migrate stored `unnamed-<n>`; stable collision suffixes; no DNS record for a fallback-only name; tests for each rule. Branch: `machine-names-j167`, base origin/dev 226a569ac.
Author
Owner

Start. Branch machine-names-j167, base origin/dev 226a569ac (D339 is on dev). Worktree on code; builds/gates on compute01 via build-slot.

Plan (est. 2-3 h):

  1. host_name.rs: machine_name rejects localhost (and stops reserving unnamed*: a real hostname is a real name); add fallback_name(os, host_id) = <os>-<first 6 hex of host id>.
  2. mesh store.rs: the placeholder name becomes that fallback (collision suffix reuses the stable free_name -2..-9 then -10..); legacy unnamed* labels heal on next attach; DNS stays suppressed for name_source='placeholder' and publishes once a real name arrives.
  3. api.rs: drop the refusal of unnamed* names (hand-picked always wins).
  4. remote_inventory.rs: display fallback uses the same function.
  5. New migration (0049: dev is at 0038, other branches hold 0039-0048; renumber at rebase) renames stored unnamed/unnamed-<n> placeholders to the fallback, audited.
  6. Tests per rule.

Open question (safe default taken): for an unknown/unreported OS the fallback prefix is host (not linux), so it never claims a wrong OS. Recommendation: keep.

**Start.** Branch `machine-names-j167`, base origin/dev `226a569ac` (D339 is on dev). Worktree on code; builds/gates on compute01 via build-slot. Plan (est. 2-3 h): 1. `host_name.rs`: `machine_name` rejects `localhost` (and stops reserving `unnamed*`: a real hostname is a real name); add `fallback_name(os, host_id)` = `<os>-<first 6 hex of host id>`. 2. mesh `store.rs`: the placeholder name becomes that fallback (collision suffix reuses the stable `free_name` -2..-9 then -10..); legacy `unnamed*` labels heal on next attach; DNS stays suppressed for `name_source='placeholder'` and publishes once a real name arrives. 3. `api.rs`: drop the refusal of `unnamed*` names (hand-picked always wins). 4. `remote_inventory.rs`: display fallback uses the same function. 5. New migration (0049: dev is at 0038, other branches hold 0039-0048; renumber at rebase) renames stored `unnamed`/`unnamed-<n>` placeholders to the fallback, audited. 6. Tests per rule. Open question (safe default taken): for an unknown/unreported OS the fallback prefix is `host` (not `linux`), so it never claims a wrong OS. Recommendation: keep.
Author
Owner

Progress. Pushed d279a747e (naming rule + tests) and 994a664c0 (migration 0049 + migration tests) on machine-names-j167. Not yet compiled: verify quick is queued on compute01 (build-slot position ~9). Log: ~/j167-logs/quick.log on compute01. Next: fix whatever quick reports, then verify fast.

**Progress.** Pushed `d279a747e` (naming rule + tests) and `994a664c0` (migration 0049 + migration tests) on `machine-names-j167`. Not yet compiled: `verify quick` is queued on compute01 (build-slot position ~9). Log: `~/j167-logs/quick.log` on compute01. Next: fix whatever quick reports, then `verify fast`.
Author
Owner

Finish. Branch machine-names-j167, head fff2e9123d0e06901bb9e730131494c4c4c35ce0, rebased on origin/dev e8dc5a3c9. Two atomic commits: ff482b105 (naming rule) and fff2e9123 (migration 0049).

scripts/verify fast on compute01 (exit 0), verbatim tail:


+---------------------------+--------------+
| Rust gate                 | Result       |
+---------------------------+--------------+
| fmt                       | PASS         |
| VT native fmt             | PASS         |
| CLI plugin compile-out    | PASS         |
| clippy                    | PASS         |
| SSH runtime test helper   | PASS         |
| real-binary fixture paths | PASS         |
| Traefik component manifest | PASS         |
| release component publication | PASS         |
| test                      | PASS         |
| SSH inode reuse fixture   | PASS         |
| shim process-per-user     | PASS         |
| cargo-deny                | PASS         |
| gate architecture         | PASS         |
| doc coverage ratchet      | PASS         |
| static builds             | PASS         |
+---------------------------+--------------+

x86_64-unknown-linux-musl: exact define removed; build directories remapped; explicit paths preserved; target override refused
aarch64-unknown-linux-musl: exact define removed; build directories remapped; explicit paths preserved; target override refused
PT_INTERP: absent; size: 23385552 bytes; baseline 22418256; delta +967296 bytes (report only, D243 amended 2026-11-01)
PT_INTERP: absent; size: 21245472 bytes; baseline 20453280; delta +792192 bytes (report only, D243 amended 2026-11-01)
SKIP key memory: aarch64-unknown-linux-musl (host x86_64; native execution required)
x86_64-unknown-linux-musl: +102400 bytes accepted with delta; zero/negative deltas reported; missing/wrong/dynamic/PT_INTERP/inspection defects rejected PASS
aarch64-unknown-linux-musl: +102400 bytes accepted with delta; zero/negative deltas reported; missing/wrong/dynamic/PT_INTERP/inspection defects rejected PASS
 48 pass
 0 fail
77248 expect() calls
Ran 48 tests across 12 files. [11.14s]
VERIFY_EXIT=0

Static size: x86 +792192 bytes vs the recorded baseline (report only); dev moved 135 commits since J150's +60896, so this is mostly baseline lag; the change itself adds one SQL migration and a small function.

Earlier gate runs, honestly: runs 1-4 failed on (1) rustfmt, (2) a stale unnamed label expectation and an audit-count assertion in review_mesh_view_truth_r2, (3) non-UUID test host ids giving an empty fallback id (fixed in host_name.rs: first six alphanumerics, identical for UUIDs), (4) the contiguous-migration-list and (40, 40) assertions in remote_migration_tests.rs, (5) the D345 doc-coverage ratchet. Separately, three infraternal-agent remote_client timing tests (unavailable_udp_does_not_add_seconds_before_tcp_admission, server_path_capability_is_advertised_on_native_and_fallback_transports, winning_quic_drops_the_unfinished_tls_dial_before_control_dispatch) failed in two gate runs under heavy compute01 load, then passed in the last full gate run and in a full workspace run on this branch; the agent crate is untouched by this branch, and they also pass on unmodified 226a569ac.

Rules and tests:

  • reported hostname is the name; empty/localhost falls back to <os>-<first 6 id chars>: host_name_tests.rs, mesh/tests/naming.rs::an_empty_or_localhost_name_falls_back_to_os_and_id, remote_inventory_name_tests.rs
  • collision suffix stable across restarts: naming.rs::the_reported_hostname_is_the_name_and_a_collision_suffix_is_stable
  • real name replaces the fallback at once, an empty report never reverts it: a_machine_leaves_its_fallback_as_soon_as_it_has_a_real_name
  • hand-picked name always wins (even unnamed-3): a_hand_picked_name_always_wins
  • legacy unnamed* labels replaced at next attach; a real hostname unnamed kept: legacy_unnamed_labels_are_replaced_and_a_real_unnamed_hostname_is_kept
  • no DNS record for a fallback-only name, published once real (mesh-dns-spike feature): mesh/tests/store.rs::a_fallback_named_node_is_not_published_in_mesh_dns_until_it_has_a_real_name
  • stored labels migrated, hand names untouched, os word from the reported OS: remote_migration_tests.rs (three tests)

Not done / for the orchestrator:

  • No real-environment proof on https://test.ssh.kayg.org: it needs this branch deployed there, which I may not do. The UI shows the inventory name field unchanged; no web change was needed (no unnamed string in any .ts/.svelte file).
  • Migration number 0049: 0041-0048 are held by other branches. remote_migration_tests.rs asserts the exact list 1..=40 plus 49, so every landing migration touches that line; renumber/adjust at merge.
  • The mesh-dns-spike DNS test was not compiled by verify fast (feature off); it is built only with that feature.
  • Default taken: unknown OS gives host-<id>.
**Finish.** Branch `machine-names-j167`, head `fff2e9123d0e06901bb9e730131494c4c4c35ce0`, rebased on origin/dev `e8dc5a3c9`. Two atomic commits: `ff482b105` (naming rule) and `fff2e9123` (migration 0049). **`scripts/verify fast` on compute01 (exit 0), verbatim tail:** ``` +---------------------------+--------------+ | Rust gate | Result | +---------------------------+--------------+ | fmt | PASS | | VT native fmt | PASS | | CLI plugin compile-out | PASS | | clippy | PASS | | SSH runtime test helper | PASS | | real-binary fixture paths | PASS | | Traefik component manifest | PASS | | release component publication | PASS | | test | PASS | | SSH inode reuse fixture | PASS | | shim process-per-user | PASS | | cargo-deny | PASS | | gate architecture | PASS | | doc coverage ratchet | PASS | | static builds | PASS | +---------------------------+--------------+ x86_64-unknown-linux-musl: exact define removed; build directories remapped; explicit paths preserved; target override refused aarch64-unknown-linux-musl: exact define removed; build directories remapped; explicit paths preserved; target override refused PT_INTERP: absent; size: 23385552 bytes; baseline 22418256; delta +967296 bytes (report only, D243 amended 2026-11-01) PT_INTERP: absent; size: 21245472 bytes; baseline 20453280; delta +792192 bytes (report only, D243 amended 2026-11-01) SKIP key memory: aarch64-unknown-linux-musl (host x86_64; native execution required) x86_64-unknown-linux-musl: +102400 bytes accepted with delta; zero/negative deltas reported; missing/wrong/dynamic/PT_INTERP/inspection defects rejected PASS aarch64-unknown-linux-musl: +102400 bytes accepted with delta; zero/negative deltas reported; missing/wrong/dynamic/PT_INTERP/inspection defects rejected PASS 48 pass 0 fail 77248 expect() calls Ran 48 tests across 12 files. [11.14s] VERIFY_EXIT=0 ``` Static size: x86 +792192 bytes vs the recorded baseline (report only); dev moved 135 commits since J150's +60896, so this is mostly baseline lag; the change itself adds one SQL migration and a small function. **Earlier gate runs, honestly:** runs 1-4 failed on (1) rustfmt, (2) a stale `unnamed` label expectation and an audit-count assertion in `review_mesh_view_truth_r2`, (3) non-UUID test host ids giving an empty fallback id (fixed in `host_name.rs`: first six alphanumerics, identical for UUIDs), (4) the contiguous-migration-list and `(40, 40)` assertions in `remote_migration_tests.rs`, (5) the D345 doc-coverage ratchet. Separately, three `infraternal-agent` `remote_client` timing tests (`unavailable_udp_does_not_add_seconds_before_tcp_admission`, `server_path_capability_is_advertised_on_native_and_fallback_transports`, `winning_quic_drops_the_unfinished_tls_dial_before_control_dispatch`) failed in two gate runs under heavy compute01 load, then passed in the last full gate run and in a full workspace run on this branch; the agent crate is untouched by this branch, and they also pass on unmodified `226a569ac`. **Rules and tests:** - reported hostname is the name; empty/`localhost` falls back to `<os>-<first 6 id chars>`: `host_name_tests.rs`, `mesh/tests/naming.rs::an_empty_or_localhost_name_falls_back_to_os_and_id`, `remote_inventory_name_tests.rs` - collision suffix stable across restarts: `naming.rs::the_reported_hostname_is_the_name_and_a_collision_suffix_is_stable` - real name replaces the fallback at once, an empty report never reverts it: `a_machine_leaves_its_fallback_as_soon_as_it_has_a_real_name` - hand-picked name always wins (even `unnamed-3`): `a_hand_picked_name_always_wins` - legacy `unnamed*` labels replaced at next attach; a real hostname `unnamed` kept: `legacy_unnamed_labels_are_replaced_and_a_real_unnamed_hostname_is_kept` - no DNS record for a fallback-only name, published once real (mesh-dns-spike feature): `mesh/tests/store.rs::a_fallback_named_node_is_not_published_in_mesh_dns_until_it_has_a_real_name` - stored labels migrated, hand names untouched, os word from the reported OS: `remote_migration_tests.rs` (three tests) **Not done / for the orchestrator:** - No real-environment proof on https://test.ssh.kayg.org: it needs this branch deployed there, which I may not do. The UI shows the inventory `name` field unchanged; no web change was needed (no `unnamed` string in any `.ts`/`.svelte` file). - Migration number 0049: 0041-0048 are held by other branches. `remote_migration_tests.rs` asserts the exact list `1..=40` plus `49`, so every landing migration touches that line; renumber/adjust at merge. - The `mesh-dns-spike` DNS test was not compiled by `verify fast` (feature off); it is built only with that feature. - Default taken: unknown OS gives `host-<id>`.
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#337
No description provided.