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/compare-module-test-regression.mjs

import fs from "node:fs"
import crypto from "node:crypto"
import assert from "node:assert/strict"

const read = path => fs.readFileSync(path, "utf8")
const hash = path => crypto.createHash("sha256").update(fs.readFileSync(path)).digest("hex")
const manifestPath = "../f1c100s-linux-nema17-coil-current-wip-2026-10-17/reports/publish-manifest.json"
const manifest = JSON.parse(read(manifestPath))
const files = manifest.files.filter(file => file.file.startsWith("modules/"))
assert.ok(files.length > 0)
for (const file of files)
  assert.equal(hash(file.file), file.sha256, `${file.file} matches the untouched published runtime`)
const cases = path => {
  const text = read(path)
  assert.match(text, /Ran 32 tests across 2 files\./, "only the same two module test files ran")
  const failed = [...text.matchAll(/^\(fail\) (.+) \[[^\]]+\]$/gm)].map(m => m[1]).sort()
  const passed = [...text.matchAll(/^\(pass\) (.+) \[[^\]]+\]$/gm)].map(m => m[1]).sort()
  assert.equal(failed.length + passed.length, 32, "all module cases completed")
  return { failed, passed }
}
const baselineLog = "reports/baseline-module-tests.log"
const currentLog = "reports/current-module-tests.log"
const baseline = cases(baselineLog)
const current = cases(currentLog)
assert.deepEqual(current, baseline, "module test outcomes match unchanged v0.4.46 runtime")
const report = {
  status: "FAILS_IDENTICALLY_ON_BASELINE_NOT_A_PASS",
  unchangedPublishedRuntimeFiles: files.length,
  baselinePassed: baseline.passed.length,
  baselineFailed: baseline.failed.length,
  currentPassed: current.passed.length,
  currentFailed: current.failed.length,
  addedFailures: 0,
  failedTests: current.failed,
  evidence: Object.fromEntries([manifestPath, baselineLog, currentLog].map(path => [path, hash(path)])),
  method: "Untouched published module runtime copied into an isolated baseline directory, with the same two test files and dependency installation. No baseline test or runtime edits.",
  caveat: "Stored-module/profile failures remain unresolved. The actual carrier's parent-owned complete replay passes emitted continuity; that is not a pass for these independent module tests.",
}
fs.writeFileSync("reports/module-test-regression.json", JSON.stringify(report, null, 2) + "\n")
console.log(JSON.stringify({ status: report.status, baselineFailed: report.baselineFailed,
  currentFailed: report.currentFailed, addedFailures: 0 }))