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/write-round3-status.mjs

import fs from "node:fs"
import assert from "node:assert/strict"
import crypto from "node:crypto"
const read=p=>JSON.parse(fs.readFileSync(p,"utf8"))
const hash=p=>crypto.createHash("sha256").update(fs.readFileSync(p)).digest("hex")
const circuitPath="dist/index/circuit.json",sha=hash(circuitPath),c=read(circuitPath)
const regression=read("reports/fix-regression.json"),drill=read("reports/drill-clearance-regression.json")
const continuity=read("reports/connectivity-audit.json"),verification=read("verification.json")
const geometry=read("reports/round3-final/expanded-geometry.json")
for(const r of [regression,drill,continuity,verification,geometry])assert.equal(r.circuitSha256,sha)
assert.equal(drill.baselineFindings,7);assert.equal(drill.currentFindings,0);assert.equal(drill.regressionCount,0)
assert.equal(continuity.sourceFailures,0);assert.equal(continuity.disconnectedTerminalIslands,0)
assert.deepEqual(read("reports/coil-all-copper-preflight.json"),[])
const preflight=read("reports/coil-all-copper-preflight-meta.json")
assert.equal(preflight.circuitSha256,sha);assert.equal(preflight.failureCount,0)
const kelvin=read("reports/coil-session-kelvin.json")
assert.equal(kelvin.length,4);assert.ok(kelvin.every(x=>x.connected&&x.joinsOnlyAtShuntLand))
assert.equal(verification.fabricationReady,false)
const oldGeometry=read("reports/review-round2-20261019-Txti31/expanded-geometry.json")
const key=x=>[x.part,x.pin,x.layer,x.x,x.y].join("/")
const before=new Set(oldGeometry.populatedPadDrillIntersections.map(key)),after=new Set(geometry.populatedPadDrillIntersections.map(key))
assert.deepEqual([...after].filter(k=>!before.has(k)),[])
const removed=[...before].filter(k=>!after.has(k)).sort()
assert.deepEqual(removed,["R_ISEN_A/2/bottom/-6.6/-15.05","U_FLASH/5/bottom/-18.85/5.6"])
const schematic=xs=>xs.filter(x=>x.type.startsWith("schematic_"))
assert.deepEqual(schematic(c),schematic(read("reports/round3-stage4/circuit.json")),"final schematic matches the visually reviewed render")
assert.match(fs.readFileSync("reports/round3-final-shorts.log","utf8"),/No shorts detected/)
assert.ok(!fs.readFileSync("reports/round3-final-style.log","utf8").includes("<SchematicPlacementIssues>"))
assert.match(fs.readFileSync("reports/round3-stage6c-build.log","utf8"),/Build exiting with code 0/)
const modules=read("reports/module-test-regression.json")
assert.equal(modules.addedFailures,0)
const report={status:"LOCAL_VALIDATED_INCREMENTAL_FIXES_NOT_FABRICATION_READY",updatedAt:new Date().toISOString(),
  circuitSha256:sha,replaySha256:hash("routing/complete-routes.json"),pushed:false,fabricationReady:false,
  fixed:{independentDrillViolations:{before:7,after:0,added:0},
    schematic:"SoC capacitor groups spaced and bulk references placed last; redundant colliding title removed. CLI placement analysis passes; current schematic equals visually inspected render. No new cloud AI analysis claimed.",
    ordinaryViaInPadRemoved:removed,additionalPopulatedPadDrillIntersections:0,
    copperGate:"Verifier now requires a fresh, hash-bound, passing independent copper preflight. Three fail-closed negative tests and the valid case pass."},
  checks:{nativeErrors:verification.drcErrors,nativeWarnings:verification.nativeWarnings,
    originalParts:regression.originalParts,originalNets:regression.originalNets,
    gerberShortsAllLayers:"pass",emittedContinuity:"pass",copperPreflight:"pass",kelvin,
    additionalPadPthDfm:[],mechanical:"0 pad/edge/NPTH/screw-land violations",
    throughVias:regression.throughVias,viaHoleMm:.3,viaPadMm:.45,
    boardOutlineAndLayers:"unchanged 42.3 mm square / 4 layers",componentPlacementChangesThisRound:["C_PD_ADC: (18,8), 0 degrees -> (18.2,8.18), 90 degrees, bottom"],
    firmware:"unchanged; host sanitizers and 6 Linux client tests pass; not flashed",typecheck:"pass",boardTests:"6 pass / 11 assertions",
    storedModuleTests:{passed:modules.currentPassed,failed:modules.currentFailed,added:0},
    catalog:"193 populated parts / 81 codes revalidated; same-BOM inventory binding only, no new inventory lookup or reservation"},
  remaining:[
    "Other ordinary pad/drill intersections (including R_ISEN_B and U_MOTOR ISENA/ISENB) still need local relayout. Thermal-pad and opposite-face solder-process qualification also remains; no filled/capped process has been assumed.",
    "178 small silkscreen texts and five off-board text anchors remain.",
    "Ethernet paired routing/stackup, under-jack copper, shield and ESD review remains.",
    "5 V load/drop/thermal budget and long analog/control routes remain.",
    "26 inherited stored-module test failures and native-warning/final-copper discrepancies remain.",
    "Actual motor rear fasteners/spacers and harness, Linux boot/power/thermal/transients/current calibration require hardware qualification.",
  ],
  rejectedCandidates:["R_ISEN_A initial stub widened adjoining copper: rejected; final accepted version preserves per-layer widths.",
    "R_ISEN_B bounded local move found no legal stub path: not installed; needs local part/route rearrangement."],
  preWorkCheckpoint:"../../checkpoints/nema17-round3-20261019-Nfouf4/board-checkpoint.tar.gz",
  evidence:Object.fromEntries(["reports/round3-stage6c-build.log","reports/round3-final-shorts.log","reports/round3-final-continuity.log",
    "reports/round3-final-copper.log","reports/round3-final-drill.log","reports/round3-final-style.log","reports/round3-copper-gate-tests.json",
    "reports/round3-firmware-tests.log","reports/round3-host-tests.log","reports/round3-module-tests.log"].map(p=>[p,hash(p)]))}
fs.writeFileSync("reports/round3-fix-status.json",JSON.stringify(report,null,2)+"\n")
console.log(JSON.stringify(report))