Repository navigation
fix(assoc): #860 unset empty-span/mask pseudo-diagnostic + #861 kvlist self-read miss - #883
Merged
Merged
Conversation
…t self-read miss WIP — full-suite verification pending a serialized batch (cargo test --test-threads=1, fmt, -D warnings, bidirectional). Probes are byte-verified against the WSL GNU 5.3.0 oracle and the regression catalog is green (38/38 declared expectations); the cargo test run has NOT happened yet. #860 (mask-before-expand): mask_subscript_escapes collapsed an unquoted backslash escape BEFORE the parameter walker, folding $x\ty into the name $xty -> empty key -> bogus '[...]: bad array subscript' + rc1 on unset 'A4[$x\ty]' (GNU: silent rc0, key ty). GNU scans left to right: the $name extraction stops at the backslash (subst.c:10934 param_expand's legal_variable_char loop) and the escaped char rides after it (subst.c:11614 case '\\'). Fix: an escaped name-character is emitted behind the PARAM_NAME_END_MARKER boundary (the #742 law); the embedded walker's tail strips the marker. #860 (empty-span writes): the arith pre-encode pass classified an empty resolution by the arith token text (sq survives, dq strips, spans re-quote) and emits the class to the parser; new ArithLValue::AssocEmptyKey gives GNU's two laws: bind = name['']: bad array subscript once, no store (arrayfunc.c:402-407 err_badarraysub); read = the bare NAME once (INDEX_ERROR, arrayfunc.c:1462-1470). Empty-token spellings (""/$u/[]) keep the name[] law (bind: not a valid identifier; read: a[] x2). set_assoc_element rejects empty keys. #861 (kvlist self-read): dequote_compound_subscript restores the lexer's E010/E011 data-quote markers in its cooked-text tail, so the strict [key]=value path stores the same clean bytes the assignment entry stores (master stored pre$<E010>x<E010>post: write parity, read miss, clean overwrite made count=2). Plus the plain-path diagnostic cooks $'' -> '' (parse-law word) and the kvlist diag prints the parsed element word; a declared-unset assoc no longer materializes on a retain-only unset. Regressions: tests/issue860_assoc_empty_key_regressions.rs (17), tests/issue861_kvlist_selfread_regressions.rs (9), catalog cases issue-860/issue-861 + manifest rows (must-match, runner 38/38). Residuals documented on the PR: kvlist diag word for span/param spellings (compound-body cooking), $'' scalar-arith error token, [''x]-class partial-sq keys, declare-line abort law — all master-equal, out of ticket scope.
# Conflicts: # scripts/regression-catalog/manifest.tsv
…gressions to the WSL oracle truth The four cases were authored against pasted hex/declare faces that no implementation (including GNU bash 5.3.0, byte-verified on the WSL oracle) produces; rubash already matches GNU byte-for-byte on all four: - escaped_char_stays_out_of_dollar_name / kvlist_bare_span_key_decodes: the `tr -d ' \\n'` pipe eats od's trailing newline — GNU's listing has none, drop the stray \\n. - plain_empty_span_write_rejected: after the refused U7['']=1 write GNU keeps `declare -p U7` silent (empty stdout, one stderr line) — the declared-empty listing face was assumed, not verified. - unset_deferred_span_quote_removal_unchanged: the raw od -An -tx1 listing of the surviving key is ' 78 09 79\n'; the pasted 24275c7479 matches no observable face of the probe.
Member
Author
Independent CR verdict: APPROVE-WITH-NITSReviewed at Oracle (WSL GNU bash 5.3.0(1),
Scope / merge hygiene:
Full verification (all re-run here):
Nits (non-blocking):
|
This was referenced Oct 19, 2026
caomengxuan666
added a commit
that referenced
this pull request
Oct 20, 2026
…ss gate (#944) * test(regression): #746 catalogue second batch + manifest exhaustiveness gate - manifest rows for the four case files that shipped unscored: issue-860/861 (PR #883), issue-868, issue-876 - all must-match - ten new cases: issue-699/701/830/832 must-match (closed/fixed); issue-700 and issue-846 diverges (residuals tracked as rubash#938 and rubash#940); issue-840/856/871/879 diverges (open) - runner: stage each arm in its own work dir (out/<case>/{arm,gnu}/) so one arm's fixture mutations cannot contaminate the other; remove dead SCRIPT constant - runner: UNSCORED (case file with no manifest row) and DANGLING (manifest row with no case file, full runs) are reported and fail the run with exit 2 - an unscored case is a hole in the ratchet - README: document the batch, the UNSCORED/DANGLING rules, and scope Verification note: arm-side staging + bounded runs were executed under target/debug/rubash.exe only; the WSL GNU 5.3.0 oracle leg was not run this session. Declared states follow the case authors' byte-verified probes; a full catalogue run is the confirming measurement. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(regression): PR#944 review rework — cwd-tail probe for issue-830, flip issue-871 to must-match (#746) issue-830 (BLOCKER): the case printed the full physical cwd via pwd -P, but the per-arm staging (out/<case>/{arm,gnu}/) puts the two legs on necessarily different paths, so the normaliser could only shrink them to /mnt@P@ vs @p@ — the row declared must-match and could never match: every full run exited 1 on a permanent false ALARM. Probe the tail segment instead (basename "$(pwd -P)"); the ticket substance (PWD-tail=sub, phys=sub, rc) was already identical on both sides and stays pinned. issue-871: the declared-diverges row is stale — the infin/nann/infx/nanx face (value + invalid-number diagnostic + rc 1) is byte-identical to the GNU oracle. Flip to must-match; case comment and README row updated. Verified differentially (arm built at 0c50b41, WSL GNU bash leg, no skips): full 51-case run exits 0 with no ALARM and no UNSCORED/DANGLING; negative control (issue-700 temporarily declared must-match) alarms and exits 1, so the ratchet still bites. --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Closes #860
Closes #861
What
Four residual faces of the #847 CR family, all byte-verified against the GNU bash 5.3.0 WSL oracle (probes 2026-10-19):
subscript_expansion.rs): the escape mask folded$x\tyinto the name$xtybefore the$namescan; GNU scans left-to-right and stops the name at the backslash.unset 'A4[$x\ty]'produced a bogusbad array subscript+ rc1 instead of GNU's silent rc0.arithmetic/lvalue.rs,parser.rs,value.rs,mod.rs):S6[$\tx]keys on the literal text$tx(24 74 78), not on the expansion oftx.unset_arrays.rs,array_assignment_exec.rs):((U8[$'']=1))/U7[$'']=1/let "C9['']=1"now take GNU's ONEname['']diagnostic with nothing stored (the""/$u/[]token spellings keep the`name[]': not a valid identifierlaw).name=( [key]=value )path stored the span's E010/E011 quote markers inside the key, so the same-spelling read missed silently and a clean-spelling overwrite made a second cell;dequote_compound_subscriptnow restores the markers to literal bytes (write parity, one clean cell).Verification (full-suite, serialized batch)
origin/master(41bfdd3, 15 commits ahead — mark_quoted_ifs_from_raw simulator is carrier-blind: carrier-laden raw words silently lose per-char IFS marking #868/mark_literal_ifs_chars 对未闭合 $(…/反引号 词的 raw-skip 哨兵越界:copy 循环 index == len 时 panic 整个 shell(niu 1.4.1 journey P7 崩溃面) #875 etc.) before verification; catalog conflict resolved by keeping both rows.cargo test --no-fail-fast -- --test-threads=1, full suite, compared bidirectionally against a pristine detachedorigin/masterworktree on the same machine:divergesrows and known Windows-environmental faces).windows_listing_cache...(master-side run flake, 6/6 pass standalone),fixture_text_tree...(nondeterministic profiler self-time tie order — also fails standalone on pristine master ~1/6),fractional_timeout_expires_with_142(fractional-timer vs read race under serial load; passes standalone).tests/issue860_*/tests/issue861_*files were initially authored against pasted (unverified) faces and failed everywhere including GNU; corrected to the oracle truth — rubash matches GNU byte-for-byte on all four (e.g. GNU keepsdeclare -p U7silent after the refusedU7[$'']=1write, and the survivingx\tykey lists raw as78 09 79\n).tests/issue860_assoc_empty_key_regressions.rs(17) +tests/issue861_kvlist_selfread_regressions.rs(9) — all green; catalog rowsissue-860/issue-861(must-match) withscripts/regression-catalog/cases/*.sh.cargo fmt --checkclean.RUSTFLAGS=-D warnings cargo check --all-targetsfails on 16 pre-existing test-crate warnings whose set is identical on pristine master (src/ crates clean); no new warnings.CI green → ready for merge by the maintainer.