shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
scripts/validate-rishabh-review.mjs
import fs from "node:fs"
import { spawn } from "node:child_process"
const bun = process.execPath, python = "/tmp/nema17-routing-python/bin/python"
const cli = ["node_modules/@tscircuit/cli/cli/entrypoint.js", "--use-global"]
const baseline = "../../checkpoints/nema17-before-rishabh-review-v053-DuFOGi/restore-verified"
// Continuity exports a canonical emitted-only snapshot. Audit that exact file,
// not the differently ordered raw extraction produced before continuity.
const env = { ...process.env, PATH: "/opt/homebrew/bin:" + process.env.PATH, ROUTING_PYTHON: python, CIRCUIT_INPUT: "dist/index/circuit.json", PHYSICAL_INPUT: "routing/physical-copper.json", SCHEMATIC_STYLE_ANALYZER: "/tmp/nema17-style-082-SUsDpR/package/dist/browser.js" }
async function run(name, commandLine) {
const [command, ...args] = commandLine
const fd = fs.openSync("reports/review-" + name + ".log", "w")
await new Promise((resolve, reject) => {
const p = spawn(command, args, { env, stdio: ["ignore", fd, fd] })
p.once("error", reject)
p.once("exit", code => { fs.closeSync(fd); console.log(JSON.stringify({ step: name, exit: code })); code === 0 ? resolve() : reject(new Error(name + " failed; inspect its log")) })
})
}
console.log("Validating the schematic revision against frozen 0.4.54, including inherited 0.4.53→0.4.54 hardware gates. This does not approve hardware qualification or publish the board.")
await run("style-current", ["bash", "scripts/check-current-schematic-style.sh", "dist/index/circuit.json", "reports/review-style"])
await run("physical-regression", [bun, "scripts/check-bulk-top-regression.mjs"])
await run("protected-copper", [python, "scripts/check-review-protected-copper.py"])
const results = await Promise.allSettled([
run("tests", [bun, "test", "./tests", "./modules/f1c100s/tests"]),
(async () => { await run("stock", [bun, "scripts/audit-jlcpcb-stock.mjs", "dist/index/circuit.json", "reports"]); await run("bom", [bun, "scripts/validate-bom.mjs"]) })(),
(async () => { await run("typecheck", [bun, "node_modules/typescript/bin/tsc", "--noEmit"]); await run("shorts", [bun, ...cli, "check", "shorts", "dist/index/circuit.json", "--mode", "gerber", "--layer", "all"]); await run("check-all", [bun, ...cli, "check", "dist/index/circuit.json"]); await run("style-cli", [bun, ...cli, "check", "schematic-placement", "dist/index/circuit.json"]); await run("warnings", [bun, "scripts/check-review-warning-regression.mjs"]) })(),
(async () => {
await run("continuity", [bun, "scripts/check-continuity.mjs"])
for (const [name, args] of [
["copper", ["scripts/audit-local-copper.py"]],
["drill", ["scripts/compare-drill-clearance.py", baseline + "/dist/index/circuit.json"]],
["dfm", ["scripts/review-additional-dfm.py"]],
["solder", ["scripts/audit-solder-process.py"]],
["kelvin", ["scripts/audit-session-kelvin.py"]],
]) await run(name, [python, ...args])
await run("motor", [bun, "scripts/check-assembly-motor-reference.mjs"])
await run("gerbers", [bun, ...cli, "export", "dist/index/circuit.json", "--format", "gerbers", "--output", "../../reports/review-preview.zip"])
await run("artwork", [python, "scripts/audit-stencil-artwork.py", "dist/index/circuit.json", "reports/review-preview.zip"])
})(),
])
const failures = results.filter(r => r.status === "rejected")
if (failures.length) { console.error(failures.map(r => r.reason.message).join("\n")); process.exitCode = 1 }
else await run("verify", [bun, "scripts/verify.mjs"])