Skip to content

WIP: #2036 S5 sync corpus (34 names) + #2043 A-class + #2046 B1 FailClosed - #2085

Merged
caomengxuan666 merged 8 commits into
masterfrom
fix/2036-s5-corpus
Oct 29, 2026
Merged

caomengxuan666 merged 8 commits into
masterfrom
fix/2036-s5-corpus

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

#2036 S5 — three-way sync corpus + first fix batch

Sync line S5 (audit §8): a shared differential corpus for the 34
builtin/WinuxCmd conflict names, plus the first fix batch out of the
audit §3.3 ledger.

Corpus (commit 1)

  • tests/difftest/cases-2036/corpus.json — 81 cases as data covering
    all 34 names of the audit §2.2 universe; every expectation dual-run
    anchored as a script file under GNU bash 5.3.20 + GNU coreutils 9.4
    (diffutils 3.10) on 2026-10-29. GNU is the shared sync target:
    the engine is pinned to it here, WinuxCmd's applets are pinned to
    it by WinuxCmd's own differential CI.
  • status: "registered" cases pin current engine behavior where a
    divergence is adjudicated-keep (ruled stand_down Replace cells) or
    not yet ruled ([同步线 B/C 类] 挑序与谓词不一致五形 + 诊断简版代答两形(#2036 审计 §3.3/§4) #2046 B2/B3/C1/C2), with the GNU measurement stored
    in the case's gnu field. No unruled cell changes behavior here.
    One further registered case (cp-comsub-diagnostic) pins a wider
    gap found during A2 verification: a spawned child's stderr inside
    $() is swallowed wholesale (rc preserved) where GNU forwards it;
    filing material is in the cluster REPORT, and the two A2 corpus
    cases assert GNU's value+status with the diagnostic noted as
    blocked by that gap.
  • Runner tests/issue2036_s5_sync_corpus.rs wired as a hard step in
    the ubuntu CI lane (recorded expectations — no live GNU oracle
    needed on the runner). The Windows three-way run of the same case
    set remains the win-diff battery (pkg10 H cell).

Fixes

Attribution correction (text only)

Audit §4 / S3 §3.2-a described cat as yielding to script fakes on the
simple-command face. The S4 four-quadrant measurement shows the
simple face replaces both script and ELF candidates (shape-blind);
the pipeline face yields both shapes via the concurrent direct-spawn
planner. The stale prose in the S1 battery comments and the corpus
README is corrected; no expectations change.

Gates

CI is the gate (this PR). Local, CI-uncovered targets only: corpus
runner, the #2043/#2046 pin files, the S1 battery, registry lib pins.

…#2046)

Case data (tests/difftest/cases-2036/corpus.json, 80 cases) covering
every name in the audit section 2.2 conflict universe, each expectation
dual-run anchored as a script file under GNU bash 5.3.20 + coreutils
9.4 on 2026-10-29. status=gnu cases assert the GNU measurement;
status=registered cases pin current engine behavior for ruled-keep
stand_down cells and the unruled #2046 B2/B3/C1/C2 cells, with the GNU
measurement recorded alongside.

Runner is a new CI step in the ubuntu lane. At this commit the corpus
is red on exactly the S5 fix scope (mkdir missing operand x3, comsub
basename x6, diff shebang); the following commits turn those cells
green.
…wed to procsub operands

A1: emulated mkdir with zero operands (bare, -p-only, ---only)
looped zero times and exited 0 — a silent fake success. GNU
coreutils 9.4 mkdir.c reports 'mkdir: missing operand' + the Try
line and exits 1; the emulation now counts operands and answers
exactly that (buffered through the command's redirections like its
other diagnostics).

A4: handle_external_shortcuts answered 'equal' (rc 0) for ANY two
files differing only in the shebang line. The in-process answer now
fires only when both operand words carry a parser-recorded process
substitution — the upstream shopt1.sub shape the shortcut exists
for. Plain files fall through to the real diff (GNU diffutils:
rc 1 with the difference block).
Verification of the #2043 A2 fix surfaced a wider, pre-existing
divergence: inside $() full execution, a spawned child's stderr is
swallowed wholesale (rc preserved). GNU forwards it to the shell's
stderr (subst.c:7143 command_substitute leaves fd 2 attached).
Pinned as registered case cp-comsub-diagnostic (unruled; S5 REPORT
carries the filing material). basename-comsub-extra / -noval keep
their GNU value+status contract; their diagnostic assertions are
annotated as blocked by this gap instead of asserting text the
declined path cannot deliver yet.
The ComsubWordSlot::Basename arm was a second, divergent basename
implementation: it silently dropped operands past the second
($(basename a b c) answered 'a' rc 0; GNU: rc 1, extra-operand
diagnostic), treated option words as the path
($(basename --suffix=.txt /a/b.txt) answered '.txt'; GNU: 'b'),
returned "" for $(basename /) where GNU prints '/', stripped a
suffix equal to the whole name, and answered rc 1 silently for no
operand.

The arm now follows the whitelist pattern of its sibling faces:
expand the argv, admit only what simple_path_tool_operands admits
(1..=2 non-option operands), compute with the simple face's own
basename_value / strip_basename_suffix (widened to
pub(in crate::executor)). Every other shape declines to full
execution, where GNU's result and diagnostics are produced
(subst.c:7143 command_substitute: the arm is an accelerator for
exactly the shapes it can answer byte-identically).
Five pins: A1 mkdir no-operand x3 shapes with the exact GNU
diagnostic (+ a real-operand collateral), A2 comsub extra operand
(value/status + the simple face's intact diagnostic), A3 option
word as option, the shared-surgery collaterals (root, --, suffix ==
name, two-operand form, no operand), A4 shebang-only diff on plain
files (+ identical-file collateral).
The comsub basename arm never consulted the stand-down predicate
(its projection cell was Unchecked); with PATH holding no basename
it answered in-process where GNU fails 127. S3 adjudicated this
cell FailClosed (DECISIONS 2026-10-29). The arm's gate now checks
emulated_external_stands_down("basename") — the same predicate,
same hash-first lookup, as the sibling cat arm — and declines to
full execution, which answers 127 with the command-not-found
diagnostic, matching GNU and this evaluator's own dirname shape.

The S1 battery's wart pin for this cell is flipped to the fixed
expectation with its adjudication history recorded; new
issue2046 pins cover the fail-closed shape plus the simple-face /
dirname contrasts; CI runs both new pin files with the corpus.
…ery comments

Text only, no expectation changes. The S4 four-quadrant
re-measurement (03ae580) showed the audit §4 / S3 §3.2-a reading
was wrong: shape 1's cat leg is a pipeline form, so its yield to a
script fake is the pipeline planner's; the simple face replaces
BOTH fake shapes (shape-blind — no layer distinguishes script vs
ELF candidates), and the pipeline face yields to both via the
concurrent direct-spawn planner. Shape 1, shape 1' and the B5
comments now say so; the B5 pin is annotated with its S3 §3.2-a
ruled-keep disposition.
First CI run failed 3 of 81 cells, all one class: for shapes the
engine declines to the real body (cat --version, no-operand chmod
and rmdir), the recorded expectation pinned the LOCAL toolset's
text verbatim — GNU coreutils 9.4 here, but the ubuntu CI image
resolves those names to uutils coreutils (clap-style diagnostics,
uutils banner). The diagnostic of a declined shape belongs to the
host toolset, not to the engine's contract.

Those three cases now anchor on status plus a toolset-independent
substring ('cat (', the tool name), with the GNU text preserved in
each case's note; the corpus README gains the host-tool rule.
Engine-produced diagnostics stay pinned verbatim (they are the
contract). Locally still 81/81.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 29, 2026 08:18
@caomengxuan666
caomengxuan666 merged commit 1749dff into master Oct 29, 2026
9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/2036-s5-corpus branch October 30, 2026 01:41
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.

1 participant