@tablation/crew 0.164.3 → 0.164.4

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/cli.js CHANGED
@@ -20262,9 +20262,9 @@ async function decideCycle(o) {
20262
20262
  data: { sweepSkipped: skipped }
20263
20263
  });
20264
20264
  }
20265
- const blockedIssues = tickets.filter((t) => blocked.has(t.id)).map((t) => t.issue_id);
20265
+ const blockedIssues = tickets.filter((t) => blocked.has(t.id)).map(displayKey);
20266
20266
  emit.note(`${blockedIssues.length} ticket(s) parked as blocked`, { data: { blocked: blockedIssues } });
20267
- const qaHeld = tickets.filter((t) => t.status === tracker.contract.statuses.verifying).map((t) => t.issue_id);
20267
+ const qaHeld = tickets.filter((t) => t.status === tracker.contract.statuses.verifying).map(displayKey);
20268
20268
  emit.note(`${qaHeld.length} ticket(s) held in QA`, { data: { qaHeld } });
20269
20269
  const stranded = strandedNeedsInfo(tickets, blocked, holds2);
20270
20270
  for (const t of stranded) {
@@ -20303,7 +20303,7 @@ async function decideCycle(o) {
20303
20303
  (added.length ? emit.emit : emit.note).call(
20304
20304
  emit,
20305
20305
  `${unroutableTickets.length} open ticket(s) have no repository and are not routable (${added.length} new since last cycle)`,
20306
- { step: "sweep", data: { unroutable: unroutableTickets.map((t) => t.issue_id), newUnroutable: added.map((a) => a.ticket.issue_id) } }
20306
+ { step: "sweep", data: { unroutable: unroutableTickets.map(displayKey), newUnroutable: added.map((a) => displayKey(a.ticket)) } }
20307
20307
  );
20308
20308
  }
20309
20309
  const attentionCurrent = {};
@@ -20410,7 +20410,7 @@ function otherRunsRemoved(tickets, own) {
20410
20410
  return tickets.filter((t) => t.id === own.ticket.id || !own.inFlight(t.id));
20411
20411
  }
20412
20412
  function ownRunBanner(own) {
20413
- const banner = `**Your ticket for this run: ${own.ticket.issue_id}.** Work this one. Any other ticket a live run on this ship is already working has been left out of this digest: it belongs to that run.`;
20413
+ const banner = `**Your ticket for this run: ${own.ticket.issue_tag ?? own.ticket.issue_id}.** Work this one. Any other ticket a live run on this ship is already working has been left out of this digest: it belongs to that run.`;
20414
20414
  const block = acceptanceChecklistBlock(acceptanceLines(own.ticket.description));
20415
20415
  const withBlock = block ? `${banner}
20416
20416
 
@@ -20564,6 +20564,10 @@ async function stampResumption(tracker, t, affinity) {
20564
20564
  }
20565
20565
  return { outcome: "unknown" };
20566
20566
  }
20567
+ function namesOf(ids, tickets) {
20568
+ const byId = new Map(tickets.map((t) => [t.issue_id, displayKey(t)]));
20569
+ return ids.map((id) => byId.get(id) ?? id).join(", ");
20570
+ }
20567
20571
  async function resolveTopCandidate(tracker, candidates2, seat, approvedStatus, buildingStatus, isServable, affinity, ticketLock) {
20568
20572
  const contended = [];
20569
20573
  const unservable = [];
@@ -20726,12 +20730,12 @@ async function refreshUnknownRepos(o) {
20726
20730
  return added;
20727
20731
  }
20728
20732
  var repoUnservableKey = (route2, issueId) => `repo_unservable:${route2}:${issueId}`;
20729
- function repoUnservableItem(route2, issueId, repoLabel, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
20733
+ function repoUnservableItem(route2, issueId, repoLabel, nowIso = (/* @__PURE__ */ new Date()).toISOString(), tag = issueId) {
20730
20734
  return {
20731
20735
  kind: "repo_unservable",
20732
20736
  key: repoUnservableKey(route2, issueId),
20733
20737
  since: nowIso,
20734
- message: `${route2}: ${issueId} is skipped \u2014 this ship has no checkout for ${repoLabel}. Resumes automatically once the route lists that repository (\`crew repos add\`) or a Repos row for it exists`
20738
+ message: `${route2}: ${tag} is skipped \u2014 this ship has no checkout for ${repoLabel}. Resumes automatically once the route lists that repository (\`crew repos add\`) or a Repos row for it exists`
20735
20739
  };
20736
20740
  }
20737
20741
  function trackUnservable(streaks, unservable) {
@@ -20752,7 +20756,7 @@ function trackUnservable(streaks, unservable) {
20752
20756
  return { raise, recovered };
20753
20757
  }
20754
20758
  var streaksByRoute = /* @__PURE__ */ new Map();
20755
- async function reportUnservable(o, unservable, repoLabelOf) {
20759
+ async function reportUnservable(o, unservable, repoLabelOf, tagOf = (id) => id) {
20756
20760
  const streaks = streaksByRoute.get(o.route.route) ?? /* @__PURE__ */ new Map();
20757
20761
  streaksByRoute.set(o.route.route, streaks);
20758
20762
  const { raise, recovered } = trackUnservable(streaks, unservable);
@@ -20764,7 +20768,7 @@ async function reportUnservable(o, unservable, repoLabelOf) {
20764
20768
  }
20765
20769
  for (const id of raise) {
20766
20770
  try {
20767
- await raiseShipAttention(o, repoUnservableItem(o.route.route, id, repoLabelOf(id)));
20771
+ await raiseShipAttention(o, repoUnservableItem(o.route.route, id, repoLabelOf(id), void 0, tagOf(id)));
20768
20772
  } catch {
20769
20773
  }
20770
20774
  }
@@ -21129,18 +21133,19 @@ function planStrandedVerified(candidate, base, remote, events, look) {
21129
21133
  lastFlaggedAt: stamps.length ? Math.max(...stamps) : void 0
21130
21134
  };
21131
21135
  }
21136
+ var searchedNames = (t) => referenceKeys(t).map((k) => `\`${k}\``).join(" or ");
21132
21137
  function flagComment(s) {
21133
- const key = s.candidate.ticket.issue_id;
21138
+ const key = displayKey(s.candidate.ticket);
21134
21139
  return `${STRANDED_MARKER}
21135
21140
 
21136
21141
  **Verified, but nothing to merge \u2014 flagging before this repeats forever.**
21137
21142
 
21138
- \`${key}\` is \`verified\` with no branch on this ship, and its key names no commit anywhere in this ship's \`${s.base}\` history (searched all of it, local commits included, for a bounded \`${key}\` in a commit subject or body). One of three things is true: it landed under a commit that never named the key, the branch was deleted before it merged, or it was verified in error \u2014 the crew cannot tell these apart and will not guess.
21143
+ \`${key}\` is \`verified\` with no branch on this ship, and its key names no commit anywhere in this ship's \`${s.base}\` history (searched all of it, local commits included, for a bounded ${searchedNames(s.candidate.ticket)} in a commit subject or body). One of three things is true: it landed under a commit that never named the key, the branch was deleted before it merged, or it was verified in error \u2014 the crew cannot tell these apart and will not guess.
21139
21144
 
21140
21145
  If it is still unplaceable next cycle, this ticket is escalated to a person. If the work already landed, closing this ticket by hand now avoids that.${nearMissText(s)}`;
21141
21146
  }
21142
21147
  function escalateComment2(s) {
21143
- const key = s.candidate.ticket.issue_id;
21148
+ const key = displayKey(s.candidate.ticket);
21144
21149
  return `${STRANDED_MARKER}
21145
21150
 
21146
21151
  **Still nothing to merge \u2014 stopping rather than repeating.**
@@ -21290,7 +21295,7 @@ function platformAdmitters(dir, baseRef, ship, tickets, locate) {
21290
21295
  if (text2 === null) continue;
21291
21296
  try {
21292
21297
  const { platform: platform2 } = parseRepoConfig(text2, join45(dir, file));
21293
- if (satisfies(ship, platform2)) out.push({ issueId: t.issue_id, branch, platform: platform2 });
21298
+ if (satisfies(ship, platform2)) out.push({ issueId: t.issue_id, tag: displayKey(t), branch, platform: platform2 });
21294
21299
  } catch (e) {
21295
21300
  if (e instanceof RepoConfigError) continue;
21296
21301
  throw e;
@@ -21599,7 +21604,7 @@ function describeUnplaceable(unplaceable, verifiedStatus) {
21599
21604
  const stranded = unplaceable.filter((u) => u.ticket.status === verifiedStatus);
21600
21605
  if (stranded.length === 0) return [];
21601
21606
  const notes = [];
21602
- const keysFor = (r) => stranded.filter((u) => u.reason === r).map((u) => u.ticket.issue_id);
21607
+ const keysFor = (r) => stranded.filter((u) => u.reason === r).map((u) => displayKey(u.ticket));
21603
21608
  const noRepo = keysFor("no-repo");
21604
21609
  if (noRepo.length) {
21605
21610
  notes.push({
@@ -21619,7 +21624,7 @@ function describeUnplaceable(unplaceable, verifiedStatus) {
21619
21624
  const byRepoName = /* @__PURE__ */ new Map();
21620
21625
  for (const u of elsewhere) {
21621
21626
  const name = u.repo ?? "?";
21622
- byRepoName.set(name, [...byRepoName.get(name) ?? [], u.ticket.issue_id]);
21627
+ byRepoName.set(name, [...byRepoName.get(name) ?? [], displayKey(u.ticket)]);
21623
21628
  }
21624
21629
  notes.push({
21625
21630
  level: "info",
@@ -21658,7 +21663,7 @@ function heldByBlockers(tickets, verifiedStatus, info, resolved) {
21658
21663
  const opts = { mergeGated: false, resolved };
21659
21664
  return tickets.filter((t) => t.status === verifiedStatus && unresolvedBlockers(t, info, opts).length > 0).map((ticket) => ({ ticket, blockers: describeUnresolved(ticket, info, opts) }));
21660
21665
  }
21661
- var describeHeld = (held) => held.map((h) => `${h.ticket.issue_tag ?? h.ticket.issue_id} held: blocked by ${h.blockers}`);
21666
+ var describeHeld = (held) => held.map((h) => `${displayKey(h.ticket)} held: blocked by ${h.blockers}`);
21662
21667
  var CHANGELOG_LINE = /^Changelog:[ \t]*(.*)$/gm;
21663
21668
  var TICKET_REF_AT_START = /^([A-Z][A-Z0-9]*)-(\d+)\b/;
21664
21669
  function dedupeChangelogEntries(entries, ticket) {
@@ -21749,7 +21754,7 @@ function planMerge(cwd, tickets, contract, lastReleased, branchFor = (t) => bran
21749
21754
  return {
21750
21755
  ticket,
21751
21756
  branch,
21752
- entries: usedFallback ? [`${ticket.title || ticket.issue_id} (${ticket.issue_id})`] : entries,
21757
+ entries: usedFallback ? [`${ticket.title || displayKey(ticket)} (${displayKey(ticket)})`] : entries,
21753
21758
  usedFallback,
21754
21759
  bump: size,
21755
21760
  majorRequested
@@ -22496,7 +22501,7 @@ function deepenUntilMergeBase(o, branch) {
22496
22501
  }
22497
22502
  }
22498
22503
  function mergeOne(o, c) {
22499
- const subject = c.entries[0] ?? `${c.ticket.title ?? c.ticket.issue_id} (${c.ticket.issue_id})`;
22504
+ const subject = c.entries[0] ?? `${c.ticket.title ?? displayKey(c.ticket)} (${displayKey(c.ticket)})`;
22500
22505
  if (o.dryRun) {
22501
22506
  o.emit.emit(`would squash-merge ${c.branch} \u2014 "${subject}"`, { ticket: c.ticket.issue_id });
22502
22507
  return { applied: true };
@@ -22524,7 +22529,7 @@ function mergeOne(o, c) {
22524
22529
  ${BRANCH_TIP_TRAILER}: ${tip}` : "";
22525
22530
  git(o.cwd, ["commit", "-m", `${subject}
22526
22531
 
22527
- Closes ${c.ticket.issue_id}.${trailer}`]);
22532
+ Closes ${displayKey(c.ticket)}.${trailer}`]);
22528
22533
  const sha = headSha(o.cwd);
22529
22534
  o.emit.note(`merged ${c.branch}`, { ticket: c.ticket.issue_id });
22530
22535
  clearFailure();
@@ -25651,7 +25656,7 @@ async function skipUnrunnable(candidates2, ctx) {
25651
25656
  const out = [];
25652
25657
  for (const t of candidates2) {
25653
25658
  if (noopBackedOff(ship.stateDir, t.id)) {
25654
- backedOff.push(t.issue_id);
25659
+ backedOff.push(t);
25655
25660
  continue;
25656
25661
  }
25657
25662
  const target = repoTargetFor(route2, t.repo_id);
@@ -25659,14 +25664,14 @@ async function skipUnrunnable(candidates2, ctx) {
25659
25664
  if (!declares.has(target.name)) declares.set(target.name, Boolean((await repoContractFor(ship, route2, target))?.sandbox));
25660
25665
  if (sandboxImageMissing(state, target.name, declares.get(target.name))) {
25661
25666
  noImage.add(target.name);
25662
- imageSkipped.push(t.issue_id);
25667
+ imageSkipped.push(t);
25663
25668
  continue;
25664
25669
  }
25665
25670
  }
25666
25671
  out.push(t);
25667
25672
  }
25668
- if (backedOff.length) emit.emit(`skipped ${backedOff.join(", ")} \u2014 recent runs changed nothing, backing off`, { step: "select" });
25669
- if (imageSkipped.length) emit.emit(`skipped ${imageSkipped.join(", ")} \u2014 the sandbox image for their repo is not built yet`, { step: "select" });
25673
+ if (backedOff.length) emit.emit(`skipped ${backedOff.map(displayKey).join(", ")} \u2014 recent runs changed nothing, backing off`, { step: "select" });
25674
+ if (imageSkipped.length) emit.emit(`skipped ${imageSkipped.map(displayKey).join(", ")} \u2014 the sandbox image for their repo is not built yet`, { step: "select" });
25670
25675
  for (const repo of noImage) {
25671
25676
  if (openShipAttention(ctx.state).some((i) => i.key === sandboxFailedKey(repo))) continue;
25672
25677
  try {
@@ -25755,13 +25760,13 @@ async function runRoleAgentLocked(role, decision, ctx, hooks, held) {
25755
25760
  );
25756
25761
  held.release = result.releaseTicket;
25757
25762
  if (result.contended.length) {
25758
- emit.emit(`claim contended for ${result.contended.join(", ")} \u2014 moved to the next candidate`, {
25763
+ emit.emit(`claim contended for ${namesOf(result.contended, candidates2)} \u2014 moved to the next candidate`, {
25759
25764
  step: "select",
25760
25765
  role
25761
25766
  });
25762
25767
  }
25763
25768
  if (result.unservable.length) {
25764
- emit.emit(`skipped ${result.unservable.join(", ")} \u2014 no local checkout for their repo`, {
25769
+ emit.emit(`skipped ${namesOf(result.unservable, candidates2)} \u2014 no local checkout for their repo`, {
25765
25770
  step: "select",
25766
25771
  role
25767
25772
  });
@@ -25769,10 +25774,11 @@ async function runRoleAgentLocked(role, decision, ctx, hooks, held) {
25769
25774
  await reportUnservable(
25770
25775
  { state: ctx.state, emit, route: route2, ship },
25771
25776
  result.unservable,
25772
- (id) => repoLabelFor(route2, candidates2.find((c) => c.issue_id === id))
25777
+ (id) => repoLabelFor(route2, candidates2.find((c) => c.issue_id === id)),
25778
+ (id) => namesOf([id], candidates2)
25773
25779
  );
25774
25780
  if (result.held.length) {
25775
- emit.emit(`skipped ${result.held.join(", ")} \u2014 held by another live ship`, { step: "select", role });
25781
+ emit.emit(`skipped ${namesOf(result.held, candidates2)} \u2014 held by another live ship`, { step: "select", role });
25776
25782
  }
25777
25783
  await noteReaccepted(tracker, result, seat, ship.name);
25778
25784
  await noteTakeover(
@@ -28990,7 +28996,7 @@ async function applyWorktreeSweep(cwd, actions, dryRun, log, remote = "origin",
28990
28996
  const refused = [];
28991
28997
  const refuse2 = (a, reason, detail) => {
28992
28998
  refused.push(a.path);
28993
- const when = held ? noteHeldWorktree(held.state, { repo: held.repo, path: a.path, ticket: a.ticket.issue_id, status: a.ticket.status, reason }) : "first";
28999
+ const when = held ? noteHeldWorktree(held.state, { repo: held.repo, path: a.path, ticket: displayKey(a.ticket), status: a.ticket.status, reason }) : "first";
28994
29000
  if (when) {
28995
29001
  log.warn(
28996
29002
  `not removing worktree ${a.path} for ${displayKey(a.ticket)} (${a.ticket.status}): ${detail}`,
@@ -29354,7 +29360,7 @@ import { dirname as dirOf2, resolve as resolvePath } from "path";
29354
29360
  import { existsSync as existsSync56, readdirSync as readdirSync18, statSync as statSync17 } from "fs";
29355
29361
  import { join as join60 } from "path";
29356
29362
  function builtVersion() {
29357
- return true ? "0.164.3" : null;
29363
+ return true ? "0.164.4" : null;
29358
29364
  }
29359
29365
  var REBUILD_HINT = "rebuild with npm run build";
29360
29366
  function newestMtime(path) {
@@ -30208,7 +30214,7 @@ function contractFixers(dir, baseRef, tickets, locate) {
30208
30214
  if (e instanceof RepoConfigError) continue;
30209
30215
  throw e;
30210
30216
  }
30211
- out.push({ issueId: t.issue_id, branch, file });
30217
+ out.push({ issueId: t.issue_id, tag: displayKey(t), branch, file });
30212
30218
  }
30213
30219
  return out;
30214
30220
  }
@@ -33015,7 +33021,7 @@ ${changed2.map((c) => ` - ${c}
33015
33021
  try {
33016
33022
  await raiseShipAttention(
33017
33023
  { state, emit: remit, route: c, ship: cfg.ship },
33018
- repoPlatformUnreleasableItem(target.name, platformStuckNote(target.name, repo.platform, cfg.ship.platform, ids))
33024
+ repoPlatformUnreleasableItem(target.name, platformStuckNote(target.name, repo.platform, cfg.ship.platform, verifiedPre.map(displayKey)))
33019
33025
  );
33020
33026
  } catch {
33021
33027
  }
@@ -33032,7 +33038,7 @@ ${changed2.map((c) => ` - ${c}
33032
33038
  } catch {
33033
33039
  }
33034
33040
  remit.emit(
33035
- `${scope}: the base contract requires ${repo.platform}, but ${admitters.map((a) => a.issueId).join(", ")} change${admitters.length === 1 ? "s" : ""} platform to ${admitters[0].platform}, which this ship satisfies \u2014 releasing`,
33041
+ `${scope}: the base contract requires ${repo.platform}, but ${admitters.map((a) => a.tag).join(", ")} change${admitters.length === 1 ? "s" : ""} platform to ${admitters[0].platform}, which this ship satisfies \u2014 releasing`,
33036
33042
  { step: "release" }
33037
33043
  );
33038
33044
  }
@@ -33105,7 +33111,7 @@ ${changed2.map((c) => ` - ${c}
33105
33111
  );
33106
33112
  if (fixers.length === 0) throw refusal;
33107
33113
  remit.emit(
33108
- `${target.name}: the base contract is refused (${refusal.message}); ${fixers.map((f2) => f2.issueId).join(", ")} replace${fixers.length === 1 ? "s" : ""} ${fixers[0].file} \u2014 merging first`,
33114
+ `${target.name}: the base contract is refused (${refusal.message}); ${fixers.map((f2) => f2.tag).join(", ")} replace${fixers.length === 1 ? "s" : ""} ${fixers[0].file} \u2014 merging first`,
33109
33115
  { step: "release" }
33110
33116
  );
33111
33117
  }
@@ -33697,19 +33703,19 @@ ${f2.tail.trimEnd()}
33697
33703
  } };
33698
33704
  }
33699
33705
  if (result.contended.length) {
33700
- wemit.note(`claim contended for ${result.contended.join(", ")} \u2014 moved to the next candidate`, {
33706
+ wemit.note(`claim contended for ${namesOf(result.contended, candidates2)} \u2014 moved to the next candidate`, {
33701
33707
  step: "select",
33702
33708
  role: w.role
33703
33709
  });
33704
33710
  }
33705
33711
  if (result.unservable.length) {
33706
33712
  wemit.emit(
33707
- `skipped ${result.unservable.join(", ")} \u2014 no local checkout for their repo`,
33713
+ `skipped ${namesOf(result.unservable, candidates2)} \u2014 no local checkout for their repo`,
33708
33714
  { step: "select", role: w.role }
33709
33715
  );
33710
33716
  }
33711
33717
  if (result.held.length) {
33712
- wemit.emit(`skipped ${result.held.join(", ")} \u2014 held by another live ship`, { step: "select", role: w.role });
33718
+ wemit.emit(`skipped ${namesOf(result.held, candidates2)} \u2014 held by another live ship`, { step: "select", role: w.role });
33713
33719
  }
33714
33720
  await noteReaccepted(fleetTracker, result, seat, cfg.ship.name);
33715
33721
  await noteTakeover(
@@ -33913,19 +33919,19 @@ ${f2.tail.trimEnd()}
33913
33919
  } };
33914
33920
  }
33915
33921
  if (result.contended.length) {
33916
- emit.note(`claim contended for ${result.contended.join(", ")} \u2014 moved to the next candidate`, {
33922
+ emit.note(`claim contended for ${namesOf(result.contended, candidates2)} \u2014 moved to the next candidate`, {
33917
33923
  step: "select",
33918
33924
  role: current
33919
33925
  });
33920
33926
  }
33921
33927
  if (result.unservable.length) {
33922
33928
  emit.emit(
33923
- `skipped ${result.unservable.join(", ")} \u2014 no local checkout for their repo`,
33929
+ `skipped ${namesOf(result.unservable, candidates2)} \u2014 no local checkout for their repo`,
33924
33930
  { step: "select", role: current }
33925
33931
  );
33926
33932
  }
33927
33933
  if (result.held.length) {
33928
- emit.emit(`skipped ${result.held.join(", ")} \u2014 held by another live ship`, { step: "select", role: current });
33934
+ emit.emit(`skipped ${namesOf(result.held, candidates2)} \u2014 held by another live ship`, { step: "select", role: current });
33929
33935
  }
33930
33936
  await noteReaccepted(tracker2, result, seat, cfg.ship.name);
33931
33937
  await noteTakeover(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.164.3",
3
+ "version": "0.164.4",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -395,7 +395,7 @@ before going further, and never change a ticket's `report_type` yourself.
395
395
  fix; minor for a larger feature or real implementation complexity;
396
396
  never `major`, which is the operator's call alone);
397
397
  - one or more `Changelog: <text>` lines, each worded exactly as the
398
- changelog entry should read, with the ticket's tag (e.g. `ISSUE-123`;
398
+ changelog entry should read, with the ticket's tag (e.g. `TABL-123`;
399
399
  the release phase matches it by number). The first one becomes the
400
400
  squash-merge subject. A ticket with no user-visible change still needs
401
401
  one saying so — a branch without a `Changelog:` line merges under a
@@ -388,7 +388,7 @@ before going further, and never change a ticket's `report_type` yourself.
388
388
  fix; minor for a larger feature or real implementation complexity;
389
389
  never `major`, which is the operator's call alone);
390
390
  - one or more `Changelog: <text>` lines, each worded exactly as the
391
- changelog entry should read, with the ticket's tag (e.g. `ISSUE-123`;
391
+ changelog entry should read, with the ticket's tag (e.g. `TABL-123`;
392
392
  the release phase matches it by number). The first one becomes the
393
393
  squash-merge subject. A ticket with no user-visible change still needs
394
394
  one saying so — a branch without a `Changelog:` line merges under a