@boyingliu01/xp-gate 0.36.1 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/cpp.sh +78 -10
- package/adapters/csharp.sh +58 -3
- package/adapters/gate-3.sh +15 -5
- package/adapters/gate-8.sh +131 -9
- package/adapters/typescript.sh +32 -8
- package/build-integrity/__tests__/import-resolver.test.ts +257 -0
- package/build-integrity/__tests__/quote-masker.test.ts +177 -0
- package/build-integrity/gate-10.ts +127 -9
- package/build-integrity/quote-masker.ts +266 -0
- package/gate-10.sh +66 -0
- package/gate-12-file-hygiene.sh +15 -7
- package/gate-13-compiler-strictness.sh +81 -1
- package/gate-3.sh +15 -5
- package/gate-6-layers.sh +375 -0
- package/gate-8.sh +131 -9
- package/hooks/gate-10.sh +66 -0
- package/hooks/gate-12-file-hygiene.sh +15 -7
- package/hooks/gate-13-compiler-strictness.sh +81 -1
- package/hooks/gate-3.sh +15 -5
- package/hooks/gate-6-layers.sh +375 -0
- package/hooks/gate-8.sh +131 -9
- package/hooks/gate-registry.sh +2 -2
- package/hooks/hook-module-resolution.sh +1 -1
- package/hooks/lib/assertion-quality.sh +8 -2
- package/hooks/lib/ccn-ratchet.sh +10 -0
- package/hooks/lib/layer-baseline.cjs +88 -0
- package/hooks/lib/typecheck.sh +28 -5
- package/hooks/pre-commit +376 -53
- package/hooks/pre-push +46 -13
- package/lib/__tests__/agent-runtime-journal.test.js +1 -1
- package/lib/__tests__/arch.test.js +9 -0
- package/lib/__tests__/audit-cli-contract.test.ts +1 -1
- package/lib/__tests__/check-alignment-reasons.test.mjs +11 -1
- package/lib/__tests__/check-all-skip-accounting.test.js +1 -1
- package/lib/__tests__/detect-deps-gate-identity.test.js +135 -0
- package/lib/__tests__/detect-deps.test.js +2 -1
- package/lib/__tests__/doctor-469-hook-env.test.js +7 -1
- package/lib/__tests__/doctor-arch-tools.test.js +169 -0
- package/lib/__tests__/doctor-delphi.test.js +1 -1
- package/lib/__tests__/doctor-drift-round2.test.js +4 -1
- package/lib/__tests__/doctor-executed-surface.test.js +45 -24
- package/lib/__tests__/doctor-module-drift.test.js +13 -7
- package/lib/__tests__/doctor-module-resolution-parity.test.js +74 -2
- package/lib/__tests__/doctor-tui-skill-freshness.test.js +21 -6
- package/lib/__tests__/doctor.test.js +17 -0
- package/lib/__tests__/gate-runner-tsx-invocation.test.js +149 -0
- package/lib/__tests__/gate-runner.test.js +23 -7
- package/lib/__tests__/init-gitignore.test.js +204 -0
- package/lib/__tests__/init.test.js +24 -3
- package/lib/__tests__/language-tools-build-file-install.test.js +82 -0
- package/lib/__tests__/language-tools-detect.test.js +61 -0
- package/lib/__tests__/mirror-sync.test.js +2 -0
- package/lib/__tests__/phase-transition.test.js +19 -1
- package/lib/__tests__/sprint-status-rework.test.js +32 -12
- package/lib/__tests__/test-alignment-range-guard.test.ts +82 -0
- package/lib/__tests__/test-alignment.test.ts +13 -3
- package/lib/__tests__/update-skill.test.js +2 -2
- package/lib/detect-deps.js +7 -1
- package/lib/doctor.js +81 -17
- package/lib/gate-runner.js +101 -7
- package/lib/hook-module-resolution.js +18 -6
- package/lib/init.js +136 -1
- package/lib/language-tools.js +217 -1
- package/lib/layer-baseline.cjs +88 -0
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/principles.js +21 -6
- package/lib/test-alignment.ts +452 -55
- package/mock-policy/AGENTS.md +1 -1
- package/mutation/AGENTS.md +1 -1
- package/package.json +2 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +34 -24
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/claude-code/skills/delphi-review/INSTALL.md +29 -1
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/skills/delphi-review/.delphi-config.json.example +34 -24
- package/plugins/dsh/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/dsh/skills/delphi-review/INSTALL.md +29 -1
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/dsh/src/client.test.ts +1 -1
- package/plugins/dsh/src/command.test.ts +1 -1
- package/plugins/dsh/src/contract.test.ts +1 -1
- package/plugins/dsh/src/credentials.test.ts +1 -1
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +34 -24
- package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/opencode/skills/delphi-review/INSTALL.md +29 -1
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +34 -24
- package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/qoder/skills/delphi-review/INSTALL.md +29 -1
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
- package/principles/AGENTS.md +1 -1
- package/principles/__tests__/config-arch-group.test.ts +106 -0
- package/principles/__tests__/config-enforcement.test.ts +1 -1
- package/principles/adapters/control-nesting.ts +572 -0
- package/principles/adapters/csharp.ts +73 -42
- package/principles/adapters/java.ts +9 -5
- package/principles/adapters/typescript.ts +138 -176
- package/principles/config.ts +37 -2
- package/principles/index.ts +57 -4
- package/principles/reporter.ts +99 -65
- package/principles/rules/arch/__tests__/dependency.test.ts +180 -0
- package/principles/rules/arch/__tests__/naming.test.ts +133 -0
- package/principles/rules/arch/__tests__/shared.test.ts +113 -0
- package/principles/rules/arch/dependency.ts +264 -0
- package/principles/rules/arch/naming.ts +188 -0
- package/principles/rules/arch/shared.ts +169 -0
- package/principles/rules/exports.ts +26 -0
- package/principles/rules/index.ts +11 -18
- package/scripts/__tests__/sync-package-content.test.js +23 -1
- package/scripts/sync-package-content.js +8 -2
- package/skills/delphi-review/.delphi-config.json.example +34 -24
- package/skills/delphi-review/AGENTS.md +1 -1
- package/skills/delphi-review/INSTALL.md +29 -1
- package/skills/sprint-flow/AGENTS.md +1 -1
- package/skills/test-specification-alignment/AGENTS.md +1 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Severity } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helpers shared by the `arch.*` rules (#694, #699).
|
|
5
|
+
*
|
|
6
|
+
* Both rule families need the same three things: the package a file lives in,
|
|
7
|
+
* the classes an adapter reports, and the severity the project configured.
|
|
8
|
+
* Keeping them here means the two families cannot drift apart on what
|
|
9
|
+
* "package segments" or "missing severity" means.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** One class as the adapters report it. */
|
|
13
|
+
export interface ClassFacts {
|
|
14
|
+
name?: string;
|
|
15
|
+
line?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** One import as the adapters report it. */
|
|
19
|
+
export interface ImportFacts {
|
|
20
|
+
name?: string;
|
|
21
|
+
line?: number;
|
|
22
|
+
type?: string;
|
|
23
|
+
used?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A Java source path reads `src/<zone>/java/<package...>/<File>.java`.
|
|
28
|
+
* `JAVA_ZONE_OFFSET` is where `java` sits relative to `src`; `JAVA_ZONE_END_OFFSET`
|
|
29
|
+
* is one past it, i.e. where the package segments begin.
|
|
30
|
+
*/
|
|
31
|
+
const JAVA_ZONE_OFFSET = 2;
|
|
32
|
+
const JAVA_ZONE_END_OFFSET = 3;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The package segments of a Java file, derived from its PATH.
|
|
36
|
+
*
|
|
37
|
+
* Anchored on the LAST `src/main/java` or `src/test/java` occurrence, which is
|
|
38
|
+
* what makes Maven multi-module work: in `core/domain/src/main/java/com/x/Y.java`
|
|
39
|
+
* the package is `com.x`, not `core.domain`. Anchoring on the first occurrence
|
|
40
|
+
* or on the start of the string would fold the module path into the package name
|
|
41
|
+
* and every rule would go blind on multi-module projects.
|
|
42
|
+
*
|
|
43
|
+
* Returns `[]` when the path carries no Java source root, so a rule that only
|
|
44
|
+
* matches known packages simply does not fire instead of guessing.
|
|
45
|
+
*/
|
|
46
|
+
export function extractPackageSegments(filePath: string): string[] {
|
|
47
|
+
const normalised = filePath.replace(/\\/g, '/');
|
|
48
|
+
const segments = normalised.split('/').filter((segment) => segment.length > 0);
|
|
49
|
+
|
|
50
|
+
let sourceRoot = -1;
|
|
51
|
+
for (let index = 0; index + JAVA_ZONE_OFFSET < segments.length; index += 1) {
|
|
52
|
+
if (segments[index] === 'src' && segments[index + JAVA_ZONE_OFFSET] === 'java') {
|
|
53
|
+
// Keep scanning: the LAST occurrence is the real source root in a
|
|
54
|
+
// multi-module layout.
|
|
55
|
+
sourceRoot = index + JAVA_ZONE_END_OFFSET;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (sourceRoot < 0) return [];
|
|
59
|
+
|
|
60
|
+
// Drop the file name; what remains is the package.
|
|
61
|
+
return segments.slice(sourceRoot, segments.length - 1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Whether a Java path is test code.
|
|
66
|
+
*
|
|
67
|
+
* `src/test/java` is excluded wholesale from the arch rules: a test may
|
|
68
|
+
* legitimately be named anything, and reporting `UserControllerTest` because it
|
|
69
|
+
* ends with `Test` and sits near `interfaces/rest` would be noise.
|
|
70
|
+
*/
|
|
71
|
+
export function isTestSource(filePath: string): boolean {
|
|
72
|
+
const normalised = filePath.replace(/\\/g, '/');
|
|
73
|
+
return normalised.includes('/src/test/java/') || normalised.startsWith('src/test/java/');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether a Java path is one the arch rules CANNOT judge because its layout is
|
|
78
|
+
* not recognised.
|
|
79
|
+
*
|
|
80
|
+
* `extractPackageSegments()` returns `[]` for such a path, and every rule then
|
|
81
|
+
* finds nothing to report -- which is indistinguishable, from the outside, from
|
|
82
|
+
* a file that was examined and found clean. That is the failure mode the
|
|
83
|
+
* feasibility seat raised in Round 2: a project using a custom source set (or a
|
|
84
|
+
* flat `java/com/...` tree) gets a silent zero. The extraction must stay empty
|
|
85
|
+
* (guessing a package would invent findings), so the skip has to be reportable
|
|
86
|
+
* on its own.
|
|
87
|
+
*
|
|
88
|
+
* Scope is deliberately the JVM languages (`.java`, `.kt`, `.kts`) even though
|
|
89
|
+
* the name says Java: the arch rules never look at anything else, and flagging
|
|
90
|
+
* a `.ts` path as "unrecognised Java layout" would bury the real signal in
|
|
91
|
+
* noise. The name is kept because every call site is a Java rule.
|
|
92
|
+
*
|
|
93
|
+
* A file in the default package (no `package` declaration) also lands here. That
|
|
94
|
+
* is intended: such a project has no package path for these rules to judge, so
|
|
95
|
+
* "not examined" is the honest answer and "no violations" is not.
|
|
96
|
+
*
|
|
97
|
+
* LIMITATION (accepted for this change, tracked for follow-up): this is a
|
|
98
|
+
* symptom-level diagnostic, not a fix. The durable answer is a source-root
|
|
99
|
+
* resolver that understands custom source sets; until then a custom layout is
|
|
100
|
+
* reported as skipped rather than silently passing. Only the naming rules emit
|
|
101
|
+
* this diagnostic today -- the dependency rules read imports and class names,
|
|
102
|
+
* not package segments, so they have no equivalent blind spot to report.
|
|
103
|
+
*
|
|
104
|
+
* @param filePath repository-relative or absolute path
|
|
105
|
+
* @returns true when the file is a JVM source AND its source root is unreadable
|
|
106
|
+
*/
|
|
107
|
+
export function isUnrecognisedJavaLayout(filePath: string): boolean {
|
|
108
|
+
const normalised = filePath.replace(/\\/g, '/');
|
|
109
|
+
if (!/\.(java|kt|kts)$/i.test(normalised)) return false;
|
|
110
|
+
return extractPackageSegments(normalised).length === 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The class names an adapter reports, skipping entries without a usable name. */
|
|
114
|
+
export function classNamesOf(adapter: unknown): Array<{ name: string; line?: number }> {
|
|
115
|
+
const raw = (adapter as { extractClasses?: () => unknown[] }).extractClasses?.() ?? [];
|
|
116
|
+
const named: Array<{ name: string; line?: number }> = [];
|
|
117
|
+
for (const entry of raw) {
|
|
118
|
+
const facts = entry as ClassFacts;
|
|
119
|
+
if (typeof facts?.name === 'string' && facts.name.length > 0) {
|
|
120
|
+
named.push({ name: facts.name, line: facts.line });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return named;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The imports an adapter reports, skipping entries without a usable name. */
|
|
127
|
+
export function importsOf(adapter: unknown): Array<{ name: string; line?: number }> {
|
|
128
|
+
const raw = (adapter as { imports?: unknown[] }).imports ?? [];
|
|
129
|
+
const named: Array<{ name: string; line?: number }> = [];
|
|
130
|
+
for (const entry of raw) {
|
|
131
|
+
const facts = entry as ImportFacts;
|
|
132
|
+
if (typeof facts?.name === 'string' && facts.name.length > 0) {
|
|
133
|
+
named.push({ name: facts.name, line: facts.line });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return named;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Read one rule's severity from the active config, with a fallback.
|
|
141
|
+
*
|
|
142
|
+
* The arch group is new, so a project whose `.principlesrc` predates it has no
|
|
143
|
+
* entry at all. Falling back keeps those projects working instead of throwing
|
|
144
|
+
* on a missing key -- which is what AC-COMPAT-01 pins down.
|
|
145
|
+
*/
|
|
146
|
+
export function readSeverity(
|
|
147
|
+
group: Record<string, { severity?: string }> | undefined,
|
|
148
|
+
ruleKey: string,
|
|
149
|
+
fallback: Severity,
|
|
150
|
+
): Severity {
|
|
151
|
+
const configured = group?.[ruleKey]?.severity;
|
|
152
|
+
if (configured === 'error' || configured === 'warning' || configured === 'info') {
|
|
153
|
+
return configured;
|
|
154
|
+
}
|
|
155
|
+
return fallback;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** The simple class name of a fully-qualified name (`a.b.UserService` -> `UserService`). */
|
|
159
|
+
export function simpleNameOf(fullyQualified: string): string {
|
|
160
|
+
const lastDot = fullyQualified.lastIndexOf('.');
|
|
161
|
+
return lastDot >= 0 ? fullyQualified.slice(lastDot + 1) : fullyQualified;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** The package segments of a fully-qualified name (`a.b.C` -> ['a','b']). */
|
|
165
|
+
export function packageSegmentsOf(fullyQualified: string): string[] {
|
|
166
|
+
const parts = fullyQualified.split('.');
|
|
167
|
+
// The last part is the type name, not a package.
|
|
168
|
+
return parts.length > 1 ? parts.slice(0, parts.length - 1) : [];
|
|
169
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @no-test-required: pure re-export barrel with no logic of its own; its contract is covered by rules/__tests__/index.test.ts, which asserts every re-exported rule name resolves to an object with id + check().
|
|
2
|
+
/**
|
|
3
|
+
* Named re-exports of every rule object.
|
|
4
|
+
*
|
|
5
|
+
* Split out of `./index` because that module exceeded the `many-exports`
|
|
6
|
+
* threshold once the architecture rules landed. The barrel's consumer contract
|
|
7
|
+
* (see `rules/__tests__/index.test.ts`) is unchanged -- `index.ts` re-exports
|
|
8
|
+
* this module wholesale, so `import { srpRule } from '.../rules'` still works.
|
|
9
|
+
*/
|
|
10
|
+
export { longFunctionRule } from './clean-code/long-function';
|
|
11
|
+
export { largeFileRule } from './clean-code/large-file';
|
|
12
|
+
export { magicNumbersRule } from './clean-code/magic-numbers';
|
|
13
|
+
export { godClassRule } from './clean-code/god-class';
|
|
14
|
+
export { deepNestingRule } from './clean-code/deep-nesting';
|
|
15
|
+
export { tooManyParamsRule } from './clean-code/too-many-params';
|
|
16
|
+
export { missingErrorHandlingRule } from './clean-code/missing-error-handling';
|
|
17
|
+
export { unusedImportsRule } from './clean-code/unused-imports';
|
|
18
|
+
export { codeDuplicationRule } from './clean-code/code-duplication';
|
|
19
|
+
export { manyExportsRule } from './clean-code/many-exports';
|
|
20
|
+
export { srpRule } from './solid/srp';
|
|
21
|
+
export { ocpRule } from './solid/ocp';
|
|
22
|
+
export { lspRule } from './solid/lsp';
|
|
23
|
+
export { ispRule } from './solid/isp';
|
|
24
|
+
export { dipRule } from './solid/dip';
|
|
25
|
+
export { archNamingRules } from './arch/naming';
|
|
26
|
+
export { archDependencyRules } from './arch/dependency';
|
|
@@ -14,24 +14,14 @@ import { ocpRule } from './solid/ocp';
|
|
|
14
14
|
import { lspRule } from './solid/lsp';
|
|
15
15
|
import { ispRule } from './solid/isp';
|
|
16
16
|
import { dipRule } from './solid/dip';
|
|
17
|
+
import { archNamingRules } from './arch/naming';
|
|
18
|
+
import { archDependencyRules } from './arch/dependency';
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
deepNestingRule,
|
|
24
|
-
tooManyParamsRule,
|
|
25
|
-
missingErrorHandlingRule,
|
|
26
|
-
unusedImportsRule,
|
|
27
|
-
codeDuplicationRule,
|
|
28
|
-
manyExportsRule,
|
|
29
|
-
srpRule,
|
|
30
|
-
ocpRule,
|
|
31
|
-
lspRule,
|
|
32
|
-
ispRule,
|
|
33
|
-
dipRule,
|
|
34
|
-
};
|
|
20
|
+
// The individual rule objects are re-exported from `./exports` so that this
|
|
21
|
+
// module stays a pure aggregator. Both halves are part of the module's public
|
|
22
|
+
// surface: `GET /rules` consumers import the named rules, while the engine
|
|
23
|
+
// imports only the arrays below.
|
|
24
|
+
export * from './exports';
|
|
35
25
|
|
|
36
26
|
const CLEAN_CODE_RULES: Rule[] = [
|
|
37
27
|
longFunctionRule,
|
|
@@ -48,8 +38,11 @@ const CLEAN_CODE_RULES: Rule[] = [
|
|
|
48
38
|
|
|
49
39
|
const SOLID_RULES: Rule[] = [srpRule, ocpRule, lspRule, ispRule, dipRule];
|
|
50
40
|
|
|
41
|
+
/** Architecture rules: package naming (#694) + dependency direction (#699). */
|
|
42
|
+
const ARCH_RULES: Rule[] = archNamingRules.concat(archDependencyRules);
|
|
43
|
+
|
|
51
44
|
export function getAllPrincipleRules(): Rule[] {
|
|
52
|
-
return [...CLEAN_CODE_RULES, ...SOLID_RULES];
|
|
45
|
+
return [...CLEAN_CODE_RULES, ...SOLID_RULES, ...ARCH_RULES];
|
|
53
46
|
}
|
|
54
47
|
|
|
55
48
|
export function getCleanCodeRules(): Rule[] {
|
|
@@ -91,13 +91,35 @@ function seedSrcModules(srcRoot, dest) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Directory names the sync script itself never mirrors (see SKIP_DIRS in
|
|
96
|
+
* sync-package-content.js). Seeding them is pure fixture cost: the run under
|
|
97
|
+
* test would skip them anyway, so copying them cannot change any assertion.
|
|
98
|
+
*/
|
|
99
|
+
const SEED_SKIP_DIRS = new Set([
|
|
100
|
+
'node_modules',
|
|
101
|
+
'.git',
|
|
102
|
+
'dist',
|
|
103
|
+
'coverage',
|
|
104
|
+
'.opencode',
|
|
105
|
+
'__pycache__',
|
|
106
|
+
'__tests__',
|
|
107
|
+
]);
|
|
108
|
+
|
|
94
109
|
function seedCanonicalSources(realRoot, destRoot) {
|
|
95
110
|
const real = realRoot || path.resolve(__dirname, '..', '..', '..', '..');
|
|
96
111
|
const dest = destRoot;
|
|
97
112
|
try {
|
|
98
113
|
for (const tree of ['githooks', 'skills', 'plugins']) {
|
|
99
114
|
const from = path.join(real, tree);
|
|
100
|
-
if (fs.existsSync(from))
|
|
115
|
+
if (!fs.existsSync(from)) continue;
|
|
116
|
+
// `plugins/` carries 6,762 node_modules files that SKIP_DIRS excludes from
|
|
117
|
+
// every sync run; copying them cost ~37 s of the file's runtime and could
|
|
118
|
+
// not affect an assertion. Filter at copy time so the seed stays faithful.
|
|
119
|
+
fs.cpSync(from, path.join(dest, tree), {
|
|
120
|
+
recursive: true,
|
|
121
|
+
filter: (src) => !SEED_SKIP_DIRS.has(path.basename(src)),
|
|
122
|
+
});
|
|
101
123
|
}
|
|
102
124
|
const srcRoot = path.join(real, 'src');
|
|
103
125
|
seedSrcModules(srcRoot, dest);
|
|
@@ -393,7 +393,13 @@ function checkPrePushDrift(prePushPath, readmePath) {
|
|
|
393
393
|
return true;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
// The README labels a gate either as `| Gate M2 |` or with a descriptive
|
|
397
|
+
// suffix as `| Gate M2 (Mock Density) |`, and the suffixed form is what this
|
|
398
|
+
// table actually uses. A pattern anchored to `| Gate M2 |` matched NONE of
|
|
399
|
+
// the suffixed rows, so a gate documented on its own README line read as
|
|
400
|
+
// "in script but NOT in README" — the guard failed on a correct table.
|
|
401
|
+
// The optional suffix accepts both spellings.
|
|
402
|
+
const readmeGates = extractReadmeGateNumbers(readmeContent, /\| Gate (M\d*)(?: [^|]*)?\|/g);
|
|
397
403
|
|
|
398
404
|
if (scriptGates.size > 0 && readmeGates.size > 0) {
|
|
399
405
|
const { scriptOnly, readmeOnly } = compareGateSets(scriptGates, readmeGates, 'Pre-push');
|
|
@@ -559,5 +565,5 @@ if (require.main === module) {
|
|
|
559
565
|
// Requiring this script must not mutate the work tree: a test that only wants
|
|
560
566
|
// checkDocsDrift/checkAdapterDrift used to trigger a full mirror sync at
|
|
561
567
|
// require-time, which vitest-worktree-guard rightly reported as pollution.
|
|
562
|
-
module.exports = { checkDocsDrift, checkAdapterDrift };
|
|
568
|
+
module.exports = { checkDocsDrift, checkAdapterDrift, checkPrePushDrift, checkPreCommitDrift };
|
|
563
569
|
}
|
|
@@ -2,10 +2,20 @@
|
|
|
2
2
|
"$comment": [
|
|
3
3
|
"Delphi Review Configuration Template",
|
|
4
4
|
"======================================",
|
|
5
|
-
"Copy this file to .delphi-config.json and fill in your API
|
|
5
|
+
"Copy this file to .delphi-config.json and fill in your API key.",
|
|
6
6
|
"Place this file alongside SKILL.md in the delphi-review skill directory.",
|
|
7
7
|
"Exactly three roles are required, with distinct trimmed executable model IDs.",
|
|
8
8
|
"",
|
|
9
|
+
"The default profile routes all three seats through one WhaleCloud gateway so a",
|
|
10
|
+
"single token plan covers the review. The three ids are deliberately different",
|
|
11
|
+
"FLASH-tier models (cheap, fast, and good enough for review):",
|
|
12
|
+
" architecture -> s-deepseek-v4.1-flash",
|
|
13
|
+
" technical -> s-glm-5.3-flash",
|
|
14
|
+
" feasibility -> g-ling-3.1-flash",
|
|
15
|
+
"Check that the seat ids resolve to three DISTINCT backend models on your",
|
|
16
|
+
"gateway -- two different ids can be aliased to the same backend, which defeats",
|
|
17
|
+
"the multi-model invariant while still looking correct in the config.",
|
|
18
|
+
"",
|
|
9
19
|
"Provider and vendor are unrestricted. provider=local is a fallback and cannot count as a successful expert execution.",
|
|
10
20
|
"cross_provider_required is deprecated and ignored with warning code cross_provider_required_ignored."
|
|
11
21
|
],
|
|
@@ -15,23 +25,23 @@
|
|
|
15
25
|
"profiles": {
|
|
16
26
|
"default": {
|
|
17
27
|
"providers": {
|
|
18
|
-
"
|
|
19
|
-
"base_url": "https://
|
|
20
|
-
"api_key": "
|
|
28
|
+
"whalecloud": {
|
|
29
|
+
"base_url": "https://lab.iwhalecloud.com/gpt-proxy",
|
|
30
|
+
"api_key": "${WHALECLOUD_API_KEY}"
|
|
21
31
|
}
|
|
22
32
|
},
|
|
23
33
|
"experts": {
|
|
24
34
|
"architecture": {
|
|
25
|
-
"provider": "
|
|
26
|
-
"model": "
|
|
35
|
+
"provider": "whalecloud",
|
|
36
|
+
"model": "s-deepseek-v4.1-flash"
|
|
27
37
|
},
|
|
28
38
|
"technical": {
|
|
29
|
-
"provider": "
|
|
30
|
-
"model": "
|
|
39
|
+
"provider": "whalecloud",
|
|
40
|
+
"model": "s-glm-5.3-flash"
|
|
31
41
|
},
|
|
32
42
|
"feasibility": {
|
|
33
|
-
"provider": "
|
|
34
|
-
"model": "
|
|
43
|
+
"provider": "whalecloud",
|
|
44
|
+
"model": "g-ling-3.1-flash"
|
|
35
45
|
}
|
|
36
46
|
}
|
|
37
47
|
},
|
|
@@ -39,23 +49,23 @@
|
|
|
39
49
|
"starter": {
|
|
40
50
|
"$comment": "One provider and token plan serving three distinct models",
|
|
41
51
|
"providers": {
|
|
42
|
-
"
|
|
43
|
-
"base_url": "https://
|
|
44
|
-
"api_key": "
|
|
52
|
+
"whalecloud": {
|
|
53
|
+
"base_url": "https://lab.iwhalecloud.com/gpt-proxy",
|
|
54
|
+
"api_key": "${WHALECLOUD_API_KEY}"
|
|
45
55
|
}
|
|
46
56
|
},
|
|
47
57
|
"experts": {
|
|
48
58
|
"architecture": {
|
|
49
|
-
"provider": "
|
|
50
|
-
"model": "
|
|
59
|
+
"provider": "whalecloud",
|
|
60
|
+
"model": "s-deepseek-v4.1-flash"
|
|
51
61
|
},
|
|
52
62
|
"technical": {
|
|
53
|
-
"provider": "
|
|
54
|
-
"model": "
|
|
63
|
+
"provider": "whalecloud",
|
|
64
|
+
"model": "s-glm-5.3-flash"
|
|
55
65
|
},
|
|
56
66
|
"feasibility": {
|
|
57
|
-
"provider": "
|
|
58
|
-
"model": "
|
|
67
|
+
"provider": "whalecloud",
|
|
68
|
+
"model": "g-ling-3.1-flash"
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
71
|
}
|
|
@@ -77,14 +87,14 @@
|
|
|
77
87
|
"model or gateway changes. See docs/plans/2026-10-14-sprint-c-design.md section 2.",
|
|
78
88
|
"Example expert entry:",
|
|
79
89
|
" \"architecture\": {",
|
|
80
|
-
" \"provider\": \"
|
|
81
|
-
" \"model\": \"
|
|
90
|
+
" \"provider\": \"whalecloud\",",
|
|
91
|
+
" \"model\": \"s-deepseek-v4.1-flash\",",
|
|
82
92
|
" \"seat_id\": \"architecture\",",
|
|
83
93
|
" \"max_prompt_bytes\": 26624,",
|
|
84
94
|
" \"prompt_calibration\": {",
|
|
85
|
-
" \"measured_at\": \"2026-
|
|
86
|
-
" \"model_id\": \"
|
|
87
|
-
" \"gateway\": \"
|
|
95
|
+
" \"measured_at\": \"2026-11-04\",",
|
|
96
|
+
" \"model_id\": \"s-deepseek-v4.1-flash\",",
|
|
97
|
+
" \"gateway\": \"whalecloud\",",
|
|
88
98
|
" \"last_pass_bytes\": 26624,",
|
|
89
99
|
" \"last_fail_bytes\": 36897",
|
|
90
100
|
" }",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.37.1.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -32,10 +32,38 @@ Then replace the provider/model placeholders:
|
|
|
32
32
|
"model": "YOUR_PROVIDER/YOUR_MODEL_A"
|
|
33
33
|
|
|
34
34
|
// After (your config):
|
|
35
|
-
"model": "
|
|
35
|
+
"model": "whalecloud/s-deepseek-v4.1-flash"
|
|
36
36
|
// The other two role model fields must be different trimmed IDs.
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
The shipped `.delphi-config.json.example` defaults to three cheap FLASH-tier
|
|
40
|
+
models on one WhaleCloud gateway, which is what most setups want:
|
|
41
|
+
|
|
42
|
+
| seat | model | purpose |
|
|
43
|
+
|------|-------|---------|
|
|
44
|
+
| architecture | `s-deepseek-v4.1-flash` | structure, boundaries, coupling |
|
|
45
|
+
| technical | `s-glm-5.3-flash` | correctness, implementation risk |
|
|
46
|
+
| feasibility | `g-ling-3.1-flash` | cost, schedule, operability |
|
|
47
|
+
|
|
48
|
+
Before trusting a profile, confirm the three ids resolve to three **distinct
|
|
49
|
+
backend** models on your gateway. Gateway aliases can map two different ids to
|
|
50
|
+
the same backend, which satisfies the "distinct ids" check while actually
|
|
51
|
+
running one model twice:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# prints the backend each id really reached
|
|
55
|
+
for m in s-deepseek-v4.1-flash s-glm-5.3-flash g-ling-3.1-flash; do
|
|
56
|
+
curl -s https://YOUR_GATEWAY/v1/chat/completions \
|
|
57
|
+
-H "Authorization: Bearer $WHALECLOUD_API_KEY" -H 'Content-Type: application/json' \
|
|
58
|
+
-d "{\"model\":\"$m\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}],\"max_tokens\":5}" \
|
|
59
|
+
| python -c 'import sys,json; print(json.load(sys.stdin).get("model"))'
|
|
60
|
+
done
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`xp-gate doctor delphi` reports the configured seats, and every expert result
|
|
64
|
+
records the gateway-reported `resolved_model` so a silent alias collision shows
|
|
65
|
+
up in the review evidence rather than passing unnoticed.
|
|
66
|
+
|
|
39
67
|
### Step 3: Ensure provider configuration exists
|
|
40
68
|
|
|
41
69
|
Your `opencode.json` must have the provider definitions. If you're using OpenCode's built-in providers (OpenAI, Anthropic, etc.), you just need API keys set in your environment.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.37.1.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.37.1.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|