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
6 changes: 3 additions & 3 deletions src/review/adapters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Review-adapter factory (reviewbot→gittensory convergence — ADDITIVE infra). Builds the injected adapter
// Review-adapter factory (reviewbot→loopover convergence — ADDITIVE infra). Builds the injected adapter
// interfaces the ported review modules expect (src/review/rag.ts `RagInfra` = VectorAdapter / InferenceAdapter /
// StorageAdapter) from gittensory's ambient `Env` bindings, so the host can wire the ported RAG path without
// StorageAdapter) from loopover's ambient `Env` bindings, so the host can wire the ported RAG path without
// the modules depending on Cloudflare bindings directly. This mirrors reviewbot's platform layer — the `cf*`
// pass-through wrappers + `createCloudflareAdapters` (src/platform/cloudflare/index.ts) and the fail-safe gates
// in src/platform/access.ts (no Vectorize → no RAG, no AI → no context).
Expand Down Expand Up @@ -37,7 +37,7 @@ export function reviewVectorAdapter(vectorize: Vectorize): VectorAdapter {
},
query: async (vector, opts) => {
const res = await vectorize.query(vector, opts as unknown as Parameters<Vectorize["query"]>[1]);
// Under `exactOptionalPropertyTypes` (gittensory's stricter tsconfig) the optional `metadata?` cannot be
// Under `exactOptionalPropertyTypes` (loopover's stricter tsconfig) the optional `metadata?` cannot be
// assigned `undefined`, so only attach it when Vectorize returned metadata. Behavior is identical to
// reviewbot's cfVector — a match with no metadata simply has no `metadata` key.
return {
Expand Down
8 changes: 4 additions & 4 deletions src/review/alerts.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Anomaly alerting (reviewbot→gittensory convergence — ADDITIVE, NATIVE port of reviewbot
// Anomaly alerting (reviewbot→loopover convergence — ADDITIVE, NATIVE port of reviewbot
// src/core/alerts.ts). On each cron tick, snapshot agent health and push a THROTTLED Discord alert when
// something drifts — a manual-rate spike, stuck/failed targets, a DLQ spike, calibration drift, disputed
// closes, or a config invariant violation — so drift is HEARD ABOUT instead of polled for.
//
// SELF-CONTAINED: every type + helper this module needs is defined HERE. No imports from reviewbot. The
// logic is byte-faithful to the reviewbot source; the only deltas are mechanical guards for gittensory's
// logic is byte-faithful to the reviewbot source; the only deltas are mechanical guards for loopover's
// stricter tsconfig (noUncheckedIndexedAccess / exactOptionalPropertyTypes), which do not change behavior.
//
// STORAGE: gittensory has no platform/access adapter — `Env` is a global ambient interface with `DB`. The
// STORAGE: loopover has no platform/access adapter — `Env` is a global ambient interface with `DB`. The
// `storage(env) => env.DB` helper below mirrors the other native ports (unified-comment-bridge etc.).
//
// HEALTH/CALIBRATION INPUTS: computing the D1 health/calibration snapshots is the runtime gate's job
Expand Down Expand Up @@ -93,7 +93,7 @@ export interface AlertAgentConfig {

// ── Inlined helpers (byte-faithful from reviewbot src/core/{crypto,util,notify,db}.ts) ───────────

/** Storage seam: gittensory's `Env` is a global ambient interface with `DB`. */
/** Storage seam: loopover's `Env` is a global ambient interface with `DB`. */
function storage(env: Env): D1Database {
return env.DB;
}
Expand Down
4 changes: 2 additions & 2 deletions src/review/auto-apply.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Self-improvement "apply" surface (#273–#279, reviewbot→gittensory convergence). The autonomous loop's
// Self-improvement "apply" surface (#273–#279, reviewbot→loopover convergence). The autonomous loop's
// (eval → advisor → apply) write side: a per-project store of runtime tunable overrides the loop raises
// (confidenceFloor / scopeCap) WITHOUT a human editing config + redeploying, plus the soak-gated promotion
// that flips a SHADOW-queued tightening to LIVE once it passes the gate. Everything here FAILS SAFE: a query
Expand All @@ -8,7 +8,7 @@
// reviewbot. Storage is reached through an inline `storage(env) => env.DB` helper + a minimal D1-shaped
// interface (no Cloudflare-binding type dependency), matching the runtime's D1 calls byte-for-byte. The pure
// helpers (sanitize / merge / tightening / promotion gate) are ports of the reviewbot source
// (src/core/tunables.ts + src/core/auto-apply.ts); the only deltas are mechanical guards for gittensory's
// (src/core/tunables.ts + src/core/auto-apply.ts); the only deltas are mechanical guards for loopover's
// stricter tsconfig (noUncheckedIndexedAccess, exactOptionalPropertyTypes), which do not change behavior.
//
// DEFERRED INFRA (out of scope here — this ports the pure logic + the D1-shaped store + tests):
Expand Down
4 changes: 2 additions & 2 deletions src/review/auto-tune.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autonomous self-improvement — accuracy circuit-breaker (#self-improve, reviewbot→gittensory convergence).
// Autonomous self-improvement — accuracy circuit-breaker (#self-improve, reviewbot→loopover convergence).
// The ONE tuning action safe to take unattended: when the gate eval shows merge precision dropping below a
// floor over a real sample, the system DISABLES its own auto-merge for that project (sets the holdonly flag)
// so it stops repeating a bad call, and alerts a human. It only ever makes itself MORE cautious — loosening /
Expand All @@ -9,7 +9,7 @@
// reviewbot. The eval-report SHAPE (GateEvalReport/GateEvalRow) and the system-flags accessors
// (isHoldOnly/setFlag/flagSetAt) are inlined as INJECTED interfaces so this ports the PURE calibration logic
// without dragging in the engine. The logic is byte-faithful to the reviewbot source (src/core/auto-tune.ts);
// the only deltas are mechanical guards for gittensory's stricter tsconfig (noUncheckedIndexedAccess,
// the only deltas are mechanical guards for loopover's stricter tsconfig (noUncheckedIndexedAccess,
// exactOptionalPropertyTypes), which do not change behavior.
//
// DEFERRED INFRA (out of scope here — this ports the pure logic + tests):
Expand Down
4 changes: 2 additions & 2 deletions src/review/content-lane/duplicates.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Deterministic duplicate-detection + protected-edit content gate (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Byte-faithful to reviewbot's
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Byte-faithful to reviewbot's
// src/agents/awesome-claude/duplicates.ts (itself a faithful port of the live submission-gate
// duplicates.ts). This module is I/O-free: the caller fetches the accepted corpus
// (`${PUBLIC_SITE_URL}/data/directory-index.json`) and any earlier-open-PR content, then passes
Expand All @@ -9,7 +9,7 @@
// Normalization, the STRICT-match rule (the only result the gate closes on), the related/legacy
// classifiers, and the protected-field set are preserved exactly. Over-closing (a false strict
// duplicate) permanently rejects a legitimate submission, so the strict boundary is unchanged.
// The only deltas vs the reviewbot source are mechanical guards for gittensory's stricter tsconfig
// The only deltas vs the reviewbot source are mechanical guards for loopover's stricter tsconfig
// (noUncheckedIndexedAccess + exactOptionalPropertyTypes) — they do not change behavior.
//
// Dedup config (protected fields, URL fields, domain exclusions, multi-entry catalog roots) is sourced from the
Expand Down
4 changes: 2 additions & 2 deletions src/review/content-lane/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Content-lane public surface (reviewbot→gittensory convergence).
// Content-lane public surface (reviewbot→loopover convergence).
//
// The native, flag-gated content-review primitives for the two CONTENT repos — awesome-claude (a
// curated list) and metagraphed (a registry) — a different domain from gittensory's code-gate. The
// curated list) and metagraphed (a registry) — a different domain from loopover's code-gate. The
// lane only runs when LOOPOVER_REVIEW_CONTENT_LANE is truthy (see ./flag); flag-off the host never reaches
// these modules.
//
Expand Down
4 changes: 2 additions & 2 deletions src/review/content-lane/netuid-verification.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Metagraphed netuid verification (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Byte-faithful to the taostats /
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Byte-faithful to the taostats /
// public-registry netuid-identity verification in reviewbot's src/agents/metagraphed/capabilities.ts
// (fetchSubnetRecord / checkNetuidExists / fetchTaostatsSubnetIdentity).
//
Expand All @@ -13,7 +13,7 @@
// 2. TAOSTATS on-chain identity (api.taostats.io) — REQUIRES the env secret TAOSTATS_API_KEY (sent
// as a raw `Authorization` header, NOT `Bearer`). STRICTLY OPTIONAL + fail-open: returns null
// when the key is unset or on any error, so the merge gate falls back to the page-mention +
// registry-identity grounding signals. The key is NOT yet declared in gittensory's Env — see the
// registry-identity grounding signals. The key is NOT yet declared in loopover's Env — see the
// port report; wire it (a Worker secret) to enable signal #2, or leave it unset to disable it.
//
// I/O is the injected fetch (`fetchImpl`, default global fetch) + a `readSecret` over a plain env
Expand Down
2 changes: 1 addition & 1 deletion src/review/content-lane/orchestrator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Deterministic surface-model review orchestrator (no AI — surfaces are structured data; gittensory is the
// Deterministic surface-model review orchestrator (no AI — surfaces are structured data; loopover is the
// sole adjudicator). Given a lane spec, the PR's changed files, and an injected file-content loader, it:
// 1. classifies the PR via classifyRegistryPrScope (entry / provider / not-a-direct-submission),
// 2. loads the head (+ base, for entries) document content,
Expand Down
6 changes: 3 additions & 3 deletions src/review/content-lane/registry-logic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Metagraphed registry decision logic (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Byte-faithful to reviewbot's
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Byte-faithful to reviewbot's
// src/agents/metagraphed/review-logic.ts (itself a faithful port of the live metagraphed
// submission-gate). PURE + testable; all I/O (GitHub, registry/taostats API, AI) lives in the
// caller. The SSRF guard is the shared content-lane safe-url; `Verdict` + `isInternalAutomation
Expand Down Expand Up @@ -458,7 +458,7 @@ function fail(reason: string, summary: string, candidate: CandidateLike | null =
/**
* Surface validators: a contribution appends ONE entry to `surfaces[]` of a `registry/subnets/<slug>.json`, whose
* `netuid` lives at the file ROOT (not on each entry). These two deterministic validators (per-entry +
* whole-document) make gittensory the sole adjudicator; no AI (surfaces are structured data). They take the
* whole-document) make loopover the sole adjudicator; no AI (surfaces are structured data). They take the
* appended entry / parsed document as arguments; the orchestrator resolves "exactly one appended entry" from a
* head-vs-base diff.
*/
Expand Down Expand Up @@ -651,7 +651,7 @@ export function probeFunctionalSurface(
//
// A community contribution appends entries to an array field of ONE registry "entry file" (e.g.
// registry/subnets/<slug>.json::surfaces[]), optionally with one flat companion provider file. To stay MODULAR —
// many maintainers will install gittensory over wildly different registries — the engine is parameterized by a
// many maintainers will install loopover over wildly different registries — the engine is parameterized by a
// RegistryLaneSpec rather than hard-coding metagraphed's paths; metagraphed is just the FIRST spec, and a spec can
// later be loaded from per-repo .loopover.yml config so a new registry needs config, not a code change.

Expand Down
2 changes: 1 addition & 1 deletion src/review/content-lane/safe-url.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SSRF-safe URL guard (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Ported from reviewbot's
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Ported from reviewbot's
// core/source-url.ts isSafeHttpUrl + isSafeEndpointUrl (the host/IP guard, including the encoded-IP
// decoding that a dotted-quad regex misses), hardened so a trailing-dot or `*.localhost` host can't
// dodge the loopback check. PURE — no imports, no I/O.
Expand Down
2 changes: 1 addition & 1 deletion src/review/content-lane/scope.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Content scope classification (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Byte-faithful to reviewbot's
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Byte-faithful to reviewbot's
// src/agents/awesome-claude/review-logic.ts (itself a faithful port of the live submission-gate
// classifyPullRequestFilesForContentReview). PURE — distinguishes ignore (no content entry) vs
// scope_failure (CLOSE) vs deletion vs review. `slugify` is inlined (a one-liner). The accepted
Expand Down
4 changes: 2 additions & 2 deletions src/review/content-lane/security-scan.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Deterministic security/abuse scan for content submissions (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Byte-faithful to reviewbot's
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Byte-faithful to reviewbot's
// src/agents/awesome-claude/security-scan.ts + the shared core/secrets-scan.ts. PURE — data in, data out,
// no I/O.
//
Expand Down Expand Up @@ -83,7 +83,7 @@ function firstSecretLine(text: string): { n: number; kinds: string[] } | null {

/**
* generic_secret_assignment is a keyword-plus-quoted-value SHAPE heuristic, not a concrete credential format
* (see ../secret-patterns.ts's HARD_SECRET_KINDS doc comment — split out post-gittensory-PR-#5346, which
* (see ../secret-patterns.ts's HARD_SECRET_KINDS doc comment — split out post-loopover-PR-#5346, which
* auto-closed a legitimate contributor PR over two inert test-fixture strings). Per this file's own header
* ("only ONE signal is unambiguous enough to hard-close... every other heuristic routes to MANUAL"), a hit
* here routes to MANUAL, never scanSubmissionContent's auto-close. Its keyword-to-value span can wrap across
Expand Down
2 changes: 1 addition & 1 deletion src/review/content-lane/source-evidence.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Deterministic source-evidence content gate (content-lane primitive).
//
// SELF-CONTAINED NATIVE PORT (reviewbot→gittensory convergence). Byte-faithful to reviewbot's
// SELF-CONTAINED NATIVE PORT (reviewbot→loopover convergence). Byte-faithful to reviewbot's
// src/agents/awesome-claude/source-evidence.ts. The SSRF guard is the shared content-lane
// `isSafeHttpUrl` (safe-url.ts); the browser fetch headers and the SHA-256 hash are inlined here.
//
Expand Down
2 changes: 1 addition & 1 deletion src/review/content-lane/spec-resolver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Per-repo RegistryLaneSpec resolution (#2435 — closes the "only metagraphed can use this" gap). Before this,
// content-lane-wire.ts hard-selected METAGRAPHED_LANE_SPEC for every repo in the LOOPOVER_REVIEW_REPOS
// allowlist; a different self-hosted maintainer's registry could only be onboarded by editing gittensory's own
// allowlist; a different self-hosted maintainer's registry could only be onboarded by editing loopover's own
// TypeScript source. This mirrors resolveConvergedFeature's precedence (review/feature-activation.ts): env
// kill-switch → per-repo `.loopover.yml` config → allowlist default — but resolves to a whole spec OBJECT (or
// null/inactive) instead of a boolean, so it lives alongside the content-lane engine rather than in
Expand Down
2 changes: 1 addition & 1 deletion src/review/cutover-gate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// ALSO pass for the feature to run on a given PR's repo.
//
// Single env var: LOOPOVER_REVIEW_REPOS — a comma-separated allowlist of repo full-names
// ("owner/repo", e.g. "JSONbored/gittensory,JSONbored/awesome-claude"). A repo activates the converged
// ("owner/repo", e.g. "JSONbored/loopover,JSONbored/awesome-claude"). A repo activates the converged
// features ONLY IF (the feature's global flag is ON) AND (the repo is in this allowlist).
//
// DEFAULT IS NO REPOS: empty / unset / whitespace-only → false for EVERY repo. So even with every global flag
Expand Down
2 changes: 1 addition & 1 deletion src/review/feature-activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import type { ConvergedFeatureKey, FocusManifest } from "../signals/focus-manife
import { loadRepoFocusManifest } from "../signals/focus-manifest-loader";

/**
* The four per-feature activation precedence shapes actually in use across gittensory's advisory review
* The four per-feature activation precedence shapes actually in use across loopover's advisory review
* capabilities (#4616):
* - `"standard"`: `override` fully controls (`true` forces on, `false` forces off); `null` (unset) falls back
* to `allowlisted`. rag / reputation / unifiedComment / e2eTests / improvementSignal.
Expand Down
2 changes: 1 addition & 1 deletion src/review/finding-taxonomy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FINDING_CATEGORIES } from "./finding-category-classify";
import { REVIEW_FINDING_SEVERITY_LADDER } from "../signals/focus-manifest";

/** MCP resource URI for the canonical review finding taxonomy (#2225). */
export const FINDING_TAXONOMY_URI = "gittensory://finding-taxonomy" as const;
export const FINDING_TAXONOMY_URI = "loopover://finding-taxonomy" as const;

export interface FindingTaxonomyDocument {
categories: readonly (typeof FINDING_CATEGORIES)[number][];
Expand Down
2 changes: 1 addition & 1 deletion src/review/fix-handoff-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// content only, no server-side write, no execution. Mirrors formatInlineBody's severity-label composition
// (inline-comments.ts) and reuses the exact no-cloud-write boundary text every other local-execution artifact
// carries (local-write-tools.ts's LOCAL_WRITE_BOUNDARY), so the guarantee reads identically everywhere
// gittensory hands a contributor something to run themselves.
// loopover hands a contributor something to run themselves.
//
// The caller is responsible for gating emission via shouldEmitFixHandoff (fix-handoff.ts) BEFORE calling into
// this module — this file is pure rendering, public-safe by construction: it only renders fields the caller
Expand Down
2 changes: 1 addition & 1 deletion src/review/gittensor-wire.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Gittensor experimental-plugin activation wiring. `gittensor` is the first key under the `experimental:`
// manifest block (EXPERIMENTAL_PLUGIN_KEYS) -- gittensory's original subnet mining-registry/scoring
// manifest block (EXPERIMENTAL_PLUGIN_KEYS) -- loopover's original subnet mining-registry/scoring
// integration, now an OPT-IN plugin rather than a core dependency, so a self-host instance with no gittensor
// affiliation has zero footprint from it (see registry/sync.ts's self-host scoping, which this feeds, and
// index.ts's cron gate, which skips the registry fetch entirely when nothing is opted in).
Expand Down
6 changes: 3 additions & 3 deletions src/review/grounding-wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// codebase convention (`/^(1|true|yes|on)$/i`, same as isSafetyEnabled / isEnabled).
//
// The ported, self-contained grounding engine lives in `./review-grounding`; this file is the thin HOST
// adapter that supplies its two inputs from data gittensory already has — the cached CI check summaries
// adapter that supplies its two inputs from data loopover already has — the cached CI check summaries
// (listCheckSummaries) and a GitHub Contents-API-backed FileFetcher — and renders the prompt text. Fully
// fail-safe: any missing CI data / fetch error degrades to "no grounding" and the review proceeds on the diff.

Expand Down Expand Up @@ -76,7 +76,7 @@ export function checkSummaryText(check: CheckSummaryRecord): string {
type CheckAggregate = { state: "passed" | "failed" | "pending"; passing: string[]; failingDetails: Array<{ name: string; summary?: string }> };

/**
* Fold gittensory's cached CI check summaries into the compact aggregate the grounding engine renders.
* Fold loopover's cached CI check summaries into the compact aggregate the grounding engine renders.
* `state` is failed if ANY check failed, else pending if ANY check is still running, else passed. A check
* with no rows at all (`undefined`) means we have no CI signal → the caller passes `undefined` so CI grounding
* is simply omitted (never asserts a green/red state we can't verify).
Expand Down Expand Up @@ -105,7 +105,7 @@ export function buildCheckAggregate(checks: CheckSummaryRecord[]): CheckAggregat
return { state, passing, failingDetails };
}

/** Map gittensory's PR file records to the subset the grounding engine reads (filename + status, plus the
/** Map loopover's PR file records to the subset the grounding engine reads (filename + status, plus the
* patch/additions/deletions a MODIFIED file's diffFullyCoversFile check needs to skip a redundant fetch
* when the diff already carries the whole file — see review-grounding.ts). */
function toGroundingFiles(files: PullRequestFileRecord[]): PullRequestFile[] {
Expand Down
Loading
Loading