@feigi/fleet-ctl 3.45.2 → 3.46.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/commands/run-merge-bot.md +1 -1
- package/package.json +1 -1
- package/scripts/diff-stats.mjs +19 -4
- package/scripts/pr-overlap.mjs +25 -20
- package/scripts/tier-check.mjs +7 -1
|
@@ -18,7 +18,7 @@ Before touching labeled PR `N`, list every open PR below `N` lacking the label.
|
|
|
18
18
|
~/.fleet/bin/fleet-run pr-overlap.mjs --a <lower-pr> --b <N>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
**Any** of its four signals (`files`, `modules`, `dirs`, `prose`) firing means related. Path equality alone is too weak: a repo mid-migration has `src/…/
|
|
21
|
+
**Any** of its four signals (`files`, `modules`, `dirs`, `prose`) firing means related. Path equality alone is too weak: a repo mid-migration has `src/…/test_foo.py` in one PR and `tests/unit/…/test_foo.py` in the other — same module, zero shared paths. A module is a test file's name with its test affix and extension removed, in any language (`foo.test.ts`, `foo_test.go` and `test_foo.py` are all `foo`); other files are not modules.
|
|
22
22
|
|
|
23
23
|
Two false positives in signal 3:
|
|
24
24
|
|
package/package.json
CHANGED
package/scripts/diff-stats.mjs
CHANGED
|
@@ -41,10 +41,25 @@ export const isTestDir = (p) => /(^|\/)(__tests__|tests?|e2e|__mocks__)\//i.test
|
|
|
41
41
|
// suffix is a naming heuristic: it also claims a production component named like
|
|
42
42
|
// `ABTest.tsx`, which is the accepted cost of recognising `FooTest.java` without
|
|
43
43
|
// naming a language.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
//
|
|
45
|
+
// Each shape captures the basename with its affix and extension removed, so
|
|
46
|
+
// `testSubject` names what the test is about from the same patterns this
|
|
47
|
+
// predicate judges by: `foo.test.ts`, `foo_test.go`, `test_foo.py` and
|
|
48
|
+
// `foo.spec.rb` give `foo`, and `FooTest.java` gives `Foo`. The first shape
|
|
49
|
+
// that matches decides. `null` means no test name.
|
|
50
|
+
const TEST_NAME_SHAPES = [
|
|
51
|
+
/(?:^|\/)([^/]*)[._](?:test|spec)\.[^/.]+$/i,
|
|
52
|
+
/(?:^|\/)test_([^/]*?)(?:\.[^/.]+)?$/i,
|
|
53
|
+
/(?:^|\/)([^/]*[A-Za-z0-9])Tests?\.[^/.]+$/,
|
|
54
|
+
];
|
|
55
|
+
export const testSubject = (p) => {
|
|
56
|
+
for (const shape of TEST_NAME_SHAPES) {
|
|
57
|
+
const m = shape.exec(p);
|
|
58
|
+
if (m) return m[1];
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
};
|
|
62
|
+
export const isTestName = (p) => testSubject(p) !== null;
|
|
48
63
|
|
|
49
64
|
// Only a prose or config extension, or a conventional name, makes a file docs or
|
|
50
65
|
// config — which those already do anywhere, so neither `docs/` nor `.github/` has
|
package/scripts/pr-overlap.mjs
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { execFileSync } from "node:child_process";
|
|
15
15
|
import { gitEnv } from "./git-env.mjs";
|
|
16
16
|
import { basename, dirname, extname } from "node:path";
|
|
17
|
+
import { isConfig, isDocs, testSubject } from "./diff-stats.mjs";
|
|
17
18
|
import { makeDie, defineFlags } from "./arg.mjs";
|
|
18
19
|
|
|
19
20
|
const NAME = "pr-overlap";
|
|
@@ -96,20 +97,24 @@ const intersect = (xs, ys) => {
|
|
|
96
97
|
|
|
97
98
|
// A repo mid-migration has src/…/foo.test.ts in one PR and
|
|
98
99
|
// tests/unit/…/foo.test.ts in the other: same module, zero shared paths. That
|
|
99
|
-
// migration case is what this signal exists for, and it is a
|
|
100
|
-
//
|
|
100
|
+
// migration case is what this signal exists for, and it is a test-file notion
|
|
101
|
+
// in any language — so only a file whose name has a test shape participates,
|
|
102
|
+
// judged by diff-stats.mjs's own patterns, and its module is that name with
|
|
103
|
+
// the test affix and extension removed: `foo_test.go`, `test_foo.py` and
|
|
104
|
+
// `foo.test.ts` all give `foo`, `FooTest.java` gives `Foo`. Modules compare
|
|
105
|
+
// case-sensitively, as `files` compares paths.
|
|
101
106
|
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
// A non-test source file never participates, `.ts` included: `types.ts` ×13
|
|
108
|
+
// and `index.ts` ×10 live in unrelated subtrees of the proving ground, and
|
|
109
|
+
// telling a shared module from a shared stock name would need a list of names.
|
|
110
|
+
// Docs and config never participate either, a test-shaped name included
|
|
111
|
+
// (`docs/test_plan.md`): matching their basenames produces confident nonsense,
|
|
112
|
+
// two PRs each touching their own README.md, or their own hooks.json, reported
|
|
113
|
+
// as sharing a "module". Measured in the proving ground: README.md ×8,
|
|
114
|
+
// SKILL.md ×6, mcp-snippet.json ×9, hooks.json ×5 across unrelated
|
|
115
|
+
// directories. Returning null for those drops them from the signal entirely
|
|
116
|
+
// rather than caveating them.
|
|
117
|
+
const moduleOf = (f) => (isDocs(f) || isConfig(f) ? null : testSubject(f) || null);
|
|
113
118
|
const modulesOf = (fs) => fs.map(moduleOf).filter((m) => m !== null);
|
|
114
119
|
|
|
115
120
|
// Repo root is excluded: every top-level file shares it, so it fires on PRs
|
|
@@ -143,7 +148,7 @@ const dirsOf = (fs) => fs.map(dirname).filter((d) => d !== ".");
|
|
|
143
148
|
// with the verdict. An extension on neither list does not participate at all.
|
|
144
149
|
//
|
|
145
150
|
// Data side — an artifact whose meaning lives in prose somewhere else. A
|
|
146
|
-
// `.ts` module's consumers are already found by `files
|
|
151
|
+
// `.ts` module's consumers are already found by `files` above. `.md`
|
|
147
152
|
// is deliberately absent: a doc citing a doc is what `dirs` fires on, and
|
|
148
153
|
// `SKILL.md` recurs 3× in this repo's 251 tracked files (measured), so it is
|
|
149
154
|
// the ambiguous-basename shape `moduleOf` above already refuses to guess at.
|
|
@@ -386,13 +391,13 @@ if (signal === "dirs") {
|
|
|
386
391
|
}
|
|
387
392
|
if (signal === "modules") {
|
|
388
393
|
// The hold rule this mechanises calls a module match a verdict, on a par with
|
|
389
|
-
// a shared file. It is not one:
|
|
390
|
-
//
|
|
391
|
-
// name and nothing else. Say so, because the caller's rule will not.
|
|
394
|
+
// a shared file. It is not one: two unrelated test files can share a name
|
|
395
|
+
// (a `test_utils.py` in each of two packages), so two PRs can share a
|
|
396
|
+
// "module" name and nothing else. Say so, because the caller's rule will not.
|
|
392
397
|
console.error(
|
|
393
|
-
`${NAME}: module-only hit — confirm before treating as a verdict.
|
|
394
|
-
`
|
|
395
|
-
`
|
|
398
|
+
`${NAME}: module-only hit — confirm before treating as a verdict. Unrelated\n` +
|
|
399
|
+
` test files can share a name (test_utils.py in two packages), so a\n` +
|
|
400
|
+
` shared name is not yet a shared module: ${modules.join(", ")}`,
|
|
396
401
|
);
|
|
397
402
|
}
|
|
398
403
|
// Keyed on the count, not on `signal`, unlike the two notes above: a prose
|
package/scripts/tier-check.mjs
CHANGED
|
@@ -117,7 +117,13 @@ export function declaredPairFor(frontmatter) {
|
|
|
117
117
|
// assistant turn's own `model`: the identity exists before the member's
|
|
118
118
|
// first turn, where the per-turn model does not, so preferring it is what
|
|
119
119
|
// makes this check usable immediately after a background dispatch rather
|
|
120
|
-
// than only once a member has already produced output.
|
|
120
|
+
// than only once a member has already produced output. A mid-run retry
|
|
121
|
+
// fallback (omp's `retry.fallbackChains` substituting a model after
|
|
122
|
+
// dispatch) is outside this check by design: `session_init` is never
|
|
123
|
+
// rewritten, so the identity stays the dispatched route, and the model that
|
|
124
|
+
// served the member's last turn is member-outcomes.mjs's per-turn `model`
|
|
125
|
+
// (last turn wins, so a fallback that reverts within the run never shows in
|
|
126
|
+
// it), not a tier verdict.
|
|
121
127
|
export function resolveActual({ transcriptText, resolvedModel, resolvedThinkingLevel }) {
|
|
122
128
|
if (resolvedModel && resolvedThinkingLevel) {
|
|
123
129
|
return { model: resolvedModel, level: resolvedThinkingLevel, viaJobRecord: true };
|