Skip to content

argv dissolution: replace hand-typed id/hostname argv with typed builders (host_reach_identity_probe) - #13564

Closed
gunbai-bot[bot] wants to merge 1 commit into
mainfrom
session/lively-bear-702
Closed

gunbai-bot[bot] wants to merge 1 commit into
mainfrom
session/lively-bear-702

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Replaces two hand-typed argv arrays in gunbc.host.host_reach_identity_probe with typed builders from extdeps.tools.*:

Before After
["id", "-un"] id_user_name_argv() (new builder in extdeps.tools.id)
["hostname"] hostname_short_read_argv() (existing builder in extdeps.tools.hostname)

Changes

  1. dag/extdeps/tools/id.dag: Added id_user_name_argv() producing ["id", "-u", "-n"] — the decomposed form equivalent to ["id", "-un"] for printing the effective username (name, not number).

  2. dag/gunbc/host/host_reach_identity_probe.dag: Updated imports and both call sites to use the typed builders.

Why this matters (argv dissolution)

Per transport_argv_anemia_dissolution and DP-M2 roadmap item "Replace hand id/hostname argv with builders":

  • Flags become modeled axes — success semantics explicit in the builder, making omit-by-typo unwritable
  • argv is derived from the model, not the reverse
  • Typed argv executes directly via typed_argv_probe_over_ssh — no re-joining into shell text that discards the checking the typing bought
  • Single source of truth for id(1) / hostname(1) flag conventions

Intentional behavioral improvement

probe_ready_target_once now runs hostname -s instead of bare hostname. This is intentional, not a refactor side-effect:

  • The result is stored in ProbeReachable.observed_short_hostname — the field name asks for a short hostname
  • On hosts where plain hostname prints the full FQDN, the probe now correctly gets the short name
  • This matches the field's semantic contract and is a fix, not a regression

Verification

  • cargo check ✅
  • Unit tests pass (1098 passed, 6 pre-existing failures unrelated) ✅
  • host_reach_identity_probe_witness_test passes ✅

…ders

- Add id_user_name_argv() to extdeps.tools.id producing ["id", "-u", "-n"] (equivalent to ["id", "-un"] for effective username)
- Replace ["id", "-un"] with id_user_name_argv() in host_reach_identity_probe.dag
- Replace ["hostname"] with hostname_short_read_argv() from extdeps.tools.hostname

This eliminates opaque hand-typed flag strings in favor of typed builders where:
- Flags become modeled axes (success semantics explicit in the builder)
- argv is derived from the model, not the reverse
- Typed argv executes directly via typed_argv_probe_over_ssh
@briansrls
briansrls added this pull request to the merge queue Oct 8, 2026
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Oct 9, 2026
@gunbai-bot

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Closed as superseded by #13626 (folded into #13641): both replace the hand-typed id/hostname argv in host_reach_identity_probe with the extdeps.tools builders. Branch kept. — sent from neat-wolf-604

@gunbai-bot gunbai-bot Bot closed this Oct 9, 2026
@gunbai-bot gunbai-bot Bot mentioned this pull request Oct 10, 2026
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.

0 participants