Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
show which preset a burn step matches instead of blanking the picker
[._.]/ Adam Eivydd8ec93acf47
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 01c1bfcc61..8a77121a02 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -26,6 +26,8 @@- **Quota burn stopped after the first family it dispatched, so a longer-windowed provider never burned at all.** A cycle selected every family whose window was inside its reset horizon, sorted them soonest-reset-first — and then returned after the first successful dispatch. Families do not share a budget: each draws down its own subscription window, against its own reserve and its own `maxDispatchesPerWindow`, so stopping early protected nothing. It just meant the soonest-resetting family took every cycle. A `claude` window resetting in 2h beat an `agy` window resetting in 21h on every tick, and the Antigravity plan sat at "93% left · 0/5 used" indefinitely while its eight configured audits never ran. A cycle now dispatches one job per *family*, records a run-log row per dispatch (so no family is hidden from the audit list), charges each window against its own key, and continues past a family whose job declines. When several plans are walked, every skip reason is prefixed with the family it came from.+- **The burn-job preset picker snapped back to "Choose a preset…" the moment you picked one.** Applying a preset copies its text into the step's work prompt 60 lines further down the row, so with the control blank the click read as a no-op and people picked again. It now shows the preset whose prompt the step still matches verbatim — derived from the text rather than stored, since nothing on disk records a preset id, so it reverts to the placeholder as soon as the prompt is edited into something else and never claims a step is an audit it no longer is. Re-picking the preset a row already matches no longer raises the "replace your text?" confirm; the text *is* that preset's.+- **The `ignore-scripts` supply-chain guard was silently inactive for every workspace install, including CI.** The repo-root `.npmrc` has pinned `ignore-scripts=true` for a while, but npm resolves the project `.npmrc` from the *local prefix* and never walks up the directory tree — so it never applied to `cd client && npm install`, `cd server && npm install`, or `npm ci --prefix server` / `--prefix client`, which is exactly what CI runs and what the documented per-workspace test workflow uses. In those paths every dependency kept an install-time code-execution slot: the same slot the August 2026 keyv/cacheable (Shai-Hulud) worm used, via a `preinstall` hook, to harvest credentials before any application code ran. `client/`, `server/`, `autofixer/`, and `browser/` now each carry their own `.npmrc`, so the guard holds in every workspace install path — whether entered by `cd`ing in or via `--prefix`.Closing the hole made the trusted-rebuild allowlist load-bearing for the first time, and it had drifted across its five copies (the root `setup` script, `scripts/ensure-deps.js`, `update.sh`, `update.ps1`, `setup.ps1`): the `esbuild` entries were dead — vite 8 dropped that dependency — while `onnxruntime-node` and `protobufjs` were missing entirely, so CI ran install hooks that the local setup skipped. All five now read one allowlist from `scripts/trusted-rebuilds.js`, and CI rebuilds it explicitly after installing server dependencies so `node-pty`'s native binding is still present for the smoke-boot. `scripts/trusted-rebuilds.test.js` fails if any workspace `.npmrc` loses the setting, or if a dependency shows up with an install hook nobody has decided about — the second case being how a missing native build otherwise surfaces much later as a confusing runtime crash.diff --git a/client/src/components/quotaBurn/JobRow.jsx b/client/src/components/quotaBurn/JobRow.jsxindex 6e7ee10017..e7dd633c21 100644--- a/client/src/components/quotaBurn/JobRow.jsx+++ b/client/src/components/quotaBurn/JobRow.jsx@@ -42,7 +42,15 @@ export default function JobRow({const spec = catalog.jobTypes.find((type) => type.id === job.jobType);const idPrefix = `burn-job-${job.id}`;const setParam = (key, value) => onChange({ ...job, params: { ...job.params, [key]: value } });- const hasPromptText = Boolean(String(job.params?.prompt || '').trim());+ const promptText = String(job.params?.prompt || '').trim();+ const hasPromptText = Boolean(promptText);+ // Which preset this row currently IS, derived rather than stored: a preset is+ // copied into `params.prompt` and nothing on disk points back at its id, so+ // matching the text is the only claim that stays true after an edit. The+ // picker shows the preset while the prompt is verbatim and reverts to its+ // placeholder as soon as the user changes a word.+ const matchedPreset = (catalog.presets || [])+ .find((preset) => promptText && String(preset.params?.prompt || '').trim() === promptText);const applyPreset = (preset) => { setPendingPreset(null); onChange(applyQuotaBurnPreset(job, preset)); };const optionsFor = (descriptor) => ({app: catalog.apps,@@ -138,7 +146,12 @@ export default function JobRow({// the conversion is safe: params carry across the type switch and// existing prompt text is confirmed before it is replaced.hint="Fills the work prompt below with a ready-made single-focus audit that files issues and changes no code."- onPick={(preset) => (hasPromptText ? setPendingPreset(preset) : applyPreset(preset))}+ value={matchedPreset?.id || ''}+ // Re-picking the preset the row already matches is a no-op, so it+ // needs no "replace your text?" confirm — the text IS the preset's.+ onPick={(preset) => (hasPromptText && preset.id !== matchedPreset?.id+ ? setPendingPreset(preset)+ : applyPreset(preset))}/>{(spec?.params || []).map((descriptor) => (<JobParamFielddiff --git a/client/src/components/quotaBurn/PresetPicker.jsx b/client/src/components/quotaBurn/PresetPicker.jsxindex cc7be75411..81a1eee37e 100644--- a/client/src/components/quotaBurn/PresetPicker.jsx+++ b/client/src/components/quotaBurn/PresetPicker.jsx@@ -7,15 +7,23 @@* configuration time. The server ships worked answers* (`server/lib/quotaBurnPresets.js`); this is how they get picked.*- * A one-shot ACTION, not a bound field: the select snaps back to its placeholder- * after firing, because the job it seeded is editable afterward and nothing on- * disk records which preset it came from — leaving a preset name selected would- * claim the row still matches text the user may have rewritten.+ * Two modes, chosen by whether the caller passes `value`:+ *+ * - **Bound** (a job row): `value` is the id of the preset whose prompt the row+ * STILL matches verbatim, derived by the caller — nothing on disk records a+ * preset id. So the control reports a fact rather than a memory: it shows the+ * preset while the text is that preset's, and falls back to the placeholder+ * the moment the user edits the prompt into something else. Leaving it blank+ * at all times (the original behavior) made picking a preset look like a+ * no-op, because the only visible effect was 60 lines below the fold.+ * - **One-shot action** (the family's "add a preset job"): no `value`, so the+ * select snaps back to its placeholder after firing — it adds a NEW step+ * rather than describing an existing one.*/import { inputClass } from './fields';-export default function PresetPicker({ id, label, presets, onPick, hint }) {+export default function PresetPicker({ id, label, presets, onPick, hint, value = '' }) {// Deliberately unfiltered by the row's current job type: a preset carries the// job type it needs, so picking one CONVERTS the step rather than being// inapplicable to it. Filtering hid the control entirely on a non-agent row,@@ -29,7 +37,9 @@ export default function PresetPicker({ id, label, presets, onPick, hint }) {<selectid={id}className={inputClass}- value=""+ // Guarded against a stale id: a `value` no match exists for would leave+ // React's <select> on whatever option the browser picked instead.+ value={rows.some((preset) => preset.id === value) ? value : ''}onChange={(event) => {const picked = rows.find((preset) => preset.id === event.target.value);if (picked) onPick(picked);diff --git a/client/src/pages/QuotaBurn.test.jsx b/client/src/pages/QuotaBurn.test.jsxindex d469d4df83..4492198b9d 100644--- a/client/src/pages/QuotaBurn.test.jsx+++ b/client/src/pages/QuotaBurn.test.jsx@@ -184,6 +184,27 @@ describe('QuotaBurn page', () => {expect(promptBox).toHaveValue('Audit the UI. File issues. Change no code.');});+ it('shows which preset a step currently matches, and drops it once the prompt is edited', async () => {+ // The picker used to snap straight back to "Choose a preset…", so applying+ // one looked like a no-op — its only visible effect was a textarea further+ // down the row. The selection is DERIVED from the prompt text (nothing on+ // disk records a preset id), so it stays honest across an edit.+ const user = userEvent.setup();+ renderPage('/devtools/quota-burn/grok');+ await user.selectOptions(await screen.findByLabelText('Job type'), 'agent-prompt');+ const picker = screen.getByLabelText(/Start from a preset/);+ expect(picker).toHaveValue('');++ await user.selectOptions(picker, 'ux-audit');+ expect(screen.getByLabelText('Work prompt')).toHaveValue('Audit the UI. File issues. Change no code.');+ expect(picker).toHaveValue('ux-audit');++ // Edited away from the preset ⇒ the row no longer IS that preset, and the+ // control must stop claiming it is.+ await user.type(screen.getByLabelText('Work prompt'), ' plus my own note');+ expect(picker).toHaveValue('');+ });+it('keeps the work prompt when the job type picker is clicked through', async () => {// Params are carried across a type switch: resetting them destroyed a long// hand-written prompt with no confirmation and no undo.