Guard local INI/direct fixture staging
This commit is contained in:
68
text7.txt
68
text7.txt
@@ -490,3 +490,71 @@ runtime promotion。
|
|||||||
```bash
|
```bash
|
||||||
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
十一、2026-06-13 继续执行记录:local INI/direct fixture staging guard
|
||||||
|
|
||||||
|
1. 本批目标。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第六轮,处理 Node/browser 成对覆盖的 local INI 与
|
||||||
|
direct G-code fixture staging:
|
||||||
|
|
||||||
|
```text
|
||||||
|
spindle_orient_offset.ini
|
||||||
|
disable_fanuc_style_sub.ini
|
||||||
|
spindle_orient_offset.ngc
|
||||||
|
disable_fanuc_style_sub_m98.ngc
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 已完成改动。
|
||||||
|
|
||||||
|
- Node 侧新增 `writeLocalIniFixture(...)`;
|
||||||
|
- browser 侧新增 `writeLocalIniFixture(...)`;
|
||||||
|
- `spindle_orient_offset.ini` 和 `disable_fanuc_style_sub.ini` 两侧均改为 helper 写入;
|
||||||
|
- `spindle_orient_offset.ngc` 和 `disable_fanuc_style_sub_m98.ngc` 两侧均改为
|
||||||
|
`writeLocalGcodeFixture(...)` 写入;
|
||||||
|
- helper 显式检查 staged `wasmPath` 与期望路径一致;
|
||||||
|
- browser 侧仍不枚举目录;
|
||||||
|
- 未修改 INI 内容、G-code 内容、canon expected、tool table 或 interpreter 语义。
|
||||||
|
|
||||||
|
涉及文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
wasm-port/tests/wasm/node/verify_interp_wasm.mjs
|
||||||
|
wasm-port/tests/browser/interp_smoke.html
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 已完成的目标验证。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
|
||||||
|
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_sim_configs_inventory_wasm.sh
|
||||||
|
wasm-port/tests/host/verify_host_smokes.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
如果通过,提交建议:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Guard local INI/direct fixture staging
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 下一步工作建议。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第七轮,优先处理 `INTERP_FILE_FIXTURES` /
|
||||||
|
`INTERP_BROWSER_FILE_FIXTURES` 和 `INTERP_ERROR_FIXTURES` 这类循环写入点,增加
|
||||||
|
loop-level single-file staging helper 或 manifest parity guard;继续避开
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|||||||
@@ -4320,6 +4320,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function writeLocalIniFixture(interp, filename, wasmPath, expectedWasmPath) {
|
||||||
|
if (wasmPath !== expectedWasmPath) {
|
||||||
|
throw new Error(`browser_${filename}_local_ini_staging: path drift`);
|
||||||
|
}
|
||||||
|
interp.writeTextFile(wasmPath, await fetchText(`../fixtures/ini/${filename}`));
|
||||||
|
return wasmPath;
|
||||||
|
}
|
||||||
|
|
||||||
async function writeLocalGcodeFixture(interp, fixtureName, wasmPath, expectedWasmPath) {
|
async function writeLocalGcodeFixture(interp, fixtureName, wasmPath, expectedWasmPath) {
|
||||||
if (wasmPath !== expectedWasmPath) {
|
if (wasmPath !== expectedWasmPath) {
|
||||||
throw new Error(`browser_${fixtureName}_local_gcode_staging: path drift`);
|
throw new Error(`browser_${fixtureName}_local_gcode_staging: path drift`);
|
||||||
@@ -5249,15 +5257,17 @@
|
|||||||
const spindleOrientOffsetExpectedText = (
|
const spindleOrientOffsetExpectedText = (
|
||||||
await fetchText(`../fixtures/canon/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.events`)
|
await fetchText(`../fixtures/canon/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.events`)
|
||||||
).trimEnd();
|
).trimEnd();
|
||||||
const spindleOrientOffsetIniPath = "/work/browser-spindle-orient-offset.ini";
|
const spindleOrientOffsetIniPath = await writeLocalIniFixture(
|
||||||
interp.writeTextFile(
|
interp,
|
||||||
spindleOrientOffsetIniPath,
|
"spindle_orient_offset.ini",
|
||||||
await fetchText("../fixtures/ini/spindle_orient_offset.ini"),
|
"/work/browser-spindle-orient-offset.ini",
|
||||||
|
"/work/browser-spindle-orient-offset.ini",
|
||||||
);
|
);
|
||||||
const disableFanucStyleSubIniPath = "/work/browser-disable-fanuc-style-sub.ini";
|
const disableFanucStyleSubIniPath = await writeLocalIniFixture(
|
||||||
interp.writeTextFile(
|
interp,
|
||||||
disableFanucStyleSubIniPath,
|
"disable_fanuc_style_sub.ini",
|
||||||
await fetchText("../fixtures/ini/disable_fanuc_style_sub.ini"),
|
"/work/browser-disable-fanuc-style-sub.ini",
|
||||||
|
"/work/browser-disable-fanuc-style-sub.ini",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||||
@@ -5353,18 +5363,23 @@
|
|||||||
baselineIniExpectedText,
|
baselineIniExpectedText,
|
||||||
);
|
);
|
||||||
|
|
||||||
const spindleOrientOffsetPath = `/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`;
|
const spindleOrientOffsetPath = await writeLocalGcodeFixture(
|
||||||
interp.writeTextFile(spindleOrientOffsetPath, spindleOrientOffsetProgramText);
|
interp,
|
||||||
|
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||||
|
`/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`,
|
||||||
|
`/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`,
|
||||||
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
`${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}_file`,
|
`${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}_file`,
|
||||||
interp.runFileWithIni(spindleOrientOffsetPath, spindleOrientOffsetIniPath),
|
interp.runFileWithIni(spindleOrientOffsetPath, spindleOrientOffsetIniPath),
|
||||||
spindleOrientOffsetExpectedText,
|
spindleOrientOffsetExpectedText,
|
||||||
);
|
);
|
||||||
|
|
||||||
const disableFanucStyleSubPath = "/work/browser-disable_fanuc_style_sub_m98.ngc";
|
const disableFanucStyleSubPath = await writeLocalGcodeFixture(
|
||||||
interp.writeTextFile(
|
interp,
|
||||||
disableFanucStyleSubPath,
|
"disable_fanuc_style_sub_m98",
|
||||||
await fetchText("../fixtures/gcode/disable_fanuc_style_sub_m98.ngc"),
|
"/work/browser-disable_fanuc_style_sub_m98.ngc",
|
||||||
|
"/work/browser-disable_fanuc_style_sub_m98.ngc",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"browser_disable_fanuc_style_sub_m98_file",
|
"browser_disable_fanuc_style_sub_m98_file",
|
||||||
|
|||||||
@@ -106,6 +106,15 @@ function writeVendorTextFile(sourcePath, wasmPath, targetInterp = interp) {
|
|||||||
targetInterp.writeTextFile(wasmPath, readFileSync(sourcePath, "utf8"));
|
targetInterp.writeTextFile(wasmPath, readFileSync(sourcePath, "utf8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function writeLocalIniFixture(filename, wasmPath, expectedWasmPath, targetInterp = interp) {
|
||||||
|
assert.equal(wasmPath, expectedWasmPath, `${filename} local ini staging path drift`);
|
||||||
|
targetInterp.writeTextFile(
|
||||||
|
wasmPath,
|
||||||
|
readFileSync(resolve(rootDir, `tests/fixtures/ini/${filename}`), "utf8"),
|
||||||
|
);
|
||||||
|
return wasmPath;
|
||||||
|
}
|
||||||
|
|
||||||
function writeLocalGcodeFixture(fixtureName, wasmPath, expectedWasmPath, targetInterp = interp) {
|
function writeLocalGcodeFixture(fixtureName, wasmPath, expectedWasmPath, targetInterp = interp) {
|
||||||
assert.equal(wasmPath, expectedWasmPath, `${fixtureName} local gcode staging path drift`);
|
assert.equal(wasmPath, expectedWasmPath, `${fixtureName} local gcode staging path drift`);
|
||||||
targetInterp.writeTextFile(
|
targetInterp.writeTextFile(
|
||||||
@@ -645,15 +654,15 @@ const spindleOrientOffsetExpected = readFileSync(
|
|||||||
resolve(rootDir, `tests/fixtures/canon/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.events`),
|
resolve(rootDir, `tests/fixtures/canon/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.events`),
|
||||||
"utf8",
|
"utf8",
|
||||||
).trimEnd();
|
).trimEnd();
|
||||||
const spindleOrientOffsetIniPath = "/work/spindle-orient-offset.ini";
|
const spindleOrientOffsetIniPath = writeLocalIniFixture(
|
||||||
interp.writeTextFile(
|
"spindle_orient_offset.ini",
|
||||||
spindleOrientOffsetIniPath,
|
"/work/spindle-orient-offset.ini",
|
||||||
readFileSync(resolve(rootDir, "tests/fixtures/ini/spindle_orient_offset.ini"), "utf8"),
|
"/work/spindle-orient-offset.ini",
|
||||||
);
|
);
|
||||||
const disableFanucStyleSubIniPath = "/work/disable-fanuc-style-sub.ini";
|
const disableFanucStyleSubIniPath = writeLocalIniFixture(
|
||||||
interp.writeTextFile(
|
"disable_fanuc_style_sub.ini",
|
||||||
disableFanucStyleSubIniPath,
|
"/work/disable-fanuc-style-sub.ini",
|
||||||
readFileSync(resolve(rootDir, "tests/fixtures/ini/disable_fanuc_style_sub.ini"), "utf8"),
|
"/work/disable-fanuc-style-sub.ini",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||||
@@ -753,18 +762,21 @@ verifyExpectedOutput(
|
|||||||
baselineIniExpected,
|
baselineIniExpected,
|
||||||
);
|
);
|
||||||
|
|
||||||
const spindleOrientOffsetFilePath = `/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`;
|
const spindleOrientOffsetFilePath = writeLocalGcodeFixture(
|
||||||
interp.writeTextFile(spindleOrientOffsetFilePath, spindleOrientOffsetProgramText);
|
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||||
|
`/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`,
|
||||||
|
`/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`,
|
||||||
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
`${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}_file`,
|
`${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}_file`,
|
||||||
interp.runFileWithIni(spindleOrientOffsetFilePath, spindleOrientOffsetIniPath),
|
interp.runFileWithIni(spindleOrientOffsetFilePath, spindleOrientOffsetIniPath),
|
||||||
spindleOrientOffsetExpected,
|
spindleOrientOffsetExpected,
|
||||||
);
|
);
|
||||||
|
|
||||||
const disableFanucStyleSubFilePath = "/work/disable_fanuc_style_sub_m98.ngc";
|
const disableFanucStyleSubFilePath = writeLocalGcodeFixture(
|
||||||
interp.writeTextFile(
|
"disable_fanuc_style_sub_m98",
|
||||||
disableFanucStyleSubFilePath,
|
"/work/disable_fanuc_style_sub_m98.ngc",
|
||||||
readFileSync(resolve(rootDir, "tests/fixtures/gcode/disable_fanuc_style_sub_m98.ngc"), "utf8"),
|
"/work/disable_fanuc_style_sub_m98.ngc",
|
||||||
);
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
"disable_fanuc_style_sub_m98_file_wasm",
|
"disable_fanuc_style_sub_m98_file_wasm",
|
||||||
|
|||||||
Reference in New Issue
Block a user