Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/loopover-miner/lib/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { resolvePlanStoreDbPath } from "./plan-store.js";
// this laptop set up correctly). Both are read-only and 100% local — no repo-scanning, no coding-agent invocation,
// no GitHub writes, and no network calls of any kind. Later phases add the real discover/plan/manage loop.

// Lazy, not module-scope: mirrors the gittensory-engine repo-map.ts fix -- this file is CLI-only today, but
// Lazy, not module-scope: mirrors the loopover-engine repo-map.ts fix -- this file is CLI-only today, but
// an eager createRequire(import.meta.url)/import.meta.dirname at module scope would crash on import in any
// bundler context where import.meta is unavailable (e.g. if a future import chain pulls this into a Worker
// bundle, the way repo-map.ts was). Deferring construction to first real use keeps this import-safe.
Expand Down Expand Up @@ -117,10 +117,10 @@ export function readInstalledEnginePackageVersion() {
try {
return readInstalledEnginePackageVersionFromPaths(
requireFromHere().resolve(ENGINE_PACKAGE),
join(moduleDir(), "../../gittensory-engine/package.json"),
join(moduleDir(), "../../loopover-engine/package.json"),
);
} catch {
const workspacePkg = join(moduleDir(), "../../gittensory-engine/package.json");
const workspacePkg = join(moduleDir(), "../../loopover-engine/package.json");
if (existsSync(workspacePkg)) {
try {
return JSON.parse(readFileSync(workspacePkg, "utf8")).version ?? null;
Expand Down Expand Up @@ -155,7 +155,7 @@ export function readExpectedEnginePackageVersionFromPaths(

export function readExpectedEnginePackageVersion() {
return readExpectedEnginePackageVersionFromPaths(
join(moduleDir(), "../../gittensory-engine/package.json"),
join(moduleDir(), "../../loopover-engine/package.json"),
join(moduleDir(), "../expected-engine.version"),
);
}
Expand Down Expand Up @@ -278,7 +278,7 @@ export function runStatus(args = [], env = process.env, cwd = process.cwd()) {
}

function checkStateDirWritable(stateDir) {
const probe = join(stateDir, ".gittensory-miner-write-probe");
const probe = join(stateDir, ".loopover-miner-write-probe");
try {
// Creating the dir and writing (then removing) a probe file proves it is writable — the state dir must be
// creatable/writable for the local SQLite stores to work.
Expand Down Expand Up @@ -310,14 +310,14 @@ function storeIntegrityChecks(env) {
return stores.map(([name, dbPath]) => checkStoreIntegrity(`store-integrity:${name}`, dbPath));
}

/** Validate the discovered `.gittensory-miner` config's CONTENT (#4873), not just its path: parse it with the
/** Validate the discovered `.loopover-miner` config's CONTENT (#4873), not just its path: parse it with the
* tolerant goal-spec parser and surface its warnings, so a malformed config is flagged by `doctor` rather than
* silently degrading to defaults. No config file is fine (defaults apply); a read failure is reported. `readImpl`
* is injectable for tests. */
export function checkConfigContent(cwd, readImpl = readFileSync) {
const configPath = discoverConfigFile(cwd);
if (!configPath) {
return { name: "config-content", ok: true, detail: "no .gittensory-miner config found (using defaults)" };
return { name: "config-content", ok: true, detail: "no .loopover-miner config found (using defaults)" };
}
let warnings;
try {
Expand Down
6 changes: 3 additions & 3 deletions test/unit/miner-plan-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempStore() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-plan-store-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-plan-store-"));
roots.push(root);
const store = openPlanStore(join(root, "nested", "plan-store.sqlite3"));
stores.push(store);
Expand All @@ -35,7 +35,7 @@ const PLAN: PlanDag = {
],
};

describe("gittensory-miner plan store (#2318)", () => {
describe("loopover-miner plan store (#2318)", () => {
it("exposes the frozen plan-status vocabulary", () => {
expect(PLAN_STATUSES).toEqual(["pending", "running", "completed", "failed"]);
expect(Object.isFrozen(PLAN_STATUSES)).toBe(true);
Expand Down Expand Up @@ -157,7 +157,7 @@ describe("gittensory-miner plan store (#2318)", () => {
});

it("fails closed on an out-of-vocabulary status column (legacy/foreign row without the CHECK)", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-plan-store-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-plan-store-"));
roots.push(root);
const dbPath = join(root, "legacy.sqlite3");
// Simulate a legacy/foreign table created before the status CHECK constraint, holding an invalid status.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/miner-policy-doc-cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempDbPath(): string {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-policy-doc-cache-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-policy-doc-cache-"));
roots.push(root);
return join(root, "policy-doc-cache.sqlite3");
}
Expand Down Expand Up @@ -44,7 +44,7 @@ describe("resolvePolicyDocCacheDbPath (#4842)", () => {
});
});

describe("gittensory-miner policy-doc cache store (#4842)", () => {
describe("loopover-miner policy-doc cache store (#4842)", () => {
it("returns null for a URL that has never been cached", () => {
expect(openStore().get(URL)).toBeNull();
});
Expand Down
4 changes: 2 additions & 2 deletions test/unit/miner-policy-verdict-cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempDbPath(): string {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-policy-verdict-cache-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-policy-verdict-cache-"));
roots.push(root);
return join(root, "policy-verdict-cache.sqlite3");
}
Expand Down Expand Up @@ -46,7 +46,7 @@ describe("resolvePolicyVerdictCacheDbPath (#4843)", () => {
});
});

describe("gittensory-miner policy-verdict cache store (#4843)", () => {
describe("loopover-miner policy-verdict cache store (#4843)", () => {
it("returns null for a repo that has never been cached", () => {
expect(openStore().get(REPO)).toBeNull();
});
Expand Down
6 changes: 3 additions & 3 deletions test/unit/miner-portfolio-discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempQueueStore() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-discovery-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-discovery-"));
roots.push(root);
const store = initPortfolioQueueStore(join(root, "portfolio-queue.sqlite3"));
stores.push(store);
return store;
}

function tempEventLedger() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-discovery-ledger-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-discovery-ledger-"));
roots.push(root);
const ledger = initEventLedger(join(root, "event-ledger.sqlite3"));
stores.push(ledger);
Expand All @@ -50,7 +50,7 @@ afterEach(() => {
for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true });
});

describe("gittensory-miner portfolio discovery (#2292)", () => {
describe("loopover-miner portfolio discovery (#2292)", () => {
it("returns a zero summary for empty input without touching the queue", () => {
const queueStore = tempQueueStore();
expect(enqueueRankedDiscovery([], { queueStore })).toEqual({
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-portfolio-queue-crash-recovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempRoot(): { root: string; dbPath: string } {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-crash-recovery-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-crash-recovery-"));
roots.push(root);
return { root, dbPath: join(root, "portfolio-queue.sqlite3") };
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-portfolio-queue-expiry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempStore() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-expiry-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-expiry-"));
roots.push(root);
const store = initPortfolioQueueStore(join(root, "portfolio-queue.sqlite3"));
stores.push(store);
Expand Down
18 changes: 9 additions & 9 deletions test/unit/miner-portfolio-queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const roots: string[] = [];
const stores: Array<{ close(): void }> = [];

function tempStore() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-"));
roots.push(root);
const store = initPortfolioQueueStore(join(root, "nested", "portfolio-queue.sqlite3"));
stores.push(store);
Expand All @@ -40,7 +40,7 @@ afterEach(() => {
for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true });
});

describe("gittensory-miner portfolio/queue store (#2292)", () => {
describe("loopover-miner portfolio/queue store (#2292)", () => {
it("exposes the frozen status vocabulary", () => {
expect(QUEUE_STATUSES).toEqual(["queued", "in_progress", "done"]);
expect(Object.isFrozen(QUEUE_STATUSES)).toBe(true);
Expand Down Expand Up @@ -184,7 +184,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
});

it("module-level markFailed delegates to the default portfolio-queue store (#2347)", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-default-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-default-"));
roots.push(root);
vi.stubEnv("LOOPOVER_MINER_PORTFOLIO_QUEUE_DB", join(root, "portfolio-queue.sqlite3"));
enqueue({ repoFullName: "o/a", identifier: "work", priority: 1 });
Expand All @@ -210,7 +210,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
});

it("module-level markDone delegates to the default portfolio-queue store", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-default-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-default-"));
roots.push(root);
vi.stubEnv("LOOPOVER_MINER_PORTFOLIO_QUEUE_DB", join(root, "portfolio-queue.sqlite3"));
enqueue({ repoFullName: "o/a", identifier: "work", priority: 1 });
Expand Down Expand Up @@ -289,7 +289,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
});

it("migrates an existing pre-#5563 file (already at the leased_at v2 shape), backfilling api_base_url and preserving every row", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-legacy-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-legacy-"));
roots.push(root);
const dbPath = join(root, "legacy.sqlite3");
const legacy = new DatabaseSync(dbPath);
Expand Down Expand Up @@ -329,7 +329,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
});

it("REGRESSION: a legacy row violating the rebuilt table's status CHECK constraint is dropped, not a migration-aborting crash", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-legacy-corrupt-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-legacy-corrupt-"));
roots.push(root);
const dbPath = join(root, "legacy-corrupt.sqlite3");
const legacy = new DatabaseSync(dbPath);
Expand Down Expand Up @@ -456,7 +456,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
});

it("module-level getAttemptHistory delegates to the default portfolio-queue store", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-default-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-default-"));
roots.push(root);
vi.stubEnv("LOOPOVER_MINER_PORTFOLIO_QUEUE_DB", join(root, "portfolio-queue.sqlite3"));
enqueue({ repoFullName: "o/a", identifier: "work", priority: 1 });
Expand All @@ -476,7 +476,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
});

it("migrates an existing pre-#5654 file (already at the api_base_url v3 shape) by backfilling the counters to 0, preserving every row", () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-legacy-v3-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-legacy-v3-"));
roots.push(root);
const dbPath = join(root, "legacy-v3.sqlite3");
const legacy = new DatabaseSync(dbPath);
Expand Down Expand Up @@ -526,7 +526,7 @@ describe("gittensory-miner portfolio/queue store (#2292)", () => {
// Mirrors the leased_at migration's own defensive column-presence guard one migration index up: a file
// that already has the three new columns (e.g. from a partially-applied prior migration attempt) must
// not crash re-adding columns that already exist -- each of the three checks must independently skip.
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-portfolio-legacy-partial-v4-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-portfolio-legacy-partial-v4-"));
roots.push(root);
const dbPath = join(root, "legacy-partial-v4.sqlite3");
const legacy = new DatabaseSync(dbPath);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-prediction-ledger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { initPredictionLedger, resolvePredictionLedgerDbPath } from "../../packa
const ledgers: Array<{ close: () => void }> = [];
const roots: string[] = [];
function tempLedger() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-prediction-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-prediction-"));
roots.push(root);
const ledger = initPredictionLedger(join(root, "prediction-ledger.sqlite3"));
ledgers.push(ledger);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-pretooluse-hook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ afterEach(() => {
});

function openLedger() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-pretooluse-hook-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-pretooluse-hook-"));
roots.push(root);
const ledger = initGovernorLedger(join(root, "governor-ledger.sqlite3"));
ledgers.push(ledger);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-process-lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ afterEach(() => {
vi.restoreAllMocks();
});

describe("gittensory-miner process lifecycle / crash-safety (#4826)", () => {
describe("loopover-miner process lifecycle / crash-safety (#4826)", () => {
it("registerCleanupResource ignores null and undefined but still returns a callable no-op", () => {
expect(cleanupResourceCount()).toBe(0);
expect(() => registerCleanupResource(null)()).not.toThrow();
Expand Down
4 changes: 2 additions & 2 deletions test/unit/miner-ranked-candidates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
const roots: string[] = [];

function tempRoot(): string {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-ranked-candidates-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-ranked-candidates-"));
roots.push(root);
return root;
}
Expand All @@ -40,7 +40,7 @@ const fullCandidate = {
dupRisk: 0.1,
};

describe("gittensory-miner ranked-candidates store (#4859 prerequisite)", () => {
describe("loopover-miner ranked-candidates store (#4859 prerequisite)", () => {
it("resolves the DB path from env override, miner config dir, XDG config, then the home default", () => {
expect(resolveRankedCandidatesDbPath({ LOOPOVER_MINER_RANKED_CANDIDATES_DB: "/custom/ranked.sqlite3" })).toBe(
"/custom/ranked.sqlite3",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-rejection-state-machine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
const CONTEXT = { repoFullName: "JSONbored/gittensory", prNumber: 4278 } as const;
const closedUnmerged = { state: "closed", merged: false, merged_at: null, closed_at: "2026-07-09T18:00:00Z" };

describe("gittensory-miner rejection state machine (#4278)", () => {
describe("loopover-miner rejection state machine (#4278)", () => {
it("extracts terminal-outcome fields from a full PR payload", () => {
expect(extractPrOutcomeFields(closedUnmerged)).toEqual({
state: "closed",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-rejection-templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {

const CONTEXT = { repoFullName: "JSONbored/gittensory", prNumber: 2751 } as const;

describe("gittensory-miner rejection templates (#2324)", () => {
describe("loopover-miner rejection templates (#2324)", () => {
it("exposes the frozen reason vocabulary", () => {
expect(REJECTION_REASONS).toEqual(["gate_close", "maintainer_close_no_reason", "superseded_by_duplicate"]);
expect(Object.isFrozen(REJECTION_REASONS)).toBe(true);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-replay-objective-anchor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
scoreObjectiveAnchor,
} from "../../packages/loopover-miner/lib/replay-objective-anchor.js";

describe("gittensory-miner replay objective-anchor scoring (#3012)", () => {
describe("loopover-miner replay objective-anchor scoring (#3012)", () => {
it("exposes a frozen change-kind vocabulary and weights that sum to 1", () => {
expect(Object.isFrozen(CHANGE_KINDS)).toBe(true);
expect(CHANGE_KINDS).toContain("feature");
Expand Down
4 changes: 2 additions & 2 deletions test/unit/miner-replay-snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function happyPathScripts(overrides: Array<{ match: (args: readonly string[]) =>
let stores: Array<{ close(): void }> = [];
let roots: string[] = [];
function tempStore() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-replay-snapshot-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-replay-snapshot-"));
roots.push(root);
const store = openReplaySnapshotStore(join(root, "db.sqlite3"));
stores.push(store);
Expand Down Expand Up @@ -380,7 +380,7 @@ describe("exportReplaySnapshot (#3010)", () => {
});

it("falls back to the default (env-resolved) store when deps.store is omitted", async () => {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-replay-snapshot-default-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-replay-snapshot-default-"));
roots.push(root);
vi.stubEnv("LOOPOVER_MINER_REPLAY_SNAPSHOT_DB", join(root, "default.sqlite3"));
const { exec } = scriptedExec(happyPathScripts());
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-replay-task-generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CONTEXT = {
revealedIssueNumbers: [250, 300],
};

describe("gittensory-miner leakage-safe replay task generation (#3011)", () => {
describe("loopover-miner leakage-safe replay task generation (#3011)", () => {
it("exposes a frozen recency-pool vocabulary and a stable placeholder", () => {
expect(Object.isFrozen(RECENCY_POOLS)).toBe(true);
expect(RECENCY_POOLS).toEqual(["recent", "older"]);
Expand Down
Loading
Loading