Skip to content

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

Add an extreme removal bar to the dependency-freedom audit and the /do:depfree run button

[._.]/ Adam Eivyf7eb7f8a3c9d
diff --git a/client/src/components/apps/SlashDoRunDrawer.jsx b/client/src/components/apps/SlashDoRunDrawer.jsx
index e070caa4bc..d0bf24b9fd 100644
--- a/client/src/components/apps/SlashDoRunDrawer.jsx
+++ b/client/src/components/apps/SlashDoRunDrawer.jsx
@@ -3,7 +3,7 @@ import { Loader2, Terminal, Wand2 } from 'lucide-react';
import Drawer from '../Drawer';
import ProviderModelSelector from '../ProviderModelSelector';
import ReviewerPicker from '../cos/ReviewerPicker';
-import { DEFAULT_PR_COMPLETION, PR_COMPLETION_OPTIONS, prCompletionOption } from '../cos/constants';
+import { DEFAULT_PR_COMPLETION, DEPFREE_MODE_DEFAULT, DEPFREE_MODE_OPTIONS, PR_COMPLETION_OPTIONS, depfreeModeOption, prCompletionOption } from '../cos/constants';
import useRunWithPicker from '../../hooks/useRunWithPicker';
import useReviewerModelOptions from '../../hooks/useReviewerModelOptions';
import { reviewerModelsFromDefaults, reviewerEffortsFromDefaults } from '../../lib/reviewerModels';
@@ -82,6 +82,12 @@ function SlashDoRunDrawerBody({ open, command, label, appId, appName, onClose, o
// agent-picked run the user just opted out of.
const awaitingPick = isNext && work.mode === 'pick' && !work.target;
+ // `/do:depfree`-only: the removal bar the route forwards as `--heavy` /
+ // `--extreme`. Sent only for that command — no other body reads the flag.
+ const isDepfree = command === 'depfree';
+ const depfreeModeId = useId();
+ const [depfreeMode, setDepfreeMode] = useState(DEPFREE_MODE_DEFAULT);
+
const handleQueue = async () => {
setSubmitting(true);
setSubmitError('');
@@ -93,6 +99,7 @@ function SlashDoRunDrawerBody({ open, command, label, appId, appName, onClose, o
issueAuthorFilter: work.issueAuthorFilter || undefined,
...picker.pin,
simplify,
+ ...(isDepfree ? { depfreeMode } : {}),
// `isNext &&` states the route's contract rather than leaning on the picker
// being unrendered: only the `next` branch of POST /tasks/slashdo reads these,
// so sending them for another command would be a silent no-op.
@@ -146,6 +153,27 @@ function SlashDoRunDrawerBody({ open, command, label, appId, appName, onClose, o
Simplify before committing
</span>
</label>
+ {isDepfree && (
+ <div>
+ <label htmlFor={depfreeModeId} className="block text-xs text-gray-400 mb-1">
+ Removal bar
+ </label>
+ <select
+ id={depfreeModeId}
+ value={depfreeMode}
+ onChange={e => setDepfreeMode(e.target.value)}
+ className="w-full bg-port-bg border border-port-border rounded px-3 py-2 text-white text-sm focus:border-port-accent focus:outline-hidden"
+ >
+ {DEPFREE_MODE_OPTIONS.map(option => (
+ <option key={option.value} value={option.value}>{option.label}</option>
+ ))}
+ </select>
+ <p className="text-xs text-gray-500 mt-1">
+ {depfreeModeOption(depfreeMode)?.description}.
+ {depfreeMode === 'extreme' && ' Pick the strongest model and max effort above; the command puts that tier on every sub-agent it spawns.'}
+ </p>
+ </div>
+ )}
{/* Reviewer choices are `/do:next`-only: they're substituted into the
claim prompt's reviewer CSV, and `POST /tasks/slashdo` reads them only
on that branch. Every other `/do:*` body owns its own review/PR
diff --git a/client/src/components/apps/SlashDoRunDrawer.test.jsx b/client/src/components/apps/SlashDoRunDrawer.test.jsx
index c396e9b937..ff1afd019e 100644
--- a/client/src/components/apps/SlashDoRunDrawer.test.jsx
+++ b/client/src/components/apps/SlashDoRunDrawer.test.jsx
@@ -194,6 +194,34 @@ describe('SlashDoRunDrawer', () => {
expect(body.reviewerMaxRounds).toBeUndefined();
});
+ // The removal bar is `/do:depfree`-only (the route forwards it as the
+ // command's own --heavy / --extreme flag). Untouched it sends the default bar,
+ // so the bare button still queues the flag-less run.
+ it('offers the depfree removal bar and sends the chosen mode', async () => {
+ renderDrawer({ command: 'depfree', label: '/do:depfree' });
+
+ const select = await screen.findByLabelText('Removal bar');
+ expect(select).toHaveValue('default');
+ await userEvent.selectOptions(select, 'extreme');
+ expect(screen.getByText(/Pick the strongest model and max effort/)).toBeInTheDocument();
+ await userEvent.click(screen.getByRole('button', { name: /Queue/ }));
+
+ await waitFor(() => expect(api.createSlashdoTask).toHaveBeenCalled());
+ const [command, , body] = api.createSlashdoTask.mock.calls[0];
+ expect(command).toBe('depfree');
+ expect(body.depfreeMode).toBe('extreme');
+ });
+
+ it('hides the removal bar for every other command and never sends it', async () => {
+ renderDrawer({ command: 'better', label: '/do:better' });
+
+ await waitFor(() => expect(screen.getByText('Task settings')).toBeInTheDocument());
+ expect(screen.queryByLabelText('Removal bar')).not.toBeInTheDocument();
+ await userEvent.click(screen.getByRole('button', { name: /Queue/ }));
+ await waitFor(() => expect(api.createSlashdoTask).toHaveBeenCalled());
+ expect(api.createSlashdoTask.mock.calls[0][2].depfreeMode).toBeUndefined();
+ });
+
it('lists the tracker items once "pick a specific" is chosen and sends the pinned ref', async () => {
const onQueued = vi.fn();
renderDrawer({ onQueued });
diff --git a/client/src/components/cos/constants.js b/client/src/components/cos/constants.js
index 2adc2a32c7..30a899c71e 100644
--- a/client/src/components/cos/constants.js
+++ b/client/src/components/cos/constants.js
@@ -439,6 +439,18 @@ export const RELEASE_OPTIONS = [
{ field: 'autoDecide', label: 'Make decisions', description: 'Make routine design and preference decisions and list them for your review, instead of stopping to ask' },
];
+// better-dependency-freedom's removal bar — the slashdo `/do:depfree` modes.
+// Values mirror DEPFREE_MODES in server/lib/cosValidation.js; the server drops
+// anything else, and an absent key means the default bar.
+export const DEPFREE_MODE_DEFAULT = 'default';
+export const DEPFREE_MODE_TASK_TYPES = new Set(['better-dependency-freedom']);
+export const DEPFREE_MODE_OPTIONS = [
+ { value: 'default', label: 'Default — small and wrapper packages', description: 'Keep large, widely audited libraries; replace micro-packages, native-API wrappers, and one-function imports' },
+ { value: 'heavy', label: 'Heavy — everything but foundations', description: 'Only frameworks, runtimes, and core platform tooling are exempt; popularity does not protect a library' },
+ { value: 'extreme', label: 'Extreme — toward zero dependencies', description: 'Only the runtime, security-sensitive protocols, native bindings, and CI-required tooling are exempt; large libraries are replaced when their used surface can be rebuilt behind parity tests. Pair with the strongest model at max effort' },
+];
+export const depfreeModeOption = (value) => DEPFREE_MODE_OPTIONS.find((o) => o.value === (value || DEPFREE_MODE_DEFAULT));
+
// Returns the Tailwind className string for an agent option toggle button.
// effective: whether the option is on (global + override resolved)
// hasOverride: whether there's an explicit per-app override set
diff --git a/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx b/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx
index 393ba45bd4..720c1b5b39 100644
--- a/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx
+++ b/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx
@@ -1,7 +1,7 @@
import { useState, memo } from 'react';
import AppIcon from '../../../AppIcon';
import CronInput from '../../../CronInput';
-import { AGENT_OPTIONS, BRANCHES_PER_AGENT_DEFAULT, BRANCHES_PER_AGENT_OPTIONS, BRANCHES_PER_AGENT_TASK_TYPES, ISSUE_AUTHOR_FILTER_OPTIONS, ISSUE_AUTHOR_FILTER_TASK_TYPES, PR_COMPLETION_OPTIONS, pinnedPrCompletion, prCompletionOption, SWARM_COUNT_OPTIONS, SWARM_TASK_TYPES, toggleAppMetadataOverride, agentOptionButtonClass } from '../../constants';
+import { AGENT_OPTIONS, BRANCHES_PER_AGENT_DEFAULT, BRANCHES_PER_AGENT_OPTIONS, BRANCHES_PER_AGENT_TASK_TYPES, DEPFREE_MODE_OPTIONS, DEPFREE_MODE_TASK_TYPES, depfreeModeOption, ISSUE_AUTHOR_FILTER_OPTIONS, ISSUE_AUTHOR_FILTER_TASK_TYPES, PR_COMPLETION_OPTIONS, pinnedPrCompletion, prCompletionOption, SWARM_COUNT_OPTIONS, SWARM_TASK_TYPES, toggleAppMetadataOverride, agentOptionButtonClass } from '../../constants';
import AppProviderPin from '../../AppProviderPin';
import { isCronExpression, describeCron } from '../../../../utils/cronHelpers';
import ToggleSwitch from '../../../ToggleSwitch';
@@ -319,6 +319,22 @@ const AppOverrideRow = memo(function AppOverrideRow({ app, taskType, globalInter
</select>
)}
+ {DEPFREE_MODE_TASK_TYPES.has(taskType) && (
+ <select
+ value={override?.taskMetadata?.depfreeMode ?? ''}
+ onChange={(e) => handleOverrideChange('depfreeMode', e.target.value)}
+ disabled={updating}
+ aria-label={`Removal bar for ${app.name}`}
+ title="How aggressively this app's dependency-freedom audit replaces packages (default / heavy / extreme)"
+ className="bg-port-card border border-port-border rounded px-2 py-1.5 text-xs text-white min-w-[120px] min-h-[40px]"
+ >
+ <option value="">Inherit ({depfreeModeOption(globalTaskMetadata?.depfreeMode)?.label})</option>
+ {DEPFREE_MODE_OPTIONS.map(opt => (
+ <option key={opt.value} value={opt.value}>{opt.label}</option>
+ ))}
+ </select>
+ )}
+
<div className="hidden sm:flex items-center gap-1.5" title={enabledToggleTitle}>{enabledToggle}</div>
</div>
diff --git a/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx b/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx
index 09e3522af7..d0ae38a1d9 100644
--- a/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx
+++ b/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx
@@ -222,6 +222,21 @@ describe('AppOverrideRow — branch-reconcile batch size', () => {
});
});
+describe('AppOverrideRow — dependency-freedom removal bar', () => {
+ it('allows an app to inherit or override the global removal bar', async () => {
+ const onUpdate = renderRow({
+ taskType: 'better-dependency-freedom',
+ globalTaskMetadata: { depfreeMode: 'heavy' },
+ override: { taskMetadata: { depfreeMode: 'extreme' } }
+ });
+ const select = screen.getByLabelText('Removal bar for Acme');
+ expect(select).toHaveValue('extreme');
+ expect(screen.getByRole('option', { name: /^Inherit \(Heavy/ })).toBeInTheDocument();
+ await act(async () => { fireEvent.change(select, { target: { value: '' } }); });
+ expect(onUpdate).toHaveBeenCalledWith('app-1', 'better-dependency-freedom', { taskMetadata: null });
+ });
+});
+
// The per-app provider/model pin beats the task's own pin at spawn for EVERY task
// type (#4783) — so the Schedule page, where that task pin is chosen, both shows
// what an app is running on and lets it be changed there.
diff --git a/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx b/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx
index 45197b0c01..cc4c2b1f27 100644
--- a/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx
+++ b/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useMemo } from 'react';
import useFieldDraft from '../../../../hooks/useFieldDraft';
import { RotateCcw, AlertCircle } from 'lucide-react';
import CronInput from '../../../CronInput';
-import { AGENT_OPTIONS, BRANCHES_PER_AGENT_DEFAULT, BRANCHES_PER_AGENT_OPTIONS, BRANCHES_PER_AGENT_TASK_TYPES, DEFAULT_REVIEW_STOP_MODE, REVIEWER_OVERRIDE_KEYS as REVIEW_CONFIG_KEYS, IMPLICIT_PR_COMPLETION, PR_AUTHOR_FILTER_OPTIONS, PR_COMPLETION_OPTIONS, pinnedPrCompletion, prCompletionOption, RELEASE_OPTIONS, RELEASE_OPTIONS_TASK_TYPES, ISSUE_AUTHOR_FILTER_OPTIONS, ISSUE_AUTHOR_FILTER_TASK_TYPES, SWARM_COUNT_OPTIONS, SWARM_TASK_TYPES } from '../../constants';
+import { AGENT_OPTIONS, BRANCHES_PER_AGENT_DEFAULT, BRANCHES_PER_AGENT_OPTIONS, BRANCHES_PER_AGENT_TASK_TYPES, DEFAULT_REVIEW_STOP_MODE, DEPFREE_MODE_DEFAULT, DEPFREE_MODE_OPTIONS, DEPFREE_MODE_TASK_TYPES, depfreeModeOption, REVIEWER_OVERRIDE_KEYS as REVIEW_CONFIG_KEYS, IMPLICIT_PR_COMPLETION, PR_AUTHOR_FILTER_OPTIONS, PR_COMPLETION_OPTIONS, pinnedPrCompletion, prCompletionOption, RELEASE_OPTIONS, RELEASE_OPTIONS_TASK_TYPES, ISSUE_AUTHOR_FILTER_OPTIONS, ISSUE_AUTHOR_FILTER_TASK_TYPES, SWARM_COUNT_OPTIONS, SWARM_TASK_TYPES } from '../../constants';
import ReviewerPicker from '../../ReviewerPicker';
import Banner from '../../../ui/Banner';
import InfoTooltip from '../../../ui/InfoTooltip';
@@ -227,6 +227,19 @@ export default function GlobalConfigControls({ taskType, config, onUpdate, onTri
}
};
+ // The removal bar is stored explicitly even for 'default', so the persisted
+ // task states the bar it ran under rather than leaving readers to infer it.
+ const handleDepfreeModeChange = async (value) => {
+ setUpdating(true);
+ try {
+ await onUpdate(taskType, {
+ taskMetadata: { ...(config.taskMetadata || {}), depfreeMode: value }
+ });
+ } finally {
+ setUpdating(false);
+ }
+ };
+
// '' drops the key so the task inherits its app's `defaultPrCompletion` —
// which works because no DEFAULT_TASK_INTERVALS entry ships a `prCompletion`
// for loadSchedule to merge back underneath. The legacy `reviewLoop` bit is
@@ -642,6 +655,27 @@ export default function GlobalConfigControls({ taskType, config, onUpdate, onTri
</div>
)}
+ {DEPFREE_MODE_TASK_TYPES.has(taskType) && (
+ <div>
+ <label htmlFor={`depfree-mode-${taskType}`} className="text-sm text-gray-400 block mb-2">Removal bar</label>
+ <select
+ id={`depfree-mode-${taskType}`}
+ value={config.taskMetadata?.depfreeMode || DEPFREE_MODE_DEFAULT}
+ onChange={(e) => handleDepfreeModeChange(e.target.value)}
+ disabled={updating}
+ className="w-full bg-port-card border border-port-border rounded px-3 py-2 text-white text-sm"
+ >
+ {DEPFREE_MODE_OPTIONS.map(opt => (
+ <option key={opt.value} value={opt.value}>{opt.label}</option>
+ ))}
+ </select>
+ <p className="text-xs text-gray-500 mt-1">
+ {depfreeModeOption(config.taskMetadata?.depfreeMode)?.description}.
+ {' '}Mirrors slashdo <code>/do:depfree</code> / <code>--heavy</code> / <code>--extreme</code>; the model and effort pins above decide what runs it.
+ </p>
+ </div>
+ )}
+
{RELEASE_OPTIONS_TASK_TYPES.has(taskType) && (
<div>
<span className="text-sm text-gray-400 block mb-2">Release Options</span>
diff --git a/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx b/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx
index 3e39880539..b724997ca0 100644
--- a/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx
+++ b/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx
@@ -175,6 +175,23 @@ describe('GlobalConfigControls — branch-reconcile batch size', () => {
});
});
+describe('GlobalConfigControls — dependency-freedom removal bar', () => {
+ it('is hidden for other audits', () => {
+ renderControls({ taskType: 'better-complexity' });
+ expect(screen.queryByLabelText('Removal bar')).not.toBeInTheDocument();
+ });
+
+ it('shows the default bar and persists the extreme bar explicitly', () => {
+ const onUpdate = renderControls({ taskType: 'better-dependency-freedom', taskMetadata: { fileIssues: true } });
+ const select = screen.getByLabelText('Removal bar');
+ expect(select).toHaveValue('default');
+ fireEvent.change(select, { target: { value: 'extreme' } });
+ expect(onUpdate).toHaveBeenCalledWith('better-dependency-freedom', {
+ taskMetadata: { fileIssues: true, depfreeMode: 'extreme' }
+ });
+ });
+});
+
describe('GlobalConfigControls — issue exclude labels', () => {
it('is hidden for a task type without the issue author filter', () => {
renderControls({ taskType: 'feature-ideas' });
diff --git a/docs/DEPS.md b/docs/DEPS.md
index eb9bf6404c..0fbae410f4 100644
--- a/docs/DEPS.md
+++ b/docs/DEPS.md
@@ -155,6 +155,18 @@ If `/do:depfree --heavy` is run, the following Tier 1 entries would drop to Tier
This is intentionally NOT done in default mode — current dependency footprint is reasonable for the project's deployment context (single-user, Tailscale-private).
+## Extreme-Mode Notes
+
+`/do:depfree --extreme` (and the `better-dependency-freedom` scheduled audit with its removal bar set to **Extreme**) aims at zero dependencies: it forces the strongest model tier at maximum reasoning effort, drops the line ceiling in favor of a parity-test gate, and keeps only what cannot be owned responsibly — the Node runtime and npm, security-sensitive protocol implementations (the `pg` wire protocol and its authentication, TLS), native bindings (`node-pty`, `better-sqlite3-multiple-ciphers`, `sharp`), and the CI-required test runner. Under that bar the following Tier 1 entries become candidates, each needing a written replacement design and a parity suite before any call site switches:
+
+- `express` and `compression` — the used surface is routing, middleware chaining, static files, body parsing, and Brotli/gzip negotiation over `node:http` and `node:zlib`.
+- `socket.io` — the used surface is rooms, acks, and reconnection over WebSocket; a design must cover the client half too.
+- `react` / `react-dom` — a product-level rewrite rather than a dependency swap; expected to be recorded `SKIPPED_INFEASIBLE` with a design sketch and a filed issue, which is the mode's required output for a package it cannot remove.
+- `@googleapis/*` — direct REST calls plus owned OAuth signing.
+- `chokidar`, `@dnd-kit/*`, `@xterm/*`, `lucide-react`, `recharts`, `three` — re-evaluated by used surface, not size.
+
+An extreme run re-tests every `SKIPPED_INFEASIBLE` row here rather than honoring it, so this section is a forecast, not a decision log; the decision log is the tables above, which record the mode each row was reached under.
+
## Override Pins (`overrides`)
Defined in `package.json` (root + server + client + autofixer) — kept current to dodge known upstream advisories:
diff --git a/docs/features/self-improvement-audits.md b/docs/features/self-improvement-audits.md
index 7db4d78767..b015d22c82 100644
--- a/docs/features/self-improvement-audits.md
+++ b/docs/features/self-improvement-audits.md
@@ -171,3 +171,24 @@ PLAN.md keeps its existing checklist IDs. New forge and JIRA issues use plain
human-readable titles, with the issue number/key as the ID and category/metric
labels for filtering. Earlier bracketed title prefixes are read only when
checking for duplicates; new issue titles do not add them.
+
+### The dependency-freedom removal bar
+
+`better-dependency-freedom` carries one more knob than its siblings: the
+**removal bar** (`taskMetadata.depfreeMode`, set globally on the Schedule page
+and overridable per app), rendered at `{depfreeMode}` and prepended when a
+customized prompt dropped the token. Its values are the slashdo `/do:depfree`
+modes, so a scheduled audit and a terminal run draw the same line:
+
+| Bar | Exempt | Ceiling |
+|:--|:--|:--|
+| `default` | large, widely audited libraries | ~300 lines of owned code |
+| `heavy` | foundational frameworks, runtimes, core tooling | ~300 lines; popularity is not an exemption |
+| `extreme` | the runtime, security-sensitive protocols and primitives, native bindings, CI-required tooling | none — a parity test suite and a written replacement design gate each swap |
+
+The extreme bar is written for the strongest available model at maximum
+reasoning effort; it tells the agent to say so at the top of its report when it
+is running on a budget provider, rather than quietly lowering the bar. Pin the
+model and effort on the same Schedule card. The server-side vocabulary is
+`DEPFREE_MODES` in `server/lib/auditCatalog.js`, beside the block text in
+`applyDepfreeMode`; `server/lib/cosValidation.js` re-exports the vocabulary.
diff --git a/lib/slashdo b/lib/slashdo
index 17ee2bbe0b..69c359bda2 160000
--- a/lib/slashdo
+++ b/lib/slashdo
@@ -1 +1 @@
-Subproject commit 17ee2bbe0b97a2dad7bb9093ac271bb3a34d030d
+Subproject commit 69c359bda22d7ac40e548b0e64492d2768aa78c8
diff --git a/server/lib/auditCatalog.js b/server/lib/auditCatalog.js
index b2d22c7645..e08d52d5b3 100644
--- a/server/lib/auditCatalog.js
+++ b/server/lib/auditCatalog.js
@@ -1,4 +1,5 @@
import { isTruthyMeta } from './metadataFlags.js';
+import { renderOrPrependSection } from './promptSectionRenderer.js';
/**
* Shared catalog of scheduled AUDIT task types — the ones that can either
* implement a fix or just file tracker issues, matching the quota-burn
@@ -787,6 +788,90 @@ export function applyAuditModeWrapper(promptTemplate, modeInstructions) {
return `${modeInstructions}\n\n---\n\n${prompt}`;
}
+// better-dependency-freedom's removal bar — the same vocabulary as slashdo's
+// `/do:depfree` / `--heavy` / `--extreme`. `default` keeps large, widely
+// audited libraries; `heavy` exempts only foundational frameworks, runtimes and
+// core tooling; `extreme` exempts only what cannot be owned responsibly (the
+// runtime, security-sensitive protocols and primitives, native bindings,
+// CI-required tooling) and is written for the strongest model at max effort.
+// Catalog-owned, like the mode contracts above, so the sanitizer
+// (lib/cosValidation.js), the generator, and the prompt-expansion guard all
+// read ONE list and a value cannot be settable yet silently absent from the
+// prompt. Absent = default.
+export const DEPFREE_MODES = ['default', 'heavy', 'extreme'];
+export const DEFAULT_DEPFREE_MODE = 'default';
+
+// One block per DEPFREE_MODES entry: where the "Acceptable" line sits for the
+// dependency-freedom audit. Keyed by the same list the sanitizer allowlists, so
+// a mode cannot be settable yet silently absent from the prompt. The wording
+// tracks slashdo's `/do:depfree` default / --heavy / --extreme rules so a
+// PortOS-scheduled audit and a terminal run of the command draw the same line.
+const DEPFREE_MODE_BLOCKS = {
+ default: `## Removal bar for this run: default
+
+Keep large, widely audited libraries that do real work — frameworks, runtimes,
+database drivers, build toolchains, rendering and math libraries — without
+relitigating them. Candidates are small single-purpose packages, wrappers over
+capabilities the platform now provides, micro-packages, and libraries where the
+project uses one or two functions. A replacement above ~300 lines of owned code
+is Infeasible at this bar; prefer a native API or a short owned helper.`,
+ heavy: `## Removal bar for this run: heavy
+
+Only foundational frameworks, core platform tooling, and language runtimes are
+exempt. Popularity and download counts do not exempt a library: utility
+collections, HTTP clients, logging, CLI parsers, date, glob, validation, retry,
+color, and event-emitter libraries are all candidates, and devDependencies get
+the same priority as production ones. Maintenance status is irrelevant — the
+question is whether the project can own the code. The replacement ceiling is
+~300 lines of owned code per package; when a package sits on the line, lean
+toward removal.`,
+ extreme: `## Removal bar for this run: extreme — the goal is zero dependencies
+
+Exempt ONLY what cannot be owned responsibly: the language runtime and its
+standard library, the package manager and compiler the build needs,
+security-sensitive protocol and primitive implementations (TLS, cryptography,
+authentication protocols, database wire protocols with authentication, codecs
+with conformance suites you cannot run), native bindings to the OS or hardware,
+and the lint/format/test tooling CI requires. Everything else is a candidate —
+web frameworks, UI libraries, client SDKs, ORMs, parsers, build plugins — judged
+by whether its USED surface can be rebuilt behind a parity test suite, never by
+its size or popularity. There is no line ceiling.
+
+For any replacement above ~100 lines, write a replacement design first: the
+exact used surface (symbols, options, behaviors relied on), the owned module's
+API, the parity test plan, the edge cases the call sites reach versus the ones
+provably unreachable, and the risk the swap carries. The design is part of the
+finding, and part of the PR when you implement. Work extra hard: read the
+library's source for the behaviors the call sites depend on — option defaults,
+error shapes, ordering guarantees, encoding edge cases — instead of guessing
+from its README, and write the parity tests so they fail against a stub before
+any call site switches over.
+
+A package you leave in place needs a reason a reviewer could argue with;
+"popular", "large", or "too much code" is not one. Record what a future run
+would need instead (a conformance suite, a native addon, a product-level
+rewrite). This bar is written for the strongest available model at maximum
+reasoning effort; if this run is on a budget provider or model, say so at the
+top of the report rather than quietly lowering the bar.`,
+};
+
+/**
+ * Render the operator's dependency-freedom removal bar into the audit prompt.
+ * `depfreeMode` was merged (global → per-app override) and value-constrained
+ * by sanitizeTaskMetadata, so read it straight from the metadata; absent means
+ * the default bar. A customized stored prompt that dropped `{depfreeMode}`
+ * still gets the block PREPENDED, so choosing the heavy or extreme bar is never
+ * a silent no-op on that install. Every other task type passes through.
+ */
+export function applyDepfreeMode(promptTemplate, taskType, metadata) {
+ const prompt = typeof promptTemplate === 'string' ? promptTemplate : '';
+ if (taskType !== 'better-dependency-freedom') return prompt;
+ const mode = DEPFREE_MODES.includes(metadata?.depfreeMode) ? metadata.depfreeMode : DEFAULT_DEPFREE_MODE;
+ // The block carries its own heading, so the prepend path passes null.
+ return renderOrPrependSection(prompt, '{depfreeMode}', null, DEPFREE_MODE_BLOCKS[mode]);
+}
+
+
/**
* Scheduled audit types mapped onto the scope table in slashdo's
* `lib/better-audit.md`. The exported `DO_BETTER_LENS_COVERAGE` name remains
diff --git a/server/lib/auditCatalog.test.js b/server/lib/auditCatalog.test.js
index 251c3b99c2..24aac9e044 100644
--- a/server/lib/auditCatalog.test.js
+++ b/server/lib/auditCatalog.test.js
@@ -2,6 +2,7 @@ import { describe, it, expect } from 'vitest';
import { QUOTA_BURN_PROMPT_PRESETS } from './quotaBurnPresets.js';
import { requireSlashdoSubmoduleInCi } from './testHelper.js';
import {
+ applyDepfreeMode,
AUDIT_DEFINITIONS,
AUDIT_TASK_TYPES,
AUDIT_TASK_TYPE_LIST,
@@ -388,3 +389,48 @@ it('keeps the quota-burn maintenance preset on registered tasks in the advisory
}
}
});
+
+describe('applyDepfreeMode — the dependency-freedom {depfreeMode} block', () => {
+ const TYPE = 'better-dependency-freedom';
+
+ it('renders the default bar when no mode is stored', () => {
+ const out = applyDepfreeMode('Bar:\n{depfreeMode}\nEnd', TYPE, {});
+ expect(out).toContain('## Removal bar for this run: default');
+ expect(out).toContain('Keep large, widely audited libraries');
+ expect(out).not.toContain('{depfreeMode}');
+ expect(out.startsWith('Bar:')).toBe(true);
+ });
+
+ it('renders the extreme bar with its design and parity requirements', () => {
+ const out = applyDepfreeMode('{depfreeMode}', TYPE, { depfreeMode: 'extreme' });
+ expect(out).toContain('## Removal bar for this run: extreme — the goal is zero dependencies');
+ expect(out).toContain('There is no line ceiling.');
+ expect(out).toContain('write a replacement design first');
+ expect(out).toContain('parity test');
+ // The security-sensitive classes stay exempt at every bar.
+ expect(out).toContain('TLS, cryptography');
+ expect(out).toContain('native bindings');
+ expect(out).toContain('strongest available model at maximum');
+ });
+
+ it('renders the heavy bar', () => {
+ const out = applyDepfreeMode('{depfreeMode}', TYPE, { depfreeMode: 'heavy' });
+ expect(out).toContain('## Removal bar for this run: heavy');
+ expect(out).toContain('Popularity and download counts do not exempt a library');
+ });
+
+ it('prepends the block once to a customized prompt that dropped the token', () => {
+ const out = applyDepfreeMode('my custom depfree prompt', TYPE, { depfreeMode: 'extreme' });
+ expect(out.startsWith('## Removal bar for this run: extreme')).toBe(true);
+ expect(out.match(/## Removal bar for this run/g)).toHaveLength(1);
+ expect(out.endsWith('my custom depfree prompt')).toBe(true);
+ });
+
+ it('falls back to the default bar for a value the sanitizer would have dropped', () => {
+ expect(applyDepfreeMode('{depfreeMode}', TYPE, { depfreeMode: 'zero' })).toContain('Removal bar for this run: default');
+ });
+
+ it('leaves every other task type untouched', () => {
+ expect(applyDepfreeMode('{depfreeMode}', 'better-complexity', { depfreeMode: 'extreme' })).toBe('{depfreeMode}');
+ });
+});
diff --git a/server/lib/cosValidation.js b/server/lib/cosValidation.js
index 75045287c0..0fa0b29bf8 100644
--- a/server/lib/cosValidation.js
+++ b/server/lib/cosValidation.js
@@ -24,7 +24,7 @@ import { ORCHESTRATION_MODES, ORCHESTRATION_ROLES } from './orchestrationProfile
import { AGENT_RUN_EVENT_KINDS, RUN_EVENT_READ_LIMITS } from './agentRunEvents.js';
import { TASK_STATUS_VALUES, TASK_PRIORITY_VALUES } from './taskParser.js';
import { recurrenceRuleSchema } from './recurrenceValidation.js';
-import { AUDIT_TASK_TYPE_LIST } from './auditCatalog.js';
+import { AUDIT_TASK_TYPE_LIST, DEPFREE_MODES } from './auditCatalog.js';
import { CLAIM_DRAIN_TASK_TYPES } from './qualitySchedulePlan.js';
import { JOB_INTERVAL_VALUES } from './autonomousJobIntervals.js';
import { jobFormFieldsSchema, jobFormValuesSchema } from './jobFormFields.js';
@@ -941,6 +941,12 @@ export const REPO_SYNC_ACTION_KEYS = ['syncPush', 'syncPull', 'switchDefault', '
// prompt block, so a toggle cannot be dropped at one boundary.
export const RELEASE_OPTION_KEYS = ['finishInFlight', 'mergeDependencyUpdates', 'resolveBlockers', 'autoDecide'];
+// better-dependency-freedom's removal bar vocabulary is catalog-owned (see
+// DEPFREE_MODES in lib/auditCatalog.js, beside the prompt block that renders
+// it); re-exported here so the validation barrel stays the one import for
+// task-metadata vocabularies.
+export { DEPFREE_MODES, DEFAULT_DEPFREE_MODE } from './auditCatalog.js';
+
const ALLOWED_TASK_METADATA_KEYS = [
...PIPELINE_BEHAVIOR_FLAGS, 'readOnly', 'claimFlow',
'cleanupMerged', 'openPr', 'resolveConflicts', 'autoMerge', 'finishAbandoned', 'autoClose',
@@ -1131,6 +1137,9 @@ export const slashdoTaskSchema = createCosTaskSchema
issueContext: prefetchedIssueContextSchema.optional(),
overrideContext: claimOverrideContextSchema,
issueAuthorFilter: z.enum(ISSUE_AUTHOR_FILTERS).optional(),
+ // `/do:depfree`-only: the removal bar, forwarded as the command's
+ // `--heavy` / `--extreme` flag (the default bar sends no flag).
+ depfreeMode: z.enum(DEPFREE_MODES).optional(),
});
// The Pull Requests tab's "Run with" picker (mirrors the Issues tab's same
@@ -1290,6 +1299,13 @@ export function sanitizeTaskMetadata(raw) {
clean.verifyMode = raw.verifyMode;
hasKeys = true;
}
+ // `depfreeMode` sets the dependency-freedom audit's removal bar — constrained
+ // to DEPFREE_MODES so a hand-edited schedule cannot smuggle in a string the
+ // prompt block would silently render as the default bar.
+ if (Object.prototype.hasOwnProperty.call(raw, 'depfreeMode') && DEPFREE_MODES.includes(raw.depfreeMode)) {
+ clean.depfreeMode = raw.depfreeMode;
+ hasKeys = true;
+ }
// `issueAuthorFilter` gates claim-issue dispatch on issue authorship —
// constrained to a known value so a hand-edited config can't smuggle in an
// arbitrary string the claim flow would silently treat as "owner".
diff --git a/server/lib/cosValidation.test.js b/server/lib/cosValidation.test.js
index 0cef1f2ed6..ae05a1dc76 100644
--- a/server/lib/cosValidation.test.js
+++ b/server/lib/cosValidation.test.js
@@ -59,6 +59,19 @@ describe('branch-reconcile batch metadata', () => {
});
});
+describe('dependency-freedom removal bar metadata', () => {
+ it('keeps each slashdo depfree mode and drops anything else', () => {
+ for (const depfreeMode of ['default', 'heavy', 'extreme']) {
+ expect(sanitizeTaskMetadata({ depfreeMode })).toEqual({ depfreeMode });
+ }
+ // A hand-edited schedule cannot smuggle in a bar the prompt block has no
+ // text for — it would render as the default bar while claiming otherwise.
+ for (const depfreeMode of ['EXTREME', 'zero', true, 2, null]) {
+ expect(sanitizeTaskMetadata({ depfreeMode })).toBeNull();
+ }
+ });
+});
+
describe('cosValidation pipeline stage metadata', () => {
const validStage = {
name: 'Eligibility Gate',
diff --git a/server/lib/workTracker.trackerInstructions.test.js b/server/lib/workTracker.trackerInstructions.test.js
index ab042848a6..9ddaf2e6e3 100644
--- a/server/lib/workTracker.trackerInstructions.test.js
+++ b/server/lib/workTracker.trackerInstructions.test.js
@@ -25,7 +25,7 @@ import { getAuditFilingPreset } from './auditCatalog.js';
// budget when a full run is contending for CPU. File scope is unbudgeted
// (#7951, #10356).
const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
-const { AUDIT_TASK_TYPES, modeContractFor } = await import('./auditCatalog.js');
+const { AUDIT_TASK_TYPES, applyDepfreeMode, modeContractFor } = await import('./auditCatalog.js');
const REF_WATCH = { slugPrefix: 'ref-watch-', label: 'reference-watch', issueLabel: 'reference-watch' };
@@ -265,7 +265,9 @@ describe('formatTrackerInstructions — ux preset (#3273)', () => {
taskType,
{ fileIssues },
);
- const rendered = template
+ // Mirrors the generator: the dependency-freedom removal bar is
+ // rendered from task metadata (absent = default) before the mode seams.
+ const rendered = applyDepfreeMode(template, taskType, {})
.replace(/\{modeInstructions\}/g, () => modeContractFor(fileIssues))
.replace(/\{trackerInstructions\}/g, () => trackerInstructions)
.replace(/\{appName\}/g, () => 'Example App')
diff --git a/server/routes/cos.test.js b/server/routes/cos.test.js
index 6b829b2a96..54a5f47d4d 100644
--- a/server/routes/cos.test.js
+++ b/server/routes/cos.test.js
@@ -1124,6 +1124,38 @@ describe('CoS Routes', () => {
expect(cos.addTask.mock.calls.at(-1)[0].worktreeChangesExpected).toBe(expected);
});
+ // The run drawer's removal bar reaches the bundled command as its own flag;
+ // the default bar is the flag-less invocation, and no other command gets
+ // the flag (its body has nothing to read it).
+ it.each([
+ ['depfree', 'extreme', '--extreme'],
+ ['depfree', 'heavy', '--heavy'],
+ ['depfree', 'default', undefined],
+ ['depfree', undefined, undefined],
+ ['better', 'extreme', undefined]
+ ])('forwards the depfree removal bar as a command flag — %s + %s ⇒ %s', async (command, depfreeMode, slashdoArgs) => {
+ getAppById.mockResolvedValue({ id: 'my-app', name: 'MyApp', type: 'web', repoPath: '/repo' });
+ cos.addTask.mockResolvedValue({ id: 'task-depfree-mode', status: 'pending' });
+
+ const response = await request(app)
+ .post('/api/cos/tasks/slashdo')
+ .send({ command, app: 'my-app', ...(depfreeMode ? { depfreeMode } : {}) });
+
+ expect(response.status).toBe(200);
+ const [taskData] = cos.addTask.mock.calls.at(-1);
+ expect(taskData.slashdoArgs).toBe(slashdoArgs);
+ expect(taskData.description.includes('mode)')).toBe(slashdoArgs !== undefined);
+ });
+
+ it('rejects an unknown depfree removal bar', async () => {
+ getAppById.mockResolvedValue({ id: 'my-app', name: 'MyApp', type: 'web', repoPath: '/repo' });
+ const response = await request(app)
+ .post('/api/cos/tasks/slashdo')
+ .send({ command: 'depfree', app: 'my-app', depfreeMode: 'zero' });
+ expect(response.status).toBe(400);
+ expect(cos.addTask).not.toHaveBeenCalled();
+ });
+
it('queues the SwiftUI audit for a Swift app', async () => {
getAppById.mockResolvedValue({ id: 'my-ios', name: 'MyPhone', type: 'ios-native', repoPath: '/repo' });
cos.addTask.mockResolvedValue({ id: 'task-sd-swift', status: 'pending' });
diff --git a/server/routes/cosTaskRoutes.js b/server/routes/cosTaskRoutes.js
index 0c90cccb2d..dedef77cb6 100644
--- a/server/routes/cosTaskRoutes.js
+++ b/server/routes/cosTaskRoutes.js
@@ -266,7 +266,7 @@ router.post('/tasks/slashdo', asyncHandler(async (req, res) => {
const {
command, app, provider, model, effort, simplify, issueTarget, prCompletion,
target, issueContext, overrideContext, issueAuthorFilter, reviewers, usernames, optionalReviewers,
- reviewerMaxRounds, reviewerModels, reviewerEfforts
+ reviewerMaxRounds, reviewerModels, reviewerEfforts, depfreeMode
} = validateRequest(slashdoTaskSchema, req.body);
const workflow = getSlashdoWorkflow(command);
@@ -390,10 +390,17 @@ router.post('/tasks/slashdo', asyncHandler(async (req, res) => {
},
};
} else {
+ // `/do:depfree`'s removal bar rides along as the command's own flag: the
+ // bundled body parses `--heavy` / `--extreme` itself, and the default bar
+ // is the flag-less invocation. Ignored for every other command, whose body
+ // has no such flag to read.
+ const depfreeArgs = command === 'depfree' && depfreeMode && depfreeMode !== 'default'
+ ? { slashdoArgs: `--${depfreeMode}` }
+ : {};
shape = {
- description: `${workflow.label} for ${appObj.name} — ${workflow.description}`,
+ description: `${workflow.label} for ${appObj.name} — ${workflow.description}${depfreeArgs.slashdoArgs ? ` (${depfreeMode} mode)` : ''}`,
slashdoCommand: command,
- taskMetadata: { useWorktree, openPR, worktreeChangesExpected },
+ taskMetadata: { useWorktree, openPR, worktreeChangesExpected, ...depfreeArgs },
};
}
diff --git a/server/services/cosTaskGenerator.js b/server/services/cosTaskGenerator.js
index 083e2e362d..b0ed39b577 100644
--- a/server/services/cosTaskGenerator.js
+++ b/server/services/cosTaskGenerator.js
@@ -70,6 +70,7 @@ import {
auditDoWorkRequiresWorktree,
modeContractFor,
applyAuditModeWrapper,
+ applyDepfreeMode,
FILE_ISSUES_DELIVERY_SETTINGS,
} from '../lib/auditCatalog.js';
import { TIMED_COOLDOWN_BLOCKED_CATEGORIES } from '../lib/taskBlockCategories.js';
@@ -2731,7 +2732,7 @@ export async function prepareManagedAppImprovementTask(taskType, app, state, {
? `${modeContractFor(fileIssues)}\n\n${auditQualityInstructions(taskType)}`
: '';
const baseDescription = await buildImprovementTaskDescription({
- promptTemplate: applyAuditModeWrapper(applyReleaseOptions(promptTemplate, promptTaskType, metadata), modeInstructions),
+ promptTemplate: applyAuditModeWrapper(applyDepfreeMode(applyReleaseOptions(promptTemplate, promptTaskType, metadata), promptTaskType, metadata), modeInstructions),
app, promptTaskType, metadata,
blocks: {
referenceData: referenceDataBlock,
diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.js
index 6829d25180..d208ad74dd 100644
--- a/server/services/taskPromptDefaults.test.js
+++ b/server/services/taskPromptDefaults.test.js
@@ -223,12 +223,12 @@ describe('taskPromptDefaults integrity snapshot', () => {
['better-complexity', ['1 + the number of independent decision points', 'Length is not complexity', 'Name the transformation', 'Behavior preservation is the contract']],
['better-cognitive-load', ['reader cost', 'Flag arguments', 'Action at a distance', 'are not your findings']],
['better-runtime-safety', ['Sentinel confusion', 'a failure scenario, not a code shape', 'Not yours']],
- ['better-dependency-freedom', ['Acceptable', 'Suspect', 'Removable', 'Respect documented decisions', 'file no version bumps here']],
+ ['better-dependency-freedom', ['Acceptable', 'Suspect', 'Removable', 'Respect documented decisions', 'file no version bumps here', '{depfreeMode}', 'The\nremoval bar above decides where the Acceptable line sits']],
['better-test-quality', ['Vacuous', 'mutation probe', 'Deletion is a valid outcome', 'Missing coverage is separate work']],
['better-dev-environment', ['Measure, do not only read', 'before and after', 'Prefer a guard to a patch', 'Not yours']],
])('%s states the discipline that makes it its own lane', (key, markers) => {
const current = DEFAULT_TASK_PROMPTS[key];
- const versions = { 'better-cognitive-load': 2, 'better-complexity': 2, 'better-runtime-safety': 3, 'better-test-quality': 2 };
+ const versions = { 'better-cognitive-load': 2, 'better-complexity': 2, 'better-dependency-freedom': 2, 'better-runtime-safety': 3, 'better-test-quality': 2 };
expect(PROMPT_VERSIONS[key]).toBe(versions[key] ?? 1);
for (const marker of markers) expect(current, key).toContain(marker);
});
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 2087771a3c..c73971f69c 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -5,7 +5,7 @@
"app-launch-video": "271c1e8bc301ba02b4a2207e0abf8573",
"better-cognitive-load": "882bbda803edcdef5a4308521050f8fd",
"better-complexity": "c99f67b43ff54a1c8cf0176c721d9c06",
- "better-dependency-freedom": "8a79c8be829f926bbc7720ee29818d53",
+ "better-dependency-freedom": "b0a95a02a2234fb6bbdce5c3dcd2eda4",
"better-dev-environment": "62523b82066e70ff1c786da22ccf0372",
"better-runtime-safety": "444c7104f32a8cd1c1ddb7a15b275512",
"better-structural-drift": "941389a1f1c8983eef4f87af1241fbf9",
@@ -70,7 +70,7 @@
"app-launch-video": 8,
"better-cognitive-load": 2,
"better-complexity": 2,
- "better-dependency-freedom": 1,
+ "better-dependency-freedom": 2,
"better-dev-environment": 1,
"better-runtime-safety": 3,
"better-structural-drift": 1,
@@ -151,6 +151,9 @@
"better-complexity": [
"c92b99080d0453d70bb26a412fb48ce9"
],
+ "better-dependency-freedom": [
+ "8a79c8be829f926bbc7720ee29818d53"
+ ],
"better-runtime-safety": [
"4259ab85dd3eaf8efb16a250187bd857",
"1038ac5008cb52e418460f53f262ad22"
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index f958517ff7..a7cc6a837f 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -1659,23 +1659,31 @@ Repository: {repoPath}
{modeInstructions}
+{depfreeMode}
+
This audit asks whether a dependency should exist at all. Keeping the
dependencies you do have current is separate work — file no version bumps here.
## Inventory and classify
-Read the project's manifest(s) and classify every direct dependency:
+Read the project's manifest(s) and classify every direct dependency. **The
+removal bar above decides where the Acceptable line sits** — read it before
+classifying; the examples below describe the default bar, and the heavy and
+extreme bars shrink Acceptable to what they exempt.
-- **Acceptable** — large, widely audited, doing real work you would never
- reimplement: frameworks, runtimes, database drivers, build toolchains,
- rendering and math libraries. Skip these; do not spend the run relitigating
- them.
+- **Acceptable** — exempt under the removal bar: at the default bar, large,
+ widely audited libraries doing real work you would never reimplement —
+ frameworks, runtimes, database drivers, build toolchains, rendering and math
+ libraries. Skip these; do not spend the run relitigating them.
- **Suspect** — a smaller library where the project appears to use one or two
functions, a wrapper over capabilities the platform now provides, or a
- single-purpose utility.
+ single-purpose utility. Under the heavy and extreme bars, every package the
+ bar does not exempt starts here.
- **Removable** — the used functionality is small enough to own outright, the
package wraps an API that is now native, it is unmaintained, or it is a
- micro-package whose whole body is a few lines.
+ micro-package whose whole body is a few lines. Under the extreme bar, also
+ any package whose used surface can be rebuilt behind a parity test suite,
+ whatever its size.
## Prove usage before proposing removal
@@ -1688,9 +1696,12 @@ grep -rn "<package-name>" --include='*.*' . | grep -v node_modules
List every symbol imported, count the call sites and files, and check for
dynamic or string-keyed usage a plain grep misses — config files, plugin
registries, build tooling, CI. Then size the replacement honestly: Trivial
-(under ~20 lines), Moderate (~20–100), Complex (~100–300), or Infeasible. Check
-maintenance status: last release, open advisories, and whether it still supports
-the runtime versions the project targets.
+(under ~20 lines), Moderate (~20–100), Complex (~100–300), or Infeasible. Under
+the extreme bar the sizes describe rather than gate — Infeasible means a class
+the bar exempts, not a line count — and a Complex-or-larger finding carries the
+replacement design the bar asks for. Check maintenance status: last release,
+open advisories, and whether it still supports the runtime versions the project
+targets.
**A platform capability that has replaced a package is the strongest case** — a
built-in UUID generator, structured cloning, array flattening, promise-based
@@ -1712,8 +1723,12 @@ status, and the risk the removal carries. Severity follows real exposure —
unmaintained with a known advisory on a reachable path is the top of the list; a
suspect package with a complex replacement is the bottom.
-In implement mode, remove exactly ONE package per run, and cover its replacement
-with a test exercising the behavior the package used to provide.`,
+In implement mode, remove exactly ONE package per run (or one family of packages
+that share a single owned replacement module), and cover its replacement with a
+test exercising the behavior the package used to provide. A large replacement
+under the extreme bar is still one run: the design, the parity suite, and the
+swap ship together, and the package stays in the manifest until the suite
+passes against the owned code.`,
'better-test-quality': `[Improvement: {appName}] Test quality audit
diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.js
index d5ec4a6c21..674f9806eb 100644
--- a/server/services/taskPromptDefaults/versions.js
+++ b/server/services/taskPromptDefaults/versions.js
@@ -67,7 +67,7 @@ export const PROMPT_VERSIONS = {
'better-cognitive-load': 2, // v2: audit and clean excessive code comments while preserving contracts and rationale. v1: reader cost (mixed abstraction, flag arguments, lying names, action at a distance) — explicitly NOT the size/nesting thresholds its siblings own.
'better-structural-drift': 1, // v1: derived artifacts as a second source of truth, position-keyed records, hand-synced registries, incidental-layout coupling — carved out of code-quality v3.
'better-runtime-safety': 3, // v3: adds cross-module contract breaks in untyped code (missing members, missing named exports, dropped wrapper arguments) with a guard-test fix. Previous version: Framework-neutral UI lifecycle overlap. Previous version: v1: latent defects (floating promises, unowned rejections, unguarded access, sentinel confusion, races, leaks) requiring a concrete failure scenario.
- 'better-dependency-freedom': 1, // v1: dependency NECESSITY (the do:depfree lens) — classify, prove usage, size the replacement. Distinct from dependency-updates, which bumps what stays.
+ 'better-dependency-freedom': 2, // v2: carries {depfreeMode} — the operator-chosen removal bar (default / heavy / extreme, the slashdo do:depfree modes) decides where the Acceptable line sits, and the extreme bar asks for a replacement design and parity suite with no size ceiling. v1: dependency NECESSITY (the do:depfree lens) — classify, prove usage, size the replacement. Distinct from dependency-updates, which bumps what stays.
'infrastructure': 2, // v2: measured CI efficiency, risk-based stage placement and test-value evidence. v1: IaC/container/orchestration/CI audit — exposure, identity grants, secrets, pinning, runtime guardrails, state config, CI supply chain, environment drift. Net-new type. Mode injected at dispatch.
'data-integrity': 1, // v1: runtime data-correctness audit — idempotency under redelivery, partial writes, lost updates, boundary validation, schema evolution, semantic corruption, pagination, retention, transfer checks. Net-new type.
'reliability': 1, // v1: service reliability audit — shutdown draining, truthful health checks, backpressure, job leasing/checkpoints, startup fragility, mixed-version deploys. Net-new type.