@mmnto/cli 2.2.1 → 2.4.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/config-drift.test.js +4 -1
- package/dist/commands/config-drift.test.js.map +1 -1
- package/dist/commands/gate-install.d.ts +17 -0
- package/dist/commands/gate-install.d.ts.map +1 -1
- package/dist/commands/gate-install.js +23 -0
- package/dist/commands/gate-install.js.map +1 -1
- package/dist/commands/gate-install.test.js +467 -0
- package/dist/commands/gate-install.test.js.map +1 -1
- package/dist/commands/gate.d.ts +9 -0
- package/dist/commands/gate.d.ts.map +1 -1
- package/dist/commands/gate.js +24 -2
- package/dist/commands/gate.js.map +1 -1
- package/dist/commands/gate.test.js +42 -1
- package/dist/commands/gate.test.js.map +1 -1
- package/dist/commands/init-templates.d.ts +5 -5
- package/dist/commands/init-templates.d.ts.map +1 -1
- package/dist/commands/init-templates.js +758 -79
- package/dist/commands/init-templates.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +8 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.test.js +122 -0
- package/dist/commands/init.test.js.map +1 -1
- package/dist/commands/mail-cli-wiring.test.js +58 -2
- package/dist/commands/mail-cli-wiring.test.js.map +1 -1
- package/dist/commands/mail-derive-seat.test.d.ts +28 -0
- package/dist/commands/mail-derive-seat.test.d.ts.map +1 -0
- package/dist/commands/mail-derive-seat.test.js +557 -0
- package/dist/commands/mail-derive-seat.test.js.map +1 -0
- package/dist/commands/mail.d.ts +112 -0
- package/dist/commands/mail.d.ts.map +1 -1
- package/dist/commands/mail.js +189 -0
- package/dist/commands/mail.js.map +1 -1
- package/dist/commands/resolve-threads-cli-wiring.test.d.ts +19 -0
- package/dist/commands/resolve-threads-cli-wiring.test.d.ts.map +1 -0
- package/dist/commands/resolve-threads-cli-wiring.test.js +103 -0
- package/dist/commands/resolve-threads-cli-wiring.test.js.map +1 -0
- package/dist/commands/resolve-threads.d.ts +472 -0
- package/dist/commands/resolve-threads.d.ts.map +1 -0
- package/dist/commands/resolve-threads.js +793 -0
- package/dist/commands/resolve-threads.js.map +1 -0
- package/dist/commands/resolve-threads.test.d.ts +2 -0
- package/dist/commands/resolve-threads.test.d.ts.map +1 -0
- package/dist/commands/resolve-threads.test.js +1123 -0
- package/dist/commands/resolve-threads.test.js.map +1 -0
- package/dist/commands/sync-labels-forms.test.d.ts +7 -4
- package/dist/commands/sync-labels-forms.test.d.ts.map +1 -1
- package/dist/commands/sync-labels-forms.test.js +266 -18
- package/dist/commands/sync-labels-forms.test.js.map +1 -1
- package/dist/index.js +74 -5
- package/dist/index.js.map +1 -1
- package/dist/parsers/bot-identity-parity.test.d.ts +2 -0
- package/dist/parsers/bot-identity-parity.test.d.ts.map +1 -0
- package/dist/parsers/bot-identity-parity.test.js +229 -0
- package/dist/parsers/bot-identity-parity.test.js.map +1 -0
- package/dist/parsers/bot-review-parser.d.ts +8 -5
- package/dist/parsers/bot-review-parser.d.ts.map +1 -1
- package/dist/parsers/bot-review-parser.js +12 -34
- package/dist/parsers/bot-review-parser.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parity sensor for the ONE bot-reviewer identity definition
|
|
3
|
+
* (mmnto-ai/totem#2800): `@mmnto/totem`'s `bot-identity.ts`.
|
|
4
|
+
*
|
|
5
|
+
* This test FAILS if any consumer grows a list of its own —
|
|
6
|
+
* `packages/cli/src/parsers/bot-review-parser.ts` (triage's loose recognition),
|
|
7
|
+
* `packages/core/src/capability/review-catch.ts` (the Layer-B actor-id map),
|
|
8
|
+
* `packages/core/src/merge-ready.ts` (the gate's predicate reads) or
|
|
9
|
+
* `packages/cli/src/commands/resolve-threads.ts` (the human-reply test) — four
|
|
10
|
+
* consumers; the last two joined the scan with the mmnto-ai/totem#2841 fold,
|
|
11
|
+
* which also moved the App-suffix rule into the identity module and gave this
|
|
12
|
+
* sensor the arm that reads an ESCAPED suffix (`\[bot\]` in a regex or string
|
|
13
|
+
* source — the spelling the literal scan never saw). A second copy is exactly
|
|
14
|
+
* the failure the module removes: the lists drift, the stale one reads a real
|
|
15
|
+
* bot as "not a bot", and a finding disappears silently.
|
|
16
|
+
*
|
|
17
|
+
* It lives in the CLI package because that is the layer that can read every
|
|
18
|
+
* source (cli depends on core, never the reverse).
|
|
19
|
+
*/
|
|
20
|
+
import * as fs from 'node:fs';
|
|
21
|
+
import * as path from 'node:path';
|
|
22
|
+
import { fileURLToPath } from 'node:url';
|
|
23
|
+
import { describe, expect, it } from 'vitest';
|
|
24
|
+
import { BOT_REVIEWER_IDENTITIES, isBotReviewerLoginExact, resolveActorId } from '@mmnto/totem';
|
|
25
|
+
import { detectBot, isBotComment } from './bot-review-parser.js';
|
|
26
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
const PARSER_SRC = path.join(HERE, 'bot-review-parser.ts');
|
|
28
|
+
const REVIEW_CATCH_SRC = path.resolve(HERE, '../../../core/src/capability/review-catch.ts');
|
|
29
|
+
const RESOLVE_THREADS_SRC = path.resolve(HERE, '../commands/resolve-threads.ts');
|
|
30
|
+
const MERGE_READY_SRC = path.resolve(HERE, '../../../core/src/merge-ready.ts');
|
|
31
|
+
const IDENTITY_SRC = path.resolve(HERE, '../../../core/src/bot-identity.ts');
|
|
32
|
+
/**
|
|
33
|
+
* Strip line and block comments so the scan reads CODE only — every consumer is
|
|
34
|
+
* free to NAME a bot in prose (and both do, explaining where the list went).
|
|
35
|
+
*/
|
|
36
|
+
function codeOnly(source) {
|
|
37
|
+
// Lowercased: the regex arms below are case-insensitive, so a case-SENSITIVE
|
|
38
|
+
// literal scan beside them let a display-cased re-declaration
|
|
39
|
+
// (`new Set(['CodeRabbitAI[bot]'])`) through — the sensor's own asymmetry
|
|
40
|
+
// (mmnto-ai/totem#2800 round 2, F9).
|
|
41
|
+
return source
|
|
42
|
+
.replace(/\/\*[\s\S]*?\*\//g, ' ')
|
|
43
|
+
.replace(/(^|[^:])\/\/[^\n]*/g, '$1')
|
|
44
|
+
.toLowerCase();
|
|
45
|
+
}
|
|
46
|
+
/** The login spellings that only a re-declared list would need to name in code. */
|
|
47
|
+
const LOGIN_SPELLINGS = [
|
|
48
|
+
'coderabbitai',
|
|
49
|
+
'gemini-code-assist',
|
|
50
|
+
'greptile-apps',
|
|
51
|
+
'github-code-quality',
|
|
52
|
+
'[bot]',
|
|
53
|
+
];
|
|
54
|
+
/** A local regex over a bot name — the first re-declaration shape. */
|
|
55
|
+
const LOCAL_BOT_REGEX = /\/[^\n/]*(?:greptile|coderabbit|gemini|github-code-quality)[^\n]*\/[gimsuy]*/i;
|
|
56
|
+
/**
|
|
57
|
+
* A local SUBSTRING test over a bot name — the second shape. `includes` was the
|
|
58
|
+
* only member until fold F8: `indexOf`, `startsWith` and a bare comparison
|
|
59
|
+
* against a concatenated name are the same re-declaration wearing another
|
|
60
|
+
* method, and the sensor missed all three (mmnto-ai/totem#2800).
|
|
61
|
+
*/
|
|
62
|
+
const LOCAL_BOT_SUBSTRING = /(?:includes|indexOf|startsWith|endsWith|search|match)\(\s*['"`](?:coderabbit|greptile|gemini|github-code-quality)/i;
|
|
63
|
+
/** A bot name assembled from pieces to dodge a literal scan — the third shape. */
|
|
64
|
+
const LOCAL_BOT_CONCAT = /['"`](?:coderabbit|greptile|gemini|github-code-quality)[^'"`\n]*['"`]\s*\+/i;
|
|
65
|
+
/**
|
|
66
|
+
* The App suffix spelled ESCAPED — `\[bot\]` inside a regex literal or a
|
|
67
|
+
* RegExp source string — the fourth shape, and the one the arms above never
|
|
68
|
+
* caught: the literal scan looks for `[bot]`, while a regex source spells the
|
|
69
|
+
* brackets escaped, so `const BOT_LOGIN_SUFFIX = /\[bot\]$/i;` passed this
|
|
70
|
+
* sensor for as long as resolve-threads carried it (the pilot-install leg's
|
|
71
|
+
* F1 on the mmnto-ai/totem#2841 fold). The suffix rule has one home,
|
|
72
|
+
* `hasBotAppLoginSuffix` in bot-identity.ts.
|
|
73
|
+
*/
|
|
74
|
+
const LOCAL_BOT_SUFFIX = /\\+\[bot\\+\]/i; // one backslash in a regex literal, two in a RegExp source string
|
|
75
|
+
describe('bot identity — exactly one definition', () => {
|
|
76
|
+
it('the single source declares the three review bots the charter names', () => {
|
|
77
|
+
const tools = BOT_REVIEWER_IDENTITIES.map((i) => i.tool);
|
|
78
|
+
expect(tools).toContain('coderabbit');
|
|
79
|
+
expect(tools).toContain('gca');
|
|
80
|
+
expect(tools).toContain('greptile');
|
|
81
|
+
// No duplicate tool ids — a duplicate would make `detectBot` order-dependent.
|
|
82
|
+
expect(new Set(tools).size).toBe(tools.length);
|
|
83
|
+
});
|
|
84
|
+
for (const [label, file] of [
|
|
85
|
+
['bot-review-parser.ts', PARSER_SRC],
|
|
86
|
+
['review-catch.ts', REVIEW_CATCH_SRC],
|
|
87
|
+
['merge-ready.ts', MERGE_READY_SRC],
|
|
88
|
+
['resolve-threads.ts', RESOLVE_THREADS_SRC],
|
|
89
|
+
]) {
|
|
90
|
+
it(`${label} declares NO bot-login list of its own`, () => {
|
|
91
|
+
const code = codeOnly(fs.readFileSync(file, 'utf-8'));
|
|
92
|
+
for (const spelling of LOGIN_SPELLINGS) {
|
|
93
|
+
expect(code.includes(spelling), `${label} names the login spelling "${spelling}" in code — the identity list lives in bot-identity.ts`).toBe(false);
|
|
94
|
+
}
|
|
95
|
+
// No local regex over a bot name, no local substring test in ANY of the
|
|
96
|
+
// methods that spell one, no name assembled by concatenation, and no
|
|
97
|
+
// escaped App suffix of its own.
|
|
98
|
+
expect(code).not.toMatch(LOCAL_BOT_REGEX);
|
|
99
|
+
expect(code).not.toMatch(LOCAL_BOT_SUBSTRING);
|
|
100
|
+
expect(code).not.toMatch(LOCAL_BOT_CONCAT);
|
|
101
|
+
expect(code).not.toMatch(LOCAL_BOT_SUFFIX);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
it('the sensor catches every re-declaration shape it claims to (mutant rows)', () => {
|
|
105
|
+
// The sensor is only worth its line if it FAILS on a re-declaration. Each
|
|
106
|
+
// mutant below is a plausible way a consumer could grow its own list back;
|
|
107
|
+
// a sensor that misses one would pass this file while the drift is real.
|
|
108
|
+
const mutants = [
|
|
109
|
+
['a local regex', 'const GREPTILE = /\\bgreptile(?:-[^[]+)?\\[bot\\]/i;'],
|
|
110
|
+
['includes()', "if (lower.includes('coderabbit')) return 'coderabbit';"],
|
|
111
|
+
['indexOf()', "if (lower.indexOf('greptile') !== -1) return 'greptile';"],
|
|
112
|
+
['startsWith()', "if (lower.startsWith('gemini-code-assist')) return 'gca';"],
|
|
113
|
+
['concatenation', "const login = 'greptile' + '-apps' + '[bot]';"],
|
|
114
|
+
// Display-cased, `[Bot]` INCLUDED: the earlier version of this row spelled
|
|
115
|
+
// `[bot]` in lowercase, so the pre-fold sensor already caught it on that
|
|
116
|
+
// spelling alone and the row proved nothing (round 3, F3). Every letter a
|
|
117
|
+
// consumer could case differently is cased here.
|
|
118
|
+
['a display-cased Set', "const BOTS = new Set(['CodeRabbitAI[Bot]', 'GREPTILE-APPS[BOT]']);"],
|
|
119
|
+
// The escaped-suffix spellings — a regex literal and a RegExp source
|
|
120
|
+
// string. The verbatim line resolve-threads carried until the
|
|
121
|
+
// mmnto-ai/totem#2841 fold; the pre-fold sensor passed it.
|
|
122
|
+
['an escaped-suffix regex', 'const BOT_LOGIN_SUFFIX = /\\[bot\\]$/i;'],
|
|
123
|
+
['an escaped-suffix RegExp string', "const SUFFIX = new RegExp('\\\\[bot\\\\]$', 'i');"],
|
|
124
|
+
];
|
|
125
|
+
for (const [label, mutant] of mutants) {
|
|
126
|
+
const scanned = codeOnly(mutant);
|
|
127
|
+
const caught = LOCAL_BOT_REGEX.test(scanned) ||
|
|
128
|
+
LOCAL_BOT_SUBSTRING.test(scanned) ||
|
|
129
|
+
LOCAL_BOT_CONCAT.test(scanned) ||
|
|
130
|
+
LOCAL_BOT_SUFFIX.test(scanned) ||
|
|
131
|
+
LOGIN_SPELLINGS.some((s) => scanned.includes(s));
|
|
132
|
+
expect(caught, `the parity sensor missed the ${label} re-declaration`).toBe(true);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
it('the escaped-suffix arm is what catches the escaped spellings (the literal scan alone does not)', () => {
|
|
136
|
+
// Pins the arm's reason to exist: without it, the two escaped mutants pass
|
|
137
|
+
// every other arm — which is how the removed declaration lived unscanned.
|
|
138
|
+
for (const mutant of [
|
|
139
|
+
'const BOT_LOGIN_SUFFIX = /\\[bot\\]$/i;',
|
|
140
|
+
"const SUFFIX = new RegExp('\\\\[bot\\\\]$', 'i');",
|
|
141
|
+
]) {
|
|
142
|
+
const scanned = codeOnly(mutant);
|
|
143
|
+
expect(LOGIN_SPELLINGS.some((s) => scanned.includes(s))).toBe(false);
|
|
144
|
+
expect(scanned).not.toMatch(LOCAL_BOT_REGEX);
|
|
145
|
+
expect(scanned).toMatch(LOCAL_BOT_SUFFIX);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
it('every consumer imports the identity module', () => {
|
|
149
|
+
const parser = fs.readFileSync(PARSER_SRC, 'utf-8');
|
|
150
|
+
expect(parser).toMatch(/import\s*{[^}]*detectBotReviewer[^}]*}\s*from\s*'@mmnto\/totem'/s);
|
|
151
|
+
expect(parser).toMatch(/isBotReviewerLogin/);
|
|
152
|
+
const reviewCatch = fs.readFileSync(REVIEW_CATCH_SRC, 'utf-8');
|
|
153
|
+
expect(reviewCatch).toMatch(/from '\.\.\/bot-identity\.js'/);
|
|
154
|
+
expect(reviewCatch).toMatch(/botReviewerActorIds\(\)/);
|
|
155
|
+
// The gate reads the exact list straight from the module.
|
|
156
|
+
const mergeReady = fs.readFileSync(MERGE_READY_SRC, 'utf-8');
|
|
157
|
+
expect(mergeReady).toMatch(/import\s*{[^}]*isBotReviewerLoginExact[^}]*}\s*from\s*'\.\/bot-identity\.js'/s);
|
|
158
|
+
// The fourth consumer loads the barrel lazily inside the command
|
|
159
|
+
// (mmnto-ai/totem#2339) and injects all three predicates — the exact list,
|
|
160
|
+
// the loose pattern and the App suffix — into its pure selector. Each
|
|
161
|
+
// symbol is asserted on its own, so the destructure's order is free.
|
|
162
|
+
const resolveThreads = fs.readFileSync(RESOLVE_THREADS_SRC, 'utf-8');
|
|
163
|
+
// The file lazy-loads the barrel more than once (safeExec rides its own
|
|
164
|
+
// import); the identity import is the one that carries all three symbols.
|
|
165
|
+
const lazyImports = Array.from(resolveThreads.matchAll(/const\s*{([^}]*)}\s*=\s*await import\('@mmnto\/totem'\)/gs), (m) => m[1]);
|
|
166
|
+
const symbols = ['hasBotAppLoginSuffix', 'isBotReviewerLogin', 'isBotReviewerLoginExact'];
|
|
167
|
+
expect(lazyImports.some((names) => symbols.every((s) => names.includes(s))), `one lazy import of @mmnto/totem carries ${symbols.join(', ')}; saw ${JSON.stringify(lazyImports)}`).toBe(true);
|
|
168
|
+
expect(resolveThreads).toMatch(/hasAppSuffix:\s*hasBotAppLoginSuffix/);
|
|
169
|
+
});
|
|
170
|
+
it('the greptile login is recorded WITH its observation, not guessed', () => {
|
|
171
|
+
const identity = fs.readFileSync(IDENTITY_SRC, 'utf-8');
|
|
172
|
+
// The observed login string and the PRs it was read from (2026-09-07).
|
|
173
|
+
expect(identity).toContain('greptile-apps[bot]');
|
|
174
|
+
expect(identity).toMatch(/Observed 2026-09-07/);
|
|
175
|
+
expect(identity).toMatch(/mmnto-ai\/totem#2834/);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe('bot identity — behaviour the consumers had before the move', () => {
|
|
179
|
+
it('isBotComment / detectBot classify the REST-shaped logins unchanged', () => {
|
|
180
|
+
expect(isBotComment('coderabbitai[bot]')).toBe(true);
|
|
181
|
+
expect(isBotComment('gemini-code-assist[bot]')).toBe(true);
|
|
182
|
+
expect(isBotComment('greptile-apps[bot]')).toBe(true);
|
|
183
|
+
expect(isBotComment('github-code-quality[bot]')).toBe(true);
|
|
184
|
+
// A human account that merely CONTAINS a bot name is not a bot — the
|
|
185
|
+
// regression that hid human replies (CR Major on mmnto-ai/totem#2244).
|
|
186
|
+
expect(isBotComment('alice-greptile')).toBe(false);
|
|
187
|
+
expect(isBotComment('alice-github-code-quality')).toBe(false);
|
|
188
|
+
expect(isBotComment('satur8d')).toBe(false);
|
|
189
|
+
expect(detectBot('coderabbitai[bot]')).toBe('coderabbit');
|
|
190
|
+
expect(detectBot('gemini-code-assist[bot]')).toBe('gca');
|
|
191
|
+
expect(detectBot('greptile-apps[bot]')).toBe('greptile');
|
|
192
|
+
expect(detectBot('github-code-quality[bot]')).toBe('ghcq');
|
|
193
|
+
expect(detectBot('satur8d')).toBe('unknown');
|
|
194
|
+
});
|
|
195
|
+
it('resolveActorId keeps EXACT-login attribution, ghcq included (no new actor id)', () => {
|
|
196
|
+
expect(resolveActorId('coderabbitai[bot]')).toBe('coderabbit');
|
|
197
|
+
expect(resolveActorId('gemini-code-assist[bot]')).toBe('gemini-code-assist');
|
|
198
|
+
expect(resolveActorId('greptile-apps[bot]')).toBe('greptile');
|
|
199
|
+
// Not one of the three paid bots the ledger attributes to: it stays itself.
|
|
200
|
+
expect(resolveActorId('github-code-quality[bot]')).toBe('github-code-quality[bot]');
|
|
201
|
+
// A variant is NOT collapsed into the parent's hit-rate.
|
|
202
|
+
expect(resolveActorId('greptile-enterprise[bot]')).toBe('greptile-enterprise[bot]');
|
|
203
|
+
expect(resolveActorId('totem-claude')).toBe('totem-claude');
|
|
204
|
+
});
|
|
205
|
+
it('the GraphQL spelling (no [bot] suffix) is a bot on the exact-login read only', () => {
|
|
206
|
+
expect(isBotReviewerLoginExact('gemini-code-assist')).toBe(true);
|
|
207
|
+
expect(isBotReviewerLoginExact('greptile-apps')).toBe(true);
|
|
208
|
+
expect(isBotReviewerLoginExact('greptile-apps[bot]')).toBe(true);
|
|
209
|
+
expect(isBotReviewerLoginExact('coderabbitai')).toBe(true);
|
|
210
|
+
expect(isBotReviewerLoginExact('alice-greptile')).toBe(false);
|
|
211
|
+
expect(isBotReviewerLoginExact('satur8d')).toBe(false);
|
|
212
|
+
expect(isBotReviewerLoginExact('')).toBe(false);
|
|
213
|
+
});
|
|
214
|
+
it('a HUMAN login that merely shares a bot prefix is not a bot (fold F5)', () => {
|
|
215
|
+
// The pre-fold wildcard arm (`greptile-<anything>`) admitted every one of
|
|
216
|
+
// these, which would let a human comment gate a merge.
|
|
217
|
+
for (const human of [
|
|
218
|
+
'greptile-fan',
|
|
219
|
+
'greptile-fan[bot]',
|
|
220
|
+
'greptile',
|
|
221
|
+
'github-code-quality-fan',
|
|
222
|
+
'coderabbitai-mirror',
|
|
223
|
+
'gemini-code-assist-community',
|
|
224
|
+
]) {
|
|
225
|
+
expect(isBotReviewerLoginExact(human), `${human} must not read as a bot`).toBe(false);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
//# sourceMappingURL=bot-identity-parity.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-identity-parity.test.js","sourceRoot":"","sources":["../../src/parsers/bot-identity-parity.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEhG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAA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AM,KAAK,IAAI;YAClB,cAAc;YACd,mBAAmB;YACnB,UAAU;YACV,yBAAyB;YACzB,qBAAqB;YACrB,8BAA8B;SAC/B,EAAE,CAAC;YACF,MAAM,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,yBAAyB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -6,18 +6,21 @@
|
|
|
6
6
|
* so that `review-learn` extracts lessons only from findings the
|
|
7
7
|
* developer actually fixed.
|
|
8
8
|
*/
|
|
9
|
+
import { type BotReviewerTool } from '@mmnto/totem';
|
|
9
10
|
/**
|
|
10
11
|
* The review bots whose comment formats triage-pr knows how to parse, plus
|
|
11
|
-
* `unknown` for an unrecognized author.
|
|
12
|
-
*
|
|
12
|
+
* `unknown` for an unrecognized author. The bot members come from
|
|
13
|
+
* `@mmnto/totem`'s `BOT_REVIEWER_IDENTITIES` (mmnto-ai/totem#2800), so adding a
|
|
14
|
+
* bot is a single-place change THERE plus its severity parser in
|
|
15
|
+
* {@link parseSeverityForTool}.
|
|
13
16
|
*
|
|
14
17
|
* NOTE: `gca` is triage's local id for `gemini-code-assist` — it intentionally
|
|
15
18
|
* diverges from the core actor-id scheme in `@mmnto/totem`'s `resolveActorId`
|
|
16
19
|
* (which uses `gemini-code-assist` and EXACT-login matching for hit-rate
|
|
17
20
|
* attribution). Triage's goal is broad recognition (surface every finding) with
|
|
18
21
|
* a compact display id; it matches coderabbit/gca by substring and greptile by
|
|
19
|
-
* its bot-login shape (
|
|
20
|
-
*
|
|
22
|
+
* its bot-login shape (`loginPattern` on each identity). Both ids now hang off
|
|
23
|
+
* the ONE identity array, so they cannot drift apart.
|
|
21
24
|
*
|
|
22
25
|
* `ghcq` is GitHub's own `github-code-quality[bot]` (mmnto-ai/totem#2626;
|
|
23
26
|
* observed corpus n=7 inline comments: mmnto-ai/totem #1897/#2224/#2434/#2457
|
|
@@ -26,7 +29,7 @@
|
|
|
26
29
|
* for it (attested: no tag has ever been attempted in-org and none is
|
|
27
30
|
* documented) — treat disposition comments as audit-trail-only.
|
|
28
31
|
*/
|
|
29
|
-
export type BotTool =
|
|
32
|
+
export type BotTool = BotReviewerTool | 'unknown';
|
|
30
33
|
export interface NormalizedBotFinding {
|
|
31
34
|
tool: BotTool;
|
|
32
35
|
severity: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-review-parser.d.ts","sourceRoot":"","sources":["../../src/parsers/bot-review-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"bot-review-parser.d.ts","sourceRoot":"","sources":["../../src/parsers/bot-review-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAyC,MAAM,cAAc,CAAC;AAM3F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,CAAC;IACxD,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACtC,uIAAuI;IACvI,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,Q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B,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,oBAAoB,EAAE,CAqCxF;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,oBAAoB,EAAE,CA+B3F"}
|
|
@@ -6,45 +6,23 @@
|
|
|
6
6
|
* so that `review-learn` extracts lessons only from findings the
|
|
7
7
|
* developer actually fixed.
|
|
8
8
|
*/
|
|
9
|
+
import { detectBotReviewer, isBotReviewerLogin } from '@mmnto/totem';
|
|
9
10
|
import { parseCodeRabbitReviewFindings, parseGreptileReviewFindings } from '../parse-nits.js';
|
|
10
11
|
// ─── Bot Detection ──────────────────────────────────
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// `
|
|
14
|
-
//
|
|
15
|
-
// `
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// exact-login map lives in `@mmnto/totem`'s `review-catch.ts`).
|
|
21
|
-
const GREPTILE_BOT_LOGIN = /\bgreptile(?:-[^[]+)?\[bot\]/i;
|
|
22
|
-
// ghcq follows the greptile bot-login-shape precedent (mmnto-ai/totem#2626):
|
|
23
|
-
// every observed login across both repos is exactly `github-code-quality[bot]`,
|
|
24
|
-
// the `[bot]` suffix requirement keeps a human account like
|
|
25
|
-
// `alice-github-code-quality` out of the bot classes, and the optional
|
|
26
|
-
// `(?:-[^[]+)?` variant arm mirrors greptile's ("future bot variants are still
|
|
27
|
-
// surfaced") so a renamed/tiered variant never re-enters the invisible-drop
|
|
28
|
-
// state this normalization removes.
|
|
29
|
-
const GHCQ_BOT_LOGIN = /\bgithub-code-quality(?:-[^[]+)?\[bot\]/i;
|
|
12
|
+
// The login patterns are NOT declared here: `@mmnto/totem`'s `bot-identity.ts`
|
|
13
|
+
// is the ONE definition the cohort reads (mmnto-ai/totem#2800), and
|
|
14
|
+
// `bot-identity-parity.test.ts` fails if this module grows a copy. What lived
|
|
15
|
+
// here — coderabbit/gca by bare substring, greptile and ghcq by bot-login SHAPE
|
|
16
|
+
// (the `[bot]` suffix required, so a human `alice-greptile` is not
|
|
17
|
+
// misclassified and real human replies are not hidden in `isThreadResolved` —
|
|
18
|
+
// CR Major on mmnto-ai/totem#2244) — is that module's `loginPattern`, moved
|
|
19
|
+
// verbatim. Triage's compact ids (`gca`) still differ from the Layer-B actor
|
|
20
|
+
// ids (`gemini-code-assist`) by design; both now hang off the same array.
|
|
30
21
|
export function isBotComment(author) {
|
|
31
|
-
|
|
32
|
-
return (lower.includes('coderabbit') ||
|
|
33
|
-
lower.includes('gemini-code-assist') ||
|
|
34
|
-
GREPTILE_BOT_LOGIN.test(author) ||
|
|
35
|
-
GHCQ_BOT_LOGIN.test(author));
|
|
22
|
+
return isBotReviewerLogin(author);
|
|
36
23
|
}
|
|
37
24
|
export function detectBot(author) {
|
|
38
|
-
|
|
39
|
-
if (lower.includes('coderabbit'))
|
|
40
|
-
return 'coderabbit';
|
|
41
|
-
if (lower.includes('gemini-code-assist'))
|
|
42
|
-
return 'gca';
|
|
43
|
-
if (GREPTILE_BOT_LOGIN.test(author))
|
|
44
|
-
return 'greptile';
|
|
45
|
-
if (GHCQ_BOT_LOGIN.test(author))
|
|
46
|
-
return 'ghcq';
|
|
47
|
-
return 'unknown';
|
|
25
|
+
return detectBotReviewer(author) ?? 'unknown';
|
|
48
26
|
}
|
|
49
27
|
// ─── CodeRabbit Parser ──────────────────────────────
|
|
50
28
|
/** Extract severity from CR comment body (red circle Critical, orange circle Major, yellow circle Minor) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-review-parser.js","sourceRoot":"","sources":["../../src/parsers/bot-review-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"bot-review-parser.js","sourceRoot":"","sources":["../../src/parsers/bot-review-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAwB,iBAAiB,EAAE,kBAAkB,E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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmnto/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Totem: local-first toolkit that keeps AI-agent work queryable, enforceable, and derivable as plain files in your codebase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"smol-toml": "^1.6.1",
|
|
29
29
|
"yaml": "^2.4.0",
|
|
30
30
|
"zod": "^3.24.0",
|
|
31
|
-
"@mmnto/totem": "2.
|
|
31
|
+
"@mmnto/totem": "2.4.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@anthropic-ai/sdk": "^0.98.0",
|