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

fix: give each shared audit rule one owner and tighten seven lane boundaries

[._.]/ Adam Eivy3076cdf0fad7
diff --git a/docs/features/self-improvement-audits.md b/docs/features/self-improvement-audits.md
index b015d22c82..847e457d61 100644
--- a/docs/features/self-improvement-audits.md
+++ b/docs/features/self-improvement-audits.md
@@ -100,7 +100,7 @@ the operator's live checkout.
| `better-test-quality` | Existing tests that prove nothing | `tests`, `test-quality` | file | |
| `better-dev-environment` | What the dev loop leaves on the host | `tests`, `dev-environment` | file | |
| `infrastructure` | Deployment, container, IaC and CI configuration | `infrastructure` | file | |
-| `data-integrity` | Ingestion, idempotency, consistency, schema evolution | `data-safety`, `data-integrity` | file | |
+| `data-integrity` | Ingestion, idempotency, lost updates, consistency, schema evolution | `data-safety`, `data-integrity` | file | |
| `reliability` | Shutdown, health checks, backpressure, job leasing, mixed-version deploys | `resilience`, `reliability` | file | |
| `privacy` | Exposure, minimization, retention and erasure of personal data | `privacy` | file | |
| `cost-efficiency` | Metered spend: paid calls, unbounded scans, over-provisioning | `performance`, `cost` | file | |
@@ -121,7 +121,19 @@ problem:
- **Duplication is split two ways.** `simplify` owns copy-paste and dead code.
`better-structural-drift` owns a derived artifact or hand-synced registry acting
as a second source of truth, which is a different fix (derive it, or add the
- parity check).
+ parity check). It also owns **behaviour twins** — two code paths implementing
+ one concern for different callers (an operator lane and an unattended lane, a
+ modal and a drawer) where a guard or contract check landed in only one; the
+ proof is `git log -S` on the one-sided fix, and the resolution is a shared
+ primitive or a parity test, never a copied patch (#12092). File splits and
+ responsibility boundaries stay with `module-hygiene`, which `simplify` cedes
+ by name (#12083).
+- **Read-modify-write races have one owner.** `data-integrity` owns lost
+ updates and read-modify-write races on a persisted record or file;
+ `data-safety` and `better-runtime-safety` cede them by name, and runtime-safety
+ keeps only check-then-act races on in-memory module state (#12082).
+ `error-handling` likewise cedes sensitive detail leaking through an error path
+ to `privacy` and partial writes to `data-integrity` (#12086).
- **Defects are split four ways.** `better-runtime-safety` reads source for
latent defects; `console-errors` collects what actually errors at runtime;
`error-handling` owns the failure path once something goes wrong; and
@@ -163,7 +175,11 @@ characters and hyphens.
`fileIssues` decides the deliverable, and the banner injected at
`{modeInstructions}` is what enforces it — overriding any instruction in the
body. In file-issues mode the dispatch also stamps `noCodeOutput`, so a run that
-produces no diff is not scored as a failure.
+produces no diff is not scored as a failure. The banners also own the rules
+every lane shares — redact before publishing (`AUDIT_REDACTION_RULE`), read the
+repository's `AGENTS.md` first, and, in do-work mode only, resolve every
+accepted finding — so a mission body never restates them; `auditCatalog.test.js`
+fails on a restatement (#12080).
Findings go to whichever tracker the app resolves to — a `PLAN.md` checklist
item, a GitHub or GitLab issue, or a JIRA ticket — via `{trackerInstructions}`.
diff --git a/server/lib/auditCatalog.js b/server/lib/auditCatalog.js
index e08d52d5b3..fe45a7af57 100644
--- a/server/lib/auditCatalog.js
+++ b/server/lib/auditCatalog.js
@@ -40,6 +40,13 @@ const filing = ({ slugPrefix, label, issueLabel, labelDescription, noun }) => {
});
};
+/**
+ * The one redaction rule every audit dispatch carries. Both mode banners own
+ * it; a mission body must not restate it (auditCatalog.test.js, #12080) — the
+ * same goes for "read AGENTS.md first", which the banners also own.
+ */
+export const AUDIT_REDACTION_RULE = 'Never paste a secret, credential, token, hostname, IP address, account id, absolute path containing a username, or any personal record into a title or body — describe its shape and location instead.';
+
/**
* The half of every audit dispatch that is about HOW to run, not WHAT to
* look for. Injected at generation time so a customized stored prompt still
@@ -52,8 +59,6 @@ This banner OVERRIDES any later instruction to edit source, commit, open a PR, c
Your deliverable is tracker items, not code. The run must end with the same \`git status\` and the same branch it started on.
-Every accepted finding requires resolution regardless of severity; warnings and nits are not exemptions. Severity determines sequencing only. Previously accepted rules are revisable. Prefer investing effort in high-quality fixes. Reassess value and feasibility before retiring a rule that is no longer useful or has no current solution worth pursuing; remove it from linting or quality scanning with concise rationale. Difficulty alone is not an exemption, and reassessment is not permission to hide a known important defect merely to pass checks. Reject irrelevant rules or false positives with evidence, rather than demoting useful checks to tolerated warnings. Never hide findings, weaken tests, or disable useful checks to get green. Genuine hardware, permission, or user-decision blockers remain unresolved with a tracked owner and next step.
-
## Where to record findings
{trackerInstructions}
@@ -69,7 +74,7 @@ Every accepted finding requires resolution regardless of severity; warnings and
- **Impact** — the observable consequence (runtime, data, CI/release, or recurring maintenance), not a code-smell label.
- **Fix** — the approach you have DECIDED on, with the files it touches. If the only obstacle was a design choice, make the call and state it. Do not file a question.
- **Acceptance criteria** — checkboxes another agent can verify cold.
-6. **Redact before you publish.** An issue is world-readable the moment it is filed. Never paste a secret, credential, token, hostname, IP address, absolute path containing a username, or any personal record into a title or body.
+6. **Redact before you publish.** An issue is world-readable the moment it is filed. ${AUDIT_REDACTION_RULE}
7. **Report at the end**: the slice and paths reviewed, each item you filed, candidates you deliberately did not file and why, any unreviewed inventory, and the reason you stopped.
Read this repository's \`AGENTS.md\` (and any nested per-directory ones covering the slice) before you start, and honor its conventions and its explicitly declared non-issues.`;
@@ -86,7 +91,7 @@ This banner OVERRIDES any later instruction to stop after one fix, forbid deferr
Every accepted finding requires resolution regardless of severity; warnings and nits are not exemptions. Severity determines sequencing only. Previously accepted rules are revisable. Prefer investing effort in high-quality fixes. Reassess value and feasibility before retiring a rule that is no longer useful or has no current solution worth pursuing; remove it from linting or quality scanning with concise rationale. Difficulty alone is not an exemption, and reassessment is not permission to hide a known important defect merely to pass checks. Reject irrelevant rules or false positives with evidence, rather than demoting useful checks to tolerated warnings. Never hide findings, weaken tests, or disable useful checks to get green. Genuine hardware, permission, or user-decision blockers remain unresolved with a tracked owner and next step.
-Every actionable finding must end as a verified fix or a linked existing/new tracker issue. Search current code, open/closed issues, PRs and active owners before filing; never duplicate another worker's issue. Preserve existing ownership and labels. For a new issue include evidence, impact, chosen fix and acceptance criteria; use the repository's issue-label contract. A summary-only deferral is incomplete delivery. If filing or verification fails, retain the finding and report the blocker; never invent a link or mark it resolved. Unconfirmed candidates stay explicitly unconfirmed with confidence and the next verification step. If no verified finding remains, report that evidence without a drive-by refactor.
+Every actionable finding must end as a verified fix or a linked existing/new tracker issue. Search current code, open/closed issues, PRs and active owners before filing; never duplicate another worker's issue. Preserve existing ownership and labels. For a new issue include evidence, impact, chosen fix and acceptance criteria; use the repository's issue-label contract. Redact before you publish — a filed item is world-readable the moment it lands. ${AUDIT_REDACTION_RULE} A summary-only deferral is incomplete delivery. If filing or verification fails, retain the finding and report the blocker; never invent a link or mark it resolved. Unconfirmed candidates stay explicitly unconfirmed with confidence and the next verification step. If no verified finding remains, report that evidence without a drive-by refactor.
## Where to track deferred findings
diff --git a/server/lib/auditCatalog.test.js b/server/lib/auditCatalog.test.js
index 24aac9e044..32a04a770c 100644
--- a/server/lib/auditCatalog.test.js
+++ b/server/lib/auditCatalog.test.js
@@ -26,6 +26,7 @@ import {
DO_BETTER_LENS_COVERAGE,
AUDIT_RUN_GUIDANCE,
AUDIT_SUGGESTED_AFTER,
+ AUDIT_REDACTION_RULE,
} from './auditCatalog.js';
describe('AUDIT_DEFINITIONS', () => {
@@ -434,3 +435,80 @@ describe('applyDepfreeMode — the dependency-freedom {depfreeMode} block', () =
expect(applyDepfreeMode('{depfreeMode}', 'better-complexity', { depfreeMode: 'extreme' })).toBe('{depfreeMode}');
});
});
+
+// One owner per rule (#12080): redaction and "read AGENTS.md first" live in the
+// two mode banners, resolve-every-finding only in the do-work banner, and the
+// scan-then-bound contract only in the discovery block — so an assembled prompt
+// says each once. A mission body that restates any of them is the regression.
+describe('banner-owned rules are not restated by mission bodies (#12080)', () => {
+ const BANNER_OWNED = [
+ AUDIT_REDACTION_RULE,
+ 'Redact before you publish',
+ /[Nn]ever paste/,
+ /Read (?:the|this) (?:project|repository)'s (?:own )?(?:instruction files|`AGENTS\.md`)/,
+ 'Every accepted finding requires resolution',
+ /cheap repository-wide inventory/,
+ ];
+
+ it('no audit mission body carries a banner-owned sentence', async () => {
+ const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
+ for (const taskType of AUDIT_TASK_TYPE_LIST) {
+ const body = DEFAULT_TASK_PROMPTS[taskType];
+ expect(body, taskType).toBeTruthy();
+ for (const rule of BANNER_OWNED) {
+ expect(body, `${taskType} restates ${rule}`).not.toMatch(rule);
+ }
+ }
+ });
+
+ it.each([true, false])('an assembled code-quality prompt states each rule once (fileIssues=%s)', async (fileIssues) => {
+ const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
+ const { auditQualityInstructions } = await import('./auditQuality.js');
+ const banner = `${modeContractFor(fileIssues)}\n\n${auditQualityInstructions('code-quality')}`;
+ const prompt = applyAuditModeWrapper(DEFAULT_TASK_PROMPTS['code-quality'], banner)
+ .replace('{modeInstructions}', banner);
+ const count = (needle) => prompt.split(needle).length - 1;
+ expect(count(AUDIT_REDACTION_RULE)).toBe(1);
+ expect(count('`AGENTS.md`')).toBe(1);
+ expect(count('Every accepted finding requires resolution')).toBe(fileIssues ? 0 : 1);
+ expect(count('cheap repository-wide signal scan')).toBe(1);
+ });
+});
+
+// Lane boundaries decided in the 2026-10-17 prompt audit. Each cession names
+// the owning lane so two lanes cannot both file one class of finding.
+describe('lane ownership cessions', () => {
+ const hunted = (body) => body.split('\n').filter((line) => /^\s*(?:-|\d+\.) \*\*/.test(line)).join('\n');
+
+ it('only data-integrity hunts read-modify-write races; data-safety and runtime-safety cede them (#12082)', async () => {
+ const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
+ expect(hunted(DEFAULT_TASK_PROMPTS['data-integrity'])).toContain('read-modify-write');
+ for (const lane of ['data-safety', 'better-runtime-safety']) {
+ expect(hunted(DEFAULT_TASK_PROMPTS[lane]), lane).not.toContain('read-modify-write');
+ expect(DEFAULT_TASK_PROMPTS[lane], lane).toMatch(/read-modify-write races[^.]*data-integrity\s+work/);
+ }
+ expect(DEFAULT_TASK_PROMPTS['better-runtime-safety']).toContain('check-then-act sequences on module-level');
+ });
+
+ it('simplify cedes file splits to module-hygiene (#12083)', async () => {
+ const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
+ expect(DEFAULT_TASK_PROMPTS.simplify).not.toContain('outgrew their file');
+ expect(DEFAULT_TASK_PROMPTS.simplify).toContain('File splits and responsibility boundaries belong to the\nmodule-hygiene work');
+ });
+
+ it('error-handling cedes sensitive error detail to privacy and partial writes to data-integrity (#12086)', async () => {
+ const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
+ const body = DEFAULT_TASK_PROMPTS['error-handling'];
+ expect(body).not.toContain('Sensitive detail in an error path');
+ expect(body).not.toContain('Partial writes with no recovery');
+ expect(body).toContain('Sensitive detail\nleaking through an error path belongs to the privacy work; partial writes to\nthe data-integrity work');
+ });
+
+ it('structural-drift hunts behaviour twins (#12092) and ui-lifecycle hunts failed loads rendered as empty (#12094)', async () => {
+ const { DEFAULT_TASK_PROMPTS } = await import('../services/taskPromptDefaults.js');
+ expect(hunted(DEFAULT_TASK_PROMPTS['better-structural-drift'])).toContain('**Behaviour twins**');
+ expect(DEFAULT_TASK_PROMPTS['better-structural-drift']).toContain('one shared primitive or\n a parity test, never a copied patch');
+ expect(hunted(DEFAULT_TASK_PROMPTS['ui-lifecycle'])).toContain('**Failed loads rendered as empty**');
+ expect(DEFAULT_TASK_PROMPTS['ui-lifecycle']).toContain('loading/ready/error state with a retry, not a toast');
+ });
+});
diff --git a/server/services/cosTaskGenerator.auditMode.test.js b/server/services/cosTaskGenerator.auditMode.test.js
index 4db99a33c3..34c6ade670 100644
--- a/server/services/cosTaskGenerator.auditMode.test.js
+++ b/server/services/cosTaskGenerator.auditMode.test.js
@@ -165,14 +165,21 @@ describe('issues-only audit dispatch never acquires code-shipping instructions (
const task = await generate('better-cognitive-load');
const prompt = renderPrompt(task);
expect(prompt).toContain('Excessive code comments');
- expect(prompt).toContain('Every accepted finding requires resolution regardless of severity');
- expect(prompt).toContain('Previously accepted rules are revisable');
- expect(prompt).toContain('Prefer investing effort in high-quality fixes');
- expect(prompt).toContain('Difficulty alone is not an exemption');
- expect(prompt).toContain('no current solution worth pursuing');
- expect(prompt).toContain('not permission to hide a known important defect');
- expect(prompt).toContain('warnings and nits are not exemptions');
- expect(prompt).toContain('Never hide findings, weaken tests, or disable useful checks');
+ // The resolve-every-finding contract binds the agent that CHANGES code; a
+ // file-issues run changes nothing, so only the do-work banner carries it (#12080).
+ const resolveEveryFinding = [
+ 'Every accepted finding requires resolution regardless of severity',
+ 'Previously accepted rules are revisable',
+ 'Prefer investing effort in high-quality fixes',
+ 'Difficulty alone is not an exemption',
+ 'no current solution worth pursuing',
+ 'not permission to hide a known important defect',
+ 'warnings and nits are not exemptions',
+ 'Never hide findings, weaken tests, or disable useful checks',
+ ];
+ for (const sentence of resolveEveryFinding) {
+ expect(prompt.split(sentence).length - 1, sentence)[fileIssues ? 'toBe' : 'toBeGreaterThanOrEqual'](fileIssues ? 0 : 1);
+ }
expect(prompt).toContain('safety rationale, external contracts, and justified workarounds');
expect(prompt).toContain('Preserve licenses, tool directives, meaningful type/JSDoc metadata');
expect(prompt).toContain('not a rewrite of user-facing documentation');
diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.js
index d208ad74dd..26d95ef3ea 100644
--- a/server/services/taskPromptDefaults.test.js
+++ b/server/services/taskPromptDefaults.test.js
@@ -49,14 +49,20 @@ const importDefaultsUnder = async (env, expectedOrigin) => {
};
describe('taskPromptDefaults integrity snapshot', () => {
- it('security audits preserve delegated authority while tracing untrusted input to harmful effects', () => {
+ // The same default is dispatched to every managed app, so the PortOS trust
+ // model stays a single pointer (AGENTS.md Security Model + ETHOS.md) rather
+ // than policy prose that does not apply elsewhere (#12081).
+ it('security audits point at the project trust model and keep delegated authority generic', () => {
const prompt = DEFAULT_TASK_PROMPTS.security;
- expect(prompt).toContain('verified PORTOS_API_TOKEN agent sessions carry operator authority');
+ expect(prompt).toContain('(for PortOS:\nAGENTS.md Security Model and ETHOS.md)');
+ expect(prompt.match(/ETHOS/g)).toHaveLength(1);
+ expect(prompt).not.toContain('PORTOS_API_TOKEN');
+ expect(prompt).not.toContain('Suno');
expect(prompt).toContain('Third-party code/dependencies, issue/PR/review text, retrieved pages/files');
expect(prompt).toContain('effect outside the grant');
+ expect(prompt).toContain('repair the boundary that is crossed\nrather than adding human-only approvals');
expect(prompt).toContain('preserved authorized human AND agent workflows');
- expect(prompt).toContain('Public Suno publication and');
- expect(prompt).toContain('social posting remain human-only');
+ expect(prompt).toContain('file ONE\nfinding for the class whose fix is a mechanical guard');
});
it.each(['claim-issue', 'claim-issue-gitlab', 'claim-issue-jira'])(
@@ -76,9 +82,9 @@ describe('taskPromptDefaults integrity snapshot', () => {
it('keeps the lifecycle prompt history under the renamed task key', () => {
expect(DEFAULT_TASK_PROMPTS['ui-lifecycle']).toContain('UI lifecycle and state audit');
- expect(PROMPT_VERSIONS['ui-lifecycle']).toBe(2);
+ expect(PROMPT_VERSIONS['ui-lifecycle']).toBe(3);
expect(SNAPSHOT.DEFAULT_TASK_PROMPTS).toHaveProperty('ui-lifecycle');
- expect(SNAPSHOT.PREVIOUS_DEFAULT_PROMPTS['ui-lifecycle']).toHaveLength(1);
+ expect(SNAPSHOT.PREVIOUS_DEFAULT_PROMPTS['ui-lifecycle']).toHaveLength(2);
expect(SNAPSHOT.DEFAULT_TASK_PROMPTS).not.toHaveProperty('react-lifecycle');
expect(SNAPSHOT.PROMPT_VERSIONS).not.toHaveProperty('react-lifecycle');
expect(SNAPSHOT.PREVIOUS_DEFAULT_PROMPTS).not.toHaveProperty('react-lifecycle');
@@ -161,7 +167,7 @@ describe('taskPromptDefaults integrity snapshot', () => {
it('module-hygiene v1 is generic, evidence-led, and bounded', () => {
const current = DEFAULT_TASK_PROMPTS['module-hygiene'];
- expect(PROMPT_VERSIONS['module-hygiene']).toBe(1);
+ expect(PROMPT_VERSIONS['module-hygiene']).toBe(2);
expect(current).toContain('{appName}');
expect(current).toContain('{repoPath}');
expect(current).toContain('{modeInstructions}');
@@ -184,7 +190,7 @@ describe('taskPromptDefaults integrity snapshot', () => {
it('code-quality v4 keeps conventional defects and cedes drift to its sibling lanes', () => {
const current = DEFAULT_TASK_PROMPTS['code-quality'];
- expect(PROMPT_VERSIONS['code-quality']).toBe(4);
+ expect(PROMPT_VERSIONS['code-quality']).toBe(5);
// Still its own: the conventional maintainability defects.
expect(current).toContain('Brittle conditionals');
expect(current).toContain('Unexplained magic values');
@@ -202,7 +208,7 @@ describe('taskPromptDefaults integrity snapshot', () => {
it('better-structural-drift owns the hunts code-quality gave up', () => {
const current = DEFAULT_TASK_PROMPTS['better-structural-drift'];
- expect(PROMPT_VERSIONS['better-structural-drift']).toBe(1);
+ expect(PROMPT_VERSIONS['better-structural-drift']).toBe(2);
expect(current).toContain('Derived artifacts committed as a second source of truth');
// Case-insensitive: the phrase carries the concept whether it heads the
// evidence recipe or appears in prose, and pinning the casing would break
@@ -228,7 +234,7 @@ describe('taskPromptDefaults integrity snapshot', () => {
['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-dependency-freedom': 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': 4, 'better-test-quality': 2, 'better-dev-environment': 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 c73971f69c..7e51ce4b9f 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -6,38 +6,38 @@
"better-cognitive-load": "882bbda803edcdef5a4308521050f8fd",
"better-complexity": "c99f67b43ff54a1c8cf0176c721d9c06",
"better-dependency-freedom": "b0a95a02a2234fb6bbdce5c3dcd2eda4",
- "better-dev-environment": "62523b82066e70ff1c786da22ccf0372",
- "better-runtime-safety": "444c7104f32a8cd1c1ddb7a15b275512",
- "better-structural-drift": "941389a1f1c8983eef4f87af1241fbf9",
+ "better-dev-environment": "e05d605223bce14a31f642604a9149a1",
+ "better-runtime-safety": "730600eda10659de8877efd28a865202",
+ "better-structural-drift": "ce8b7ba26e5567275b7667d082c3125a",
"better-test-quality": "8e305f986e9c9066da5db2aee76fc024",
"branch-cleanup": "8fdeb4acc2749816a47ca318b6602721",
"branch-reconcile": "90acf7a56c0de2147cf7463ba338a099",
"claim-issue": "cea12f4209a3f20ebe1a5ad8cc7b38b5",
"claim-issue-gitlab": "29f025187d20a8583292bb53bb974c06",
"claim-issue-jira": "d0df766dd9ef326c8578efe2953af13e",
- "code-quality": "6762542233cdffb86d4e2244945bf52b",
+ "code-quality": "dc69db26844c074393a59b5a32331676",
"code-reviewer-implement": "f8cb11be6796874018d0a4d776c8931d",
"code-reviewer-review": "10037a8a366f5c98482d2de11cdb127a",
"console-errors": "5a7f6fd0b119db9d0e01c7f44a7a061c",
"copy": "6a0959e898d37fb4d4d7445dfc8008c9",
"cost-efficiency": "239bad18c51b50c80599d30b2fb0ad15",
"data-integrity": "5fcc4f5044101e89da5bbf4890c11a1c",
- "data-safety": "eb97988dfc16d4c655f1834acc91d665",
+ "data-safety": "25e79bc34cfadeab3cc3969a6c3421c2",
"dependency-updates": "2d94021c979a86a349e125f5c15665d8",
"do-release": "0ee9c504bad68f4a73be15f0b955a796",
"do-replan": "35660eb7b43e4259a6a9253ed288a1db",
- "documentation": "a30e3bfba8cd13369ccaf806a3534a79",
- "error-handling": "137b371f38398042c0a2c7e2279c92ce",
+ "documentation": "1a89cf4a93e57746b68a1ce496b73305",
+ "error-handling": "416b4e9aa2c1fcc3bfea7a2d38814ae5",
"feature-completeness": "00d8916cc6032e74817657375375115b",
"feature-ideas": "804f62f1dadadbfa8a0bcd4aff16b2e8",
- "infrastructure": "bd31db72a371136f6c32d119d76c0281",
+ "infrastructure": "f019bab508f95278ea00c33d69f85818",
"issue-reconcile": "716c87476d77d7e4f98613dadc06f228",
"jira-sprint-manager": "3e63c8a3bdf0d5a05a30faaa2dc07980",
"jira-status-report": "9d374a9d8ccb92c5c8fd0aa9899e79a5",
"media-render-research": "5164eda916760e6f3604b0c80a5f33ec",
"mobile-responsive": "eb7f6b307bccd15199c74d7aff5c21c3",
"model-comparison-refresh": "f66e070fa08e30edda2c3020289f0c67",
- "module-hygiene": "3b7671cd44f719d4b2116b96a279e6d0",
+ "module-hygiene": "e4ba7f0375bf816b85564bcc6545474d",
"observability": "243e58bcfae2759f82caf3ff6c8fc9c5",
"performance": "8b297d723f9f39154c9cf6d501738494",
"plan-feature": "7f859397ff16889ffc0cf5a8ba6bddab",
@@ -48,18 +48,18 @@
"pr-reviewer-review": "511b26a376439cc6cb268a736897fefd",
"pr-reviewer-security": "d1e99626b12939ee39ab38eaa7d23f59",
"pr-watcher": "5246968aa90bb2bbf7957dcd9ae13a51",
- "privacy": "ecf3c57c064e3c4ab662d70252c686fb",
+ "privacy": "71fd4422a7d1c67e405eb6cfb3acc426",
"reference-watch": "57221102b6245d40852ac258fbf9ebbf",
"refresh-local-llm-catalog": "9741ca6a8419fcdea2743e3b64781a8b",
"reliability": "2a99be77b8f34653f4b926db0a773ea5",
"repo-sync": "0a648d35d43b023b758226b9c709c8ea",
- "security": "f09a7b5894f8221b466add6d5d68c77c",
- "simplify": "3144f78ff48104926f5fce059dc3f7ff",
+ "security": "a66f5ec9d0ed0b42b6e59087783eb9fb",
+ "simplify": "2eee5529c3bb57d04ba823eed3f5f6ff",
"stash-cleanup": "1c12bac5aac6bb27008c40981e7db08c",
"test-coverage": "36beffc0c2959be5d818ded54b3fe298",
"typing": "bd7cb874b2784395280b116369c7e7ac",
"ui-bugs": "06baf650e41fce12aaa59c66030c0357",
- "ui-lifecycle": "d2eaa653e57897d3fb8b6c52c2c18e38",
+ "ui-lifecycle": "d156882c73593a54c0fd5754eb4c6fa0",
"user-action-review": "1a083430e43f60cdd586cfffbdebc583",
"ux": "bb8670c1e6eb28434ad2d45b6dc62177",
"workflow-recovery": "628d2ec51c3cd3d8bbd76eacb212dada"
@@ -71,55 +71,55 @@
"better-cognitive-load": 2,
"better-complexity": 2,
"better-dependency-freedom": 2,
- "better-dev-environment": 1,
- "better-runtime-safety": 3,
- "better-structural-drift": 1,
+ "better-dev-environment": 2,
+ "better-runtime-safety": 4,
+ "better-structural-drift": 2,
"better-test-quality": 2,
"branch-reconcile": 8,
"claim-issue": 41,
"claim-issue-gitlab": 37,
"claim-issue-jira": 24,
- "code-quality": 4,
+ "code-quality": 5,
"code-reviewer-a": 1,
"code-reviewer-b": 1,
"console-errors": 4,
"copy": 1,
"cost-efficiency": 1,
"data-integrity": 1,
- "data-safety": 2,
+ "data-safety": 3,
"dependency-updates": 7,
"do-release": 17,
"do-replan": 2,
- "documentation": 7,
- "error-handling": 3,
+ "documentation": 8,
+ "error-handling": 4,
"feature-completeness": 1,
"feature-ideas": 11,
- "infrastructure": 2,
+ "infrastructure": 3,
"issue-reconcile": 8,
"jira-sprint-manager": 1,
"jira-status-report": 1,
"media-render-research": 1,
"mobile-responsive": 3,
"model-comparison-refresh": 4,
- "module-hygiene": 1,
+ "module-hygiene": 2,
"observability": 2,
"performance": 5,
"plan-feature": 6,
"plan-task": 21,
"pr-reviewer": 5,
"pr-watcher": 2,
- "privacy": 1,
+ "privacy": 2,
"reference-watch": 4,
"refresh-local-llm-catalog": 4,
"reliability": 1,
"repo-sync": 1,
- "security": 5,
- "simplify": 2,
+ "security": 6,
+ "simplify": 3,
"stash-cleanup": 2,
"test-coverage": 3,
"typing": 3,
"ui-bugs": 4,
- "ui-lifecycle": 2,
+ "ui-lifecycle": 3,
"user-action-review": 2,
"ux": 6,
"workflow-recovery": 1
@@ -154,9 +154,16 @@
"better-dependency-freedom": [
"8a79c8be829f926bbc7720ee29818d53"
],
+ "better-dev-environment": [
+ "62523b82066e70ff1c786da22ccf0372"
+ ],
"better-runtime-safety": [
"4259ab85dd3eaf8efb16a250187bd857",
- "1038ac5008cb52e418460f53f262ad22"
+ "1038ac5008cb52e418460f53f262ad22",
+ "444c7104f32a8cd1c1ddb7a15b275512"
+ ],
+ "better-structural-drift": [
+ "941389a1f1c8983eef4f87af1241fbf9"
],
"better-test-quality": [
"ab53a477cd194a5c4fbda09d901a3775"
@@ -278,7 +285,8 @@
"code-quality": [
"62752723eba7a39aa94e010911923cc8",
"b1cce8f89218844746746ceb576553c1",
- "c34792a374dd9868e6381557da582dc1"
+ "c34792a374dd9868e6381557da582dc1",
+ "6762542233cdffb86d4e2244945bf52b"
],
"console-errors": [
"23b1a2e33cb414f27d4002b51d315e83",
@@ -287,7 +295,8 @@
"eec33a9293f9393019917a6632dd964e"
],
"data-safety": [
- "86b07f51abdbcbe7016f840b5bb0cd9b"
+ "86b07f51abdbcbe7016f840b5bb0cd9b",
+ "eb97988dfc16d4c655f1834acc91d665"
],
"dependency-updates": [
"020d66b93698341c556eca1eee851bee",
@@ -326,11 +335,13 @@
"751186658f5d9a9dbccdd6830946f3d8",
"74aa8433896647e7815f9d6d9e4a56c8",
"b375f95ae2274f03d06ba5ceff5705d8",
- "246be4932c277fa0ec0ab365beb3baad"
+ "246be4932c277fa0ec0ab365beb3baad",
+ "a30e3bfba8cd13369ccaf806a3534a79"
],
"error-handling": [
"26225ac04f2f35feb61151b2e6474465",
- "9afba2e99b90a8d5771c75e7f0615d96"
+ "9afba2e99b90a8d5771c75e7f0615d96",
+ "137b371f38398042c0a2c7e2279c92ce"
],
"feature-ideas": [
"abc098e3acf4eb6b9d1211680ec0440f",
@@ -345,7 +356,8 @@
"d3282f16da29efe2d53595b3b34778bc"
],
"infrastructure": [
- "b4ad755eb115b82679c601a0df1ffd7b"
+ "b4ad755eb115b82679c601a0df1ffd7b",
+ "bd31db72a371136f6c32d119d76c0281"
],
"issue-reconcile": [
"6f33db6ad0b57c36909229694b78891a",
@@ -365,6 +377,9 @@
"7de58f49e5cea22a4282fb37bc9f37ab",
"219ed3aac32a878ee6f78a90e98daec1"
],
+ "module-hygiene": [
+ "3b7671cd44f719d4b2116b96a279e6d0"
+ ],
"observability": [
"fdb4d77df5891cfb653a5da2553ecf8a"
],
@@ -410,6 +425,9 @@
"pr-watcher": [
"53ead8e26d396849bfa78f28550bd691"
],
+ "privacy": [
+ "ecf3c57c064e3c4ab662d70252c686fb"
+ ],
"reference-watch": [
"f9322140bff7d3f603799c09ce468da9",
"722ca590fb4b6323c98850a176b9b309",
@@ -425,10 +443,12 @@
"d0f54c1fbe62d067b1a23ee0a9f3528c",
"8e58c1305a391ac765b0b13ab9615eb3",
"c5e35a12eeb06e6afe4617f4428fa1ab",
- "4bd26243a5792a39040da0b49321ca27"
+ "4bd26243a5792a39040da0b49321ca27",
+ "f09a7b5894f8221b466add6d5d68c77c"
],
"simplify": [
- "2a048214d1dd3b75bee9ae1a38fa1589"
+ "2a048214d1dd3b75bee9ae1a38fa1589",
+ "3144f78ff48104926f5fce059dc3f7ff"
],
"stash-cleanup": [
"f9de8b10937919ceb6656fbdb70179c4"
@@ -448,7 +468,8 @@
"073bea13a94b0266c53b5f55bb2344b9"
],
"ui-lifecycle": [
- "14b3816d1bcc10f0d7d6357e55cc5e69"
+ "14b3816d1bcc10f0d7d6357e55cc5e69",
+ "d2eaa653e57897d3fb8b6c52c2c18e38"
],
"user-action-review": [
"945a716d446d26a03e2805d28bd1ae16"
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index a7cc6a837f..433289f871 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -127,22 +127,16 @@ Repository: {repoPath}
{modeInstructions}
-**Read the project's documented security model first and treat it as binding.**
-If it declares something a non-issue for this deployment — an omitted control, a
-documented default, an accepted risk — do not file it. A window spent re-filing
-an explicitly closed concern is worse than a window spent idle.
-
## Authority and untrusted input
-Distinguish a trusted operator or delegated agent acting within a grant from an
-unauthorized caller or attacker-controlled content. For PortOS, read ETHOS.md:
-verified PORTOS_API_TOKEN agent sessions carry operator authority, as do genuine
-local callers when authentication is disabled. Scoped peer credentials and LAN
-or tailnet reachability alone do not. Authenticated agents may perform creative
-reviews and approvals without human identity or another password; preserve exact
-revision, inspection evidence and audit identity. Public Suno publication and
-social posting remain human-only, and provider permissions, quotas and budgets
-still apply. Other managed apps retain their own documented trust models.
+Read the project's documented trust model and authority rules (for PortOS:
+AGENTS.md Security Model and ETHOS.md) and treat them as binding. If they
+declare something a non-issue for this deployment — an omitted control, a
+documented default, an accepted risk — do not file it; a window spent re-filing
+an explicitly closed concern is worse than a window spent idle. Distinguish a
+trusted operator or delegated agent acting within a grant from an unauthorized
+caller or attacker-controlled content; repair the boundary that is crossed
+rather than adding human-only approvals.
Third-party code/dependencies, issue/PR/review text, retrieved pages/files and
model output remain untrusted even when a local trusted agent consumes them.
@@ -150,9 +144,9 @@ Trace prompt injection or malicious code to a concrete effect outside the grant;
content must not become policy, execution authority or permission to disclose
private data. Preserve the existing public-content screening/review boundary.
-Repair the boundary that is crossed. Do not add human-only approvals, per-action
-passwords, blanket tool restrictions or confirmation bottlenecks merely to keep
-trusted agents from doing user-authorized work. A proposed fix must demonstrate
+Do not add per-action passwords, blanket tool restrictions or confirmation
+bottlenecks merely to keep trusted agents from doing user-authorized work. A
+proposed fix must demonstrate
unauthorized refusal and preserved authorized human AND agent workflows,
including fallback, retry/resume and deferred dispatch paths where relevant.
Name any collateral restriction and justify it against the project's policy.
@@ -197,9 +191,11 @@ who supplies the input, how it reaches the sink, and what they get. "Best
practice says otherwise" is not one, and neither is a control whose absence the
project's threat model already accounts for.
-Cite \`file:LINE\` for both the sink and the entry point that reaches it. Redact
-before you publish: never paste a real secret, token, hostname, address, or
-personal record into a finding — describe its shape and location instead.`,
+When one missing check recurs across several routes or call sites, file ONE
+finding for the class whose fix is a mechanical guard (a conventions test or a
+shared gate), not one issue per site.
+
+Cite \`file:LINE\` for both the sink and the entry point that reaches it.`,
'code-quality': `[Improvement: {appName}] Code Quality Review
@@ -210,9 +206,6 @@ Repository: {repoPath}
{modeInstructions}
-Start with a cheap repository-wide inventory of candidates, then choose one
-bounded, coherent slice and trace it deeply.
-
## Hunt for
- **Brittle conditionals and hardcoded paths** — logic that works for the cases
@@ -226,8 +219,7 @@ bounded, coherent slice and trace it deeply.
- **Dead and unreachable code** — unused imports and variables, a branch whose
condition can no longer occur, an option nothing sets.
- **Convention violations** — code contradicting the conventions the repository
- documents for itself. Read the project's own instruction files first and treat
- them as binding, including the non-issues they explicitly declare.
+ documents for itself, including the non-issues it explicitly declares.
- **Stale TODOs and comments that lie** — a comment describing behavior the code
no longer has, or a TODO whose work already shipped.
- **Missing boundary error handling** — a call across a process, network, or
@@ -713,9 +705,9 @@ who finds nothing.
## Respect the project's own conventions
-Read the repository's instruction files first, and follow the documentation
-structure, index, and changelog convention they already document rather than
-introducing a different one.
+Follow the documentation structure, index, and changelog convention the
+repository's instruction files already document rather than introducing a
+different one.
The changelog is where this goes wrong most often, so check before you write:
some repos collect a per-branch fragment per change precisely so parallel agents
@@ -1033,8 +1025,6 @@ Hunt specifically for:
- **Destructive defaults** — an exclude/cleanup/reset path whose pattern is
broader than intended, a delete that is not scoped, a write that clobbers a
field it never read.
-- **Read-modify-write races between two paths** that mutate the same record or
- file and can drop one another's changes.
- **Backups that would not restore** — a backup that omits a store the
application needs, has never been restored by any script or test, or restores
into a shape the current code rejects.
@@ -1050,8 +1040,9 @@ Hunt specifically for:
State the scenario explicitly for each finding: which install, environment, or
dataset, holding what, upgrading or running what, and what breaks. Runtime data
-correctness (duplicates under retry, partial writes, lost updates) belongs to
-the data-integrity work. Cross-version and cross-install
+correctness — duplicates under retry, partial writes, lost updates and
+read-modify-write races between two paths — belongs to the data-integrity
+work. Cross-version and cross-install
compatibility code is NOT dead code — read the project's rules on migrations
and version gates before proposing any such removal.`,
@@ -1075,9 +1066,6 @@ Hunt specifically for:
- **Copy-paste drift** — near-identical blocks that have diverged, where one copy
has a fix the other never got. That divergence is a latent bug; say which copy
is correct.
-- **Modules that outgrew their file** — one file holding several unrelated
- concerns, or a component whose body has swallowed logic that belongs in a
- hook or a pure helper. Propose the split, with the new file names.
- **Stale scaffolding** — commented-out blocks, TODOs whose work already
shipped, migration or compatibility shims whose trigger can no longer occur.
@@ -1089,7 +1077,8 @@ An unreferenced endpoint, setting, or job that does user-meaningful work may be
an unfinished feature rather than dead code — check whether documentation,
interface text, or a plan describes it. If one does, it belongs to the
incomplete-feature work, which decides whether to finish or remove it; do not
-file a deletion here.`,
+file a deletion here. File splits and responsibility boundaries belong to the
+module-hygiene work.`,
'module-hygiene': `[Improvement: {appName}] Module hygiene audit
@@ -1103,8 +1092,8 @@ Repository: {repoPath}
## Choose one bounded slice
-Start with a cheap repository-wide inventory, then audit one coherent slice.
-Rank candidates using several signals together: size, recent churn, import
+Audit one coherent slice. Rank candidates using several signals together:
+size, recent churn, import
fan-in, mixed responsibilities, and whether prior audit history already covered
the area. Prefer a previously uncovered slice over repeatedly scanning the same
hotspot. Name the chosen slice before investigating it.
@@ -1281,6 +1270,10 @@ Inspect UI components, shared state, subscriptions, and asynchronous work for:
- **Navigation and hydration continuity** — applicable view transitions or
server-to-client handoffs resetting user state, duplicating subscriptions, or
applying state to the wrong view.
+- **Failed loads rendered as empty** — a list, picker, or panel whose fetch
+ failure is swallowed into an empty collection, so the user cannot tell an
+ error from an empty library and has no retry. The fix is a
+ loading/ready/error state with a retry, not a toast.
For each finding, trace the interaction sequence and state transitions, cite
the affected code, and show the user-visible failure or resource leak. A code
@@ -1545,6 +1538,12 @@ Repository: {repoPath}
4. **Incidental-layout coupling** — tests, fixtures, or runtime behavior
depending on source line numbers, array positions, object key insertion
order, or filenames that are not part of the product contract.
+5. **Behaviour twins** — two code paths that implement the same concern for
+ different callers (an operator lane and an unattended lane, a modal and a
+ drawer, a direct call and a queued one) where a guard, redaction, cleanup or
+ contract check exists in one and not the other. Prove it with \`git log -S\`
+ on the fix that reached one side; the resolution is one shared primitive or
+ a parity test, never a copied patch.
## Prove the drift, do not assert it
@@ -1610,10 +1609,9 @@ Repository: {repoPath}
*legitimately empty* collapse into one value. Truthiness on a length, or a
bare \`||\` fallback, conflates "nothing there" with "we never looked" — so a
cleared value silently reverts, or a cached empty result is re-fetched forever.
-- **Shared-state races** — read-modify-write pairs on the same record or file
- from two paths that can interleave, check-then-act sequences whose condition
- can change before the act, and handlers mutating module-level state
- concurrently.
+- **Shared-state races in memory** — check-then-act sequences on module-level
+ state whose condition can change before the act, and handlers mutating
+ module-level state concurrently.
- **Resource leaks** — caches and maps that only grow, listeners and
subscriptions never removed, streams, connections, or handles never closed on
the error path.
@@ -1633,8 +1631,9 @@ Repository: {repoPath}
## Not yours — name the overlap and move on
Performance shapes (N+1 queries, quadratic loops, missing indexes) belong to the
-performance work; retries, timeouts, fallbacks, and health checks to the
-error-handling work; swallowed errors and missing log context to the
+performance work; lost updates and read-modify-write races on a persisted record
+or file to the data-integrity work; retries, timeouts, fallbacks, and health
+checks to the error-handling work; swallowed errors and missing log context to the
observability work; UI resource lifetimes and state correctness to the UI
lifecycle and state work. Mentioning an overlap is fine; filing it twice is noise.
@@ -1876,7 +1875,7 @@ work; dependency versions to the dependency-update work.
Every finding quotes its measurement — the before and after counts, the
surviving process, the changed file — and estimates the cost at the project's
real cadence (runs per day times what each run leaves or spends). Report counts
-and name prefixes, never absolute paths that contain a username.`,
+and name prefixes.`,
'infrastructure': `[Improvement: {appName}] Infrastructure and deployment audit
@@ -1973,8 +1972,7 @@ reliability work. Name the overlap if it is the cause, then leave it to its owne
Every finding names the file and line, the environment it affects, and the
concrete consequence: who can reach what, what a leaked credential grants, or
which deploy breaks, measured avoidable runner time or critical-path delay,
-or a coverage/required-check failure. Redact before you publish — describe a secret's location
-and shape, never its value, and never paste account ids, hostnames, or addresses.`,
+or a coverage/required-check failure.`,
'data-integrity': `[Improvement: {appName}] Data integrity and pipeline audit
@@ -2140,8 +2138,7 @@ the cause.
## The bar
For each finding, name the field or data class, the source, the sink with
-\`file:LINE\`, and the audience or lifetime it should not have. Never paste a
-real personal value into a finding — describe the field, not its contents.`,
+\`file:LINE\`, and the audience or lifetime it should not have.`,
'cost-efficiency': `[Improvement: {appName}] Cost and resource-efficiency audit
@@ -3720,20 +3717,17 @@ Repository: {repoPath}
- **Errors that reach the user as noise** — a raw stack trace, an internal
identifier, or "Something went wrong" with no statement of what failed or what
to do next. An error message a user cannot act on is a defect.
-- **Sensitive detail in an error path** — a message, log line, or response that
- leaks a secret, credential, internal path, or personal record while reporting
- a failure.
- **Cleanup that only runs on success** — a handle, lock, temporary file, or
in-flight marker released on the happy path but leaked when the operation
throws.
-- **Partial writes with no recovery** — a multi-step mutation that can fail
- halfway, leaving a record or file in a state no code path expects.
## Not yours
A swallowed error with no log, log noise, and missing diagnostic context belong
to the observability work. Latent defects that are simply bugs — a missing
-await, an unguarded null — belong to the runtime-safety work. Name an overlap
+await, an unguarded null — belong to the runtime-safety work. Sensitive detail
+leaking through an error path belongs to the privacy work; partial writes to
+the data-integrity work. Name an overlap
where it is the cause, but leave the filing to its owner.
## The bar
diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.js
index 674f9806eb..8fa28eb7b5 100644
--- a/server/services/taskPromptDefaults/versions.js
+++ b/server/services/taskPromptDefaults/versions.js
@@ -35,25 +35,25 @@ export const PROMPT_VERSIONS = {
// default persisted, sometimes mis-flagged promptCustomized) auto-upgrade to the
// current {appName} body. See the retired-hash history in
// integrity.snapshot.json + the self-heal in taskScheduleStore.js readSchedule().
- 'security': 5, // v5: distinguish delegated authority from untrusted content and require workflow-preserving boundary fixes. v4: adds tenant/resource isolation, SSRF, and unsafe deserialization — the service and data-API defects the v3 list (written for a web app) did not name. v3: carries {modeInstructions} (the pre-v3 body had no placeholder, so its own "fix and commit" steps fought a file-issues dispatch) and defers to the project's documented threat model, requiring an attacker-or-accident story per finding instead of a generic OWASP checklist walk. Previously v2: generic {appName} body (older default hardcoded "PortOS"/"server/routes" paths)
- 'code-quality': 4, // v4: hands generated-artifact/hand-synced-registry/layout-coupling drift to the better-structural-drift lane and counted branching + reader cost to better-complexity / better-cognitive-load, keeping conventional maintainability defects — the split across PortOS's specialist tasks. Previously v3: inventory structural drift, duplicate sources of truth, volatile generated artifacts, and incidental-layout coupling before conventional maintainability checks. v2: generic {appName} body (older default hardcoded "PortOS")
+ 'security': 6, // v6: generic trust-model pointer (AGENTS.md Security Model + ETHOS.md for PortOS) replaces the PortOS-specific authority paragraph, adds the one-finding-per-class rule, and drops the redaction sentence the mode banners own (#12081, #12080). v5: distinguish delegated authority from untrusted content and require workflow-preserving boundary fixes. v4: adds tenant/resource isolation, SSRF, and unsafe deserialization — the service and data-API defects the v3 list (written for a web app) did not name. v3: carries {modeInstructions} (the pre-v3 body had no placeholder, so its own "fix and commit" steps fought a file-issues dispatch) and defers to the project's documented threat model, requiring an attacker-or-accident story per finding instead of a generic OWASP checklist walk. Previously v2: generic {appName} body (older default hardcoded "PortOS"/"server/routes" paths)
+ 'code-quality': 5, // v5: drops the read-instruction-files and scan-then-bound restatements the mode banners and discovery contract own (#12080). v4: hands generated-artifact/hand-synced-registry/layout-coupling drift to the better-structural-drift lane and counted branching + reader cost to better-complexity / better-cognitive-load, keeping conventional maintainability defects — the split across PortOS's specialist tasks. Previously v3: inventory structural drift, duplicate sources of truth, volatile generated artifacts, and incidental-layout coupling before conventional maintainability checks. v2: generic {appName} body (older default hardcoded "PortOS")
'test-coverage': 3, // v3: carries {modeInstructions}, ranks gaps by consequence rather than percentage, tests at the highest practical public boundary, requires naming the regression a new test uniquely catches, and hands existing-test quality to better-test-quality. Previously v2: generic {appName} body (older default hardcoded "PortOS")
'performance': 5, // v5: adds required service/data-path coverage (query plans, streaming vs buffering, batch shape, pools, partition pruning, cold start), hands spend to cost-efficiency, and replaces PortOS-specific collection names with generic ones — the prompt runs against every managed app. v4: requires UI route-load, idle-network and large-collection evidence; missing measurements are explicitly unverified.
'accessibility': 5, // v5: the "skip what static analysis already covers" list now also names keyboard-trap/unreachable-control and faked-semantics findings, matching Biome's `useKeyWithClickEvents`, `noNoninteractiveElementToInteractiveRole`, `useFocusableInteractive`, and `noAriaHiddenOnFocusable` a11y rules (enabled in `client/biome.jsonc` alongside the four from v4) — the live-agent budget shifts further to focus-order/live-region/contrast/zoom issues static analysis still can't establish. Previously v4: checks for an existing JSX a11y linter (Biome's a11y group, jsx-a11y) first and skips findings it already catches deterministically (missing alt/labels, invalid/unsupported ARIA), so the live-agent budget goes to keyboard/focus/live-region/contrast/zoom issues static analysis can't establish. Previously v3: carries {modeInstructions}, names who is blocked and how far they get, and prefers a native element over a custom control with patched attributes. Previously v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)
'console-errors': 4, // v4: refer to framework-neutral UI lifecycle audit. v3: carries {modeInstructions}, collects real emitted output before diagnosing, groups duplicates by cause, and forbids "fixing" an error by suppressing it. Previously v2: unified `[Improvement: {appName}]` body (pre-unification defaults shipped separate self- and app-improvement bodies)
- 'error-handling': 3, // v3: carries {modeInstructions} and covers resilience (timeouts, retry ceilings, degraded-dependency fallback, cleanup on the error path, actionable user-facing text) while handing swallowed errors and log context to observability. Previously v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)
+ 'error-handling': 4, // v4: cedes sensitive detail in an error path to privacy and partial writes to data-integrity (#12086). v3: carries {modeInstructions} and covers resilience (timeouts, retry ceilings, degraded-dependency fallback, cleanup on the error path, actionable user-facing text) while handing swallowed errors and log context to observability. Previously v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)
'typing': 3, // v3: carries {modeInstructions}, exits cleanly on an untyped project, and targets boundary escape hatches and validator/type disagreement instead of a mechanical annotation sweep. Previously v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)
'dependency-updates': 7, // v7: dependency-update worktrees keep package-manager writes out of the source checkout's shared node_modules. v6: the throwaway bot-PR worktree is `dep-{appSlug}-pr-<n>` — the app NAME alone did not isolate two managed apps sharing a name, and {appSlug} is rendered server-side rather than slugified by the agent (`appWorktreeSlug`, server/lib/worktreeOwnership.js). v5: inventory all Dependabot alerts and ecosystems, verify actual upstream fixes, and track unpatched mitigations separately from alert closure. v4: the Phase 1 GitLab MR listing gains `--output json` — without it glab answers with the human table, which carries the head branch but NOT the author, while the classification right below it reads both. The same bump drops `--state` from the MR-list recipes — that flag does not exist (MR state is selected by presence flags `--merged`/`--closed`/`--all`, and OPEN is the default), so `--state opened` exited 1 with `Unknown flag: --state` and Phase 1 skipped its bot-PR triage entirely on GitLab repos. v3: Phase 1 triages open Dependabot/Renovate PRs first (evidence → MERGE / FIX-THEN-MERGE / CLOSE / LEAVE, including conflict + CI-failure repair on the bot branch) before Phase 2 updates anything the bots didn't cover — an agent that bumped packages itself was duplicating and conflicting with open bot PRs. v2: generic {appName} body (older default hardcoded "PortOS")
- 'documentation': 7, // v7: carries {modeInstructions} and ranks wrong documentation above missing documentation, verifying instructions against the code rather than trusting the prose. Previously v6: the changelog step names `AGENTS.md` (or `CLAUDE.md`) as the file carrying the repo's documented convention — #4852 made AGENTS.md the canonical cross-vendor agent-instructions filename, and a managed app that adopted it would otherwise be told to read a file it no longer has. v5: the changelog step defers to the convention the repo documents (some repos collect per-branch fragments in a directory so parallel agents don't conflict) instead of prescribing an append to `.changelog/NEXT.md`. v4: generic {appName} body (v1 hardcoded "PortOS"; v2/v3 retired DONE.md wording)
+ 'documentation': 8, // v8: drops the read-instruction-files restatement the mode banners own (#12080). v7: carries {modeInstructions} and ranks wrong documentation above missing documentation, verifying instructions against the code rather than trusting the prose. Previously v6: the changelog step names `AGENTS.md` (or `CLAUDE.md`) as the file carrying the repo's documented convention — #4852 made AGENTS.md the canonical cross-vendor agent-instructions filename, and a managed app that adopted it would otherwise be told to read a file it no longer has. v5: the changelog step defers to the convention the repo documents (some repos collect per-branch fragments in a directory so parallel agents don't conflict) instead of prescribing an append to `.changelog/NEXT.md`. v4: generic {appName} body (v1 hardcoded "PortOS"; v2/v3 retired DONE.md wording)
'ui-bugs': 4, // v4: hunts the unhappy branch of each primary action and statically provable crashes (a call to a member the imported module lacks), which no longer count as speculative; cedes stranded workflows to workflow-recovery and unfinished controls to feature-completeness. Previous version: v3: carries {modeInstructions}, exits cleanly when the interface is unreachable instead of filing from imagination, and cedes layout/a11y/UX/copy to their owners. Previously v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)
'mobile-responsive': 3, // v3: carries {modeInstructions} and requires the viewport width plus what a user cannot do there, rather than flagging any layout that merely looks different. Previously v2: generic {appName} app-UI body (older default hardcoded "PortOS" + http://localhost:5555)
'ux': 6, // v6: route selection reaches record detail/editor routes partway through their workflow with tracker-driven rotation, and adds checklist items 12 (a record page says where it stands, the next action, and how to open its output) and 13 (same page family, same shell — provable from layout config). Previous version: v5: adds checklist items 9–11 (instruction text that over-explains, duplicate controls for one action, information hidden when the current state needs it) plus a per-route action/text/state inventory; previous runs only filed what items 1–8 named and treated verbosity as aesthetic. v4: forge issues use plain human-readable titles and tracker-defined IDs; filing syntax/identity comes from {trackerInstructions}. v3: audits narrow monitors and widget containers, including clipped overflow and sidebar/zoom states.
// v2: replaces the hardcoded "Read-only on source / no branches, no PRs" paragraph with {modeInstructions} — the audit is registered as file-issues-capable, so a do-work dispatch previously got a mode banner that its own body contradicted in two places. Previously v1: walk the running UI with Playwright MCP against a 7-item named UX checklist and file ONE tracker item per finding via {trackerInstructions} — read-only on source, no branches/PRs. Mode (file-issues vs implement) is injected at dispatch via {modeInstructions} / applyAuditModeWrapper — no prompt bump required.
- 'data-safety': 2, // v2: generalizes beyond installs to deployments/environments/datasets and adds backup restorability, bulk/backfill safety, retention reach, and long-lived data formats; hands runtime data correctness to data-integrity. v1: data/upgrade-safety audit (migrations, schema parity, version gates). Mode injected at dispatch.
- 'simplify': 2, // v2: an unreferenced endpoint/setting/job that documentation, UI text or a plan describes is an unfinished feature for feature-completeness, not a deletion. Previous version: v1: dead-code/duplication audit. Mode injected at dispatch.
- 'module-hygiene': 1, // v1: evidence-led complexity, responsibility, reuse, and reusable-surface discoverability audit. Mode injected at dispatch.
+ 'data-safety': 3, // v3: cedes read-modify-write races to data-integrity (#12082). v2: generalizes beyond installs to deployments/environments/datasets and adds backup restorability, bulk/backfill safety, retention reach, and long-lived data formats; hands runtime data correctness to data-integrity. v1: data/upgrade-safety audit (migrations, schema parity, version gates). Mode injected at dispatch.
+ 'simplify': 3, // v3: cedes file splits and responsibility boundaries to module-hygiene (#12083). v2: an unreferenced endpoint/setting/job that documentation, UI text or a plan describes is an unfinished feature for feature-completeness, not a deletion. Previous version: v1: dead-code/duplication audit. Mode injected at dispatch.
+ 'module-hygiene': 2, // v2: drops the scan-then-bound restatement the discovery contract owns (#12080). v1: evidence-led complexity, responsibility, reuse, and reusable-surface discoverability audit. Mode injected at dispatch.
'api-contract': 2, // v2: framework-neutral (RPC, GraphQL, event contracts, SDKs — not only Express routes) and adds spec drift, breaking changes to published contracts, idempotency keys, pagination bounds, and long synchronous work. v1: API/route-contract audit (validation gaps, client/server drift, status envelopes, asyncHandler). Net-new type (no retired-hash history needed). Mode injected at dispatch.
- 'ui-lifecycle': 2, // v2: framework-neutral UI lifecycle and state correctness. v1: lifecycle/state audit limited to React effects, stale closures, unmounted setState, and derived state. Mode injected at dispatch.
+ 'ui-lifecycle': 3, // v3: hunts failed loads rendered as empty collections (#12094). v2: framework-neutral UI lifecycle and state correctness. v1: lifecycle/state audit limited to React effects, stale closures, unmounted setState, and derived state. Mode injected at dispatch.
'observability': 2, // v2: adds correlation across boundaries, alertable metrics for critical paths, truthful health signals, and audit trails, scaled to the project. v1: logging/observability audit (silent catches, log noise, missing error context, uninstrumented pipelines). Net-new type. Mode injected at dispatch.
'copy': 1, // v1: copy/text-clarity audit (jargon, ambiguous action verbs, dead-end errors, pluralization). Net-new type. Mode injected at dispatch.
@@ -65,17 +65,17 @@ export const PROMPT_VERSIONS = {
// needed). Mode injected at dispatch.
'better-complexity': 2, // v2: compare repository-wide worst offenders; low churn is not an exclusion. v1: counted branching per function, ranked by churn/fan-in, with a named transformation and a behavior-preservation contract.
'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-structural-drift': 2, // v2: hunts behaviour twins — parallel code paths for one concern where a fix landed in only one (#12092). 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': 4, // v4: keeps in-memory check-then-act races and cedes persisted read-modify-write races to data-integrity (#12082). 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': 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.
+ 'infrastructure': 3, // v3: drops the redaction sentence the mode banners own (#12080). 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.
- 'privacy': 1, // v1: personal/sensitive-data audit — operational exposure, third-party minimization, API over-exposure, retention, erasure reach, real data in fixtures. Honors the project's documented sharing model. Net-new type.
+ 'privacy': 2, // v2: drops the redaction sentence the mode banners own (#12080). v1: personal/sensitive-data audit — operational exposure, third-party minimization, API over-exposure, retention, erasure reach, real data in fixtures. Honors the project's documented sharing model. Net-new type.
'cost-efficiency': 1, // v1: metered-spend audit — repeated paid calls, unrequested provider work, retry multiplication, unbounded scans, storage growth, over-provisioning, egress. Net-new type.
'feature-completeness': 1, // v1: incomplete-feature audit — stubs and 501s reachable from the UI, permanently disabled or "coming soon" controls, UI/doc promises the code does not keep, settings nothing reads, capabilities with no entry point, events nobody hears, plans that disagree with the code, deferred work with no live tracker item. Decides finish / hide / remove. Net-new type.
'workflow-recovery': 1, // v1: workflow completion and recovery audit — inventories server in-progress states and checks each has a visible resume/cancel/reattach exit, busy refusals carry the holder id, client-orchestrated chains survive a failed follow-up step or reload, waits time out, and duplicate-preventing markers live on the server. Net-new type.
- 'better-dev-environment': 1, // v1: host impact of the development loop, measured by diffing host state around a bounded run — leaked temp files/processes/ports, writes outside the sandbox, accumulation, watcher/idle cost, suite runtime. Net-new type.
+ 'better-dev-environment': 2, // v2: drops the redaction clause the mode banners own (#12080). v1: host impact of the development loop, measured by diffing host state around a bounded run — leaked temp files/processes/ports, writes outside the sandbox, accumulation, watcher/idle cost, suite runtime. Net-new type.
'better-test-quality': 2, // v2: adds mocks that drift from the module they replace (members/exports the real module lacks). Previous version: v1: vacuous/weak/redundant existing tests, proven with a mutation probe. Distinct from test-coverage, which owns the gaps.
'stash-cleanup': 2, // v2: the STALE/ABANDONED heuristic names `AGENTS.md` (or `CLAUDE.md`) as the policy file to check before assuming a stash contradicts current architecture (#4852). v1: triage git stash list — supersession check against main, drop superseded/stale entries, leave real unlanded work in place. Net-new type (no retired-hash history needed).
'repo-sync': 1, // v1: verify + finish the deterministic install-wide origin-sync sweep (services/repoSync.js) — resolve mid-flight merges/rebases, decide what to do with uncommitted work, land or report unpushed branches, triage the stashes it could not prove redundant. Net-new type (no retired-hash history needed).