@stage5/lumine 0.2.26 → 0.2.27

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/admin.js CHANGED
@@ -12,6 +12,11 @@ const MAX_COMPOSED_COMMENT_LENGTH = 10_000;
12
12
  // its model and no AI Energy is spent.
13
13
  function readComposedCommentFile(filePath) {
14
14
  const normalizedPath = String(filePath || "").trim();
15
+ if (!normalizedPath) {
16
+ throw cliValidationError(
17
+ "Pass composed comment text with --file <comment.md>.",
18
+ );
19
+ }
15
20
  let contents;
16
21
  try {
17
22
  contents = readFileSync(normalizedPath, "utf8");
@@ -638,6 +643,30 @@ export function parseAdminOperation(options) {
638
643
  },
639
644
  );
640
645
  }
646
+ if (action === "edit") {
647
+ const rawTarget = String(target || "").trim();
648
+ let commentId;
649
+ if (/^\d+$/.test(rawTarget)) {
650
+ commentId = parseRequiredInteger(rawTarget, "comment id", 1);
651
+ } else {
652
+ const parsedTarget = parseRecommendationTarget({
653
+ target,
654
+ explicitType: options.adminType,
655
+ });
656
+ if (parsedTarget.type !== "comment") {
657
+ throw cliValidationError(
658
+ "comment edit targets a comment: lumine admin comment edit <commentId> --file <comment.md>.",
659
+ );
660
+ }
661
+ commentId = parsedTarget.id;
662
+ }
663
+ return writeOperation(
664
+ "comment.edit",
665
+ "PUT",
666
+ `/cli/admin/comments/${commentId}`,
667
+ { content: readComposedCommentFile(options.adminFile) },
668
+ );
669
+ }
641
670
  if (action === "post") {
642
671
  const draftId = parseRequiredInteger(
643
672
  options.draftId || target,
package/lib/commands.js CHANGED
@@ -2526,6 +2526,7 @@ export function printHelp() {
2526
2526
  lumine admin comment draft <target> [--type subject|comment|aiStory|dailyReflection] [--identity zero|ciel|auto] [--json]
2527
2527
  lumine admin comment reply comment:<id> [--identity zero|ciel|auto] [--json]
2528
2528
  lumine admin comment post --draft-id <id> [--json]
2529
+ lumine admin comment edit <comment-id> --file <comment.md> [--json]
2529
2530
  lumine admin brief [--days <1..30>] [--json]
2530
2531
  lumine admin audit [list] [--run current|last|<run-id>] [--target <target>] [--actions <a,b>] [--full] [--cursor <cursor>] [--json]
2531
2532
 
@@ -2607,6 +2608,7 @@ Options:
2607
2608
  --reward-twinkles 3 Pair a recommendation with exactly 3 Twinkles
2608
2609
  --twinkles 3 Give exactly 3 Twinkles through the normal economy
2609
2610
  --draft-id <id> Canonical delegated comment draft ID
2611
+ --file <path> Editorial JSON or composed comment text file
2610
2612
  --reason <text> Reason when marking an admin run failed
2611
2613
  --force Overwrite server files even if this workspace is stale or missing filesHash
2612
2614
  --search <text> Search public open-source Builds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stage5/lumine",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "Command line tools for launching Lumine builds on Twinkle.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1062,10 +1062,11 @@ Four sections (Mikey's chosen cut, 2026-08-10):
1062
1062
  - `aiSpending` — a compact projection of the management AI-cost report:
1063
1063
  `summary`, top spending accounts, top risk groups. Unlike the other sections'
1064
1064
  exact `window.sinceTs`, this existing report is bucketed into whole UTC days;
1065
- `aiSpending.days` includes today and may begin up to one day before the exact
1066
- brief window. Flag accounts that jumped tiers or dominate that report period.
1067
- May be `{ unavailable: true }` if the cost report fails; say so rather than
1068
- guessing.
1065
+ `aiSpending.startDayIndex` and `endDayIndex` are its canonical bounds. The
1066
+ report period can begin up to one day before or after the exact brief window,
1067
+ so use those bounds when describing it. Flag accounts that jumped tiers or
1068
+ dominate that report period. May be `{ unavailable: true }` if the cost
1069
+ report fails; say so rather than guessing.
1069
1070
  - `notableCandidates` — kids (never bots, staff `userType`s, or users already
1070
1071
  on the Notable Users list) ranked by authored activity in the window, with
1071
1072
  `isNewUser` marking window-new signups. Use it to find the overlooked and
@@ -1138,6 +1139,8 @@ type InsightsBrief = Success<{
1138
1139
  aiSpending:
1139
1140
  | {
1140
1141
  days: number;
1142
+ startDayIndex: number;
1143
+ endDayIndex: number;
1141
1144
  summary: unknown;
1142
1145
  topAccounts: unknown[];
1143
1146
  topRiskGroups: unknown[];
@@ -1146,6 +1149,24 @@ type InsightsBrief = Success<{
1146
1149
  }>;
1147
1150
  ```
1148
1151
 
1152
+ **Editing the bot's own comments.** `comment edit <commentId> --file
1153
+ <comment.md>` replaces the text of a comment the ACTING bot itself authored —
1154
+ for correcting a factual error, an unfulfillable claim, or outdated guidance
1155
+ in Zero/Ciel's own words. It is deliberately not a moderation verb: comments
1156
+ by the other bot, by any human, and hidden notification records are all
1157
+ rejected (`CLI_ADMIN_EDIT_NOT_OWN_COMMENT`,
1158
+ `CLI_ADMIN_EDIT_NOTIFICATION_COMMENT`). The replacement text follows the
1159
+ composed-comment rules (plain UTF-8, 10,000-character limit, truth about what
1160
+ the session actually did) and publishes through the website's canonical
1161
+ comment-edit pipeline — mentions are reprocessed (a newly added `@mikey`
1162
+ notifies him), and Earn-candidate projections resync. Submitting identical
1163
+ text returns `already_done`. Requires the `comment:post` scope of a
1164
+ comment-mode `post` run, and is audited as `comment.edit` with the previous
1165
+ content in `beforeState` and `data.edit.previousContent`. Edit sparingly:
1166
+ kids may have already read the original, so a comment that changed meaning
1167
+ (not just wording) usually deserves a follow-up reply instead of a silent
1168
+ rewrite.
1169
+
1149
1170
  ## Audit history
1150
1171
 
1151
1172
  ```bash
@@ -1216,6 +1237,9 @@ lumine admin comment reply comment:456 --json
1216
1237
 
1217
1238
  lumine admin comment post --draft-id 77 \
1218
1239
  --idempotency-key comment-123-post-v1 --json
1240
+
1241
+ # Correct the acting bot's OWN published comment.
1242
+ lumine admin comment edit 342752 --file corrected.md --json
1219
1243
  ```
1220
1244
 
1221
1245
  **Compose in persona by default (Mikey's standing direction, 2026-08-10).**
@@ -1237,6 +1261,24 @@ from memory:
1237
1261
  decisions are yours to make and record with `post skip` or in the run
1238
1262
  report).
1239
1263
 
1264
+ **Lumine Build app posts are composed-only, and only after actually looking
1265
+ (Mikey's direction, 2026-08-10).** When a post is about a Build app — the
1266
+ author shares their app, announces an update, or asks for feedback on their
1267
+ build — never use the server-generated draft path: the API persona cannot
1268
+ open an app, so its drafts either stay generic or fabricate first-hand
1269
+ experience (a real Ciel draft claimed "I clicked over to check it out" on an
1270
+ app nobody had opened). The day's management agent comments instead, and
1271
+ looks first: pull the project with lumine-cli when it is open source (or
1272
+ yours to pull) and read the code, or open the app and actually try it; then
1273
+ compose a comment whose specifics come from what you genuinely saw — a
1274
+ mechanic you liked, a nice touch in their code, a concrete suggestion. Be
1275
+ truthful about what you did: "I read through your code" and "I played a few
1276
+ rounds" are different claims, and a comment must only make the one that
1277
+ happened. If you could not access the app at all, say nothing about having
1278
+ tried it — ask the author about it instead. This is the standing rule for
1279
+ every composed comment, applied to apps: never claim an experience the
1280
+ session did not actually have.
1281
+
1240
1282
  A composed draft (`--file`, plain UTF-8 text, at most the website's 10,000
1241
1283
  character comment limit) flows through the identical draft lifecycle —
1242
1284
  reservation, idempotency, context-revision CAS, publish fencing, audit