@feigi/fleet-ctl 3.127.0 → 3.127.2
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/package.json
CHANGED
package/scripts/label-map.mjs
CHANGED
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
// every call), and prints the map as JSON
|
|
38
38
|
// (exit 0, writing the cache only when it
|
|
39
39
|
// derived one), or the question payload as
|
|
40
|
-
// JSON (exit 3, nothing written)
|
|
40
|
+
// JSON (exit 3, nothing written): `certain`,
|
|
41
|
+
// `uncertain` and `tableFile`, the table's
|
|
42
|
+
// path under the checkout's top level, for
|
|
43
|
+
// the question to name. It never
|
|
41
44
|
// creates a label. Exit 1: the table breaks
|
|
42
45
|
// the string rules, the message naming each
|
|
43
46
|
// role, the rule and the fix. Exit 2: no
|
|
@@ -385,8 +388,9 @@ const squash = (text) => lc(text).replace(/[^\p{L}\p{N}]/gu, "");
|
|
|
385
388
|
* to it as it would to a table row. Pure: no file, no `gh`. One of
|
|
386
389
|
* { kind: "certain", roles, origin } every role certain, the map valid
|
|
387
390
|
* { kind: "break", faults: [{ role, rule, fix }] } the table or an answer breaks the string rules
|
|
388
|
-
* { kind: "uncertain", payload: { certain, uncertain }, roles, origin } the maintainer decides;
|
|
389
|
-
* `roles` and `origin` are the certain roles' and what settled them
|
|
391
|
+
* { kind: "uncertain", payload: { certain, uncertain, tableFile }, roles, origin } the maintainer decides;
|
|
392
|
+
* `roles` and `origin` are the certain roles' and what settled them;
|
|
393
|
+
* `tableFile` is TRIAGE_TABLE_FILE, so the question can name the file
|
|
390
394
|
*/
|
|
391
395
|
export function deriveLabelMap({ table, live, cache, answers = new Map() }) {
|
|
392
396
|
const exact = new Set(live);
|
|
@@ -563,7 +567,7 @@ export function deriveLabelMap({ table, live, cache, answers = new Map() }) {
|
|
|
563
567
|
if (dropped.has(role)) entry.claimedBy = dropped.get(role);
|
|
564
568
|
uncertain.push(entry);
|
|
565
569
|
}
|
|
566
|
-
if (uncertain.length) return { kind: "uncertain", payload: { certain, uncertain }, roles: certain, origin };
|
|
570
|
+
if (uncertain.length) return { kind: "uncertain", payload: { certain, uncertain, tableFile: TRIAGE_TABLE_FILE }, roles: certain, origin };
|
|
567
571
|
// Nothing above lets two certain roles share a string; this is the belt to
|
|
568
572
|
// that suspenders, the same rules the reader and the writer's caller hold.
|
|
569
573
|
const broken = labelStringFaults(certain);
|
|
@@ -21,7 +21,7 @@ Before the query, run the Label map derivation step:
|
|
|
21
21
|
~/.fleet/bin/fleet-run label-map.mjs ensure
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Exit 0 → the map is in place; go on. Exit 3 → it printed the question payload, a JSON object with `certain` and `
|
|
24
|
+
Exit 0 → the map is in place; go on. Exit 3 → it printed the question payload, a JSON object with `certain`, `uncertain` and `tableFile`, the path of the repository's triage-label table: render it to the maintainer as one question listing each uncertain role, its suggestion, why it is uncertain (a role declared in the table but not in the tracker names the payload's `tableFile`) and the alternatives, ending with "reply `defaults` to accept every suggestion, or name `<role>=<label>` for any you want otherwise — a role with no suggestion must be named; labels that do not exist are created on your confirmation". **Wait for the answer**, then run `~/.fleet/bin/fleet-run label-map.mjs set --create` with it — `--accept-suggestions` for `defaults`, plus each `<role>=<label>` the maintainer named — and run `ensure` again, which now exits 0. Tell the maintainer how to make the answer permanent: add or edit the row for the role in the file the payload's `tableFile` names, the role in the first cell and the string in the second; never write that table yourself. Exit 1 or 2 → show what it printed and stop; neither is a question.
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
~/.fleet/bin/fleet-run candidates.mjs --require-label ready-for-agent --allow-fallback
|
|
@@ -132,13 +132,16 @@ never asks.
|
|
|
132
132
|
stop. Neither is a question. Once the cause is fixed, run phase 0 again.
|
|
133
133
|
|
|
134
134
|
**Ask once, as one question, and wait.** The payload holds `certain`, the
|
|
135
|
-
roles already settled (role → string),
|
|
136
|
-
ask about: `{role, suggestion, origin, candidates, exists, was, claimedBy}
|
|
135
|
+
roles already settled (role → string), `uncertain`, one entry per role to
|
|
136
|
+
ask about: `{role, suggestion, origin, candidates, exists, was, claimedBy}`,
|
|
137
|
+
and `tableFile`, the path of the repository's triage-label table, the file
|
|
138
|
+
the reasons below name. It is the payload's string, read from the echoed
|
|
139
|
+
payload, never a path you spell yourself.
|
|
137
140
|
Put it to the maintainer as one question listing each uncertain role, its
|
|
138
141
|
suggestion, why, and the alternatives (`candidates`, the near matches the
|
|
139
142
|
tracker has). The why, by the entry:
|
|
140
143
|
|
|
141
|
-
- `origin` `table` — `declared in
|
|
144
|
+
- `origin` `table` — `declared in <tableFile> but not in the tracker`
|
|
142
145
|
- `origin` `near-match` — `near match in the tracker`
|
|
143
146
|
- `origin` `default`, `exists` true — `the default and a near match are both in the tracker`
|
|
144
147
|
- `origin` `default`, `exists` false — `nothing found — the default, to be created`
|
|
@@ -146,7 +149,7 @@ tracker has). The why, by the entry:
|
|
|
146
149
|
|
|
147
150
|
Any other entry carrying `was` takes the prefix `was <was> when cached, now
|
|
148
151
|
gone from the tracker; `, and one carrying `claimedBy` the prefix `your
|
|
149
|
-
earlier answer <string> is now <role>'s in
|
|
152
|
+
earlier answer <string> is now <role>'s in <tableFile>; `
|
|
150
153
|
when its `by` is `table`, `your earlier answer <string> is now <role>'s label
|
|
151
154
|
(its default); ` when it is `default`. End the question with: reply
|
|
152
155
|
`defaults` to accept every suggestion, or name `<role>=<label>` for any you
|
|
@@ -159,8 +162,8 @@ exist are created on your confirmation.
|
|
|
159
162
|
maintainer named. Exit 0 prints the map it wrote; exit 1 is a refusal naming
|
|
160
163
|
the role and the rule, nothing written and nothing created — put it to the
|
|
161
164
|
maintainer and ask again. In the same reply, tell the maintainer how to make
|
|
162
|
-
the answer permanent: add or edit the role's row in the
|
|
163
|
-
|
|
165
|
+
the answer permanent: add or edit the role's row in the file the payload's
|
|
166
|
+
`tableFile` names, the role in the first cell and the string in the
|
|
164
167
|
second. The plugin never writes that table, so neither do you. Then run
|
|
165
168
|
phase 0 again; `ensure` now exits 0. Exit 2 of `set` is no question: a pair
|
|
166
169
|
it could not read (an unknown role, a malformed pair, a role answered twice),
|