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
12 changes: 6 additions & 6 deletions src/services/self-dogfood-registration-pack.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { GITTENSOR_SELF_REPO_DEFAULT, resolveGittensorySelfRepoFullName } from "../config/gittensory-repo-focus-manifest";
import {
buildGittensorConfigRecommendation,
buildRegistrationReadiness,
Expand All @@ -8,7 +9,10 @@ import {
} from "../signals/registration-readiness";
import { nowIso } from "../utils/json";

export const DEFAULT_SELF_DOGFOOD_REPO = "JSONbored/gittensory";
// Re-exported for backward compatibility with existing callers/tests (#2911); the actual default value and
// resolver logic live in config/gittensory-repo-focus-manifest.ts, the single source of truth shared with
// upstream/ruleset.ts.
export const DEFAULT_SELF_DOGFOOD_REPO = GITTENSOR_SELF_REPO_DEFAULT;

export type SelfDogfoodActionArea = {
area: string;
Expand All @@ -32,11 +36,7 @@ export type SelfDogfoodRegistrationPack = {
rerunHint: string;
};

export function resolveSelfDogfoodRepoFullName(env: { GITTENSORY_DRIFT_ISSUE_REPO?: string }): string {
const configured = env.GITTENSORY_DRIFT_ISSUE_REPO?.trim();
if (!configured || !configured.includes("/")) return DEFAULT_SELF_DOGFOOD_REPO;
return configured;
}
export const resolveSelfDogfoodRepoFullName = resolveGittensorySelfRepoFullName;

export function buildSelfDogfoodRegistrationPack(args: {
repoFullName: string;
Expand Down
4 changes: 2 additions & 2 deletions src/upstream/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
updateUpstreamDriftReportIssue,
upsertUpstreamDriftReport,
} from "../db/repositories";
import { resolveGittensorySelfRepoFullName } from "../config/gittensory-repo-focus-manifest";
import { timeoutFetch } from "../github/client";
import { resolveUpstreamCommitSha } from "./commit";
import { isGlobalAgentPause } from "../settings/agent-execution";
Expand All @@ -34,7 +35,6 @@ import { errorMessage, jsonString, nowIso } from "../utils/json";

// The Gittensor upstream repo/ref defaults are single-sourced from src/scoring/model.ts (where the same
// env.GITTENSOR_UPSTREAM_* override is honoured) — see DEFAULT_GITTENSOR_UPSTREAM_REPO/REF.
const DEFAULT_DRIFT_ISSUE_REPO = "JSONbored/gittensory";
const UPSTREAM_STALE_MS = 2 * 60 * 60 * 1000;
const REGISTRY_HYPERPARAMETER_DRIFT_LIMIT = 100;

Expand Down Expand Up @@ -285,7 +285,7 @@ export async function fileUpstreamDriftIssues(env: Env): Promise<Record<string,
}
const token = env.GITTENSORY_DRIFT_ISSUE_TOKEN ?? env.GITHUB_PUBLIC_TOKEN;
if (!token) return { status: "skipped", reason: "missing_issue_token", created: 0, updated: 0, skipped: 0 };
const repo = env.GITTENSORY_DRIFT_ISSUE_REPO || DEFAULT_DRIFT_ISSUE_REPO;
const repo = resolveGittensorySelfRepoFullName(env);
const assignees = resolveDriftAssignees(env);
const reports = (await listUpstreamDriftReports(env, 20)).filter((report) => report.status === "open");
let created = 0;
Expand Down
Loading