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
4 changes: 2 additions & 2 deletions test/contract/selfhost-d1-database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// no meaningful way to fake generic SQL execution for an arbitrary CREATE TABLE/INSERT/SELECT -- so it
// follows the exact same PG_TEST_URL gate test/integration/selfhost-pg.test.ts already established: unset in
// CI (skipped, not failed), set locally against a real Postgres to actually exercise it:
// docker run -d -e POSTGRES_PASSWORD=devpw -e POSTGRES_DB=gittensory -p 55432:5432 postgres:16
// PG_TEST_URL=postgres://postgres:devpw@localhost:55432/gittensory npx vitest run test/contract/selfhost-d1-database.test.ts
// docker run -d -e POSTGRES_PASSWORD=devpw -e POSTGRES_DB=loopover -p 55432:5432 postgres:16
// PG_TEST_URL=postgres://postgres:devpw@localhost:55432/loopover npx vitest run test/contract/selfhost-d1-database.test.ts
// Every statement here uses only PG-native column types (INTEGER/TEXT) and `?`-style placeholders with
// explicit values (never relying on SQLite ROWID auto-assignment), which pg-dialect.ts's translateDdl/
// translateSql already pass through/translate unchanged (see its own doc comments) -- so the same SQL text is
Expand Down
2 changes: 1 addition & 1 deletion test/contract/upstream-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe.skipIf(!runLiveContracts)("live upstream Gittensor contract", () => {
expect(result.ruleset.activeModel).not.toBe("unknown");
expect(result.ruleset.payload).toMatchObject({
registry: expect.objectContaining({
repositories: expect.arrayContaining([expect.objectContaining({ repo: "JSONbored/gittensory" })]),
repositories: expect.arrayContaining([expect.objectContaining({ repo: "JSONbored/loopover" })]),
}),
scoring: expect.objectContaining({ activeModel: result.ruleset.activeModel }),
issueDiscovery: expect.objectContaining({ branchEligibilityRequired: expect.any(Boolean) }),
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/engine-parity/predicted-gate/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Predicted Gate Parity Fixtures

These fixtures are the scenario corpus for [issue #2285](https://github.com/JSONbored/gittensory/issues/2285).
These fixtures are the scenario corpus for [issue #2285](https://github.com/JSONbored/loopover/issues/2285).
Each file exports one complete, self-contained `buildPredictedGateVerdict` input plus the expected high-level
surface it should produce today. The follow-up parity runner can reuse the same inputs to snapshot full outputs.

Expand Down
4 changes: 2 additions & 2 deletions test/integration/miner-calibration-loop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { initEventLedger } from "../../packages/loopover-miner/lib/event-ledger.
const roots: string[] = [];

function tempLedgerPath() {
const root = mkdtempSync(join(tmpdir(), "gittensory-miner-calibration-"));
const root = mkdtempSync(join(tmpdir(), "loopover-miner-calibration-"));
roots.push(root);
return join(root, "event-ledger.sqlite3");
}
Expand Down Expand Up @@ -85,7 +85,7 @@ describe("miner Phase 7 calibration loop (#4248)", () => {
repoFullName: "acme/widgets",
});

// Deliverable: the snapshot is queryable via the EXISTING `gittensory-miner ledger list --type` tooling.
// Deliverable: the snapshot is queryable via the EXISTING `loopover-miner ledger list --type` tooling.
const typed = filterLedgerEvents(reopened.readEvents(), { type: MINER_CALIBRATION_SNAPSHOT_EVENT });
expect(typed).toHaveLength(1);

Expand Down
8 changes: 4 additions & 4 deletions test/integration/orb-webhook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function post(
return handleOrbWebhook(ctx(e, headers, request));
}

const INSTALL = JSON.stringify({ action: "created", installation: { id: 42 }, repository: { full_name: "JSONbored/gittensory" } });
const INSTALL = JSON.stringify({ action: "created", installation: { id: 42 }, repository: { full_name: "JSONbored/loopover" } });
const row = (e: Env, delivery: string) =>
(e.DB as unknown as TestD1Database).prepare("SELECT event_name, action, installation_id, repository_full_name, status FROM orb_webhook_events WHERE delivery_id=?").bind(delivery).first<{ event_name: string; action: string; installation_id: number; repository_full_name: string; status: string }>();

Expand Down Expand Up @@ -102,13 +102,13 @@ describe("handleOrbWebhook (POST /v1/orb/webhook)", () => {
const res = await post(e, INSTALL, { delivery: "ok-1" });
expect(res.status).toBe(202);
await expect(res.json()).resolves.toMatchObject({ status: "received", eventName: "installation" });
expect(await row(e, "ok-1")).toMatchObject({ action: "created", installation_id: 42, repository_full_name: "JSONbored/gittensory", status: "received" });
expect(await row(e, "ok-1")).toMatchObject({ action: "created", installation_id: 42, repository_full_name: "JSONbored/loopover", status: "received" });
});

it("ACKs 202 immediately and SCHEDULES the relay forward via waitUntil (never blocks the ACK on a slow container, #orb-ack-fast)", async () => {
const e = env();
const scheduled: Promise<unknown>[] = [];
const PR = JSON.stringify({ action: "opened", installation: { id: 99 }, repository: { full_name: "JSONbored/gittensory" }, number: 7 });
const PR = JSON.stringify({ action: "opened", installation: { id: 99 }, repository: { full_name: "JSONbored/loopover" }, number: 7 });
const request = new Request("https://collector/v1/orb/webhook", { method: "POST", body: PR });
const headers = { "x-github-delivery": "fwd-1", "x-github-event": "pull_request", "x-hub-signature-256": await sign(PR, SECRET) };
const res = await handleOrbWebhook(ctx(e, headers, request, { waitUntil: (p) => scheduled.push(p) }));
Expand All @@ -121,7 +121,7 @@ describe("handleOrbWebhook (POST /v1/orb/webhook)", () => {
it("INVARIANT: central Orb ingress stays live without the self-host review-runtime cache", async () => {
const e = env();
delete e.SELFHOST_TRANSIENT_CACHE;
const PR = JSON.stringify({ action: "opened", installation: { id: 100 }, repository: { full_name: "JSONbored/gittensory" }, number: 8 });
const PR = JSON.stringify({ action: "opened", installation: { id: 100 }, repository: { full_name: "JSONbored/loopover" }, number: 8 });
const res = await post(e, PR, { delivery: "orb-no-review-cache", event: "pull_request" });
expect(res.status).toBe(202);
await expect(res.json()).resolves.toMatchObject({ status: "received", eventName: "pull_request" });
Expand Down
24 changes: 12 additions & 12 deletions test/integration/public-stats-route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { PUBLIC_REVIEW_VOLUME_TREND_WEEKS } from "../../src/services/public-revi
async function seed(env: Env) {
// [repo, number, state, mergedAt] — merged (merged_at set) / closed (state closed, no merge) / open (in review).
const prs: Array<[string, number, string, string | null]> = [
["JSONbored/gittensory", 1, "closed", "2026-06-20T00:00:00Z"], // merged
["JSONbored/gittensory", 2, "closed", null], // closed without merge
["JSONbored/gittensory", 3, "open", null], // still in review
["JSONbored/loopover", 1, "closed", "2026-06-20T00:00:00Z"], // merged
["JSONbored/loopover", 2, "closed", null], // closed without merge
["JSONbored/loopover", 3, "open", null], // still in review
["JSONbored/awesome-claude", 5, "closed", "2026-06-20T00:00:00Z"], // merged
["JSONbored/awesome-claude", 6, "closed", "2026-06-20T00:00:00Z"], // merged
];
Expand All @@ -37,10 +37,10 @@ async function seed(env: Env) {
)
.run();
}
// One live reversal: the engine CLOSED gittensory#3, but it is now reopened (state 'open') — a human overturned
// One live reversal: the engine CLOSED loopover#3, but it is now reopened (state 'open') — a human overturned
// the auto-action. awesome-claude has none → exercises the per-project ?? 0 fallback.
await env.DB.prepare(
`INSERT INTO audit_events (id, event_type, target_key, outcome) VALUES ('rev1', 'agent.action.close', 'JSONbored/gittensory#3', 'completed')`,
`INSERT INTO audit_events (id, event_type, target_key, outcome) VALUES ('rev1', 'agent.action.close', 'JSONbored/loopover#3', 'completed')`,
).run();
}

Expand All @@ -56,23 +56,23 @@ describe("GET /v1/public/stats (#1059)", () => {
});

it("a present publicStats manifest override turns the endpoint ON even when LOOPOVER_PUBLIC_STATS is OFF (#6275)", async () => {
const env = createTestEnv({ LOOPOVER_DRIFT_ISSUE_REPO: "JSONbored/gittensory" }); // flag unset → OFF
await upsertRepoFocusManifest(env, "JSONbored/gittensory", { publicStats: { enabled: true } });
const env = createTestEnv({ LOOPOVER_DRIFT_ISSUE_REPO: "JSONbored/loopover" }); // flag unset → OFF
await upsertRepoFocusManifest(env, "JSONbored/loopover", { publicStats: { enabled: true } });
const res = await createApp().request("/v1/public/stats", {}, env);
expect(res.status).toBe(200);
});

it("a present publicStats manifest override turns the endpoint OFF even when LOOPOVER_PUBLIC_STATS is ON (#6275)", async () => {
const env = createTestEnv({ LOOPOVER_PUBLIC_STATS: "1", LOOPOVER_DRIFT_ISSUE_REPO: "JSONbored/gittensory" });
await upsertRepoFocusManifest(env, "JSONbored/gittensory", { publicStats: { enabled: false } });
const env = createTestEnv({ LOOPOVER_PUBLIC_STATS: "1", LOOPOVER_DRIFT_ISSUE_REPO: "JSONbored/loopover" });
await upsertRepoFocusManifest(env, "JSONbored/loopover", { publicStats: { enabled: false } });
const res = await createApp().request("/v1/public/stats", {}, env);
expect(res.status).toBe(404);
});

it("serves public-safe aggregates with no auth + a cache header when enabled", async () => {
const env = createTestEnv({
LOOPOVER_PUBLIC_STATS: "1",
LOOPOVER_PUBLIC_STATS_REPOS: "JSONbored/gittensory,JSONbored/awesome-claude",
LOOPOVER_PUBLIC_STATS_REPOS: "JSONbored/loopover,JSONbored/awesome-claude",
});
await seed(env);
const res = await createApp().request("/v1/public/stats", {}, env);
Expand All @@ -97,8 +97,8 @@ describe("GET /v1/public/stats (#1059)", () => {
expect(body.totals.reviewed).toBe(5); // merged 3 + closed 1 + in-review 1
expect(body.totals.reversed).toBe(1);
expect(body.totals.accuracyPct).toBe(75); // 1 - 1 / (3 + 1)
// busiest repo first: gittensory reviewed 3 (m1+c1+cm1) > awesome-claude 2 (m2+m3)
expect(body.byProject[0]?.project).toBe("JSONbored/gittensory");
// busiest repo first: loopover reviewed 3 (m1+c1+cm1) > awesome-claude 2 (m2+m3)
expect(body.byProject[0]?.project).toBe("JSONbored/loopover");
expect(body.byProject.map((p) => p.project)).toContain(
"JSONbored/awesome-claude",
);
Expand Down
Loading
Loading