spur-board 0.59.1 → 0.59.2

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/daemon.mjs CHANGED
@@ -433,9 +433,15 @@ function priorAddressees(original, current, type, hasCurator) {
433
433
  }
434
434
  return path;
435
435
  }
436
- function escalateBlock(block, hasCurator = false) {
436
+ /** Skips each step the escalating actor's own project holds, up to the operator. */
437
+ function escalateBlock(block, hasCurator = false, heldByActor = () => false) {
437
438
  requireOpen(block);
438
- const addressee = nextAddressee(block.addressee, block.type, hasCurator);
439
+ let addressee = nextAddressee(block.addressee, block.type, hasCurator);
440
+ while (heldByActor(addressee)) {
441
+ const next = nextAddressee(addressee, block.type, hasCurator);
442
+ if (next === addressee) break;
443
+ addressee = next;
444
+ }
439
445
  return {
440
446
  addressee,
441
447
  changed: block.addressee !== addressee
@@ -11522,6 +11528,20 @@ function holdsBlock(config, actor, target) {
11522
11528
  target
11523
11529
  }).status === "allowed";
11524
11530
  }
11531
+ /** `target` with its block moved to `role`, to ask who would hold it there. */
11532
+ function atAddressee(target, role) {
11533
+ if (target.kind !== "found" || target.value.block === null) return target;
11534
+ return {
11535
+ kind: "found",
11536
+ value: {
11537
+ ...target.value,
11538
+ block: {
11539
+ ...target.value.block,
11540
+ addressee_role: role
11541
+ }
11542
+ }
11543
+ };
11544
+ }
11525
11545
  function wroteBlock(config, actor, target) {
11526
11546
  return authorize([{ grant: "block-author" }], actor, {
11527
11547
  config,
@@ -11840,17 +11860,8 @@ function createBlockMutations(config) {
11840
11860
  const { task } = subject;
11841
11861
  if (task === null) return [target];
11842
11862
  const priors = priorAddressees(await routeBlock(trx, task, block, config), block.addressee_role, block.type, curatorProject(config, task.project) !== null);
11843
- for (const addressee_role of priors) {
11844
- const prior = {
11845
- kind: "found",
11846
- value: {
11847
- ...target.value,
11848
- block: {
11849
- ...target.value.block,
11850
- addressee_role
11851
- }
11852
- }
11853
- };
11863
+ for (const role of priors) {
11864
+ const prior = atAddressee(target, role);
11854
11865
  if (holdsBlock(config, actor, prior)) return [prior];
11855
11866
  }
11856
11867
  return [target];
@@ -11861,13 +11872,13 @@ function createBlockMutations(config) {
11861
11872
  const { task } = subject;
11862
11873
  if (task !== null) active(task);
11863
11874
  const hasCurator = curatorProject(config, subject.project) !== null;
11864
- const next = rule(() => escalateBlock(current$1(block), hasCurator));
11875
+ const target = await subjectTarget(trx, subject, block);
11876
+ const next = rule(() => escalateBlock(current$1(block), hasCurator, (role) => holdsBlock(config, ctx.actor, atAddressee(target, role))));
11865
11877
  const unchanged = async () => {
11866
11878
  if (input.note !== void 0) await addComment(trx, subject, block, input.note, ctx, block.addressee_role, config, { ringsAuthor: false });
11867
11879
  return { block: blockView(block, subject) };
11868
11880
  };
11869
11881
  if (!next.changed || task === null) return unchanged();
11870
- const target = await subjectTarget(trx, subject, block);
11871
11882
  if (!holdsBlock(config, ctx.actor, target)) return unchanged();
11872
11883
  const updated = await moveBlockToAddressee(trx, {
11873
11884
  task,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.59.1",
3
+ "version": "0.59.2",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -100,7 +100,9 @@ the curator's own question goes to the operator. A column explicitly assigned to
100
100
  A `code` block goes to the worker to repair. A `dependency` or `external` block
101
101
  stays with its author's role to track the dependency or outside event. Questions
102
102
  can escalate from column orchestrator to curator to operator; other blocks
103
- escalate straight to the operator. Use keyed `board escalate <block>`
103
+ escalate straight to the operator. Escalation skips a step your own project also
104
+ holds: a curator that also orchestrates the column escalates its column's
105
+ question straight to the operator. Use keyed `board escalate <block>`
104
106
  when the current addressee cannot resolve it.
105
107
 
106
108
  The routing configuration is `projects[].columns[].orchestrator`,