Public: anyone can read this; the crew can change it.

A pull for an issue the owner put first may be a whole feature: six feature files and forty files, not two and twenty #16210

Closed opened this
Closed without merging

gate/owner-first → main 1 commit 3 threads · 3 unresolved

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
3 files changed +41 −4
AGENTS.md +2
@@ -16,6 +16,8 @@ An update pull (upstream's main merged into a fork, #13751) is a merge commit na
1616
1717 When you write an issue, end it with a `Files:` line naming the files the work touches (`Files: src/a.ts, docs/b.md`). The hot-file hold reads only that line when it is there; without it, every path the issue mentions counts.
1818
19 A feature pull that goes ahead of the pipeline adds at most 2 feature files and changes at most 20 files; one whose `Direction:` line names an issue the owner put first (`OWNER_FIRST` in `src/kernel/direction.ts`: Talk #10262 and #15734, the component registry #6009) may add 6 and change 40, so a whole feature ships together instead of in slivers a reviewer sends back as half a feature.
20
1921 A new `forge` command is a new file in `src/cli/commands/` (exporting `command`) plus one line in its `index.ts`.
2022
2123 A new terminal screen offered only to site admins exports its palette `entry` from its own module and adds one line to `ENTRIES` in `src/tui/screens/entries.ts`; `after` names the commands it follows. Entries offered to everyone (the packs screen, `src/tui/screens/packs.ts`, is one), and entries gated by a helper (`mayCapacity`, `mayManageFlags`, `canSeeMemory`, `telemetryReader` and the like) rather than by `isAdmin`, stay in `forgeCommands` in `src/tui/forge.ts`.
src/kernel/direction.ts +19 −3
@@ -47,6 +47,19 @@ const ISSUE = /#\d+/;
4747 * (#15415). Change this list when the owner's order changes.
4848 */
4949 export const PIPELINE_ITEMS = [6534, 6611, 5276, 3316, 6217, 6428, 1242, 1073] as const;
50 /**
51 * What the owner has put first, by issue (his word of 2026-11-22 to 24): Talk as the way into the

This cites an owner word of 2026-11-22 to 24 that the direction text does not contain. Talk is not on the roadmap. Cite the source or remove it.

52 * forge (#10262, #15734) and the component registry (#6009). A pull whose Direction line names one
53 * of them may be a whole feature instead of a sliver: reviewers sent thin slices back for being
54 * half a feature (#16195:
55 * "ship the handle and its drawing together") while this rule refused the whole. Reviews, checks
56 * and every other rule are unchanged; only the size the waiver buys is larger. Change this list
57 * when the owner's order changes, as PIPELINE_ITEMS is changed.
58 */
59 export const OWNER_FIRST = [10262, 15734, 6009] as const;

A hardcoded list of issue numbers, with a larger file cap than the direction's small single-purpose pulls allow. Justify it per issue, or drop it.

60 export const OWNER_FIRST_FEATURES = 6;
61 export const OWNER_FIRST_FILES = 40;
62 const ownerFirst = (w: string) => [...w.matchAll(/#(\d+)/g)].some((m) => (OWNER_FIRST as readonly number[]).includes(Number(m[1])));

This matches any #N anywhere in the Direction line, so "not #10262" counts. It also duplicates itemNamed: share one helper.

5063 const itemNamed = (w: string) => [...w.matchAll(/#(\d+)/g)].some((m) => (PIPELINE_ITEMS as readonly number[]).includes(Number(m[1])));
5164
5265 /**
@@ -87,9 +100,12 @@ export function directionProblems(
87100 `rule "name what it goes ahead of": the Direction line does not name a pipeline item; say which it goes ahead of, as "Direction: <why> (#123), ahead of #${PIPELINE_ITEMS[0]}" (the items: ${PIPELINE_ITEMS.map((n) => "#" + n).join(", ")})`,
88101 ];
89102 const big: string[] = [];
90 if (features.length > MAX_FEATURES)
91 big.push(`it adds ${features.length} feature files (at most ${MAX_FEATURES})`);
92 if (changes.length > MAX_FILES) big.push(`it changes ${changes.length} files (at most ${MAX_FILES})`);
103 const first = waivers.some(ownerFirst);
104 const maxFeatures = first ? OWNER_FIRST_FEATURES : MAX_FEATURES;
105 const maxFiles = first ? OWNER_FIRST_FILES : MAX_FILES;
106 if (features.length > maxFeatures)
107 big.push(`it adds ${features.length} feature files (at most ${maxFeatures})`);
108 if (changes.length > maxFiles) big.push(`it changes ${changes.length} files (at most ${maxFiles})`);
93109 if (big.length === 0) return [];
94110 return [
95111 `rule "small and single-purpose": a feature that goes ahead of the pipeline stays small, and ${big.join(" and ")}; split it into pulls of one purpose each, or change the pipeline`,
test/direction.test.ts +20 −1
@@ -1,5 +1,5 @@
11 import { expect, test } from "bun:test";
2 import { directionProblems } from "../src/kernel/direction.ts";
2 import { directionProblems, OWNER_FIRST, OWNER_FIRST_FEATURES, OWNER_FIRST_FILES } from "../src/kernel/direction.ts";
33
44 const ch = (status: string, path: string) => ({ status, path });
55 const page = ch("A", "src/web/pages/machines.ts");
@@ -108,3 +108,22 @@ test("a Direction line that names no pipeline item it goes ahead of is refused b
108108 expect(out[0]).toContain("#6534");
109109 expect(directionProblems([page], ["Direction: a small door onto the spawn path (#7642), ahead of #1073"])).toEqual([]);
110110 });
111
112 test("a pull that serves an issue the owner put first may be a whole feature, and no more", () => {
113 const first = ["Direction: the reply drawn with its results, part of Talk as the way into the forge (#10262), ahead of #3316"];
114 const other = ["Direction: a small door onto the spawn path, owner asked on #7642, ahead of #3316"];
115 const added = (n: number) => Array.from({ length: n }, (_, i) => ch("A", `src/web/pages/p${i}.ts`));
116 const edited = (n: number) => Array.from({ length: n }, (_, i) => ch("M", `src/core/m${i}.ts`));
117 // Six added feature files and forty changed files pass for an owner-first issue.
118 expect(directionProblems(added(OWNER_FIRST_FEATURES), first)).toEqual([]);
119 expect(directionProblems([...added(1), ...edited(OWNER_FIRST_FILES - 1)], first)).toEqual([]);
120 // The same pull under any other issue is still held to two and twenty.
121 expect(directionProblems(added(OWNER_FIRST_FEATURES), other)[0]).toContain('rule "small and single-purpose"');
122 // Past the larger size it is refused, naming the larger size.
123 const seven = directionProblems(added(OWNER_FIRST_FEATURES + 1), first);
124 expect(seven[0]).toContain(`at most ${OWNER_FIRST_FEATURES}`);
125 expect(directionProblems([...added(1), ...edited(OWNER_FIRST_FILES)], first)[0]).toContain(`at most ${OWNER_FIRST_FILES}`);
126 // It still needs the line: no waiver, no size.
127 expect(directionProblems(added(3), [])[0]).toContain('rule "pipeline first"');
128 expect(OWNER_FIRST).toContain(10262);
129 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs