spur-board 0.63.2 → 0.63.3

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.
Files changed (2) hide show
  1. package/dist/daemon.mjs +34 -3
  2. package/package.json +1 -1
package/dist/daemon.mjs CHANGED
@@ -11735,6 +11735,31 @@ function atAddressee(target, role) {
11735
11735
  }
11736
11736
  };
11737
11737
  }
11738
+ /** Advances open questions whose persisted author now holds their stored addressee role. */
11739
+ async function reconcileQuestionAddressees(trx, config, at) {
11740
+ const blocks = await trx.selectFrom("block").selectAll().where("type", "=", "needs_input").where("state", "=", "open").where("task_id", "is not", null).where("addressee_spur_project", "is", null).execute();
11741
+ for (const block of blocks) {
11742
+ if (parseActorId(block.author)?.actor !== "agent" || block.addressee_role !== "curator" && !block.addressee_role.startsWith("orchestrator:")) continue;
11743
+ const subject = await blockSubject(trx, block);
11744
+ const { task } = subject;
11745
+ if (task === null || task.membership === "archived") continue;
11746
+ const target = await subjectTarget(trx, subject, block);
11747
+ if (!holdsBlock(config, block.author, target)) continue;
11748
+ const next = escalateBlock(current$1(block), curatorProject(config, subject.project) !== null, (role) => holdsBlock(config, block.author, atAddressee(target, role)));
11749
+ if (!next.changed) continue;
11750
+ await moveBlockToAddressee(trx, {
11751
+ task,
11752
+ block,
11753
+ to: next.addressee,
11754
+ reason: "asker_is_addressee",
11755
+ ctx: {
11756
+ actor: "system",
11757
+ at
11758
+ },
11759
+ config
11760
+ });
11761
+ }
11762
+ }
11738
11763
  function wroteBlock(config, actor, target) {
11739
11764
  return authorize([{ grant: "block-author" }], actor, {
11740
11765
  config,
@@ -15922,9 +15947,14 @@ const EVENT_SUMMARIES = {
15922
15947
  token_expired: "Token expired",
15923
15948
  token_revoked: "Token revoked"
15924
15949
  };
15925
- function linkSummary(kind, payloadText) {
15926
- if (kind !== "link_added" && kind !== "link_removed") return null;
15950
+ function linkOrEscalationSummary(kind, payloadText) {
15951
+ if (kind !== "link_added" && kind !== "link_removed" && kind !== "block_escalated") return null;
15927
15952
  try {
15953
+ if (kind === "block_escalated") {
15954
+ const payload = eventPayloadSchemas[kind].safeParse(JSON.parse(payloadText));
15955
+ if (!payload.success || payload.data.reason !== "asker_is_addressee") return null;
15956
+ return `Block ${payload.data.block} escalated from ${payload.data.from} to ${payload.data.to}: ${payload.data.reason}`;
15957
+ }
15928
15958
  const payload = eventPayloadSchemas[kind].safeParse(JSON.parse(payloadText));
15929
15959
  if (!payload.success) return null;
15930
15960
  const target = payload.data.entity === "pr" ? `${payload.data.repo}#${String(payload.data.pr)}` : payload.data.entity === "session" ? payload.data.session : payload.data.ticket;
@@ -16116,7 +16146,7 @@ function createTaskQueries(deps) {
16116
16146
  at: row.at,
16117
16147
  kind,
16118
16148
  actor: eventActor(row),
16119
- summary: linkSummary(kind, row.payload) ?? shadowSummary(kind, row.payload) ?? submitSummary(kind, row.payload) ?? EVENT_SUMMARIES[kind]
16149
+ summary: linkOrEscalationSummary(kind, row.payload) ?? shadowSummary(kind, row.payload) ?? submitSummary(kind, row.payload) ?? EVENT_SUMMARIES[kind]
16120
16150
  }];
16121
16151
  });
16122
16152
  return {
@@ -17694,6 +17724,7 @@ async function tickBoard(deps) {
17694
17724
  at
17695
17725
  });
17696
17726
  }
17727
+ await reconcileQuestionAddressees(trx, config, at);
17697
17728
  await dispatchJournaled(trx, {
17698
17729
  config,
17699
17730
  at: new Date(now),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.63.2",
3
+ "version": "0.63.3",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"