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: redact emails, phones and network hosts from every filed forge issue (#8460)

[._.]/ Adam Eivyd3fe1571eaf3
diff --git a/server/lib/persistentMindCapabilities.js b/server/lib/persistentMindCapabilities.js
index e4c34b030c..a83850419d 100644
--- a/server/lib/persistentMindCapabilities.js
+++ b/server/lib/persistentMindCapabilities.js
@@ -102,7 +102,7 @@ export const PERSISTENT_MIND_TOOL_CATALOG = Object.freeze([
'Read and create only — no editing, closing, commenting, assigning, or labeling existing issues',
'Every filed issue carries both required dispatch axes plus the persistent-mind and planner attribution labels',
'An unreadable tracker refuses the file instead of risking a duplicate, and an exact title match reuses the existing issue',
- 'Issue titles and bodies are the mind\'s own prose, with home-directory paths and credential-shaped strings stripped before filing; it is additionally instructed to keep private records out, which is guidance rather than an enforced filter',
+ 'Issue titles and bodies are the mind\'s own prose, with home-directory paths, credential-shaped strings, email addresses, phone numbers, IP/MAC addresses and network hostnames stripped before filing; it is additionally instructed to keep private records out, which is guidance rather than an enforced filter',
],
}),
Object.freeze({
diff --git a/server/services/appIssues.js b/server/services/appIssues.js
index a1e0d21de5..18000844dc 100644
--- a/server/services/appIssues.js
+++ b/server/services/appIssues.js
@@ -34,6 +34,7 @@ import { ServerError, boundedErrorMessage } from '../lib/errorHandler.js';
import { forgeIssueCreateArgs, forgeLabelCreateArgs, parseCreatedForgeIssue } from '../lib/forgeIssueCli.js';
import { scrubHomePath } from '../lib/homePath.js';
import { scrubSecretTokens } from '../lib/secretText.js';
+import { redactPii } from '../lib/piiRedactionPatterns.js';
// Single-user repos never realistically exceed this; `glab` caps a page at 100.
const GH_LIST_LIMIT = 200;
@@ -327,16 +328,22 @@ export async function prepareAppIssueClaim(app, issueNumber, tracker) {
* copy (#7687 — three filers had re-implemented this, and only two called it).
* `scrubHomePath` collapses the running user's home prefix (which embeds the OS
* username in `/Users/<name>/…`); `scrubSecretTokens` replaces credential-shaped
- * substrings. Neither is a content filter — deciding whether a sentence names a
+ * substrings; `redactPii` replaces emails, phone numbers, IP/MAC literals,
+ * `.ts.net`/`.local` hosts and labelled GPS coordinates (#8460 — only one of
+ * three filers applied it). Its phone pattern also collapses ISO dates such as
+ * `2026-09-25`, an accepted over-redaction. None is a content filter — deciding whether a sentence names a
* private record is not mechanically decidable, so that stays a prompt
- * instruction for the callers that reach an LLM. Both helpers pass a non-string
- * through untouched.
+ * instruction for the callers that reach an LLM. A non-string passes through
+ * untouched.
*
* Exported (not just used internally by `fileForgeIssue`) because a filer that
* needs to scrub text for a NON-forge tracker in the same request — JIRA,
* today — still needs one shared definition to call.
*/
-export const scrubForgeIssueText = (value) => scrubSecretTokens(scrubHomePath(value));
+export const scrubForgeIssueText = (value) => {
+ const scrubbed = scrubSecretTokens(scrubHomePath(value));
+ return typeof scrubbed === 'string' ? redactPii(scrubbed) : scrubbed;
+};
/**
* Refuse to proceed against an unreachable GitHub forge, in the `{ ok, error }`
@@ -420,13 +427,14 @@ export async function ensureForgeIssueLabels({ cli, exec, cwd, env, repo = null,
* @param {string|null} [args.hostname] - github API host to probe; omit to skip the probe (already done, or non-github)
* @param {string} args.title
* @param {string} args.body
+ * @param {string} [args.trailer] - machine-generated text appended to the body AFTER scrubbing (a dedup marker the scrub must not rewrite); never pass model- or user-authored text here
* @param {{name:string, color:string, description:string}[]} [args.labels] - applied to the issue AND created first
* @param {(cli:string, args:string[], opts:object) => Promise<{code:number, stdout:string, stderr:string}>} [args.exec]
* @returns {Promise<{ok:true, number:number|null, url:string}|{ok:false, error:string}>}
*/
export async function fileForgeIssue({
cli, cwd = undefined, env = undefined, repo = null, repoPath = null,
- hostname = null, title, body, labels = [], exec = execForgeIssueCli,
+ hostname = null, title, body, trailer = '', labels = [], exec = execForgeIssueCli,
} = {}) {
const probe = await probeForgeReachability({ cli, hostname, env, label: 'file-forge-issue' });
if (!probe.ok) return { ok: false, error: probe.error };
@@ -437,7 +445,7 @@ export async function fileForgeIssue({
const args = forgeIssueCreateArgs(cli, {
title: scrubForgeIssueText(title),
- body: scrubForgeIssueText(body),
+ body: `${scrubForgeIssueText(body)}${trailer}`,
labels: labels.map((spec) => spec.name),
repo: cli === 'glab' ? null : repo,
});
diff --git a/server/services/appIssues.test.js b/server/services/appIssues.test.js
index 780332e9be..30185bb1fa 100644
--- a/server/services/appIssues.test.js
+++ b/server/services/appIssues.test.js
@@ -548,6 +548,30 @@ describe('fileForgeIssue', () => {
expect(body).not.toContain('ghp_');
expect(body).not.toContain(home);
});
+
+ // #8460 — the machine-identity/PII redactor rides the same choke point, so
+ // an email, IP, tailnet host or phone number a model copied from the user's
+ // records never reaches a (often public) tracker, whichever filer called.
+ it('redacts emails, IPs, tailnet hosts and phone numbers from the title and body', async () => {
+ const leaks = ['[email protected]', '192.0.2.10', 'host-1.example.ts.net', '+1 555 010 0000'];
+ execGh.mockResolvedValueOnce('').mockResolvedValueOnce('https://github.com/acme/widget/issues/1');
+ await fileForgeIssue({
+ cli: 'gh', labels: LABELS,
+ title: `Invite to [email protected] bounces`,
+ body: `Peer host-1.example.ts.net at 192.0.2.10 fails; call +1 555 010 0000.`,
+ });
+ const argv = execGh.mock.calls[1][0].join('\n');
+ for (const leak of leaks) expect(argv).not.toContain(leak);
+ expect(argv).toContain('Invite to <email> bounces');
+ });
+
+ it('appends a machine-generated trailer after scrubbing, so redaction cannot rewrite it', async () => {
+ execGh.mockResolvedValueOnce('').mockResolvedValueOnce('https://github.com/acme/widget/issues/1');
+ const trailer = '\n\n<!-- marker: release-2026-09-25 -->';
+ await fileForgeIssue({ cli: 'gh', labels: LABELS, title: 'T', body: 'Due 2026-09-25.', trailer });
+ const createArgs = execGh.mock.calls[1][0];
+ expect(createArgs[createArgs.indexOf('--body') + 1]).toBe(`Due <phone>.${trailer}`);
+ });
});
describe('probeForgeReachability', () => {
diff --git a/server/services/goalFidelityFollowUp.js b/server/services/goalFidelityFollowUp.js
index 8c58c93ccc..7208f96de8 100644
--- a/server/services/goalFidelityFollowUp.js
+++ b/server/services/goalFidelityFollowUp.js
@@ -64,7 +64,6 @@ import { investigationOutcome } from '../lib/investigationTasks.js';
import { forgeCliForTracker, resolveAppForgeTarget } from '../lib/workTracker.js';
import { safeJSONParse } from '../lib/fileUtils.js';
import { boundedErrorMessage } from '../lib/errorHandler.js';
-import { redactPii } from '../lib/piiRedactionPatterns.js';
import { localApiBaseUrl } from '../lib/networkExposure.js';
import { buildGoalFidelityFalsePositiveReportBlock } from '../lib/goalFidelityCalibration.js';
import {
@@ -323,10 +322,10 @@ async function fileFollowUpIssue({ task, review, fingerprint, context }) {
const draft = buildGoalFidelityIssue({ task, review, fingerprint, context });
if (draft.error) return { issue: null, error: draft.error };
// Publishing the objective adds more operator-authored text than a title.
- // Reuse the shared PII and credential scrubbers; never include transcripts
- // or unrelated metadata in this public projection.
- const title = redactPii(scrubForgeIssueText(draft.title));
- const body = redactPii(scrubForgeIssueText(draft.body));
+ // The shared forge scrubber strips PII and credentials; never include
+ // transcripts or unrelated metadata in this public projection.
+ const title = scrubForgeIssueText(draft.title);
+ const body = scrubForgeIssueText(draft.body);
// The marker hashes the local fingerprint, so redacting dates or private
// task text cannot change the identity the duplicate scan reads back.
const created = tracker === 'jira'
diff --git a/server/services/layeredIntelligence.test.js b/server/services/layeredIntelligence.test.js
index 02a452f2cb..fca734880c 100644
--- a/server/services/layeredIntelligence.test.js
+++ b/server/services/layeredIntelligence.test.js
@@ -3061,6 +3061,29 @@ describe('Jira filer', () => {
expect(payload.description).toContain('B');
});
+ // #8460 — the Jira filer shares the forge scrubber, and both filers append
+ // the slug marker after it: a date-bearing slug would otherwise collapse to
+ // `<phone>` and lose the dedup identity the next run reads back.
+ it('fileProposalToJira redacts PII but keeps a date-bearing slug marker intact', async () => {
+ const create = vi.fn().mockResolvedValue({ success: true, ticketId: 'PROJ-12', url: 'https://j/browse/PROJ-12' });
+ await fileProposalToJira({
+ instanceId: 'i', projectKey: 'PROJ', slug: 'release-2026-09-25', create,
+ title: 'Mail [email protected]', body: 'Peer 192.0.2.10 on host-1.example.ts.net, call +1 555 010 0000.',
+ });
+ const { summary, description } = create.mock.calls[0][1];
+ for (const leak of ['[email protected]', '192.0.2.10', 'host-1.example.ts.net', '+1 555 010 0000']) {
+ expect(`${summary}\n${description}`).not.toContain(leak);
+ }
+ expect(extractSlugFromBody(description)).toBe('release-2026-09-25');
+ });
+
+ it('fileProposalToForge keeps a date-bearing slug marker intact through the scrubber', async () => {
+ const exec = vi.fn().mockResolvedValue({ code: 0, stdout: 'https://github.com/o/r/issues/5\n' });
+ await fileProposalToForge({ cli: 'gh', cwd: '/x', title: 'T', body: 'B', slug: 'release-2026-09-25', model: 'light', effort: 'low', exec });
+ const createCall = exec.mock.calls.find(c => c[1][0] === 'issue')[1];
+ expect(extractSlugFromBody(createCall[createCall.indexOf('--body') + 1])).toBe('release-2026-09-25');
+ });
+
it('fileProposalToJira forwards hyphenated dispatch + contributor labels without deriving them', async () => {
const create = vi.fn().mockResolvedValue({ success: true, ticketId: 'PROJ-11', url: 'https://j/browse/PROJ-11' });
await fileProposalToJira({
diff --git a/server/services/layeredIntelligence/forgeFiler.js b/server/services/layeredIntelligence/forgeFiler.js
index 52957ea289..72a6354838 100644
--- a/server/services/layeredIntelligence/forgeFiler.js
+++ b/server/services/layeredIntelligence/forgeFiler.js
@@ -255,7 +255,7 @@ export async function fileProposalToForge({
const extras = forgeIssueLabels({ model, effort, goodFirstIssue, helpWanted, planner, cli })
.map((name) => dispatchLabelSpec(name, { cli }));
const labels = [LI_LABEL_SPEC, ...extras.filter(Boolean)];
- const result = await fileForgeIssue({ cli, cwd, env, hostname, title, body: `${body}\n\n${slugMarker(slug)}`, labels, exec });
+ const result = await fileForgeIssue({ cli, cwd, env, hostname, title, body, trailer: `\n\n${slugMarker(slug)}`, labels, exec });
return result.ok
? { success: true, number: result.number, url: result.url }
: { success: false, error: result.error };
diff --git a/server/services/layeredIntelligence/jiraFiler.js b/server/services/layeredIntelligence/jiraFiler.js
index de8bbae80b..bccc06ebfb 100644
--- a/server/services/layeredIntelligence/jiraFiler.js
+++ b/server/services/layeredIntelligence/jiraFiler.js
@@ -13,6 +13,7 @@ import { createTicket, searchIssues, addLabels, escapeJql } from '../jira.js';
import { LI_LABEL, PLANNED_WORK_LABEL, LI_JIRA_BLOCKING_LABEL } from './constants.js';
import { slugMarker, extractSlugFromBody } from './dedup.js';
import { normalizeIssueLabels } from './forgeFiler.js';
+import { scrubForgeIssueText } from '../appIssues.js';
// ---------------------------------------------------------------------------
// Jira filer. Jira has no forge CLI — it goes through the PortOS Jira REST
@@ -109,7 +110,10 @@ export async function listJiraBlockingIssues({ instanceId, projectKey, search =
/**
* File ONE proposal ticket in a Jira project. Embeds the slug marker in the
* description (searchable for dedup) and tags it with the layered-intelligence
- * label. Returns `{ success, key, url }` — Jira issues are keyed strings
+ * label. The summary and description go through the same scrubber every forge
+ * filer shares (`scrubForgeIssueText`, #8460); the slug marker is appended
+ * after it so redaction can never rewrite the dedup identity. Returns
+ * `{ success, key, url }` — Jira issues are keyed strings
* (`PROJ-123`), not integers, so the handler resolves pause targets by key.
*/
export async function fileProposalToJira({
@@ -117,10 +121,10 @@ export async function fileProposalToJira({
model, effort, goodFirstIssue, helpWanted, planner, create = createTicket
} = {}) {
if (!instanceId || !projectKey) return { success: false, error: 'jira instance/project not configured' };
- const description = `${body}\n\n${slugMarker(slug)}`;
+ const description = `${scrubForgeIssueText(body)}\n\n${slugMarker(slug)}`;
const res = await create(instanceId, {
projectKey,
- summary: title,
+ summary: scrubForgeIssueText(title),
description,
issueType,
labels: [LI_LABEL, ...jiraIssueLabels({ model, effort, goodFirstIssue, helpWanted, planner })]
diff --git a/server/services/persistentMindIssueCapability.test.js b/server/services/persistentMindIssueCapability.test.js
index d896c3d259..4974ef42ac 100644
--- a/server/services/persistentMindIssueCapability.test.js
+++ b/server/services/persistentMindIssueCapability.test.js
@@ -247,6 +247,26 @@ describe('persistent mind issue capability', () => {
expect(ghArgsFor('issue')).toHaveLength(0);
});
+ // #8460 — the same mind can hold portos.read, so a calendar attendee or a
+ // peer hostname can reach its prose; the shared scrubber redacts both.
+ it('redacts emails and network hosts, and dedupes on the redacted title', async () => {
+ mocks.listAppIssues.mockResolvedValue(okList([
+ openIssue({ number: 13, title: 'Invite to <email> bounces' }),
+ ]));
+ expect(await filePersistentMindIssue(fileRequest({
+ title: 'Invite to [email protected] bounces',
+ }))).toMatchObject({ ok: true, duplicate: true, number: 13 });
+
+ mocks.listAppIssues.mockResolvedValue(okList([]));
+ await filePersistentMindIssue(fileRequest({
+ title: 'Invite to [email protected] bounces',
+ body: 'Seen on host-1.example.ts.net.',
+ }));
+ const [args] = ghArgsFor('issue');
+ expect(argValue(args, '--title')).toBe('Invite to <email> bounces');
+ expect(argValue(args, '--body')).toBe('Seen on <host>.');
+ });
+
it('leaves ordinary prose, repo-relative paths and short ids untouched', async () => {
const body = 'server/services/sync.js drops job 4f2a on retry — see PR #118.';
await filePersistentMindIssue(fileRequest({ title: 'Sync drops a job on retry', body }));