@theholocron/cli 5.0.0-alpha.578 → 5.0.0-alpha.579

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/README.md CHANGED
@@ -789,7 +789,8 @@ See the [command pages](https://theholocron.dev/holocron/commands/setup-notifica
789
789
  provider (`providers.ideas: ["obsidian", { dir }]`, an Obsidian vault; `HOLOCRON_IDEAS_DIR` overrides `dir`; the older
790
790
  `ideas.dir` is deprecated and read as that entry when `providers.ideas` is absent) and, for each one whose status is
791
791
  the filing state (`ideas.states.file`, default `in-progress`) with no issue, creates an issue through the `issues`
792
- provider (title the first `#` heading, body the note plus `Filed from idea: <title>`) and records it with
792
+ provider (title the first `#` heading as a Conventional Commits title, `type(scope): text`, from the note's optional `type:` and
793
+ `scope:` properties, default `feat`; body the note plus a footer with the note's path, the date filed and `Filed from idea: <title>`) and records it with
793
794
  `Ideas.markFiled` (an `issue:` property, for Obsidian). Ideas with attachments are skipped. It never deletes, asks first
794
795
  unless `--dry-run` or `--yes`, and a second run changes nothing.
795
796
  - **`holocron new spec <issue> [--name <topic>] [--dry-run] [--yes]`** — the spec-time step: reads the issue through the
package/dist/cli.mjs CHANGED
@@ -20150,8 +20150,9 @@ async function matrixPlaces(input) {
20150
20150
  const syncEntries = config.repo?.secrets?.sync ?? [];
20151
20151
  const deployEntries = config.repo?.secrets?.deploy ?? [];
20152
20152
  const variableEntries = config.repo?.variables?.sync ?? [];
20153
+ const feeders = [...deployEntries, ...input.workspaceDeploy ?? []];
20153
20154
  const sentTo = (environment, present) => {
20154
- const filter = deployFilter(deployEntries, environment);
20155
+ const filter = deployFilter(feeders, environment);
20155
20156
  return filter ? splitDeployKeys(present, filter).send : [];
20156
20157
  };
20157
20158
  const names = /* @__PURE__ */ new Map();
@@ -20236,7 +20237,7 @@ async function matrixPlaces(input) {
20236
20237
  environment
20237
20238
  });
20238
20239
  }
20239
- for (const entry of deployEntries) {
20240
+ for (const entry of feeders) {
20240
20241
  const environment = resolvedEnvironment(entry);
20241
20242
  envs.set(`secret:${environment}`, {
20242
20243
  kind: "secret",
@@ -20311,6 +20312,64 @@ async function matrixPlaces(input) {
20311
20312
  }
20312
20313
  return places;
20313
20314
  }
20315
+ // src/commands/doctor-secrets/matrix-headings.ts
20316
+ const SHORT_GROUPS = {
20317
+ "1Password": "1P",
20318
+ GitHub: "GH"
20319
+ };
20320
+ const ENV_PREFIX = "env ";
20321
+ /**
20322
+ * A column's full heading: its group and its label, such as `GitHub env sentinel-production`.
20323
+ *
20324
+ * @param column - The column.
20325
+ */
20326
+ function fullHeading(column) {
20327
+ return `${column.group} ${column.label}`;
20328
+ }
20329
+ function isEnvironment(column) {
20330
+ return column.group === "GitHub" && column.label.startsWith(ENV_PREFIX);
20331
+ }
20332
+ function shortHeading(column) {
20333
+ if (isEnvironment(column)) return column.label.slice(4);
20334
+ return `${SHORT_GROUPS[column.group] ?? column.group} ${column.label}`;
20335
+ }
20336
+ /**
20337
+ * The short headings of a block's columns, with the legend lines that define every abbreviation or bare name used:
20338
+ * `1Password` is `1P`, `GitHub` is `GH`, and a GitHub environment's column is headed by the environment's name alone.
20339
+ * Any other group keeps its full heading. Returns nothing when two short headings would be the same, because a heading
20340
+ * must name exactly one place.
20341
+ *
20342
+ * @param columns - The block's columns.
20343
+ */
20344
+ function shortHeadings(columns) {
20345
+ const headings = columns.map(shortHeading);
20346
+ if (new Set(headings).size !== headings.length) return void 0;
20347
+ const legend = /* @__PURE__ */ new Set();
20348
+ for (const column of columns) if (isEnvironment(column)) legend.add(`${shortHeading(column)} GitHub environment ${shortHeading(column)}`);
20349
+ else if (column.group in SHORT_GROUPS) legend.add(`${SHORT_GROUPS[column.group]} ${column.group}`);
20350
+ return {
20351
+ headings,
20352
+ legend: [...legend]
20353
+ };
20354
+ }
20355
+ // src/commands/doctor-secrets/matrix-trim.ts
20356
+ /**
20357
+ * Leaves out of one block what says nothing: a place column whose every cell is `n/a` and a row whose every cell is
20358
+ * `n/a`. Nothing is hidden that a failing or `extra` cell could show, because only `n/a` is left out.
20359
+ *
20360
+ * @param rows - The block's rows.
20361
+ * @param columns - The block's columns.
20362
+ */
20363
+ function trimBlock(rows, columns) {
20364
+ const keptColumns = columns.filter((column) => rows.some((row) => row.cells[column.id] !== "n/a"));
20365
+ const keptRows = rows.filter((row) => columns.some((column) => row.cells[column.id] !== "n/a"));
20366
+ return {
20367
+ rows: keptRows,
20368
+ columns: keptColumns,
20369
+ leftOutNames: rows.length - keptRows.length,
20370
+ leftOutColumns: columns.filter((column) => !keptColumns.includes(column))
20371
+ };
20372
+ }
20314
20373
  // src/commands/doctor-secrets/matrix-render.ts
20315
20374
  /** What each cell word means. Printed under the matrix every time, one meaning per line. */
20316
20375
  const MATRIX_LEGEND = [
@@ -20320,30 +20379,80 @@ const MATRIX_LEGEND = [
20320
20379
  "extra found here, but nothing feeds it",
20321
20380
  "? could not read this place"
20322
20381
  ];
20323
- const heading = (column) => `${column.group} ${column.label}`;
20324
20382
  function pad(text, width) {
20325
20383
  return text + " ".repeat(Math.max(0, width - text.length));
20326
20384
  }
20327
- /** The block as a table: one line per name, one column per place. */
20328
- function table(name, rows, columns) {
20385
+ /** The block as a table: one line per name, one column per place, headed by `headings`. */
20386
+ function table(name, rows, columns, headings) {
20329
20387
  const nameWidth = Math.max(name.length, ...rows.map((row) => row.name.length));
20330
- const widths = columns.map((column) => Math.max(heading(column).length, ...rows.map((row) => row.cells[column.id].length)));
20388
+ const widths = columns.map((column, i) => Math.max(headings[i].length, ...rows.map((row) => row.cells[column.id].length)));
20331
20389
  const line = (first, cells) => [pad(first, nameWidth), ...cells.map((cell, i) => pad(cell, widths[i]))].join(" ").trimEnd();
20332
- return [line(name, columns.map((column) => heading(column))), ...rows.map((row) => line(row.name, columns.map((column) => row.cells[column.id])))];
20390
+ return [line(name, headings), ...rows.map((row) => line(row.name, columns.map((column) => row.cells[column.id])))];
20333
20391
  }
20334
20392
  /** The block turned on its side: one short paragraph per name, for a terminal too narrow for the table. */
20335
20393
  function stacked(rows, columns) {
20336
- return rows.flatMap((row) => [row.name, ...columns.map((column) => ` ${heading(column)}: ${row.cells[column.id]}`)]);
20394
+ return rows.flatMap((row) => [row.name, ...columns.map((column) => ` ${fullHeading(column)}: ${row.cells[column.id]}`)]);
20395
+ }
20396
+ const widest = (lines) => Math.max(...lines.map((l) => l.length));
20397
+ /** The closing line of a block that left rows or columns out, saying how to find them again. */
20398
+ function leftOutLine(trimmed) {
20399
+ const parts = [];
20400
+ if (trimmed.leftOutNames > 0) parts.push(`${trimmed.leftOutNames} ${trimmed.leftOutNames === 1 ? "name" : "names"}`);
20401
+ if (trimmed.leftOutColumns.length > 0) parts.push(`${trimmed.leftOutColumns.length === 1 ? "1 place" : `${trimmed.leftOutColumns.length} places`} (${trimmed.leftOutColumns.map(fullHeading).join(", ")})`);
20402
+ return ` (left out, n/a everywhere: ${parts.join(" and ")}; --name <name> says how each place stands)`;
20337
20403
  }
20338
- function block(title, noun, rows, columns, width) {
20339
- if (rows.length === 0) return [title, ` (no ${noun} declared or found)`];
20340
- const wide = table("name", rows, columns);
20341
- return [title, ...Math.max(...wide.map((l) => l.length)) <= width ? wide : stacked(rows, columns)];
20404
+ /**
20405
+ * One block: the full-heading table when it fits, else the table with short headings (whose legend lines come back for
20406
+ * the legend), else the block on its side.
20407
+ */
20408
+ function block(title, noun, allRows, allColumns, width) {
20409
+ if (allRows.length === 0) return {
20410
+ lines: [title, ` (no ${noun} declared or found)`],
20411
+ legend: []
20412
+ };
20413
+ const trimmed = trimBlock(allRows, allColumns);
20414
+ const { rows, columns } = trimmed;
20415
+ const closing = trimmed.leftOutNames + trimmed.leftOutColumns.length > 0 ? [leftOutLine(trimmed)] : [];
20416
+ if (rows.length === 0) return {
20417
+ lines: [title, ...closing],
20418
+ legend: []
20419
+ };
20420
+ const full = table("name", rows, columns, columns.map(fullHeading));
20421
+ if (widest(full) <= width) return {
20422
+ lines: [
20423
+ title,
20424
+ ...full,
20425
+ ...closing
20426
+ ],
20427
+ legend: []
20428
+ };
20429
+ const short = shortHeadings(columns);
20430
+ if (short !== void 0) {
20431
+ const compact = table("name", rows, columns, short.headings);
20432
+ if (widest(compact) <= width) return {
20433
+ lines: [
20434
+ title,
20435
+ ...compact,
20436
+ ...closing
20437
+ ],
20438
+ legend: short.legend
20439
+ };
20440
+ }
20441
+ return {
20442
+ lines: [
20443
+ title,
20444
+ ...stacked(rows, columns),
20445
+ ...closing
20446
+ ],
20447
+ legend: []
20448
+ };
20342
20449
  }
20343
20450
  /**
20344
20451
  * Lays the matrix out as text: a heading and a block for the secrets, the same for the variables, then the legend.
20345
20452
  * The cells are words, not symbols or colour, so a pipe or a log reads the same. When the table would pass `width`
20346
- * columns it is turned on its side (one paragraph per name) instead of wrapping mid-row.
20453
+ * columns the headings are shortened (the legend then defines them), and when it still does not fit it is turned on its
20454
+ * side (one paragraph per name) instead of wrapping mid-row. Rows and columns that are `n/a` everywhere are left out
20455
+ * and counted in a closing line.
20347
20456
  *
20348
20457
  * @param matrix - The matrix.
20349
20458
  * @param width - The terminal's width in columns.
@@ -20351,9 +20460,20 @@ function block(title, noun, rows, columns, width) {
20351
20460
  */
20352
20461
  function renderMatrix(matrix, width, only) {
20353
20462
  const out = [];
20354
- if (only !== "variables") out.push(...block("Secrets", "secrets", matrix.secrets, matrix.columns.secret, width), "");
20355
- if (only !== "secrets") out.push(...block("Variables", "variables", matrix.variables, matrix.columns.variable, width), "");
20463
+ const legend = [];
20464
+ if (only !== "variables") {
20465
+ const secrets = block("Secrets", "secrets", matrix.secrets, matrix.columns.secret, width);
20466
+ out.push(...secrets.lines, "");
20467
+ legend.push(...secrets.legend);
20468
+ }
20469
+ if (only !== "secrets") {
20470
+ const variables = block("Variables", "variables", matrix.variables, matrix.columns.variable, width);
20471
+ out.push(...variables.lines, "");
20472
+ legend.push(...variables.legend);
20473
+ }
20356
20474
  out.push("Legend", ...MATRIX_LEGEND.map((line) => ` ${line}`));
20475
+ const headings = [...new Set(legend)];
20476
+ if (headings.length > 0) out.push("", "Headings", ...headings.map((line) => ` ${line}`));
20357
20477
  return out;
20358
20478
  }
20359
20479
  // src/commands/doctor-secrets/matrix-rows.ts
@@ -21007,6 +21127,30 @@ async function checkToken(token, module, env, readToken, now) {
21007
21127
  return row$21(keyringKey, "fail", `could not be verified (${from}): ${errorMessage(err)}`);
21008
21128
  }
21009
21129
  }
21130
+ // src/commands/doctor-secrets/workspace-deploy-entries.ts
21131
+ /**
21132
+ * The `repo.secrets.deploy` entries of every workspace package, which feed names the root config does not list (Sentinel's
21133
+ * and Comlink's lists for `prod` and `preview`). A package whose config cannot be read is one skipped row naming it, never
21134
+ * a failure. Names only; nothing is written.
21135
+ *
21136
+ * @param repoRoot - The repository root.
21137
+ * @param read - Reads the packages' configs. Defaults to `readWorkspaceConfigs()`; tests pass a fake.
21138
+ */
21139
+ async function workspaceDeployEntries(repoRoot, read = readWorkspaceConfigs) {
21140
+ const result = {
21141
+ entries: [],
21142
+ rows: []
21143
+ };
21144
+ for (const pkg of await read(repoRoot)) if ("error" in pkg) result.rows.push({
21145
+ id: `workspace-deploy:${pkg.path}`,
21146
+ title: `${pkg.path} deploy list`,
21147
+ status: "skip",
21148
+ detail: `could not read its config, so the names its repo.secrets.deploy feeds are not counted: ${pkg.error}`,
21149
+ problems: []
21150
+ });
21151
+ else result.entries.push(...pkg.resolved.repo?.secrets?.deploy ?? []);
21152
+ return result;
21153
+ }
21010
21154
  // src/commands/doctor-secrets/doctor-secrets.ts
21011
21155
  /**
21012
21156
  * `holocron doctor secrets` — do the secrets the config says must exist, exist?
@@ -21082,14 +21226,19 @@ async function runDoctorSecrets(input) {
21082
21226
  detail: "none declared",
21083
21227
  problems: []
21084
21228
  });
21085
- rows.push(...ci.rows, ...variables.rows, ...skipRow("test"), ...deployRows);
21229
+ const workspace = withSecrets && (wants("prod") || wants("preview")) ? await workspaceDeployEntries(input.context.repoRoot, input.workspaceConfigs) : {
21230
+ entries: [],
21231
+ rows: []
21232
+ };
21233
+ rows.push(...ci.rows, ...variables.rows, ...skipRow("test"), ...deployRows, ...workspace.rows);
21086
21234
  places.push(...await matrixPlaces({
21087
21235
  config,
21088
21236
  vault,
21089
21237
  secrets: ci.observations,
21090
21238
  variables: variables.observations,
21091
21239
  org,
21092
- wants
21240
+ wants,
21241
+ workspaceDeploy: workspace.entries
21093
21242
  }));
21094
21243
  } else rows.push(...skipRow("test"));
21095
21244
  if (!input.shared) rows.push(...skipRow("preview"), ...skipRow("agent"));
@@ -33726,7 +33875,7 @@ const CATALOG_SECTIONS = [
33726
33875
  /** Catalogs that are not a group's own dependencies. */
33727
33876
  const SPECIAL_CATALOGS = ["peers"];
33728
33877
  /** The scope of this org's own packages. */
33729
- const SCOPE = "@theholocron/";
33878
+ const SCOPE$1 = "@theholocron/";
33730
33879
  // src/commands/probe/deps/group-of.ts
33731
33880
  /** The group of a workspace folder: its top-level directory, or `root`. */
33732
33881
  function groupOf(dir) {
@@ -33869,7 +34018,7 @@ function planDeps(root) {
33869
34018
  const wanted = {};
33870
34019
  const rows = [];
33871
34020
  for (const entry of [...byName.values()].sort((a, b) => a.name.localeCompare(b.name))) {
33872
- const isScoped = entry.name.startsWith(SCOPE);
34021
+ const isScoped = entry.name.startsWith(SCOPE$1);
33873
34022
  const nonPeer = entry.edges.filter((e) => e.section !== "peerDependencies");
33874
34023
  const peers = entry.edges.filter((e) => e.section === "peerDependencies");
33875
34024
  let target;
@@ -33932,7 +34081,7 @@ function detail(p, filter) {
33932
34081
  const rows = p.rows.filter((r) => r.name.includes(filter));
33933
34082
  if (rows.length === 0) return `No dependency matches "${filter}".\n`;
33934
34083
  const lines = [];
33935
- const short = (pkg) => pkg.replace(SCOPE, "");
34084
+ const short = (pkg) => pkg.replace(SCOPE$1, "");
33936
34085
  for (const r of rows) {
33937
34086
  const where = r.catalog === null ? "peer ranges only (not in a catalog)" : r.catalog === "default" ? "catalog: (default)" : `catalog:${r.catalog}`;
33938
34087
  lines.push(`### ${r.name}${r.range ? ` ${r.range}` : ""} (${where})`, "");
@@ -39123,6 +39272,73 @@ async function convergeCreatedIssue(issues, marker, created) {
39123
39272
  detail: `filed as ${winner} (closed duplicate ${created} from an overlapping run)`
39124
39273
  };
39125
39274
  }
39275
+ // src/commands/ideas-sync/run-ideas-sync/issue-body/issue-body.ts
39276
+ /**
39277
+ * The hidden line that ties an issue to its note. A later run looks for it before it creates an issue, so a note whose
39278
+ * `issue:` could not be written is not filed twice.
39279
+ */
39280
+ const ideaMarker = (key) => `<!-- holocron:idea ${key} -->`;
39281
+ /**
39282
+ * The issue's body: the idea's text, a footer saying it came from Obsidian (the vault's name when the provider knows
39283
+ * it, the note's path inside the ideas folder and the day it was filed, never a folder's own path), the line that
39284
+ * traces the issue to its idea, and the hidden marker, which stays last.
39285
+ */
39286
+ function issueBody(idea, filedOn) {
39287
+ const vault = idea.vault === void 0 ? "" : `vault \`${idea.vault}\`, `;
39288
+ return [
39289
+ idea.body.trim(),
39290
+ "",
39291
+ "---",
39292
+ `Filed from Obsidian: ${vault}note \`${idea.key}\`, ${filedOn}`,
39293
+ "",
39294
+ `Filed from idea: ${idea.title}`,
39295
+ ideaMarker(idea.key)
39296
+ ].join("\n");
39297
+ }
39298
+ // src/commands/ideas-sync/run-ideas-sync/issue-title/issue-title.ts
39299
+ /** The Conventional Commits types a note's `type:` may name. */
39300
+ const CONVENTIONAL_TYPES = [
39301
+ "feat",
39302
+ "fix",
39303
+ "docs",
39304
+ "style",
39305
+ "refactor",
39306
+ "perf",
39307
+ "test",
39308
+ "build",
39309
+ "ci",
39310
+ "chore",
39311
+ "revert"
39312
+ ];
39313
+ /** The type used when a note names none. */
39314
+ const DEFAULT_TYPE = "feat";
39315
+ const PREFIXED = new RegExp(`^(${CONVENTIONAL_TYPES.join("|")})(\\([^()\\s]+\\))?!?:\\s`);
39316
+ const SCOPE = /^[a-z0-9][a-z0-9._/-]*$/i;
39317
+ /**
39318
+ * The issue title for an idea: its heading as a Conventional Commits title, `type(scope): text`. The type and scope are
39319
+ * the note's `type:` and `scope:` properties (default type `feat`, no scope). A heading that already starts with a
39320
+ * conventional prefix is left as it is. An unknown `type:` (or a `scope:` with characters a scope cannot hold) is a
39321
+ * problem, so the note is not filed.
39322
+ */
39323
+ function issueTitle(idea) {
39324
+ const type = idea.type ?? DEFAULT_TYPE;
39325
+ if (!CONVENTIONAL_TYPES.includes(type)) return {
39326
+ ok: false,
39327
+ problem: `unknown \`type: ${type}\`; use one of ${CONVENTIONAL_TYPES.join(", ")}. Nothing was filed`
39328
+ };
39329
+ if (idea.scope !== void 0 && !SCOPE.test(idea.scope)) return {
39330
+ ok: false,
39331
+ problem: `\`scope: ${idea.scope}\` is not a scope (letters, digits, \`.\`, \`_\`, \`/\` and \`-\`). Nothing was filed`
39332
+ };
39333
+ if (PREFIXED.test(idea.title)) return {
39334
+ ok: true,
39335
+ title: idea.title
39336
+ };
39337
+ return {
39338
+ ok: true,
39339
+ title: `${type}${idea.scope === void 0 ? "" : `(${idea.scope})`}: ${idea.title}`
39340
+ };
39341
+ }
39126
39342
  // src/commands/ideas-sync/run-ideas-sync/run-ideas-sync.ts
39127
39343
  /**
39128
39344
  * `holocron sync ideas` — files the idea notes that are ready.
@@ -39131,7 +39347,9 @@ async function convergeCreatedIssue(issues, marker, created) {
39131
39347
  * Obsidian plugin skips folders whose name starts with `_` or `.`). An idea whose status is the filing state (default
39132
39348
  * `in-progress`) and that has no issue becomes an issue through the repo's `issues` provider, and the issue is then
39133
39349
  * recorded with `Ideas.markFiled` (for Obsidian, an `issue:` property in the tracker's own syntax), which is what makes
39134
- * the step run once. An idea with attachments is reported and skipped, since an issue body cannot carry them. Only
39350
+ * the step run once. The issue's title is the note's heading as a Conventional Commits title (`type(scope): text`, from the
39351
+ * note's `type:` and `scope:` properties, default `feat`; a heading with a prefix is kept, an unknown `type:` is a failing
39352
+ * row), and its body ends with a footer naming the note's path and the day it was filed. An idea with attachments is reported and skipped, since an issue body cannot carry them. Only
39135
39353
  * ideas to be filed, and ideas that need the person's attention, get a row; the rest are counted. The issue body ends
39136
39354
  * with a hidden `<!-- holocron:idea <key> -->` line, and an issue that carries it is reused instead of making a second
39137
39355
  * one (found with one `Issues.search({ text })` per note about to be filed, confirmed by the exact marker in the body;
@@ -39150,13 +39368,6 @@ const row$3 = (id, status, detail) => ({
39150
39368
  detail,
39151
39369
  problems: []
39152
39370
  });
39153
- /**
39154
- * The hidden line that ties an issue to its note. A later run looks for it before it creates an issue, so a note whose
39155
- * `issue:` could not be written is not filed twice.
39156
- */
39157
- const marker = (key) => `<!-- holocron:idea ${key} -->`;
39158
- /** The issue's body: the idea's text, the line that traces the issue to its idea, and the hidden marker. */
39159
- const issueBody = (idea) => `${idea.body.trim()}\n\nFiled from idea: ${idea.title}\n${marker(idea.key)}`;
39160
39371
  async function runIdeasSync(input) {
39161
39372
  /* v8 ignore next -- the console is only used outside tests, which inject `print` */
39162
39373
  const print = input.print ?? ((line) => console.log(line));
@@ -39198,13 +39409,20 @@ async function runIdeasSync(input) {
39198
39409
  const fileState = input.loaded.resolved.ideas?.states?.file ?? DEFAULT_FILING_STATE;
39199
39410
  const rows = [];
39200
39411
  const ready = [];
39412
+ const titles = /* @__PURE__ */ new Map();
39201
39413
  for (const idea of records) if (idea.error !== void 0) rows.push(row$3(idea.key, "fail", idea.error));
39202
39414
  else if (idea.status !== fileState || idea.issue !== void 0) notReady++;
39203
39415
  else if (idea.attachments.length > 0) rows.push(row$3(idea.key, "skip", `has embedded files an issue cannot carry (${idea.attachments.join(", ")}); not filed`));
39204
- else ready.push(idea);
39416
+ else {
39417
+ const title = issueTitle(idea);
39418
+ if (title.ok) {
39419
+ titles.set(idea.key, title.title);
39420
+ ready.push(idea);
39421
+ } else rows.push(row$3(idea.key, "fail", title.problem));
39422
+ }
39205
39423
  if (ready.length === 0) return finish(rows);
39206
39424
  if (dryRun) {
39207
- for (const idea of ready) rows.push(row$3(idea.key, "skip", `would file "${idea.title}"`));
39425
+ for (const idea of ready) rows.push(row$3(idea.key, "skip", `would file "${titles.get(idea.key)}"`));
39208
39426
  return finish(rows.sort((a, b) => a.id.localeCompare(b.id)));
39209
39427
  }
39210
39428
  if (!input.yes) {
@@ -39225,6 +39443,7 @@ async function runIdeasSync(input) {
39225
39443
  await loader.load();
39226
39444
  assertPluginsResolvable(loader, "sync ideas");
39227
39445
  const issues = loader.has("issues") ? loader.get("issues") : void 0;
39446
+ const filedOn = (input.now?.() ?? /* @__PURE__ */ new Date()).toISOString().slice(0, 10);
39228
39447
  for (const idea of ready) {
39229
39448
  const path = idea.key;
39230
39449
  if (!issues) {
@@ -39234,9 +39453,9 @@ async function runIdeasSync(input) {
39234
39453
  let existing;
39235
39454
  try {
39236
39455
  existing = pickCanonicalIssue((await issues.search({
39237
- text: marker(path),
39456
+ text: ideaMarker(path),
39238
39457
  limit: 100
39239
- })).filter((issue) => issue.body?.includes(marker(path))));
39458
+ })).filter((issue) => issue.body?.includes(ideaMarker(path))));
39240
39459
  } catch (err) {
39241
39460
  rows.push(row$3(path, "fail", `could not check for an existing issue, so none was created: ${describeError(err)}`));
39242
39461
  continue;
@@ -39249,14 +39468,14 @@ async function runIdeasSync(input) {
39249
39468
  let created;
39250
39469
  try {
39251
39470
  ({key: created} = await issues.create({
39252
- summary: idea.title,
39253
- body: issueBody(idea)
39471
+ summary: titles.get(path),
39472
+ body: issueBody(idea, filedOn)
39254
39473
  }));
39255
39474
  } catch (err) {
39256
39475
  rows.push(row$3(path, "fail", `could not create the issue: ${describeError(err)}`));
39257
39476
  continue;
39258
39477
  }
39259
- ({key, detail, warning} = await convergeCreatedIssue(issues, marker(path), created));
39478
+ ({key, detail, warning} = await convergeCreatedIssue(issues, ideaMarker(path), created));
39260
39479
  }
39261
39480
  try {
39262
39481
  await ideas.markFiled(path, key);