Repository navigation
WIP: 2036 S2 introspection faces project from the single registry; disclose live claims - #2075
Conversation
…se live claims Fixes #2044 (env introspection drift, KD-1), refs #2036. Name-list unification (one source = executor/command_registry): - complete.rs: SHELL_BUILTINS / SHELL_KEYWORDS / HELP_TOPIC_COMPLETIONS hand copies deleted; compgen -b, the builtin/keyword actions, the enabled-builtin candidates and command candidates project from the registry; the helptopic action projects from help's topic table (drops 13 set -o option names GNU does not treat as help topics; GNU 5.3.20 compgen -A helptopic = 77 names, matching help_texts). - enable.rs: ALL_BUILTINS / SPECIAL_BUILTINS deleted; listings and validation project from the registry (specials = the registry's GNU 16-name set, mkbuiltins.c:148-154). - builtins/type.rs + builtins/command.rs fallback describe: private 62-name matches! copies replaced by the registry projection. - help: env gains its missing topic + bare-help entry (it was the one builtin with no help face); dead HELP_TOPICS copy removed. KD-2 (report side): the posix special-builtin wording in type_describe now reads the registry set, so POSIX-mode 'type source' reports 'a special shell builtin' like GNU (type.def:262-270; the set is name-based, mkbuiltins.c:819-820). The execution-side predicate still lacks source; the registry pins the remainder at exactly {source} for S3. Disclosure ruling (the slice's core): rows whose class claims the simple-command point (HiddenFastpath/Fastpath/EmulatedExternal) get Introspection::Emulated. While the claim is live - tested with the dispatch test itself per face (host flag for the emulation layer, the shared stand-down predicate, the WindowsOnly cfg gate) - type prints 'X is a shell emulation of <path>', type -t prints 'emulation', command -V the sentence, command -v the bare name, type -p silent-but-found; type -a prints the claim line plus the file lines. Shape-scoped claims (pipeline/comsub/shortcut/bridge) keep the file answer. Stand-down returns the plain file/not-found answer, exactly as dispatch behaves. One dispatch-adjacent line, flagged for review: env's primary arm gains the per-arm enable -n check every sibling arm carries - with enable now managing env, the disable must be real, not report-only. Pins: registry consistency suite grows projection-equivalence, class=>introspection mapping and help-topic equation pins (the KD-1 drift pin turned positive); the S1 battery's introspection section asserts the disclosure forms and the compgen -b / enable -a sets turned positive; new Windows battery pins the product form (WinuxCmd-style applets on PATH, incl. tput live on Windows). Two legacy expectations updated to the unified contract: regression.rs enable -a count 61->62 (its subject, zsh-isms staying gone, is unchanged) and cli_tests type -t cat file->emulation. docs/builtins.md: S2 introspection contract, stty joins the fastpath machine block + table, tput joins section 4.1.
|
CI final state (run 40829138475 + niu-canary 40829138487): all jobs success — Rust tests (lib pins incl. the new registry projection/mapping/help-topic pins), Rust tests (macOS), GNU regression goldens and canaries (Windows; runs One coverage note for the record: no CI job targets the integration batteries (same disposition as the S1 battery). The S1 unix battery's 20/20 was run locally through the build slot; the new Windows battery's body was type-checked locally (cfg-flip compile; a full windows-target check is unreachable on this host — the |
One conflict, src/executor/command_registry.rs cat row: S2 (#2075) replaced the row's introspection projection (ExternalWithHashRecord -> Emulated; the old variant no longer exists in the enum) while this branch aligned the adjacent gate comment. Resolution keeps both facts: field = Emulated (S2 projection fact), comment = the #2066 gate fact (the host flag gates the simple-command face and, since #2066, the pipeline stage arm; the comsub faces are not flag-gated). No other file conflicted; S2 did not touch pipeline_exec.rs.
WIP: #2036 S2 — introspection faces project from the single registry; live in-process claims are disclosed instead of being reported as files.
Fixes #2044
Refs #2036
Convergence (single source:
src/executor/command_registry.rs)type/command -v/-V(executor describe)compgen -b/-A builtinSHELL_BUILTINShand copy (61, no env)compgen -A keyword, command candidatesSHELL_KEYWORDShand copycompgen -A helptopicHELP_TOPIC_COMPLETIONShand copy (90, incl. 13set -onames GNU does not treat as topics)enable,enable -a,enable -s, name validationALL_BUILTINS(61) +SPECIAL_BUILTINShand copiesmatches!copieshelptopicsenvmissing — a builtin with no help facehelpentry added; deadHELP_TOPICScopy removedRulings recorded in this slice
Introspection::Emulated. While the claim is live,type XprintsX is a shell emulation of <path>,type -t Xprintsemulation,command -Vthe sentence,command -vthe bare name (invoking the name reproduces the in-process behavior; invoking the path would not),type -pis silent-but-found, andtype -aprints the claim line plus the file lines. Shape-scoped claims (pipeline-only, comsub-only, the diff shortcut, the display bridge) keep the file answer. When the claim stands down, the plain file / not-found answer returns. Liveness reuses the dispatch test verbatim per face: host flag for the emulation layer, the sharedemulated_external_stands_downpredicate, the WindowsOnly cfg gate (tput).envis in every projection;enable env/enable -n envnow manage it.builtins/mkbuiltins.c:148-154; the flag is applied by name,mkbuiltins.c:819-820; measured viaenable -son GNU bash 5.3.20). POSIX-modetype sourcenow reports "a special shell builtin" (GNUbuiltins/type.def:262-270). The execution-side predicate still lackssource; a registry pin holds the remainder at exactly{"source"}for S3.enable -ncheck every sibling arm carries. With enable now managing env, the disable must be real rather than report-only; the S1 battery's shape-13 pin proves the fallthrough to the PATH body afterenable -n env.Boundary
No dispatch or execution change beyond the flagged env guard. Docs:
docs/builtins.mdintrospection contract rewritten for §1/§3/§4.1,sttyjoins the fastpath machine block and table,tputjoins §4.1.Gates
Local (build slot; CI-uncovered pins are the reason these ran locally):
cargo checkwith-D warningsclean; registry consistency 18/18 (new projection-equivalence, class⇒introspection mapping, and help-topic equation pins; the KD-1 drift pin turned positive);builtin_namesdoc-sync 8/8; S1 precedence/introspection battery 20/20;regression.rszsh pin updated (61→62, its subject unchanged) and green;help_pages12/12;executor_testsfull-run failure set identical to baseline master's except one proven flake (part_080 procsub rewrite, fail→pass across isolated reruns).CI adjudicates the rest at full-green equivalence (canary included), including the new Windows product-form battery
tests/issue2036_s2_introspection_windows.rs(WinuxCmd-style applets on PATH; tput live on Windows), which cannot run on this Linux host.