73f5bd7c21
Closes the two remaining small items of Block E. Both were largely recon: much of what they filed had already been fixed, and the part that had not turned up a real GNU divergence. Item 31 (T3-7), rule/doc reconciliation --------------------------------------- The `object`-parameter half is already done: #825's mypy inversion took the package from the filed 28 down to 7, of which 3 are docstring prose and the remaining 4 are protocol methods (`__contains__`, `pop`) whose signatures typeshed dictates, all already listed in the no-object gate. `utils/errors.py` reads `str | PathSpec` today, and `builders/sed.py` no longer holds flag values at all -- item 22 moved that to the generic. That left the nested-function rule, which the plan asked to decide before gating. Measured: 39 nested defs, and **every one of them closes over its enclosing scope** -- 38 by free variable, and `sed_helper._repl` by binding through parameter defaults, the loop-variable idiom, with a comment saying so. A flat "do not nest" is a rule the architecture cannot keep (op factories, provision builders, the read-through cache, every decorator's wrapper), so gating it as written would have meant 39 standing violations. So the rule now says what it was reaching for: a nested def must capture the scope around it, or it belongs at module level. That is mechanical and enforceable -- `tests/test_nested_functions_are_closures.py` reads free variables from `symtable` and parameter defaults from the AST. It passes on the tree as-is and fires on a helper that reads only its own arguments. Layout: the eight test-only TS directories are flattened (`ram/{cat,cut,grep,head,ls,tail,wc}/`, `ssh/ls/`), `awk_helper.ts` moves up beside its nine siblings, and the `provision.ts` / `_provision.ts` split is settled on Python's convention -- `_provision` for a backend's own, bare `provision` for the shared ones (cli, generic_bind). That last one was not cosmetic: Python already had `_provision.py` for github, gmail, redis and email, so renaming **closed 4 real parity divergences** (layout baseline 296 -> 292). The `findEval`/`findParse` line was already done in #827. Item 32 (T3-8), test/CI tidiness -------------------------------- The two asymmetric `ls` conformance matrices are raised to symmetry, and they pass: python `[ram,disk,redis]` vs typescript `[ram]` was stale caution, not a divergence. Both runners now reject an asymmetric matrix at load time unless the case carries a `divergence` key explaining why -- a case is a parity claim, and narrowing one side reads as coverage while the side that still lists the backend goes green. Loading the corpus under the new assertion proves no other case was asymmetric. The README documented the override as "not yet needed"; it exists now. Adds the `ts-audit` job, mirroring `test_python.yml`'s exactly (same `continue-on-error`, same out-of-gate placement). Nothing ran `pnpm audit` for the TS tree while `typescript/package.json` carried 27 hand-written CVE overrides that only a person remembering to check kept current. Integ facets for `ls`: `-A`, `-d`, `-r`, `-S`, `-h`, all pinned against GNU coreutils 9.7 in docker. `-S` uses regular files only, because GNU sorts a directory by its inode size while mirage counts it as 0 -- a divergence CLAUDE.md documents deliberately. The `-h` facet found a real bug ------------------------------- `ls -h` disagreed with GNU three ways, and because the flag had zero cross-backend coverage nothing caught it. GNU prints a count below one unit with no suffix (`24`); mirage printed `24B`. GNU rounds *up* to the precision shown (1025 bytes is `1.1K`); mirage gave `1.0K`. GNU drops the decimal once the value reaches ten (`10K`); mirage gave `10.0K`. One shared engine replaces both formatters in both languages -- GNU runs `-h` and `-H` through one `human_readable`, and so do we now. Rounding up can carry past the base (1048575 ceils to 1024K, which GNU shows as `1.0M`), so the unit is re-chosen after rounding rather than once up front. 21 GNU-read points are pinned as a table in each language. Blast radius, all re-pinned: five integ cases that had recorded the `B` suffix (du, discord, langfuse, email, gmail), and the du fan-out tests. Those last ones needed care rather than a new number: they exist to prove the total is humanized once instead of twice, and their 1500+1500 stops discriminating under correct rounding, since 3000 bytes and two `1.5K` readings both render `3.0K`. They now use 1025+1025, where single-rounding gives `2.1K` and double-rounding would give `2.2K`. Verified: pre-commit clean, integ 8054/0 on ram+disk+redis in both languages, conformance green in both, and the layout, spec, barrel, docs, case-target and PathSpec gates all pass. Not covered, still open on item 32: integ facets for `ls -t` (mtime order is not stable across backends without a seeded fixture), mktemp, gzip, the checksum `--check` companions, `df -H/-k/-a`, and `cmp -n/-b/-i`; and the T2-7 helper unit-suite mirroring. Item 31 leaves the provision *presence* sets unreconciled (Python has lancedb/qdrant, TS has trello) -- that is a question about which backends should provision at all, not about naming. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
120 lines
2.3 KiB
JSON
120 lines
2.3 KiB
JSON
{
|
|
"cases": [
|
|
{
|
|
"id": "ls_r_reverses_name_order",
|
|
"seq": 354,
|
|
"targets": [
|
|
"ram",
|
|
"disk",
|
|
"redis",
|
|
"opfs",
|
|
"s3",
|
|
"databricks",
|
|
"gridfs",
|
|
"s3-prefix",
|
|
"databricks-prefix",
|
|
"gridfs-prefix",
|
|
"hf",
|
|
"hf-prefix",
|
|
"dropbox",
|
|
"dropbox-root",
|
|
"onedrive",
|
|
"sharepoint",
|
|
"sharepoint-prefix",
|
|
"ssh",
|
|
"nextcloud",
|
|
"gdrive",
|
|
"gdrive-folder",
|
|
"box"
|
|
],
|
|
"command": "ls -1r /data/sub",
|
|
"expect": {
|
|
"exit": 0,
|
|
"stdout": "nested.txt\ndeep\n",
|
|
"stderr": ""
|
|
},
|
|
"flags": [
|
|
"1",
|
|
"r"
|
|
]
|
|
},
|
|
{
|
|
"id": "ls_S_sorts_by_size_desc",
|
|
"seq": 960081,
|
|
"targets": [
|
|
"ram",
|
|
"disk",
|
|
"redis",
|
|
"opfs",
|
|
"s3",
|
|
"databricks",
|
|
"gridfs",
|
|
"s3-prefix",
|
|
"databricks-prefix",
|
|
"gridfs-prefix",
|
|
"hf",
|
|
"hf-prefix",
|
|
"dropbox",
|
|
"dropbox-root",
|
|
"onedrive",
|
|
"sharepoint",
|
|
"sharepoint-prefix",
|
|
"ssh",
|
|
"nextcloud",
|
|
"gdrive",
|
|
"gdrive-folder",
|
|
"box"
|
|
],
|
|
"command": "ls -1S /data/a.txt /data/b.txt /data/c.txt /data/one_byte.txt",
|
|
"expect": {
|
|
"exit": 0,
|
|
"stdout": "/data/a.txt\n/data/c.txt\n/data/b.txt\n/data/one_byte.txt\n",
|
|
"stderr": ""
|
|
},
|
|
"flags": [
|
|
"1",
|
|
"S"
|
|
]
|
|
},
|
|
{
|
|
"id": "ls_rS_reverses_the_size_sort",
|
|
"seq": 960082,
|
|
"targets": [
|
|
"ram",
|
|
"disk",
|
|
"redis",
|
|
"opfs",
|
|
"s3",
|
|
"databricks",
|
|
"gridfs",
|
|
"s3-prefix",
|
|
"databricks-prefix",
|
|
"gridfs-prefix",
|
|
"hf",
|
|
"hf-prefix",
|
|
"dropbox",
|
|
"dropbox-root",
|
|
"onedrive",
|
|
"sharepoint",
|
|
"sharepoint-prefix",
|
|
"ssh",
|
|
"nextcloud",
|
|
"gdrive",
|
|
"gdrive-folder",
|
|
"box"
|
|
],
|
|
"command": "ls -1rS /data/a.txt /data/b.txt /data/c.txt /data/one_byte.txt",
|
|
"expect": {
|
|
"exit": 0,
|
|
"stdout": "/data/one_byte.txt\n/data/b.txt\n/data/c.txt\n/data/a.txt\n",
|
|
"stderr": ""
|
|
},
|
|
"flags": [
|
|
"1",
|
|
"r",
|
|
"S"
|
|
]
|
|
}
|
|
]
|
|
}
|