@yemi33/minions 0.1.2024 → 0.1.2026

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
@@ -1782,9 +1782,17 @@ function getStatus() {
1782
1782
  if (fastStale) {
1783
1783
  // Reload config on fast-state miss — picks up external changes (minions init, minions add)
1784
1784
  reloadConfig();
1785
+ // Snapshot mtimes BEFORE the rebuild reads disk. If an engine write lands
1786
+ // mid-rebuild (dispatch.json, work-items.json, pull-requests.json), the
1787
+ // snapshot reflects pre-write state, but capturing _lastMtimes AFTER would
1788
+ // record the post-write mtime — silently masking the change. Subsequent
1789
+ // polls would then see no mtime delta and return 304 with stale data until
1790
+ // FAST_STATE_TTL expires. Capturing pre-build at worst forces one extra
1791
+ // (no-op) rebuild on the next poll; capturing post-build loses the update.
1792
+ const preBuildMtimes = _getMtimes();
1785
1793
  _fastState = _buildStatusFastState();
1786
1794
  _fastStateTs = now;
1787
- _lastMtimes = _getMtimes();
1795
+ _lastMtimes = preBuildMtimes;
1788
1796
  }
1789
1797
 
1790
1798
  // Rebuild slow state (rarely-changing data: ~8-15 reads, 60s TTL)
@@ -1836,8 +1844,14 @@ function refreshStatusAsync() {
1836
1844
  if (!fastStale && !slowStale && _statusCache) return _statusCache;
1837
1845
 
1838
1846
  let fast = _fastState;
1847
+ // Pre-build mtime snapshot (see getStatus() for the rationale). The async
1848
+ // path has an even wider race window than the sync path because of the
1849
+ // `await _yieldEventLoop()` below — any write that lands between disk
1850
+ // reads and the post-build `_getMtimes()` capture would be lost.
1851
+ let preBuildMtimes = null;
1839
1852
  if (fastStale) {
1840
1853
  reloadConfig();
1854
+ preBuildMtimes = _getMtimes();
1841
1855
  fast = _buildStatusFastState();
1842
1856
  }
1843
1857
 
@@ -1868,7 +1882,7 @@ function refreshStatusAsync() {
1868
1882
  if (fastStale) {
1869
1883
  _fastState = fast;
1870
1884
  _fastStateTs = now;
1871
- _lastMtimes = _getMtimes();
1885
+ _lastMtimes = preBuildMtimes;
1872
1886
  }
1873
1887
  if (slowStale) {
1874
1888
  _slowState = slow;
package/engine/queries.js CHANGED
@@ -1907,6 +1907,21 @@ function getStatusFastStateMtimePaths(config) {
1907
1907
  path.join(ENGINE_DIR, 'watches.json'),
1908
1908
  // Central work-items.json surfaced by getWorkItems().
1909
1909
  path.join(MINIONS_DIR, 'work-items.json'),
1910
+ // notes.md (surfaced by getNotesWithMeta) — consolidation writes this
1911
+ // when an inbox batch is processed. Single file, mtime advances on every
1912
+ // write. Without this, the dashboard's notes view sat stale for up to
1913
+ // FAST_STATE_TTL (10 s) after each consolidation cycle.
1914
+ NOTES_PATH,
1915
+ // notes/inbox/ (surfaced by getInbox) — every writeToInbox call CREATES
1916
+ // a new file (engine/shared.js#writeToInbox always uses a uid'd path,
1917
+ // never an in-place edit), so the directory's mtime is a reliable
1918
+ // entry-add/remove signal even on Windows NTFS. Without it, PR-comment
1919
+ // notifications, agent-failure summaries, follow-up build alerts, and
1920
+ // meeting-transcript dumps all lagged up to 10 s before appearing on
1921
+ // the dashboard's inbox view. The meeting directory is still excluded
1922
+ // (see "Files intentionally NOT tracked") because round transitions
1923
+ // edit existing files in-place, which dir mtime can't detect.
1924
+ INBOX_DIR,
1910
1925
  ];
1911
1926
  // Per-project work-items (surfaced by getWorkItems) and pull-requests
1912
1927
  // (surfaced by getPullRequests). The PR file was the biggest miss in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.2024",
3
+ "version": "0.1.2026",
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"