@letterstory/cli 0.177.14 → 0.177.15
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/lib/cli.mjs +4 -1
- package/lib/commands/admin.mjs +56 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
89
89
|
|
|
90
90
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
91
|
-
export const VERSION = "0.177.
|
|
91
|
+
export const VERSION = "0.177.15";
|
|
92
92
|
|
|
93
93
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
94
94
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -114,6 +114,9 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
114
114
|
"from-plan",
|
|
115
115
|
// domains plan: scores only, no model call.
|
|
116
116
|
"no-write",
|
|
117
|
+
// admin letterpress endings: no model reading; write the proposed eval cases locally.
|
|
118
|
+
"no-model",
|
|
119
|
+
"write-cases",
|
|
117
120
|
// build: a website or app of its own (deploy create's path). deploy create: hold until its build starts.
|
|
118
121
|
"new-site",
|
|
119
122
|
"wait",
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
// admin recipes list|show|runs|vocab|export|import|save|delete|refit … (recipes:read / recipes:write)
|
|
22
22
|
// admin letterpress companies | company <org-id> | facts <org-id> (the standing fit, per company)
|
|
23
23
|
// admin letterpress beyond [--limit N] [--before ISO] (what members asked that went past the library)
|
|
24
|
+
// admin letterpress endings [--days N] [--write-cases] (how turns and repo changes ended when not done, by owner)
|
|
24
25
|
// admin letterpress settings|flip|set … (recipes:read / recipes:write)
|
|
25
26
|
// admin demo guide|list|show|set|reset|check|ideas … (demo:read / demo:write)
|
|
26
27
|
// admin deployments [--health down|failing|blocked|setting_up|live|paused|archived] [--org <id>] [--q <text>] [--archived] [--test] [--no-host] (fleet:read)
|
|
@@ -5264,8 +5265,9 @@ const PULL_REQUESTS = "/api/superadmin/pull-requests";
|
|
|
5264
5265
|
const PLATFORM_USAGE = "/api/superadmin/usage/platform";
|
|
5265
5266
|
const BUILD_FAILURES = "/api/superadmin/build-failures";
|
|
5266
5267
|
const SUGGESTION_REVIEW = "/api/superadmin/suggestion-review";
|
|
5268
|
+
const TURN_ENDINGS = "/api/superadmin/turn-endings";
|
|
5267
5269
|
const ENGINE_USAGE =
|
|
5268
|
-
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--all-orgs] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
|
|
5270
|
+
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--all-orgs] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
|
|
5269
5271
|
|
|
5270
5272
|
/** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
|
|
5271
5273
|
function engineSettingsPatch(path, value) {
|
|
@@ -5354,6 +5356,26 @@ function engineSettingsText(r) {
|
|
|
5354
5356
|
].join("\n");
|
|
5355
5357
|
}
|
|
5356
5358
|
|
|
5359
|
+
/**
|
|
5360
|
+
* Writes list_turn_endings' proposed eval cases into evals/letterpress (or --dir). A case already there keeps its status
|
|
5361
|
+
* (a proposed case written again from the fixed library passes, and the gate says to flip it); only its inputs move.
|
|
5362
|
+
*/
|
|
5363
|
+
function writeEndingCases(cases, dir = "evals/letterpress") {
|
|
5364
|
+
const out = [];
|
|
5365
|
+
for (const { key, case: c } of cases ?? []) {
|
|
5366
|
+
const file = `${dir}/${key}.json`;
|
|
5367
|
+
let status = c.status;
|
|
5368
|
+
try {
|
|
5369
|
+
status = JSON.parse(readFileSync(file, "utf8")).status ?? status;
|
|
5370
|
+
} catch {
|
|
5371
|
+
// a new case
|
|
5372
|
+
}
|
|
5373
|
+
writeFileSync(file, `${JSON.stringify({ ...c, status }, null, "\t")}\n`);
|
|
5374
|
+
out.push(file);
|
|
5375
|
+
}
|
|
5376
|
+
return out;
|
|
5377
|
+
}
|
|
5378
|
+
|
|
5357
5379
|
/**
|
|
5358
5380
|
* `admin letterpress …` — what steers Letterpress beside the recipes (get_engine_settings,
|
|
5359
5381
|
* save_engine_settings): the one judgement's weights per ask and, per lens, its mode: off,
|
|
@@ -5459,6 +5481,39 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5459
5481
|
);
|
|
5460
5482
|
return 0;
|
|
5461
5483
|
}
|
|
5484
|
+
case "endings": {
|
|
5485
|
+
// list_turn_endings: how Letterpress's turns and repo changes ended when not done, clustered by owner
|
|
5486
|
+
// (docs/architecture/turn-endings.md). --write-cases writes the proposed eval cases here, never on the server.
|
|
5487
|
+
const q = new URLSearchParams();
|
|
5488
|
+
if (flags.since) q.set("since", String(flags.since));
|
|
5489
|
+
else q.set("days", String(flags.days ?? 1));
|
|
5490
|
+
if (flags.org) q.set("org_ids", String(flags.org));
|
|
5491
|
+
if (flagBool(flags["no-model"])) q.set("model", "0");
|
|
5492
|
+
if (flags.top) q.set("top", String(flags.top));
|
|
5493
|
+
const r = await staffRequest(ctx, "GET", `${TURN_ENDINGS}?${q}`);
|
|
5494
|
+
const written = flagBool(flags["write-cases"]) ? writeEndingCases(r.cases, flagStr(flags.dir)) : [];
|
|
5495
|
+
printResult(io, flags, r, (x) =>
|
|
5496
|
+
[
|
|
5497
|
+
`Since ${x.since}: ${x.endings} endings from ${x.turns} turns and ${x.runs} repo changes${x.model === "used" ? "" : ` (model ${x.model}: code's rules only)`}`,
|
|
5498
|
+
...x.clusters.map((c) =>
|
|
5499
|
+
[
|
|
5500
|
+
`${String(c.count).padStart(3)} ${(c.owner ?? "unplaced").padEnd(7)} ${c.by.padEnd(5)} ${c.recipe ? c.recipe.name : (c.kind ?? "")}: ${c.why}`,
|
|
5501
|
+
...(c.line ? [` line: ${c.line}`] : []),
|
|
5502
|
+
` e.g. ${c.examples.map((e) => e.build_id ?? `run ${e.run_id}`).join(", ")}`,
|
|
5503
|
+
].join("\n")
|
|
5504
|
+
),
|
|
5505
|
+
...(x.cases.length
|
|
5506
|
+
? [
|
|
5507
|
+
"",
|
|
5508
|
+
written.length
|
|
5509
|
+
? `Wrote ${written.length} proposed case${written.length === 1 ? "" : "s"}: ${written.join(", ")}`
|
|
5510
|
+
: `${x.cases.length} proposed case${x.cases.length === 1 ? "" : "s"} (--write-cases writes them): ${x.cases.map((c) => c.key).join(", ")}`,
|
|
5511
|
+
]
|
|
5512
|
+
: []),
|
|
5513
|
+
].join("\n")
|
|
5514
|
+
);
|
|
5515
|
+
return 0;
|
|
5516
|
+
}
|
|
5462
5517
|
case "unblock": {
|
|
5463
5518
|
// clear_blocker: "Show anyway" on one withheld item.
|
|
5464
5519
|
const [orgId, host, subject] = positionals.slice(1);
|