Guard browser nc-files staging

This commit is contained in:
2026-06-13 14:56:53 +08:00
parent dbf55e8230
commit e6bf24e106
2 changed files with 95 additions and 0 deletions

View File

@@ -424,3 +424,69 @@ table runtime state tests。
```bash
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
```
十、2026-06-13 继续执行记录browser nc-files staging guard
1. 本批目标。
继续 staged path guard inventory 第五轮,处理 browser 侧 vendor `nc_files` helper
```text
runVendorNcFile(...)
runVendorNcFileWithToolTable(...)
```
2. 已完成改动。
- browser 侧新增 `assertVendorNcFileStaging(...)`
- browser 侧新增 `assertVendorNcFileContextStaging(...)`
- direct `nc_files` helper 增加 `/work/browser-nc-files/<file>` root parity guard
- context helper 增加固定 manifest guard
- `<file>`
- `tool.tbl`
- `nc_files_context.ini`
- context helper 增加 staged root/path parity guard
- browser 侧仍不枚举目录;
- 未修改 vendor `nc_files`、tool table 内容、INI 内容或 interpreter 语义。
涉及文件:
```text
wasm-port/tests/browser/interp_smoke.html
```
3. 已完成的目标验证。
```bash
git diff --check
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
```
4. 本批剩余建议验证。
```bash
wasm-port/tools/verify_vendor_sync.sh
wasm-port/tools/verify_no_standalone_cnc_semantics.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
wasm-port/tests/host/verify_host_smokes.sh
```
如果通过,提交建议:
```text
Guard browser nc-files staging
```
5. 下一步工作建议。
继续 staged path guard inventory 第六轮,优先处理 browser/Node 中剩余的单文件
direct `/work/...` 写入点,例如 `disable_fanuc_style_sub_m98.ngc` 或 spindle-orient
INI fixture staging继续避开 parameter/tool table runtime state tests 和 blocked
runtime promotion。
下一轮第一条命令仍保持:
```bash
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
```

View File

@@ -4790,8 +4790,35 @@
}
}
function assertVendorNcFileStaging(filename, wasmPath, expectedRoot) {
if (wasmPath !== `${expectedRoot}/${filename}`) {
throw new Error(`browser_nc_files_${filename}_staging_manifest: path drift`);
}
}
function assertVendorNcFileContextStaging(filename, wasmDir, files) {
const expectedRoot = "/work/browser-nc-files-context";
const expectedFiles = [filename, "tool.tbl", "nc_files_context.ini"];
if (wasmDir !== expectedRoot) {
throw new Error(`browser_nc_files_${filename}_context_root: path drift`);
}
if (
files.length !== expectedFiles.length ||
new Set(files).size !== files.length ||
files.join(",") !== expectedFiles.join(",")
) {
throw new Error(`browser_nc_files_${filename}_context_manifest: list drift`);
}
for (const file of files) {
if (`${wasmDir}/${file}` !== `${expectedRoot}/${file}`) {
throw new Error(`browser_nc_files_${filename}_${file}_context_staging: path drift`);
}
}
}
async function runVendorNcFile(interp, filename) {
const wasmPath = `/work/browser-nc-files/${filename}`;
assertVendorNcFileStaging(filename, wasmPath, "/work/browser-nc-files");
await writeFetchedTextFile(
interp,
`../../vendor/linuxcnc/nc_files/${filename}`,
@@ -4802,8 +4829,10 @@
async function runVendorNcFileWithToolTable(interp, filename) {
const wasmDir = "/work/browser-nc-files-context";
const files = [filename, "tool.tbl", "nc_files_context.ini"];
const wasmPath = `${wasmDir}/${filename}`;
const iniPath = `${wasmDir}/nc_files_context.ini`;
assertVendorNcFileContextStaging(filename, wasmDir, files);
await writeFetchedTextFile(
interp,
`../../vendor/linuxcnc/nc_files/${filename}`,