Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

refactor: keep item hold reads with canonical queries [C7,N22]

Corey Olson65e64a7421bc
diff --git a/src/board-query.js b/src/board-query.js
index ebe8fb6c..79aa4803 100644
--- a/src/board-query.js
+++ b/src/board-query.js
@@ -102,6 +102,15 @@ export function getItem(board, id) {
return { ...item, ...(baseline ? { item_check_baseline: baseline } : {}), ...(source ? { outside: source } : {}) };
}
+/** Read an item's coordinator hold, or null when it is available for claims. */
+export function itemHold(board, id) {
+ const item = getItem(board, id);
+ return item.item_hold_reason ? {
+ item_id: item.item_id, item_hold_reason: item.item_hold_reason,
+ item_hold_by: item.item_hold_by, item_hold_at: item.item_hold_at,
+ } : null;
+}
+
/**
* Items, newest first, as a reader should see them. Closed items (verified, withdrawn) only when
* asked.
diff --git a/src/board.js b/src/board.js
index cadab271..8669a726 100644
--- a/src/board.js
+++ b/src/board.js
@@ -88,6 +88,7 @@ import {
unreadCount,
events,
itemThread,
+ itemHold,
laneHold,
laneHolds,
rowDecisions,
@@ -2160,14 +2161,7 @@ export function releaseLane(board, lane, { agentId, asPerson = false, channel =
export { laneHold, laneHolds } from './board-query.js';
-/** Read an item's coordinator hold, or null when it is available for claims. */
-export function itemHold(board, id) {
- const item = getItem(board, id);
- return item.item_hold_reason ? {
- item_id: item.item_id, item_hold_reason: item.item_hold_reason,
- item_hold_by: item.item_hold_by, item_hold_at: item.item_hold_at,
- } : null;
-}
+export { itemHold } from './board-query.js';
/** Hold an open or already-claimed item without changing its current lifecycle state. */
export function holdItem(board, id, { agentId, reason }) {