@yemi33/minions 0.1.2011 → 0.1.2012

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/dashboard.js CHANGED
@@ -1919,7 +1919,7 @@ async function _handleStatusRequest(req, res) {
1919
1919
  }
1920
1920
  }
1921
1921
 
1922
- // Periodic push for engine-driven changes (dispatch.json, control.json) that bypass invalidateStatusCache
1922
+ // Periodic push for engine-driven changes (dispatch.json, work-items.json, pull-requests.json) that bypass invalidateStatusCache
1923
1923
  setInterval(() => {
1924
1924
  if (_statusStreamClients.size === 0) return;
1925
1925
  const data = getStatusJson();
@@ -8098,6 +8098,11 @@ What would you like to discuss or change? When you're happy, say "approve" and I
8098
8098
  async function handleEngineRestart(req, res) {
8099
8099
  try {
8100
8100
  const newPid = restartEngine();
8101
+ // control.json is no longer in the mtime-tracked list (W-mpg8aapw001d7e0c)
8102
+ // because heartbeat noise dominated legitimate state changes and defeated
8103
+ // the /api/status ETag short-circuit. Explicit invalidation here keeps the
8104
+ // restart visible on the next poll without re-tracking control.json.
8105
+ invalidateStatusCache();
8101
8106
  return jsonReply(res, 200, { ok: true, pid: newPid });
8102
8107
  } catch (e) { return jsonReply(res, e.statusCode || 500, { error: e.message }); }
8103
8108
  }
package/engine/queries.js CHANGED
@@ -1822,6 +1822,19 @@ function resetProjectGitStatusCache() {
1822
1822
  * automatically.
1823
1823
  *
1824
1824
  * Files intentionally NOT tracked:
1825
+ * - `engine/log.json` — append-only log written many times per tick
1826
+ * (PR polls, dispatch transitions, heartbeat). Its mtime advances
1827
+ * every few seconds in steady state, which by itself was enough to
1828
+ * bust the ETag cache on every poll and reduce the /api/status 304
1829
+ * short-circuit to 0% hit rate (W-mpg8aapw001d7e0c). Log tail is
1830
+ * surfaced by `getEngineLog()` and accepts the 10 s `FAST_STATE_TTL`
1831
+ * backstop — log entries are not UX-blocking.
1832
+ * - `engine/control.json` — heartbeat writes advance mtime every tick
1833
+ * (~60 s) plus on any control-side mutation, dominating legitimate
1834
+ * state changes. Engine state (running/paused/stopped) is surfaced
1835
+ * by `getEngineState()`; the dashboard-side mutating handlers
1836
+ * (`handleEngineRestart` etc.) call `invalidateStatusCache()`
1837
+ * directly, and the 10 s TTL covers CLI-driven control-file edits.
1825
1838
  * - `engine/state.json` — surfaced via `getEngineState()` but changes
1826
1839
  * only on engine startup / reconcile. Negligible benefit.
1827
1840
  * - `engine/cooldowns.json`, `engine/pr-links.json`, `engine/pending-
@@ -1841,11 +1854,10 @@ function resetProjectGitStatusCache() {
1841
1854
  function getStatusFastStateMtimePaths(config) {
1842
1855
  const projects = getProjects(config || getConfig());
1843
1856
  const files = [
1844
- // Engine-level state surfaced by getDispatchQueue / inline engine block /
1845
- // getEngineLog / getMetrics.
1857
+ // Engine-level state surfaced by getDispatchQueue / getMetrics.
1858
+ // `control.json` and `log.json` are intentionally omitted — see the
1859
+ // "Files intentionally NOT tracked" section above (W-mpg8aapw001d7e0c).
1846
1860
  DISPATCH_PATH,
1847
- CONTROL_PATH,
1848
- LOG_PATH,
1849
1861
  path.join(ENGINE_DIR, 'metrics.json'),
1850
1862
  // Watches surfaced by watchesMod.getWatches() (W-mpftp7na000td0f4 fix).
1851
1863
  path.join(ENGINE_DIR, 'watches.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.2011",
3
+ "version": "0.1.2012",
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"