Repository navigation
WIP: special-paths: publish the registry consumer face for niu S5 (niubash#627/#628) - #2011
Merged
Merged
Conversation
…5 faces Enabler for niubash#627/#628 (vfs audit slice S5: completion and highlighting ask the special-path registry). No semantic change — the classification judgments are byte-identical; this only makes the registry reachable from outside the crate and adds the two enumeration faces its consumers need. - special_paths: the classification enum/function and the per-class queries become pub (the module was already pub mod; every item was pub(crate), so the host could not ask the registry at all). canonical_fd_number stays internal. - special_dev_entries(): the listable children of the shell-namespace /dev — leaf device/alias names plus the fd/tcp/udp prefix dirs. A two-way consistency pin (special_dev_entries_match_classification) proves the table against the classification over the audit's /dev vocabulary, so a future registry arm trips the pin until the table follows in the same change. Spellings the registry does not classify (/dev/zero, /dev/full, /dev/tty — audit D5) are deliberately not listed: the open points treat them as plain filesystem paths. - Executor::open_fds(): the session's open fd numbers from the fd table — the dynamic /dev/fd completion tier's source (audit §6.4: the fd table itself, never a name list). Pinned end-to-end in tests/session_api.rs: a fresh session holds [0, 1, 2], `exec 3>/dev/null` adds 3, `exec 3>&-` removes it. Refs unixwin/niubash#627 Refs unixwin/niubash#628
caomengxuan666
marked this pull request as ready for review
October 29, 2026 01:29
caomengxuan666
added a commit
that referenced
this pull request
Oct 29, 2026
… table with #1898 Master advanced eight PRs while this family was in flight. The one semantic intersection is PR #2011 (S5 registry faces, niubash#627): it added special_dev_entries() — the listable /dev table — with zero/full deliberately absent and a consistency pin stating that a future /dev/zero simulation (audit D5) must update the table in the same change. #1898 is that simulation: the table now lists zero/full as leaf entries and the doc comment records the move. Everything else auto-merged cleanly (notably #2022's #1965 guard-strip alongside #1966, and #2010's -D warnings hygiene). Verified on the merged tree: cargo check --all-targets -D warnings is clean for the library and every target this family touches; the single remaining error (dead 'status' field in tests/issue1941_1948_sim_layer_option_regressions.rs) is byte-identical to master 1f007cc — master's own debt, not this branch's.
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion face for the niubash S5 slice (completion #627 + highlighting #628 per the vfs audit,
~/workspace/vfs-audit/REPORT.md§6.2/6.4/6.5): the audit's unified-layer ruling is that both host faces ask the engine's special-path registry — but the registry was unreachable from outside this crate (pub mod special_paths, every itempub(crate)). This PR publishes the consumer face. No semantic change: classification judgments are byte-identical; the existing in-crate test matrix is untouched.What's here
special_pathsitemspub(crate)→pub: the class enum,classify_special_path, and the per-class queries (is_net_redirect_target,is_shell_null_device,fd_alias_target,synthetic_proc_content,is_synthetic_link_path,synthetic_link_target,synthetic_proc_dir_entries).canonical_fd_numberstays internal.special_dev_entries()(new, inside the registry module): the listable children of the shell-namespace/dev— leaf names (null/stdin/stdout/stderr) plus thefd/tcp/udpprefix dirs. Pinned byspecial_dev_entries_match_classification, a two-way consistency check over the audit's/devvocabulary: a spelling is listed ⟺ its family is classified special (fd alias / net redirect / null device). A future registry arm (e.g. D5 simulating/dev/zero) trips this pin until the table follows in the same change./dev/zero,/dev/full,/dev/ttyare deliberately not listed: the registry classifies themFilesystemtoday, so neither face may present them as simulated.Executor::open_fds() -> Vec<u32>(new,public_accessors): the fd table's live fd numbers — the dynamic/dev/fdtier's source (audit §6.4: "the fd table itself", never a name list). Pinned end-to-end intests/session_api.rs: the live set always holds the standard trio (plus any descriptors adopted from the host process, rubash#1557 —/dev/fdshows those too),exec 3>/dev/nulladds 3,exec 3>&-removes it.Consumers (niubash#677)
/devstatic tier =special_dev_entries();/dev/fd+/proc/self/fddynamic tier =open_fds()(synced throughCompletionState);/proc=synthetic_proc_dir_entries()unchanged./dev/tcp//dev/udpcomplete to nothing (GNU has no hostname completion there).classify_special_path+ the enumeration faces as a pre-check before the filesystem existence test, so simulated paths stop falling toUnknownTokenat command position — a miss still falls through (the existence check is not disabled).Verification
open_fds_reflect_the_session_fd_table(tests/session_api.rs, not in rubash CI's named targets) run locally through the build slot: first run caught the pin's own wrong premise (fresh set[0, 1, 2, 9]— an adopted host descriptor, see the fix-up commit), pin corrected to delta form; re-run queued.Merge order: this PR first — niubash#677 calls these faces and its CI builds against master, so it stays red until this lands (transitional state, same shape as #1999 → #668).
Refs unixwin/niubash#627
Refs unixwin/niubash#628