Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fdeops",
"description": "Forward deployed engineering skills for AI coding agents. Use focused task skills or @fde for discovery, implementation, verification and handoff, with local engagement records.",
"version": "5.1.4",
"version": "5.1.5",
"category": "productivity",
"tags": [
"community-managed"
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 5.1.5 - 2026-09-17

- Seal truncated and control-character private markers before preparing context or reports.
- Show locations only in redaction previews and refuse changes that would remove privacy delimiters.
- Confine staged inbox reads to the active customer and reject linked or non-regular inbox items.
- Put approved-data guidance and the synthetic demo before first customer use, with explicit limits for masking, AI hosts and local storage.

## 5.1.4 - 2026-09-16

- Include JavaScript and TypeScript module extensions in reconnaissance, disclose scan limits, and avoid unsupported clean-scan claims.
Expand Down
4 changes: 3 additions & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

fdeops is local tooling. No fdeops-operated backend, telemetry, or accounts.

**Use customer-approved data and AI tools.** The CLI runs locally, but your AI agent may send what it reads to its provider. Masking is partial and does not protect direct file reads or pasted text. If approval is unclear, start with synthetic data. Anonymised customer material still needs permission. See [before customer work](SECURITY.md#before-customer-work) for host, access and storage controls.

## What fdeops does

- Reads and writes files under **`FDEOPS_ENGAGEMENT`** (default `~/fde-engagements/<name>/.fde/`)
Expand Down Expand Up @@ -42,7 +44,7 @@ Notes about identifiable people (stakeholder signals, contact logs) may carry da

## The fieldbook dashboard

`fde dashboard` renders your engagements into a local `fieldbook.html` (default `~/fde-engagements/fieldbook.html`). It is a static file - no server, no network calls, works offline. Anything inside a `<private>…</private>` block in your `.fde/` notes is **redacted** from the rendered page (closed or unclosed), and `<!-- comments -->` are stripped, so the file you might hand to a sponsor never carries your private working notes.
`fde dashboard` renders your engagements into a local `fieldbook.html` (default `~/fde-engagements/fieldbook.html`). It is a static file - no server, no network calls, works offline. Anything inside a `<private>…</private>` block in your `.fde/` notes is **redacted** from the rendered page (closed or unclosed), and `<!-- comments -->` are stripped, but unmarked confidential information can remain. Inspect the output and its customer scope before sharing.

## AI assistants

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ Use it for a single integration, a small client project, or work within a larger

## Quick start

**Use customer-approved data and AI tools.** The CLI runs locally, but your AI agent may send what it reads to its provider. Masking is partial and does not protect direct file reads or pasted text. If approval is unclear, start with synthetic data. Anonymised customer material still needs permission. See [safe setup and limits](SECURITY.md#before-customer-work).

Use FDEOps with an AI coding agent that supports skills. Start with one task, or let `fde` coordinate a customer project.

Try the fictional engagement first with `npx fdeops demo` (requires Node.js 18+ and Git; may download the package). It creates or resets a separate `.demo` workspace and does not need customer data.

### Work on a customer project

Run this in the terminal where your coding agent runs, then select your agent in the installer:
Expand Down
14 changes: 13 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

fdeops stores **engagement-sensitive** material on your machine. Treat `.fde/` like confidential work papers.

## Before customer work

**Use customer-approved data and AI tools.** The CLI runs locally, but your AI agent may send what it reads to its provider. Masking is partial and does not protect direct file reads or pasted text. If approval is unclear, start with synthetic data. Anonymised customer material still needs permission.

- Use an approved AI host, model provider and deployment configuration. A local CLI does not make the model local.
- Restrict host file access and connectors to the authorised engagement. Enforce outbound access and external-write permissions in the host or infrastructure; skills are not a sandbox.
- Keep credentials in approved secret storage. Keep `.fde/`, `.inbox/`, exports and the reversible `.privacy/` dictionary out of shared repositories and unapproved sync or backups. These files are not encrypted by FDEOps.
- Review prepared outputs before sharing. Names, business details and identifying context may remain even after masking. Reports can include multiple customers unless you select the current one.
- Start with `npx fdeops demo` to inspect fictional inputs and outputs before introducing permitted customer material.

FDEOps does not certify regulatory compliance, enforce provider retention settings, or prevent an agent from reading files outside its prepared context. Customer security review and host controls remain necessary. See [privacy behaviour](PRIVACY.md) and [verification limits](docs/verification.md).

## Never commit engagement data

- Default: `~/fde-engagements/<name>/.fde/` - outside shared repositories.
Expand Down Expand Up @@ -32,7 +44,7 @@ What to expect: acknowledgement within 5 days, an assessment with a fix or a rea

### In scope

Anything that breaks the guarantees fdeops makes: `<private>` content reaching a model, a dashboard, a hook, an MCP response, or a structured memory file; engagement memory leaking between clients; the installer or CLI destroying or exfiltrating data; a write applied without human confirmation; the CLI reaching the network.
Leaks through FDEOps-controlled preparation: protected `<private>` content appearing in prepared CLI, dashboard, hook or ingest MCP outputs, or being copied into public fields of structured records; engagement memory leaking between clients; the installer or CLI destroying or exfiltrating data; a write applied without human confirmation; the CLI reaching the network.

### Out of scope

Expand Down
106 changes: 76 additions & 30 deletions bin/fde.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function stripControlChars(s) {
const PRIVATE_MARKER = '(private - redacted)'
// Openers tolerate whitespace and attributes (<private >, <private data-x="1">)
// so a near-miss tag still seals instead of failing open.
const PRIVATE_TAG = /<(\/)?private\b[^>]*>/gi
const PRIVATE_TAG = /<\s*(\/\s*)?private\b[^>\r\n]*(?:>|(?=\r?\n|$))/gi

// Depth-aware split of a markdown body into public text and sealed blocks. A
// nested block seals to the outermost close, an unclosed one seals to EOF, and a
Expand All @@ -373,7 +373,7 @@ const PRIVATE_TAG = /<(\/)?private\b[^>]*>/gi
// gets that: on the read path a stray `<!--` already stored in memory would
// otherwise hide every line after it from every view.
function splitPrivate(md, opts = {}) {
let text = String(md || '').replace(/<!--[\s\S]*?-->/g, '')
let text = stripControlChars(String(md || '')).replace(/<!--[\s\S]*?-->/g, '')
if (opts.sealDangling) text = text.replace(/<!--[\s\S]*$/, '')
const blocks = []
let out = ''
Expand Down Expand Up @@ -437,7 +437,7 @@ function sealedText(blocks) {
// a stray `</private>` leaves the text after it in the clear, and a forgotten
// closer seals everything appended later. Counts only - never the content.
function privateMarkerImbalance(md) {
const text = String(md || '')
const text = stripControlChars(String(md || ''))
let depth = 0
let unclosed = 0
let stray = 0
Expand Down Expand Up @@ -2393,7 +2393,12 @@ function parseIngestFrontMatter(raw) {
if (!text.startsWith('---\n')) return { meta: {}, body: text }
const end = text.indexOf('\n---\n', 4)
if (end === -1) return { meta: {}, body: text }
const head = text.slice(4, end)
const rawHead = text.slice(4, end)
const balance = privateMarkerImbalance(rawHead)
if (balance.unclosed || balance.stray || rawHead.lastIndexOf('<!--') > rawHead.lastIndexOf('-->')) {
throw new Error('ingest refused: privacy boundaries must not cross the metadata separator')
}
const head = stripPrivate(rawHead)
const body = text.slice(end + 5)
const meta = {}
for (const line of head.split('\n')) {
Expand All @@ -2403,20 +2408,44 @@ function parseIngestFrontMatter(raw) {
return { meta, body }
}

function resolveInboxItem(eng, id) {
// Inbox IDs select local staged files, never arbitrary filesystem paths.
function checkedInbox(eng) {
const box = inboxDir(eng)
let st
try { st = fs.lstatSync(box) } catch (error) { if (error.code === 'ENOENT') return null; throw error }
if (st.isSymbolicLink() || !st.isDirectory()) throw new Error('ingest refused: inbox must be a real directory')
return box
}

function readInboxItem(eng, name) {
const box = checkedInbox(eng)
if (!box || !name || /[\\/]/.test(name) || name === '.' || name === '..') throw new Error('ingest refused: invalid inbox item')
let fd
try {
fd = fs.openSync(path.join(box, name), fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW | fs.constants.O_NONBLOCK)
const st = fs.fstatSync(fd)
if (!st.isFile() || st.nlink !== 1) throw new Error('ingest refused: staged item must be a regular file with one link')
if (st.size > DEBRIEF_MAX_BYTES) throw new Error('ingest refused: staged item exceeds the notes size limit')
// Bound the actual read too: a file can grow after fstat.
const buf = Buffer.alloc(DEBRIEF_MAX_BYTES + 1)
let size = 0, n
while (size < buf.length && (n = fs.readSync(fd, buf, size, buf.length - size, null))) size += n
if (size > DEBRIEF_MAX_BYTES) throw new Error('ingest refused: staged item exceeds the notes size limit')
return stripControlChars(buf.subarray(0, size).toString('utf8'))
} finally { if (fd !== undefined) fs.closeSync(fd) }
}

function resolveInboxItem(eng, id) {
const want = String(id || '').trim()
if (!want) return null
const direct = path.join(box, want)
if (fs.existsSync(direct) && fs.statSync(direct).isFile()) return direct
if (!want || /[\\/]/.test(want) || want === '.' || want === '..') throw new Error('ingest refused: use an inbox filename or ID, not a path')
const box = checkedInbox(eng)
if (!box) return null
const files = fs.readdirSync(box).filter(f => f.endsWith('.md'))
if (files.includes(want)) return want
const withMd = want.endsWith('.md') ? want : `${want}.md`
const alt = path.join(box, withMd)
if (fs.existsSync(alt) && fs.statSync(alt).isFile()) return alt
try {
const hits = fs.readdirSync(box).filter(f => f === want || f.startsWith(want) || f.includes(want))
if (hits.length === 1) return path.join(box, hits[0])
} catch (_) {}
return null
if (files.includes(withMd)) return withMd
const hits = files.filter(f => f.includes(want))
return hits.length === 1 ? hits[0] : null
}

function cmdIngest(args) {
Expand All @@ -2439,9 +2468,9 @@ function cmdIngest(args) {
if (!eng) { console.error('no engagement - run: fde resume --init <name>'); process.exit(2) }

if (sub === 'list') {
const box = inboxDir(eng)
if (!fs.existsSync(box)) {
console.log(`inbox empty → ${box}`)
const box = checkedInbox(eng)
if (!box) {
console.log(`inbox empty → ${inboxDir(eng)}`)
console.log('(stage with: fde ingest stage --source granola notes.md)')
return
}
Expand All @@ -2452,7 +2481,7 @@ function cmdIngest(args) {
}
console.log(`INBOX → ${box}\n`)
for (const f of files) {
const raw = fs.readFileSync(path.join(box, f), 'utf8')
const raw = readInboxItem(eng, f)
const { meta } = parseIngestFrontMatter(raw)
const src = meta.source || '?'
const title = meta.title || ''
Expand All @@ -2471,7 +2500,7 @@ function cmdIngest(args) {
console.error(`ingest propose: no staged item matching "${id}" - run: fde ingest list`)
process.exit(1)
}
const raw = stripControlChars(fs.readFileSync(item, 'utf8'))
const raw = readInboxItem(eng, item)
const { meta, body } = parseIngestFrontMatter(raw)
const source = meta.source || 'manual'
const title = meta.title || path.basename(item, '.md')
Expand Down Expand Up @@ -2540,7 +2569,10 @@ function cmdIngest(args) {
if (hit && force) console.error(`warning: staging possible ${hit} (--force)`)

const box = inboxDir(eng)
try { fs.mkdirSync(box, { recursive: true }) } catch (e) { failFs(e, 'create inbox', box) }
try {
if (!checkedInbox(eng)) fs.mkdirSync(box)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Concurrent first inbox stage fails

Two first-time ingest stage calls can both find no inbox, then one mkdirSync fails with EEXIST. One valid staging request is lost.

Suggested change
if (!checkedInbox(eng)) fs.mkdirSync(box)
if (!checkedInbox(eng)) fs.mkdirSync(box, { recursive: true })
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

checkedInbox(eng)
} catch (e) { failFs(e, 'create inbox', box) }
const compact = new Date().toISOString().replace(/[-:]/g, '').replace(/\.\d{3}Z$/, 'Z')
const id = `${compact}-${source}-${titleSlug}.md`
const dest = path.join(box, id)
Expand Down Expand Up @@ -3389,7 +3421,7 @@ function cmdRedact(args) {
const apply = args.includes('--apply')
const term = args.filter(a => a !== '--apply').join(' ').trim()
if (!term || term.length < 4) {
console.error('usage: fde redact <term> [--apply]\n preview lines containing <term>; --apply removes them and commits the ledger')
console.error('usage: fde redact <term> [--apply]\n preview locations containing <term>; --apply removes matching lines and commits the ledger')
process.exit(1)
}
const eng = resolveEngagement({ forWrite: apply })
Expand All @@ -3406,26 +3438,40 @@ function cmdRedact(args) {
})
}
if (!hits.length) {
console.log(`redact: no lines contain ${JSON.stringify(masking.mask(term))}`)
console.log('redact: no matching lines')
return
}
console.log(`REDACT - ${hits.length} matching line(s) for ${JSON.stringify(masking.mask(term))}`)
hits.slice(0, 20).forEach(h => {
const preview = h.line.length > 100 ? masking.mask(h.line).slice(0, 97) + '…' : h.line
console.log(` ${h.file}:${h.lineNo} ${preview}`)
})
console.log(`REDACT - ${hits.length} matching line(s); content withheld`)
hits.slice(0, 20).forEach(h => console.log(` ${h.file}:${h.lineNo}`))
if (hits.length > 20) console.log(` … +${hits.length - 20} more`)
if (!apply) {
console.log('\nPreview only. Remove and commit: fde redact <term> --apply')
console.log('Note: git history still holds prior commits - rotate the real secret.')
return
}
const removesMarker = md => {
const lines = md.split('\n')
const clean = stripControlChars(md)
const markers = new RegExp(`${PRIVATE_TAG.source}|<!--|-->`, 'gi')
for (const match of clean.matchAll(markers)) {
const first = clean.slice(0, match.index).split('\n').length - 1
const last = first + match[0].split('\n').length - 1
if (lines.slice(first, last + 1).some(line => line.toLowerCase().includes(needle))) return true
}
return false
}
if ([...new Set(hits.map(h => h.file))].some(file => removesMarker(readEng(eng, file)))) {
console.error('redact refused: a matching line contains a privacy delimiter. Remove the complete private block locally, preserving other privacy boundaries.')
process.exitCode = 1
return
}
ensureMemoryGit(eng)
const touched = []
for (const file of new Set(hits.map(h => h.file))) {
const abs = path.join(eng, file)
withFileLock(abs, () => {
const before = readEng(eng, file)
if (removesMarker(before)) throw new Error('redact refused: privacy delimiter changed during review')
Comment on lines 3473 to +3474

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Delimiter race leaves partial redaction

A later file gaining a matching delimiter makes removesMarker throw after earlier files were rewritten. Redaction exits with only some matches removed.

Learn more

Redaction validates all files before writing, but the validation does not hold their locks. The command then locks and rewrites files one at a time. A cooperating writer can change a later file after preflight, causing the new in-lock delimiter check to throw after earlier rewrites. The command has no rollback around this loop.

Example: REMOVE_ME appears in decisions.md and context.md. After preflight, another process changes the matching context line to <private data-note="REMOVE_ME">. The command rewrites decisions.md, rejects context.md, and exits without committing a complete redaction.

Recommended fix: Acquire all touched-file locks in deterministic order before revalidating or writing. Snapshot every file, validate all snapshots, then write them; restore written snapshots if any write fails.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

const after = before.split('\n').filter(line => !line.toLowerCase().includes(needle)).join('\n')
if (after === before) return
atomicWriteFile(abs, after.endsWith('\n') || after === '' ? after : after + '\n')
Expand Down Expand Up @@ -4160,8 +4206,8 @@ function cmdDemo(args) {
- PR#42 is fictional evidence for a measured result. The ledger still says claimed:
naming Priya as signer does not mean she accepted the result.
- The <private> block in those notes never appears in resume, prep, receipts or
the dashboard - it is sealed in context.md and redacted from anything an agent
or a screen share can see.
the dashboard. Raw files still contain it: agent file reads and pasted text
bypass this protection. Review reports before sharing; unmarked data may remain.
- Tomorrow's session starts from the record instead of a blank chat.
${fs.existsSync(html) ? `\n Open the fieldbook: ${html}` : ''}

Expand Down
4 changes: 3 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ fdeops installs on **your laptop** - where **your AI coding agent** runs. Not on

**Terminology:** **You** = human FDE. **Agent** = AI coding software (e.g. Claude Code), never a person. See [README § Who this is for](../README.md#who-this-is-for).

**Try before installing:** `npx fdeops scan` prints local repository reconnaissance and day-one questions without creating engagement records. `npx` may download the package; the scan itself does not use the network. Requires Node.js 18+ and Git.
**Use customer-approved data and AI tools.** The CLI runs locally, but your AI agent may send what it reads to its provider. Masking is partial and does not protect direct file reads or pasted text. If approval is unclear, start with synthetic data. Anonymised customer material still needs permission.

**Try with fictional data:** `npx fdeops demo` runs a synthetic engagement in a separate `.demo` workspace. It creates or resets that demo only. `npx` may download the package; the CLI itself does not use the network. Requires Node.js 18+ and Git.

---

Expand Down
2 changes: 2 additions & 0 deletions docs/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ A two-session Codex/GPT-6-Astra diagnostic prepared a masked meeting review, wai

Regression tests cover stable aliases, original-record preservation, confirmed proposal restoration, sourced replay, masked stderr/MCP responses, truncation and invalid private state. Raw file tools, pasted chat, upstream sources and unrecognized identifiers remain outside this boundary. See [privacy details](../PRIVACY.md#default-identifier-masking).

The 5.1.5 privacy regressions exercise truncated and control-character private markers, redaction previews and delimiter preservation, and inbox traversal, symlinks, hardlinks, nonregular files, oversized reads and private metadata. These are synthetic local tests. They do not enforce host permissions, prevent a malicious local process from changing directories during a read, or certify a regulated deployment.

## Agent task evidence

Completed synthetic diagnostics include:
Expand Down
2 changes: 1 addition & 1 deletion mcp/fdeops-ingest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fdeops-ingest-mcp",
"version": "5.1.4",
"version": "5.1.5",
"private": true,
"description": "Thin stdio MCP sink for FDEOps ingest (stage \u2192 propose \u2192 apply). Zero runtime dependencies.",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fdeops",
"version": "5.1.4",
"version": "5.1.5",
"description": "Forward deployed engineering skills for AI coding agents. Use focused task skills or @fde for discovery, implementation, verification and handoff, with local engagement records.",
"bin": {
"fdeops": "bin/install.js",
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "fdeops",
"version": "5.1.4",
"version": "5.1.5",
"description": "Forward deployed engineering skills for AI coding agents. Use focused task skills or @fde for discovery, implementation, verification and handoff, with local engagement records.",
"author": {
"name": "Subash Natarajan",
Expand Down
2 changes: 1 addition & 1 deletion skills/audit/.fde-generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"SKILL.md": "aa120dd0b6c0781300d56f916f1721525de7fbe65608ff7a9a0239a2a5e20e88",
"references/audit.md": "ed32ea78cbccb100742dd838e8cf4cd4b6f33ad44b3de7424fc624670d571dbc",
"references/discover.md": "f65aa11a539b4dbbed70cfaa94ec2a35595aa9a2d0282790510b933ac9c721ce",
"references/task-context.md": "28684273e9d6edf1d05fb02c96caf4223e19b73e7ae840bdec2ff0bf06e3bc27"
"references/task-context.md": "3c0b0083e63a3e667d80fa7641b10eabf88ee729e877f658580cbc07031834ec"
}
}
Loading
Loading