@yemi33/minions 0.1.1996 → 0.1.1997
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/refresh.js +23 -1
- package/dashboard.js +473 -103
- package/docs/security.md +21 -13
- package/engine/ado.js +18 -2
- package/engine/consolidation.js +38 -9
- package/engine/dispatch.js +2 -0
- package/engine/github.js +14 -2
- package/engine/lifecycle.js +166 -0
- package/engine/playbook.js +120 -10
- package/engine/qa-runs.js +42 -1
- package/engine/queries.js +49 -7
- package/engine/shared.js +3 -1
- package/engine/untrusted-fence.js +184 -0
- package/engine.js +11 -0
- package/package.json +1 -1
- package/playbooks/qa-validate.md +118 -0
- package/playbooks/shared-rules.md +8 -0
- package/prompts/cc-system.md +8 -0
- package/routing.md +1 -0
package/dashboard/js/refresh.js
CHANGED
|
@@ -150,9 +150,31 @@ function _processStatusUpdate(data) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
let _knownDashboardStartId = null;
|
|
153
|
+
// /api/status ETag cache (W-mpehsyhv0017085a). The dashboard polls every 4 s
|
|
154
|
+
// but the server-side cache only changes every 10–60 s. Sending If-None-Match
|
|
155
|
+
// lets the server short-circuit ~60 %+ of polls into a 304 with no body —
|
|
156
|
+
// drops the 7.7 MB JSON.stringify + gzipSync off the dashboard event loop on
|
|
157
|
+
// the hot path. Falls back to the cached payload on 304; transparent to all
|
|
158
|
+
// downstream consumers of `data`.
|
|
159
|
+
let _lastStatusEtag = null;
|
|
160
|
+
let _lastStatusData = null;
|
|
153
161
|
async function refresh() {
|
|
154
162
|
try {
|
|
155
|
-
const
|
|
163
|
+
const headers = {};
|
|
164
|
+
if (_lastStatusEtag) headers['If-None-Match'] = _lastStatusEtag;
|
|
165
|
+
const res = await safeFetch('/api/status', { headers });
|
|
166
|
+
let data;
|
|
167
|
+
if (res.status === 304 && _lastStatusData) {
|
|
168
|
+
// Cache hit — reuse last payload, skip parsing entirely.
|
|
169
|
+
data = _lastStatusData;
|
|
170
|
+
} else {
|
|
171
|
+
data = await res.json();
|
|
172
|
+
const etag = res.headers && (res.headers.get ? res.headers.get('etag') : null);
|
|
173
|
+
if (etag) {
|
|
174
|
+
_lastStatusEtag = etag;
|
|
175
|
+
_lastStatusData = data;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
156
178
|
// Auto-reload when dashboard restarts (stale connections cause "Failed to fetch" on CC/doc-chat)
|
|
157
179
|
const dashId = (data.version && data.version.dashboardStartedAt) || null;
|
|
158
180
|
if (dashId && _knownDashboardStartId && dashId !== _knownDashboardStartId) {
|