Skip to content

Commit e615ec7

Browse files
authored
docs(engine): document the deliberate gate-advisory twin divergence (#5784)
Record the keep-divergent decision for the gate-decision advisory twins (#4881): src/rules/advisory.ts (host) and packages/loopover-engine/src/advisory/gate-advisory.ts (engine). Add header docs to both explaining that they are intentionally NOT converged — the host copy reaches into the full signals subsystem (isCodeFile, isTestPath, scoring/preview, signals/engine types) while the engine copy is a slimmed re-implementation, precisely so @loopover/engine and its CLI consumers never pull the ~5,800-line signals/engine into their dependency graph. Note that scripts/check-engine-parity.ts keeps the core gate-decision functions in lock-step, and that converging must wait until the dependency-graph constraint is solved. Comments only — no gate-decision behavior changes. Closes #4881
1 parent f06e414 commit e615ec7

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

packages/loopover-engine/src/advisory/gate-advisory.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Gate-decision advisory logic — ENGINE copy. This is an intentionally-divergent twin of the host
2+
// src/rules/advisory.ts (#4518; keep-divergent decision recorded for #4881). This slimmed re-implementation uses
3+
// predicted-gate-types + ../scoring/label-match and deliberately imports none of ../signals/engine, isCodeFile, or
4+
// isTestPath, so @loopover/engine — and the CLI packages that consume it (packages/loopover-miner,
5+
// packages/loopover-mcp) — never pull the ~5,800-line signals/engine subsystem into their dependency graph. The
6+
// core gate-decision functions are kept structurally in lock-step with the host copy by
7+
// scripts/check-engine-parity.ts (GATE_DECISION_CORE_MARKERS); do NOT converge to a single source until that
8+
// dependency-graph constraint is solved — see #4881.
19
import { randomUUID } from "node:crypto";
210
import type {
311
Advisory,

src/rules/advisory.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
// Gate-decision advisory logic — HOST copy. This is an intentionally-divergent twin of the engine's
2+
// packages/loopover-engine/src/advisory/gate-advisory.ts (#4518; keep-divergent decision recorded for #4881). The
3+
// two are deliberately NOT converged to a single source.
4+
//
5+
// Why kept divergent: this host copy reaches into the full signals subsystem — `isCodeFile`
6+
// (../signals/local-branch, which transitively pulls the whole review-scoring / GitHub-API graph), `isTestPath`
7+
// (../signals/test-evidence), `labelMatchesPattern` (../scoring/preview), and the CollisionCluster/CollisionReport
8+
// types from the ~5,800-line ../signals/engine. The engine twin is a slimmed re-implementation (slim
9+
// predicted-gate-types + ../scoring/label-match, importing none of signals/engine) precisely so @loopover/engine —
10+
// and the CLI packages that depend on it (packages/loopover-miner, packages/loopover-mcp) — never drag
11+
// signals/engine and its subsystem into their dependency graph.
12+
//
13+
// What keeps this safe: scripts/check-engine-parity.ts (GATE_DECISION_CORE_MARKERS) asserts BOTH files still export
14+
// the core gate-decision functions (evaluateGateCheck / evaluateGateCheckCore / isConfiguredGateBlocker /
15+
// buildPullRequestAdvisory), so the gate *decision* stays in lock-step even though the surrounding types and
16+
// imports diverge. Do NOT converge these into a single shim until the dependency-graph-size constraint is solved
17+
// (e.g. a shared type-only module carrying CollisionReport without dragging the signals implementation along) — see
18+
// #4881.
119
import type {
220
Advisory,
321
AdvisoryConclusion,

0 commit comments

Comments
 (0)