@mmnto/cli 2.0.0 → 2.2.0
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/dist/commands/describe.d.ts +13 -1
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +29 -1
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/describe.test.js +86 -3
- package/dist/commands/describe.test.js.map +1 -1
- package/dist/commands/doctor-parity-fetch.d.ts +93 -2
- package/dist/commands/doctor-parity-fetch.d.ts.map +1 -1
- package/dist/commands/doctor-parity-fetch.js +332 -11
- package/dist/commands/doctor-parity-fetch.js.map +1 -1
- package/dist/commands/doctor-parity-fetch.test.d.ts +6 -0
- package/dist/commands/doctor-parity-fetch.test.d.ts.map +1 -1
- package/dist/commands/doctor-parity-fetch.test.js +405 -1
- package/dist/commands/doctor-parity-fetch.test.js.map +1 -1
- package/dist/commands/doctor-parity.d.ts.map +1 -1
- package/dist/commands/doctor-parity.js +27 -1
- package/dist/commands/doctor-parity.js.map +1 -1
- package/dist/commands/doctor-parity.test.js +67 -0
- package/dist/commands/doctor-parity.test.js.map +1 -1
- package/dist/commands/eject-gate-needle.test.d.ts +2 -0
- package/dist/commands/eject-gate-needle.test.d.ts.map +1 -0
- package/dist/commands/eject-gate-needle.test.js +48 -0
- package/dist/commands/eject-gate-needle.test.js.map +1 -0
- package/dist/commands/eject.d.ts +10 -0
- package/dist/commands/eject.d.ts.map +1 -1
- package/dist/commands/eject.js +67 -12
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/eject.test.js +113 -0
- package/dist/commands/eject.test.js.map +1 -1
- package/dist/commands/gate-install.d.ts +37 -5
- package/dist/commands/gate-install.d.ts.map +1 -1
- package/dist/commands/gate-install.js +26 -38
- package/dist/commands/gate-install.js.map +1 -1
- package/dist/commands/gate-install.test.js +294 -48
- package/dist/commands/gate-install.test.js.map +1 -1
- package/dist/commands/gate.d.ts +24 -9
- package/dist/commands/gate.d.ts.map +1 -1
- package/dist/commands/gate.js +36 -17
- package/dist/commands/gate.js.map +1 -1
- package/dist/commands/gate.test.js +74 -3
- package/dist/commands/gate.test.js.map +1 -1
- package/dist/commands/host-hooks.d.ts +8 -2
- package/dist/commands/host-hooks.d.ts.map +1 -1
- package/dist/commands/host-hooks.js.map +1 -1
- package/dist/commands/init-templates.d.ts +3 -3
- package/dist/commands/init-templates.d.ts.map +1 -1
- package/dist/commands/init-templates.js +107 -48
- package/dist/commands/init-templates.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +20 -16
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install-hooks.d.ts.map +1 -1
- package/dist/commands/install-hooks.js +159 -27
- package/dist/commands/install-hooks.js.map +1 -1
- package/dist/commands/install-hooks.test.js +460 -12
- package/dist/commands/install-hooks.test.js.map +1 -1
- package/dist/commands/legs.d.ts +35 -7
- package/dist/commands/legs.d.ts.map +1 -1
- package/dist/commands/legs.js +26 -7
- package/dist/commands/legs.js.map +1 -1
- package/dist/commands/legs.test.js +87 -0
- package/dist/commands/legs.test.js.map +1 -1
- package/dist/commands/release-train-shape.test.d.ts +2 -0
- package/dist/commands/release-train-shape.test.d.ts.map +1 -0
- package/dist/commands/release-train-shape.test.js +226 -0
- package/dist/commands/release-train-shape.test.js.map +1 -0
- package/dist/commands/tools-hook-parity.test.js +200 -0
- package/dist/commands/tools-hook-parity.test.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import type { ProjectDescription } from '@mmnto/totem';
|
|
1
2
|
export type { ProjectDescription } from '@mmnto/totem';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The banner's rules line (mmnto-ai/totem#2765): the ACTIVE count leads — it is
|
|
5
|
+
* the number lint enforces and status reports — and the inert split renders
|
|
6
|
+
* only when it is non-trivial, so `Rules: 385 active of 485 compiled (93
|
|
7
|
+
* archived, 7 untested-against-codebase)` on this repo and `Rules: 12 active`
|
|
8
|
+
* on a repo with nothing inert. Never a bare "N compiled": that was the raw
|
|
9
|
+
* total posing as the enforced set. A missing file says so, and a file the
|
|
10
|
+
* loader refused says `unreadable` — a 0 the reader could mistake for an
|
|
11
|
+
* honestly empty set is the sensor-trust class this line exists to end.
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatRulesLine(d: Pick<ProjectDescription, 'rules' | 'rulesCompiled' | 'rulesArchived' | 'rulesUntested' | 'rulesPendingVerification' | 'rulesSource'>): string;
|
|
14
|
+
export declare function getProjectDescription(cwd: string): Promise<ProjectDescription>;
|
|
3
15
|
export declare function describeCommand(): Promise<void>;
|
|
4
16
|
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/commands/describe.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/commands/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,IAAI,CACL,kBAAkB,EAChB,OAAO,GACP,eAAe,GACf,eAAe,GACf,eAAe,GACf,0BAA0B,GAC1B,aAAa,CAChB,GACA,MAAM,CAcR;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,+BAUtD;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA4BrD"}
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The banner's rules line (mmnto-ai/totem#2765): the ACTIVE count leads — it is
|
|
3
|
+
* the number lint enforces and status reports — and the inert split renders
|
|
4
|
+
* only when it is non-trivial, so `Rules: 385 active of 485 compiled (93
|
|
5
|
+
* archived, 7 untested-against-codebase)` on this repo and `Rules: 12 active`
|
|
6
|
+
* on a repo with nothing inert. Never a bare "N compiled": that was the raw
|
|
7
|
+
* total posing as the enforced set. A missing file says so, and a file the
|
|
8
|
+
* loader refused says `unreadable` — a 0 the reader could mistake for an
|
|
9
|
+
* honestly empty set is the sensor-trust class this line exists to end.
|
|
10
|
+
*/
|
|
11
|
+
export function formatRulesLine(d) {
|
|
12
|
+
if (d.rulesSource === 'absent')
|
|
13
|
+
return `Rules: ${d.rules} active (no compiled-rules.json)`;
|
|
14
|
+
if (d.rulesSource === 'unreadable') {
|
|
15
|
+
return `Rules: ${d.rules} active — compiled-rules.json unreadable (run 'totem lint' for the parse error)`;
|
|
16
|
+
}
|
|
17
|
+
const inert = [];
|
|
18
|
+
if (d.rulesArchived > 0)
|
|
19
|
+
inert.push(`${d.rulesArchived} archived`);
|
|
20
|
+
if (d.rulesUntested > 0)
|
|
21
|
+
inert.push(`${d.rulesUntested} untested-against-codebase`);
|
|
22
|
+
if (d.rulesPendingVerification > 0) {
|
|
23
|
+
inert.push(`${d.rulesPendingVerification} pending-verification`);
|
|
24
|
+
}
|
|
25
|
+
return inert.length === 0
|
|
26
|
+
? `Rules: ${d.rules} active`
|
|
27
|
+
: `Rules: ${d.rules} active of ${d.rulesCompiled} compiled (${inert.join(', ')})`;
|
|
28
|
+
}
|
|
1
29
|
export async function getProjectDescription(cwd) {
|
|
2
30
|
const path = await import('node:path');
|
|
3
31
|
const { describeProject } = await import('@mmnto/totem');
|
|
@@ -20,7 +48,7 @@ export async function describeCommand() {
|
|
|
20
48
|
if (result.description)
|
|
21
49
|
log.info('[Describe]', `Description: ${result.description}`);
|
|
22
50
|
log.info('[Describe]', `Tier: ${result.tier}`);
|
|
23
|
-
log.info('[Describe]',
|
|
51
|
+
log.info('[Describe]', formatRulesLine(result));
|
|
24
52
|
log.info('[Describe]', `Lessons: ${result.lessons}`);
|
|
25
53
|
log.info('[Describe]', `Targets: ${result.targets.length}`);
|
|
26
54
|
for (const t of result.targets) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/commands/describe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/commands/describe.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAC7B,CAQC;IAED,IAAI,CAAC,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,CAAC,KAAK,kCAAkC,CAAC;IAC3F,IAAI,CAAC,CAAC,WAAW,KAAK,YAAY,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC,CAAC,KAAK,iFAAiF,CAAC;IAC5G,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,aAAa,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,WAAW,CAAC,CAAC;IACnE,IAAI,CAAC,CAAC,aAAa,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,4BAA4B,CAAC,CAAC;IACpF,IAAI,CAAC,CAAC,wBAAwB,GAAG,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,wBAAwB,uBAAuB,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;QACvB,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,SAAS;QAC5B,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,aAAa,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACtF,CAAC;AAED,MAAM,CAAC,KAAK,UA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,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/C,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5D,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QAC/B,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as os from 'node:os';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
|
-
import { describe, expect, it } from 'vitest';
|
|
5
|
-
import { getProjectDescription } from './describe.js';
|
|
4
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
5
|
+
import { formatRulesLine, getProjectDescription } from './describe.js';
|
|
6
6
|
function makeTmpDir() {
|
|
7
7
|
return fs.mkdtempSync(path.join(os.tmpdir(), 'totem-describe-'));
|
|
8
8
|
}
|
|
@@ -33,9 +33,25 @@ function scaffoldProject(dir, opts = {}) {
|
|
|
33
33
|
// (`{ version, rules: [...] }`) matching `loadCompiledRulesFile` and
|
|
34
34
|
// the rest of the codebase. Prior versions of this helper wrote a bare
|
|
35
35
|
// array, which masked the rule-count bug fixed in mmnto-ai/totem#1884.
|
|
36
|
+
// Entries are SCHEMA-VALID compiled rules since mmnto-ai/totem#2765: describe
|
|
37
|
+
// now counts through the same validating loader lint and status use, so a
|
|
38
|
+
// `{ id }` stub would (correctly) count as nothing. `archived` marks the
|
|
39
|
+
// first N entries inert.
|
|
36
40
|
const rulesCount = opts.rules ?? 0;
|
|
37
41
|
if (rulesCount > 0) {
|
|
38
|
-
const rules = Array.from({ length: rulesCount }, (_, i) => ({
|
|
42
|
+
const rules = Array.from({ length: rulesCount }, (_, i) => ({
|
|
43
|
+
lessonHash: `hash${String(i).padStart(8, '0')}`,
|
|
44
|
+
lessonHeading: `Rule ${i}`,
|
|
45
|
+
pattern: 'dummy',
|
|
46
|
+
message: `Rule ${i} message`,
|
|
47
|
+
engine: 'regex',
|
|
48
|
+
compiledAt: '2026-05-11T00:00:00Z',
|
|
49
|
+
...(i < (opts.archived ?? 0)
|
|
50
|
+
? { status: 'archived' }
|
|
51
|
+
: i < (opts.archived ?? 0) + (opts.untested ?? 0)
|
|
52
|
+
? { status: 'untested-against-codebase' }
|
|
53
|
+
: {}),
|
|
54
|
+
}));
|
|
39
55
|
fs.writeFileSync(path.join(dir, '.totem', 'compiled-rules.json'), JSON.stringify({ version: 1, rules, nonCompilable: [] }));
|
|
40
56
|
}
|
|
41
57
|
}
|
|
@@ -80,11 +96,78 @@ describe('getProjectDescription', () => {
|
|
|
80
96
|
scaffoldProject(dir, { rules: 10 });
|
|
81
97
|
const result = await getProjectDescription(dir);
|
|
82
98
|
expect(result.rules).toBe(10);
|
|
99
|
+
expect(result.rulesCompiled).toBe(10);
|
|
83
100
|
}
|
|
84
101
|
finally {
|
|
85
102
|
cleanTmpDir(dir);
|
|
86
103
|
}
|
|
87
104
|
});
|
|
105
|
+
it('counts the ACTIVE set, not the raw total, and renders the split (mmnto-ai/totem#2765)', async () => {
|
|
106
|
+
const dir = makeTmpDir();
|
|
107
|
+
try {
|
|
108
|
+
scaffoldProject(dir, { rules: 10, archived: 3 });
|
|
109
|
+
const result = await getProjectDescription(dir);
|
|
110
|
+
expect(result.rules).toBe(7);
|
|
111
|
+
expect(result.rulesCompiled).toBe(10);
|
|
112
|
+
expect(result.rulesArchived).toBe(3);
|
|
113
|
+
expect(formatRulesLine(result)).toBe('Rules: 7 active of 10 compiled (3 archived)');
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
cleanTmpDir(dir);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
it('formatRulesLine: the split renders only when non-trivial, and names every inert status', () => {
|
|
120
|
+
const base = {
|
|
121
|
+
rules: 12,
|
|
122
|
+
rulesCompiled: 12,
|
|
123
|
+
rulesArchived: 0,
|
|
124
|
+
rulesUntested: 0,
|
|
125
|
+
rulesPendingVerification: 0,
|
|
126
|
+
rulesSource: 'compiled-rules',
|
|
127
|
+
};
|
|
128
|
+
expect(formatRulesLine(base)).toBe('Rules: 12 active');
|
|
129
|
+
expect(formatRulesLine({
|
|
130
|
+
...base,
|
|
131
|
+
rulesCompiled: 20,
|
|
132
|
+
rulesArchived: 5,
|
|
133
|
+
rulesUntested: 2,
|
|
134
|
+
rulesPendingVerification: 1,
|
|
135
|
+
})).toBe('Rules: 12 active of 20 compiled (5 archived, 2 untested-against-codebase, 1 pending-verification)');
|
|
136
|
+
// The ACTIVE count leads; the raw total never poses as the enforced set.
|
|
137
|
+
expect(formatRulesLine({ ...base, rulesCompiled: 20, rulesArchived: 8 })).toBe('Rules: 12 active of 20 compiled (8 archived)');
|
|
138
|
+
// A zero is never left ambiguous: absent and unreadable each say so.
|
|
139
|
+
const zeros = { ...base, rules: 0, rulesCompiled: 0 };
|
|
140
|
+
expect(formatRulesLine({ ...zeros, rulesSource: 'absent' })).toBe('Rules: 0 active (no compiled-rules.json)');
|
|
141
|
+
expect(formatRulesLine({ ...zeros, rulesSource: 'unreadable' })).toBe("Rules: 0 active — compiled-rules.json unreadable (run 'totem lint' for the parse error)");
|
|
142
|
+
});
|
|
143
|
+
// The issue's own contract clause, second conjunct: describe's number equals
|
|
144
|
+
// what `totem status` PRINTS (mmnto-ai/totem#2765). The two commands share no
|
|
145
|
+
// helper — status counts through `loadCompiledRules` inline, describe through
|
|
146
|
+
// `isActiveCompiledRule` — so this is the only place the two numbers meet.
|
|
147
|
+
it('describe reports the same active count that totem status prints', async () => {
|
|
148
|
+
const dir = makeTmpDir();
|
|
149
|
+
const originalCwd = process.cwd();
|
|
150
|
+
try {
|
|
151
|
+
// Archived AND untested, as the issue's clause names — untested is the
|
|
152
|
+
// status class that produced the 392-vs-385 divergence in the MCP extractor.
|
|
153
|
+
scaffoldProject(dir, { rules: 10, archived: 3, untested: 1 });
|
|
154
|
+
const description = await getProjectDescription(dir);
|
|
155
|
+
process.chdir(dir);
|
|
156
|
+
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
157
|
+
const { statusCommand } = await import('./status.js');
|
|
158
|
+
await statusCommand();
|
|
159
|
+
const output = consoleSpy.mock.calls.map((c) => String(c[0])).join('\n');
|
|
160
|
+
const printed = /Rules: (\d+) compiled/.exec(output);
|
|
161
|
+
expect(printed, output).not.toBeNull();
|
|
162
|
+
expect(Number(printed[1])).toBe(6);
|
|
163
|
+
expect(description.rules).toBe(Number(printed[1]));
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
process.chdir(originalCwd);
|
|
167
|
+
vi.restoreAllMocks();
|
|
168
|
+
cleanTmpDir(dir);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
88
171
|
it('returns zero counts when .totem directories are missing', async () => {
|
|
89
172
|
const dir = makeTmpDir();
|
|
90
173
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.test.js","sourceRoot":"","sources":["../../src/commands/describe.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"describe.test.js","sourceRoot":"","sources":["../../src/commands/describe.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEvE,SAAS,UAAU;IACjB,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,WAAW,CAAC,GAAW;IAC9B,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,sDAAsD;AACtD,SAAS,eAAe,CACtB,GAAW,EACX,OAMI,EAAE;IAEN,kBAAkB;IAClB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjF,MAAM,WAAW,GAAG;QAClB,kBAAkB;QAClB,6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ns `gh api` via `safeExec` (arg
|
|
25
25
|
* arrays, no `shell: true`, bounded timeout) — the git-subprocess pattern the
|
|
26
26
|
* core detectors already use.
|
|
27
|
+
*
|
|
28
|
+
* The two 472-charter orientation rows (mmnto-ai/totem#2791) join the same
|
|
29
|
+
* family here: `gh-issue-label-canon` adds a paginated REST label walk plus the
|
|
30
|
+
* roster-wide canon text ({@link resolveLabelCanon}), and
|
|
31
|
+
* `gh-project-vocabulary` adds a second read-only transport ({@link GhGraphql})
|
|
32
|
+
* for the bound project's single-select fields. Both keep the §14 edges above:
|
|
33
|
+
* read-only, per-surface honest degradation, no retries, never partial.
|
|
27
34
|
*/
|
|
28
|
-
import type { NetworkPostureRow, NetworkProbeRepoSnapshot, NetworkSurfaceOutcome } from '@mmnto/totem';
|
|
35
|
+
import type { NetworkPostureRow, NetworkProbeRepoSnapshot, NetworkSurfaceOutcome, NetworkSurfaceSnapshot } from '@mmnto/totem';
|
|
29
36
|
/** Resolve a contract id to its network-posture row kind, or undefined when unregistered. */
|
|
30
37
|
export declare function networkPostureRowFor(contractId: string): NetworkPostureRow | undefined;
|
|
31
38
|
/** One fetched surface plus its outcome — what {@link GhFetch} returns. */
|
|
@@ -42,6 +49,14 @@ export interface GhFetchResult {
|
|
|
42
49
|
* implementation; production omits it and the default spawns `gh api`.
|
|
43
50
|
*/
|
|
44
51
|
export type GhFetch = (apiPath: string, cwd: string) => GhFetchResult;
|
|
52
|
+
/**
|
|
53
|
+
* Injectable GraphQL transport seam: issue one read-only `gh api graphql` query
|
|
54
|
+
* from `cwd`. Same degradation contract as {@link GhFetch} — a transport throw
|
|
55
|
+
* classifies through {@link classifyGhError}, and a 200 body carrying `errors`
|
|
56
|
+
* classifies through {@link classifyGraphqlBody} (GraphQL reports authorization
|
|
57
|
+
* and not-found failures in the BODY, not the HTTP status).
|
|
58
|
+
*/
|
|
59
|
+
export type GhGraphql = (query: string, variables: Record<string, string | number>, cwd: string) => GhFetchResult;
|
|
45
60
|
/** Injectable local-remote reader (default `git remote get-url origin`). */
|
|
46
61
|
export type ReadRemote = (cwd: string) => string | undefined;
|
|
47
62
|
/** One network-posture row present in the manifest (id-derived row kind + its consumers scope). */
|
|
@@ -59,8 +74,16 @@ export interface ResolveNetworkSnapshotsOptions {
|
|
|
59
74
|
gitRoot: string;
|
|
60
75
|
/** Optional cross-repo read set (`orient.parityProbeRepos`), each an `owner/repo` slug. */
|
|
61
76
|
probeRepos?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* The CURRENT repo's bound GH Project number (`orient.projectNumber`). Only
|
|
79
|
+
* the current repo's binding is locally derivable — a sibling's config is not
|
|
80
|
+
* a surface this checkout reads (mmnto-ai/totem#2791).
|
|
81
|
+
*/
|
|
82
|
+
projectNumber?: number;
|
|
62
83
|
/** Injectable transport (default spawns `gh api`). */
|
|
63
84
|
ghFetch?: GhFetch;
|
|
85
|
+
/** Injectable GraphQL transport (default spawns `gh api graphql`). */
|
|
86
|
+
ghGraphql?: GhGraphql;
|
|
64
87
|
/** Injectable local-remote reader (default reads `git remote get-url origin`). */
|
|
65
88
|
readRemote?: ReadRemote;
|
|
66
89
|
}
|
|
@@ -78,7 +101,75 @@ export declare function resolveNetworkSnapshots(options: ResolveNetworkSnapshots
|
|
|
78
101
|
/**
|
|
79
102
|
* Extract `owner/repo` from an ssh (`git@host:owner/repo.git`) or https
|
|
80
103
|
* (`https://host/owner/repo.git`) remote URL, tolerating a trailing `.git` and
|
|
81
|
-
* slashes.
|
|
104
|
+
* slashes in either order (`…/totem.git/` too — falsification pass 5, p5-F5).
|
|
105
|
+
* The HOST is not part of the result: a mirror at the same `owner/repo` path
|
|
106
|
+
* yields the same slug, the same host-blindness the cohort-id derivation has.
|
|
107
|
+
* Returns undefined when no `owner/repo` pair resolves.
|
|
82
108
|
*/
|
|
83
109
|
export declare function slugFromRemoteUrl(remoteUrl: string | undefined): string | undefined;
|
|
110
|
+
/** Seams + anchor for {@link resolveLabelCanon}. */
|
|
111
|
+
export interface ResolveLabelCanonOptions {
|
|
112
|
+
/** The git root the local read is anchored at + `gh` runs in. */
|
|
113
|
+
gitRoot: string;
|
|
114
|
+
/**
|
|
115
|
+
* The current repo's `owner/repo` slug from its LOCAL `origin` remote (no
|
|
116
|
+
* network; {@link defaultCurrentSlug}). The local read is selected only when
|
|
117
|
+
* this is exactly the canon's `owner/repo` PATH ({@link LABEL_CANON_REPO};
|
|
118
|
+
* the host is not compared — a mirror at the same path reads locally, the
|
|
119
|
+
* same host-blindness the cohort-id derivation has, disclosed). A
|
|
120
|
+
* fork or a differently owned checkout — even one whose cohort id derives to
|
|
121
|
+
* `totem` from its package name or its directory — takes the canonical
|
|
122
|
+
* contents fetch, so a stale or edited local script can never pose as the
|
|
123
|
+
* canon (Greptile P1 on mmnto-ai/totem#2797). Absent ⇒ the fetch.
|
|
124
|
+
*/
|
|
125
|
+
currentSlug?: string;
|
|
126
|
+
/** Transport for the canonical (non-canon-repo) read. Tests inject; production builds one. */
|
|
127
|
+
ghFetch?: GhFetch;
|
|
128
|
+
/** Test seam for the local read (default: UTF-8 `readFileSync`). */
|
|
129
|
+
readFile?: (absPath: string) => string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Resolve the ROSTER-WIDE label canon: the TEXT of
|
|
133
|
+
* `mmnto-ai/totem:scripts/sync-labels.ps1`, plus a `detail` naming its
|
|
134
|
+
* provenance. In the canon repository's own checkout (origin exactly
|
|
135
|
+
* `mmnto-ai/totem`) the file is local (no network, no rate limit); every other
|
|
136
|
+
* checkout — every other cohort repo AND every fork — reads the canonical blob
|
|
137
|
+
* over the contents API and discloses the blob sha. Parsing happens in core
|
|
138
|
+
* (Tenet 20) — this only resolves TEXT. Never throws: an unreadable canon is a
|
|
139
|
+
* cannot-verify outcome.
|
|
140
|
+
*/
|
|
141
|
+
export declare function resolveLabelCanon(options: ResolveLabelCanonOptions): NetworkSurfaceSnapshot;
|
|
142
|
+
/**
|
|
143
|
+
* Build the production {@link GhFetch} for callers OUTSIDE
|
|
144
|
+
* {@link resolveNetworkSnapshots} (e.g. the label-canon resolution in
|
|
145
|
+
* `doctor-parity.ts`). Async only because `safeExec` is lazily imported — the
|
|
146
|
+
* returned transport is synchronous, and NOTHING spawns until it is called, so
|
|
147
|
+
* a test that never calls it never touches `gh`.
|
|
148
|
+
*/
|
|
149
|
+
export declare function defaultGhFetch(): Promise<GhFetch>;
|
|
150
|
+
/**
|
|
151
|
+
* The current repo's `owner/repo` slug from its LOCAL `origin` remote, for
|
|
152
|
+
* callers outside {@link resolveNetworkSnapshots} (the label-canon source
|
|
153
|
+
* selection in `doctor-parity.ts`). No network: one `git remote get-url`
|
|
154
|
+
* read, degraded to `undefined` when there is no remote, no git, or no
|
|
155
|
+
* parseable `owner/repo`. Async only for the lazy `safeExec` import.
|
|
156
|
+
*/
|
|
157
|
+
export declare function defaultCurrentSlug(gitRoot: string): Promise<string | undefined>;
|
|
158
|
+
/**
|
|
159
|
+
* Classify a GraphQL 200 BODY (GraphQL reports authorization + not-found in the
|
|
160
|
+
* body, not the HTTP status). ANY `errors` entry is decisive: GraphQL returns
|
|
161
|
+
* partial data beside its errors (a nested FORBIDDEN, a node-limit hit, a
|
|
162
|
+
* SERVICE_UNAVAILABLE on one field), and a partial field list verdicted as if
|
|
163
|
+
* complete is a drift verdict on a cannot-verify read — the one outcome §14
|
|
164
|
+
* clause 2 forbids (falsification pass 1, F1: a FORBIDDEN body with a half-read
|
|
165
|
+
* project rendered "Priority: field absent"). Pure: no I/O, exported for test.
|
|
166
|
+
*/
|
|
167
|
+
export declare function classifyGraphqlBody(body: unknown): GhFetchResult;
|
|
168
|
+
/**
|
|
169
|
+
* True when the label-canon row will verdict at least one roster repo — the
|
|
170
|
+
* gate on the roster-wide canon read (falsification pass 1, F7; pass 2, p2-F7).
|
|
171
|
+
* The SAME predicate core applies per repo (`consumers` undefined = every repo),
|
|
172
|
+
* so the canon is read exactly when some line will use it. Pure, exported for test.
|
|
173
|
+
*/
|
|
174
|
+
export declare function labelCanonNeeded(rows: readonly NetworkRowSpec[], snapshots: readonly NetworkProbeRepoSnapshot[]): boolean;
|
|
84
175
|
//# sourceMappingURL=doctor-parity-fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-parity-fetch.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-parity-fetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"doctor-parity-fetch.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-parity-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EAExB,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,cAAc,CAAC;AAgDtB,6FAA6F;AAC7F,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEtF;AAED,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,qBAAqB,CAAC;IAC/B,gDAAgD;IAChD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,aAAa,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,CACtB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC1C,GAAG,EAAE,MAAM,KACR,aAAa,CAAC;AAEnB,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAE7D,mGAAmG;AACnG,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,iBAAiB,CAAC;IACvB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