@yemi33/minions 0.1.2031 → 0.1.2032

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.
@@ -145,17 +145,35 @@ function _processStatusUpdate(data) {
145
145
  const threshEl = document.getElementById('inbox-threshold');
146
146
  if (threshEl && data.autoMode?.inboxThreshold) threshEl.textContent = data.autoMode.inboxThreshold;
147
147
 
148
- // Publish window._last* snapshots BEFORE any renderer runs. Several renderers
149
- // (renderProjects, renderPrd, renderPrs, refreshPlans, and others) read
150
- // window._lastStatus / window._lastWorkItems / window._lastDispatch during
151
- // their render path. If we assign these after the renderer calls, every tick
152
- // consumes the PREVIOUS tick's globals a one-tick (~4 s) staleness lag
153
- // baked into the polling loop (W-mpgb0x81000cf8df, audit F4). No renderer in
154
- // this function mutates `data`, so hoisting is safe.
148
+ // Publish window._last* snapshots BEFORE any renderer runs. Several
149
+ // renderers (renderPrd, renderPrs, derivePlanStatus inside refreshPlans,
150
+ // and the projectChipRemove/optimisticallyAddProject paths off
151
+ // renderProjects) read window._lastStatus / window._lastWorkItems /
152
+ // window._lastDispatch synchronously during their render path. When the
153
+ // assignments lived AFTER the renderer calls (the pre-fix layout in
154
+ // refresh.js:106-108), every tick consumed the PREVIOUS tick's globals —
155
+ // a one-tick (~4 s) staleness lag baked into the polling loop on top of
156
+ // the natural poll interval.
157
+ //
158
+ // See dashboard-refresh-audit.md finding F4 (W-mpgb0x81000cf8df / PR #2753
159
+ // landed the initial hoist; W-mpgbzpn9000390ae extends it with the
160
+ // render-agents / render-work-items invariants below). No renderer below
161
+ // mutates `data`, so hoisting the publish is safe; the renderers
162
+ // themselves still take their slice as a direct argument.
163
+ //
164
+ // Locking-in note (W-mpgbzpn9000390ae): renderAgents
165
+ // (render-agents.js:38) and renderWorkItems (render-work-items.js:98) —
166
+ // the two surfaces the user explicitly called out on /home and /work —
167
+ // take their data slice via argument and DO NOT read window._last*.
168
+ // Hoisting the publish here additionally guarantees that any future
169
+ // refactor that adds a window._last* read to those renderers will see
170
+ // fresh data on the same tick, not the previous one. Covered by
171
+ // dashboard-resilience.test.js source-inspection assertions.
155
172
  window._lastDispatch = data.dispatch;
156
173
  window._lastWorkItems = data.workItems || [];
157
174
  window._lastStatus = data;
158
175
 
176
+
159
177
  // Render only changed sections
160
178
  if (_changed('agents', data.agents)) { renderAgents(data.agents); cmdUpdateAgentList(data.agents); }
161
179
  if (_changed('prdProgress', data.prdProgress) || _changed('prdPrs', data.pullRequests?.length)) { renderPrdProgress(data.prdProgress); _cachePrdItems(data.prdProgress); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.2031",
3
+ "version": "0.1.2032",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"