From 96836f51896a8017ee0ce6aec0ce88c58f50934a Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Mon, 6 Jul 2026 01:32:44 -0700 Subject: [PATCH] fix(miner): flatten calibration module to match the flat lib/ convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit packages/gittensory-miner/lib/calibration/{index,types}.{js,d.ts} was the only nested directory under lib/ — every other module is a flat lib/.(js|d.ts) file. scripts/check-miner-package.mjs's pack-safety allowlist only accepts that flat one-segment shape, so the real npm pack --dry-run of this package started failing test:miner-pack (a required CI check) as soon as the nested files landed, breaking validate-code/validate for every PR against main. Flatten to lib/calibration.js + lib/calibration-types.js (mirroring the existing .js / -cli.js / -expiry.js pairing convention elsewhere in lib/) instead of widening the pack-safety allowlist. --- .../lib/{calibration/types.d.ts => calibration-types.d.ts} | 0 .../lib/{calibration/types.js => calibration-types.js} | 0 .../lib/{calibration/index.d.ts => calibration.d.ts} | 4 ++-- .../lib/{calibration/index.js => calibration.js} | 2 +- packages/gittensory-miner/package.json | 2 +- test/unit/miner-calibration-types.test.ts | 4 ++-- 6 files changed, 6 insertions(+), 6 deletions(-) rename packages/gittensory-miner/lib/{calibration/types.d.ts => calibration-types.d.ts} (100%) rename packages/gittensory-miner/lib/{calibration/types.js => calibration-types.js} (100%) rename packages/gittensory-miner/lib/{calibration/index.d.ts => calibration.d.ts} (76%) rename packages/gittensory-miner/lib/{calibration/index.js => calibration.js} (76%) diff --git a/packages/gittensory-miner/lib/calibration/types.d.ts b/packages/gittensory-miner/lib/calibration-types.d.ts similarity index 100% rename from packages/gittensory-miner/lib/calibration/types.d.ts rename to packages/gittensory-miner/lib/calibration-types.d.ts diff --git a/packages/gittensory-miner/lib/calibration/types.js b/packages/gittensory-miner/lib/calibration-types.js similarity index 100% rename from packages/gittensory-miner/lib/calibration/types.js rename to packages/gittensory-miner/lib/calibration-types.js diff --git a/packages/gittensory-miner/lib/calibration/index.d.ts b/packages/gittensory-miner/lib/calibration.d.ts similarity index 76% rename from packages/gittensory-miner/lib/calibration/index.d.ts rename to packages/gittensory-miner/lib/calibration.d.ts index 8dd672e950..4286d64f00 100644 --- a/packages/gittensory-miner/lib/calibration/index.d.ts +++ b/packages/gittensory-miner/lib/calibration.d.ts @@ -3,11 +3,11 @@ export type { CalibrationRow, ObservedOutcomeRecord, PredictedVerdictRecord, -} from "./types.js"; +} from "./calibration-types.js"; export { isCalibrationReport, isCalibrationRow, isObservedOutcomeRecord, isPredictedVerdictRecord, -} from "./types.js"; +} from "./calibration-types.js"; diff --git a/packages/gittensory-miner/lib/calibration/index.js b/packages/gittensory-miner/lib/calibration.js similarity index 76% rename from packages/gittensory-miner/lib/calibration/index.js rename to packages/gittensory-miner/lib/calibration.js index 92cc60b3a1..40d74e7115 100644 --- a/packages/gittensory-miner/lib/calibration/index.js +++ b/packages/gittensory-miner/lib/calibration.js @@ -3,4 +3,4 @@ export { isCalibrationRow, isObservedOutcomeRecord, isPredictedVerdictRecord, -} from "./types.js"; +} from "./calibration-types.js"; diff --git a/packages/gittensory-miner/package.json b/packages/gittensory-miner/package.json index addc3122e9..fa11aa7ad3 100644 --- a/packages/gittensory-miner/package.json +++ b/packages/gittensory-miner/package.json @@ -31,7 +31,7 @@ "lib" ], "scripts": { - "build": "node --check bin/gittensory-miner.js && node --check lib/cli.js && node --check lib/deny-check.js && node --check lib/run-state-cli.js && node --check lib/update-check.js && node --check lib/opportunity-fanout.js && node --check lib/ci-poller.js && node --check lib/run-state.js && node --check lib/deny-hooks.js && node --check lib/event-ledger.js && node --check lib/event-ledger-cli.js && node --check lib/claim-ledger.js && node --check lib/claim-ledger-expiry.js && node --check lib/portfolio-queue.js && node --check lib/portfolio-queue-cli.js && node --check lib/portfolio-discovery.js && node --check lib/opportunity-ranker.js && node --check lib/plan-store.js && node --check lib/plan-store-cli.js && node --check lib/rejection-templates.js && node --check lib/governor-ledger.js && node --check lib/governor-ledger-cli.js && node --check lib/manage-status.js && node --check lib/manage-poll.js && node --check lib/status.js && node --check lib/laptop-init.js && node --check lib/replay-objective-anchor.js && node --check lib/replay-task-generation.js && node --check lib/calibration/types.js && node --check lib/calibration/index.js" + "build": "node --check bin/gittensory-miner.js && node --check lib/cli.js && node --check lib/deny-check.js && node --check lib/run-state-cli.js && node --check lib/update-check.js && node --check lib/opportunity-fanout.js && node --check lib/ci-poller.js && node --check lib/run-state.js && node --check lib/deny-hooks.js && node --check lib/event-ledger.js && node --check lib/event-ledger-cli.js && node --check lib/claim-ledger.js && node --check lib/claim-ledger-expiry.js && node --check lib/portfolio-queue.js && node --check lib/portfolio-queue-cli.js && node --check lib/portfolio-discovery.js && node --check lib/opportunity-ranker.js && node --check lib/plan-store.js && node --check lib/plan-store-cli.js && node --check lib/rejection-templates.js && node --check lib/governor-ledger.js && node --check lib/governor-ledger-cli.js && node --check lib/manage-status.js && node --check lib/manage-poll.js && node --check lib/status.js && node --check lib/laptop-init.js && node --check lib/replay-objective-anchor.js && node --check lib/replay-task-generation.js && node --check lib/calibration-types.js && node --check lib/calibration.js" }, "dependencies": { "@jsonbored/gittensory-engine": "0.1.0" diff --git a/test/unit/miner-calibration-types.test.ts b/test/unit/miner-calibration-types.test.ts index e877a1bbb3..dd20b3db47 100644 --- a/test/unit/miner-calibration-types.test.ts +++ b/test/unit/miner-calibration-types.test.ts @@ -4,13 +4,13 @@ import { isCalibrationRow, isObservedOutcomeRecord, isPredictedVerdictRecord, -} from "../../packages/gittensory-miner/lib/calibration/index.js"; +} from "../../packages/gittensory-miner/lib/calibration.js"; import type { CalibrationReport, CalibrationRow, ObservedOutcomeRecord, PredictedVerdictRecord, -} from "../../packages/gittensory-miner/lib/calibration/index.js"; +} from "../../packages/gittensory-miner/lib/calibration.js"; describe("gittensory-miner calibration types scaffold (#2332)", () => { const predicted: PredictedVerdictRecord = {