@bli-cockpit/telemetry-core 0.1.105 → 0.1.107
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/gated-paths.d.ts +12 -0
- package/dist/gated-paths.js +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/log-digest/sources/types.d.ts +0 -4
- package/dist/work-next-order.d.ts +19 -0
- package/dist/work-next-order.js +28 -0
- package/package.json +6 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gated-path rule (Vee's 2026-10-19 ruling): which changed paths put a pull request behind a human code-owner approval.
|
|
3
|
+
*
|
|
4
|
+
* ONE copy, shared by the delivery scoreboard collector (`apps/runner/src/delivery-classify.ts`, `cockpit delivery report`)
|
|
5
|
+
* and the "PRs waiting on me" reader (`apps/dashboard/src/lib/github/prs-waiting.ts`, `cockpit github waiting`), so the
|
|
6
|
+
* scoreboard's "gated" count and a person's "needs a code owner" flag can never disagree. Pure: nothing here touches the
|
|
7
|
+
* network. Docs: docs/architecture/delivery-scoreboard.md.
|
|
8
|
+
*/
|
|
9
|
+
/** The paths behind a human code-owner approval, as repo-relative path patterns. */
|
|
10
|
+
export declare const GATED_PATH_PATTERNS: readonly RegExp[];
|
|
11
|
+
/** The changed paths that are gated, in the order given. */
|
|
12
|
+
export declare const gatedPathsOf: (paths: readonly string[]) => string[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gated-path rule (Vee's 2026-10-19 ruling): which changed paths put a pull request behind a human code-owner approval.
|
|
3
|
+
*
|
|
4
|
+
* ONE copy, shared by the delivery scoreboard collector (`apps/runner/src/delivery-classify.ts`, `cockpit delivery report`)
|
|
5
|
+
* and the "PRs waiting on me" reader (`apps/dashboard/src/lib/github/prs-waiting.ts`, `cockpit github waiting`), so the
|
|
6
|
+
* scoreboard's "gated" count and a person's "needs a code owner" flag can never disagree. Pure: nothing here touches the
|
|
7
|
+
* network. Docs: docs/architecture/delivery-scoreboard.md.
|
|
8
|
+
*/
|
|
9
|
+
/** The paths behind a human code-owner approval, as repo-relative path patterns. */
|
|
10
|
+
export const GATED_PATH_PATTERNS = [
|
|
11
|
+
/^supabase\/migrations\//,
|
|
12
|
+
/^\.github\/workflows\//,
|
|
13
|
+
/^\.github\/agent-batches\//,
|
|
14
|
+
/^railway[^/]*\.json$/,
|
|
15
|
+
/^vercel\.json$/,
|
|
16
|
+
];
|
|
17
|
+
/** The changed paths that are gated, in the order given. */
|
|
18
|
+
export const gatedPathsOf = (paths) => paths.filter((path) => GATED_PATH_PATTERNS.some((pattern) => pattern.test(path)));
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BLI-26083: "what do I work on next?" — ONE order for a person's own tickets, shared by every surface that shows
|
|
3
|
+
* it: `cockpit ticket list --assignee me`, the `GET /api/work/issues?order=next` door (MCP `work_list_issues`
|
|
4
|
+
* rides it), and web My Work. In progress first, then priority Urgent to Low with no priority last, then the
|
|
5
|
+
* sooner due date with none last, then the most recently updated; the identifier breaks every remaining tie so
|
|
6
|
+
* the order is total. Finished tickets (done, canceled), when shown at all, come last.
|
|
7
|
+
*/
|
|
8
|
+
export declare const WORK_FINISHED_STATE_NAMES: readonly string[];
|
|
9
|
+
/** Tower's own priority words, the same as the web board's `WORK_PRIORITY_OPTIONS`. */
|
|
10
|
+
export declare const WORK_PRIORITY_WORDS: readonly ["No priority", "Urgent", "High", "Medium", "Low"];
|
|
11
|
+
export declare function workPriorityWord(priority: number | null | undefined): string;
|
|
12
|
+
export interface NextOrderRow {
|
|
13
|
+
identifier: string;
|
|
14
|
+
state: string;
|
|
15
|
+
priority: number | null;
|
|
16
|
+
target_date?: string | null;
|
|
17
|
+
updated_at: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function compareNextWork(a: NextOrderRow, b: NextOrderRow): number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BLI-26083: "what do I work on next?" — ONE order for a person's own tickets, shared by every surface that shows
|
|
3
|
+
* it: `cockpit ticket list --assignee me`, the `GET /api/work/issues?order=next` door (MCP `work_list_issues`
|
|
4
|
+
* rides it), and web My Work. In progress first, then priority Urgent to Low with no priority last, then the
|
|
5
|
+
* sooner due date with none last, then the most recently updated; the identifier breaks every remaining tie so
|
|
6
|
+
* the order is total. Finished tickets (done, canceled), when shown at all, come last.
|
|
7
|
+
*/
|
|
8
|
+
export const WORK_FINISHED_STATE_NAMES = ["done", "canceled"];
|
|
9
|
+
/** Tower's own priority words, the same as the web board's `WORK_PRIORITY_OPTIONS`. */
|
|
10
|
+
export const WORK_PRIORITY_WORDS = ["No priority", "Urgent", "High", "Medium", "Low"];
|
|
11
|
+
export function workPriorityWord(priority) {
|
|
12
|
+
return WORK_PRIORITY_WORDS[priority ?? 0] ?? "No priority";
|
|
13
|
+
}
|
|
14
|
+
function stateRank(state) {
|
|
15
|
+
if (state === "in_progress")
|
|
16
|
+
return 0;
|
|
17
|
+
return WORK_FINISHED_STATE_NAMES.includes(state) ? 2 : 1;
|
|
18
|
+
}
|
|
19
|
+
function priorityRank(priority) {
|
|
20
|
+
return priority && priority >= 1 && priority <= 4 ? priority : 5;
|
|
21
|
+
}
|
|
22
|
+
export function compareNextWork(a, b) {
|
|
23
|
+
return stateRank(a.state) - stateRank(b.state)
|
|
24
|
+
|| priorityRank(a.priority) - priorityRank(b.priority)
|
|
25
|
+
|| (a.target_date ?? "9999-12-31").localeCompare(b.target_date ?? "9999-12-31")
|
|
26
|
+
|| b.updated_at.localeCompare(a.updated_at)
|
|
27
|
+
|| a.identifier.localeCompare(b.identifier);
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bli-cockpit/telemetry-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.107",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,6 +54,11 @@
|
|
|
54
54
|
"types": "./dist/github-app-token.d.ts",
|
|
55
55
|
"import": "./dist/github-app-token.js",
|
|
56
56
|
"default": "./dist/github-app-token.js"
|
|
57
|
+
},
|
|
58
|
+
"./gated-paths": {
|
|
59
|
+
"types": "./dist/gated-paths.d.ts",
|
|
60
|
+
"import": "./dist/gated-paths.js",
|
|
61
|
+
"default": "./dist/gated-paths.js"
|
|
57
62
|
}
|
|
58
63
|
},
|
|
59
64
|
"publishConfig": {
|