devworkspace 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"taskContext.js","sourceRoot":"","sources":["../../src/services/taskContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAgC,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAGzE,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAK,aAAmC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAwCD,MAAM,IAAI,GAAG,IAAI,GAAG,CAA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YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;YAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3D,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,IAAI,CAAC;QACZ,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,QAAQ,IAAI,EAAE;QAClB,MAAM,EAAE,wBAAwB,IAAI,4CAA4C;KACjF,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,IAAI;QACP,IAAI;QACJ,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,eAAe;QAC1B,SAAS,EAAE,eAAe;QAC1B,KAAK,EAAE,YAAY;QACnB,QAAQ;QACR,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACpD,SAAS,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC7D,SAAS,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SAC9D;QACD,YAAY;QACZ,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { SCHEMA_VERSION, validateCommands, type CommandEntry, type Fact } from '../config/schemas.js';\nimport { loadProject, requireWorkspace } from '../core/workspace.js';\nimport { readVersioned } from '../core/versioned.js';\nimport { listDecisions } from '../decisions/decision.js';\nimport { loadFacts } from '../knowledge/facts.js';\nimport { classifyRequest } from '../tasks/routing.js';\nimport type { TaskType } from '../tasks/task.js';\nimport { pathExists } from '../utils/fs.js';\nimport { classifyCommand, readManifestEvidence } from '../verification/safety.js';\nimport { dirtyFiles, packageDirs } from '../verification/scope.js';\nimport { SAFETY_RULES, type ContextResult } from './knowledge.js';\nimport type { ServiceOptions } from './common.js';\nimport { loadFeatures } from './features.js';\nimport { loadGraphData, findMatchingStartNode } from './graph.js';\n\nexport const CONTEXT_ROLES = ['explorer', 'tester', 'reviewer'] as const;\nexport type ContextRole = (typeof CONTEXT_ROLES)[number];\n\nexport function isContextRole(v: unknown): v is ContextRole {\n return typeof v === 'string' && (CONTEXT_ROLES as readonly string[]).includes(v);\n}\n\nexport interface ContextItem {\n kind: 'fact' | 'check' | 'decision' | 'document' | 'rule';\n id: string;\n /** Why this item is in the context; every item carries one. */\n reason: string;\n}\n\nexport interface TaskContextResult {\n project: { name: string; id: string };\n request: string;\n type: TaskType;\n confidence: 'high' | 'low';\n readOnly: boolean;\n /** `clipped` = characters left out of a long detector-derived value; the full value is in facts.json. */\n facts: (Fact & { clipped?: number })[];\n /** Detector facts folded into another fact with the identical value; nothing is deleted from facts.json. */\n aliases: { key: string; sameAs: string }[];\n checks: CommandEntry[];\n safety: ContextResult['safety'];\n rules: string[];\n decisions: { number: number; title: string; status: string; file: string }[];\n /** Detailed documents are referenced by name, never embedded. */\n documents: { name: string; bytes: number }[];\n packages: string[];\n included: ContextItem[];\n counts: { facts: [number, number]; checks: [number, number]; decisions: [number, number]; documents: [number, number] };\n role?: ContextRole;\n roleGuidance?: string[];\n roleFindings?: {\n entryPoints?: string[];\n graphNodes?: { id: string; status: string; path: string | null; symbol: string | null }[];\n features?: { id: string; name: string; status?: string }[];\n testFrameworks?: string[];\n zeroTestSafeguards?: string[];\n diffNotice?: string;\n };\n}\n\nconst STOP = new Set([\n 'the', 'and', 'for', 'with', 'that', 'this', 'from', 'into', 'does', 'how',\n 'what', 'where', 'why', 'when', 'which', 'fix', 'add', 'bug', 'make', 'new',\n 'can', 'are', 'not', 'our', 'all', 'use', 'get', 'set', 'let', 'may'\n]);\nconst WEAK_TERMS = new Set(['error', 'errors', 'check', 'checks', 'data', 'improve', 'update', 'run', 'test', 'handle', 'handling', 'code']);\nconst PATH_STRUCTURAL_TERMS = new Set([\n 'backend', 'frontend', 'service', 'services', 'controller', 'controllers',\n 'worker', 'workers', 'dto', 'dtos', 'src', 'modules', 'app', 'tests',\n 'unit', 'integration', 'test', 'spec', 'ts', 'tsx', 'js', 'jsx', 'json', 'md'\n]);\nconst CLIP = 400;\nconst SECURITY_WORDS = /auth|tenant|permission|rbac|security|isolation|role|session|ownership/i;\nconst ISSUE_KEY = /^(?:issue|limit|known|bug|risk)/i;\n/** Facts that describe the stack and layout; implementation-style tasks need them, a lookup question does not. */\nconst STACK_KEY = /^(?:stack\\.|repo\\.packages|repo\\.monorepo|repo\\.entry-points|convention|style|arch|pattern|testing)/i;\nconst BROAD_TYPES: TaskType[] = ['FEATURE', 'REFACTOR', 'ARCHITECTURE', 'TESTING', 'PERFORMANCE', 'MAINTENANCE', 'RELEASE'];\n\n/** Normalizes words by stripping standard English inflectional suffixes deterministically. */\nfunction normalizeStem(w: string): string {\n const s = w.toLowerCase().trim();\n if (s.endsWith('ies') && s.length > 4) return s.slice(0, -3) + 'y';\n if (s.endsWith('es') && s.length > 4 && /[sxz]|ch|sh$/.test(s.slice(0, -2))) return s.slice(0, -2);\n if (s.endsWith('s') && s.length > 3 && !s.endsWith('ss')) return s.slice(0, -1);\n if (s.endsWith('ing') && s.length > 5) return s.slice(0, -3);\n if (s.endsWith('tion') && s.length > 6) return s.slice(0, -4);\n if (s.endsWith('ed') && s.length > 4) return s.slice(0, -2);\n return s;\n}\n\n/** Explicit domain synonym dictionary grounded in engineering tasks and repository knowledge. */\nconst DOMAIN_SYNONYMS: Record<string, string[]> = {\n // Database, migrations, schema and persistence\n table: ['database', 'schema', 'orm', 'migration', 'sql'],\n column: ['database', 'schema', 'migration', 'sql'],\n schema: ['database', 'orm', 'migration', 'sql', 'drizzle', 'postgres'],\n migration: ['database', 'schema', 'migrate', 'sql', 'drizzle'],\n migrate: ['database', 'schema', 'migration', 'sql'],\n sql: ['database', 'postgres', 'drizzle', 'query'],\n db: ['database', 'postgres', 'drizzle', 'orm'],\n database: ['db', 'schema', 'orm', 'postgres', 'drizzle'],\n drizzle: ['database', 'orm', 'schema'],\n postgres: ['database', 'sql'],\n\n // Authentication, tenancy, and authorization\n auth: ['jwt', 'session', 'security', 'tenant', 'permission'],\n jwt: ['auth', 'session', 'token', 'security'],\n password: ['hash', 'argon2', 'auth', 'security'],\n hash: ['password', 'argon2', 'security'],\n tenant: ['tenancy', 'isolation', 'security', 'auth'],\n tenancy: ['tenant', 'isolation', 'security'],\n isolation: ['tenant', 'tenancy', 'security'],\n\n // Billing and financial\n invoice: ['billing', 'cents', 'precision'],\n billing: ['invoice', 'cents', 'precision'],\n cents: ['billing', 'invoice', 'precision'],\n payment: ['stripe', 'gateway'],\n\n // API, HTTP, and Backend Services\n endpoint: ['api', 'controller', 'service', 'dto'],\n api: ['endpoint', 'controller', 'service', 'dto'],\n supplier: ['supplier', 'dto', 'service'],\n controller: ['service', 'dto', 'api', 'endpoint'],\n dto: ['validation', 'typebox', 'schema', 'controller'],\n\n // Frontend and UI\n component: ['ui', 'frontend', 'page', 'react'],\n pagination: ['ui', 'component', 'frontend', 'table'],\n frontend: ['ui', 'component', 'react'],\n ui: ['component', 'frontend', 'react'],\n react: ['ui', 'component', 'frontend'],\n\n // Inventory and Stock\n stock: ['inventory', 'product', 'service'],\n inventory: ['stock', 'product', 'service'],\n product: ['inventory', 'stock', 'service'],\n sku: ['product', 'inventory', 'barcode'],\n barcode: ['sku', 'product', 'inventory']\n};\n\n/** Extracts words from text without punctuation. */\nconst words = (text: string): string[] =>\n [...new Set((text.toLowerCase().match(/[a-z0-9_][a-z0-9_.-]{1,}/g) ?? []).filter((w) => !STOP.has(w)))].sort();\n\n/** Expands terms using word stemming and explicit domain synonym clusters. */\nfunction expandQueryTerms(rawWords: string[]): string[] {\n const expanded = new Set<string>(rawWords);\n for (const w of rawWords) {\n const stem = normalizeStem(w);\n if (stem.length >= 2) expanded.add(stem);\n const syns = DOMAIN_SYNONYMS[w] ?? DOMAIN_SYNONYMS[stem];\n if (syns) {\n for (const s of syns) expanded.add(s);\n }\n }\n return [...expanded].sort();\n}\n\n/** Matches terms against text with token/boundary precision. */\nfunction matchesQuery(text: string, terms: string[]): string[] {\n const lower = text.toLowerCase();\n const matched: string[] = [];\n for (const term of terms) {\n if (term.includes('.') || term.includes('/')) {\n if (lower.includes(term)) matched.push(term);\n } else {\n const re = new RegExp(`(?:^|[\\\\s._/:-])${term}(?:$|[\\\\s._/:-])`, 'i');\n if (re.test(lower)) matched.push(term);\n }\n }\n return matched;\n}\n\nconst norm = (s: string): string => s.toLowerCase().replace(/\\s+/g, ' ').trim();\n\n/** Which context documents are worth pointing at for a task type. */\nconst DOCS_BY_TYPE: Partial<Record<TaskType, string[]>> = {\n ARCHITECTURE: ['architecture.md', 'integrations.md'],\n REFACTOR: ['architecture.md', 'conventions.md'],\n FEATURE: ['architecture.md', 'conventions.md'],\n BUG: ['testing.md'],\n TESTING: ['testing.md'],\n SECURITY: ['testing.md', 'architecture.md'],\n PERFORMANCE: ['architecture.md'],\n RELEASE: ['testing.md'],\n};\n\n/**\n * Task-aware context. Selection is deterministic (sorted inputs, no clocks, no randomness) and rule-based: the request is\n * classified, its keywords select facts/decisions/packages, and the type decides which broader groups come along.\n * Safety rules are included for every type; the per-package \"not run automatically\" list whenever checks are included.\n */\nasync function buildBaseTaskContext(o: ServiceOptions, request: string): Promise<TaskContextResult> {\n const ws = await requireWorkspace(o.cwd);\n const project = await loadProject(ws);\n const cls = classifyRequest(request);\n const type = cls.type;\n const kw = words(request);\n const expandedTerms = expandQueryTerms(kw);\n const included: ContextItem[] = [];\n const hit = (text: string): string[] => matchesQuery(text, expandedTerms);\n\n // Packages and the testing contract\n let allChecks: CommandEntry[] = [];\n if (await pathExists(ws.commands)) allChecks = (await readVersioned(ws.commands, 'commands', SCHEMA_VERSION, validateCommands)).data.checks;\n const pkgReason = new Map<string, string>();\n for (const d of packageDirs(allChecks)) {\n const m = matchesQuery(request, [d]);\n if (m.length > 0) pkgReason.set(d, `request names \"${m[0]}\"`);\n }\n\n // Enhanced package discovery from domain context when not explicitly named\n if (pkgReason.size === 0 && packageDirs(allChecks).length > 1) {\n const hasBackend = matchesQuery(request, ['api', 'endpoint', 'endpoints', 'controller', 'controllers', 'dto', 'dtos', 'database', 'migration', 'migrations', 'migrate', 'sql', 'postgres', 'drizzle', 'orm', 'fastify', 'server', 'jwt', 'argon2', 'service', 'services', 'invoice']).length > 0;\n const hasFrontend = matchesQuery(request, ['ui', 'component', 'components', 'frontend', 'page', 'pages', 'pagination', 'react', 'vite', 'view', 'views', 'button', 'modal']).length > 0;\n const available = packageDirs(allChecks);\n if (hasBackend && !hasFrontend && available.includes('backend')) {\n pkgReason.set('backend', 'inferred from backend domain terminology');\n } else if (hasFrontend && !hasBackend && available.includes('frontend')) {\n pkgReason.set('frontend', 'inferred from frontend UI terminology');\n } else if (hasBackend && hasFrontend) {\n if (available.includes('backend')) pkgReason.set('backend', 'request spans backend');\n if (available.includes('frontend')) pkgReason.set('frontend', 'request spans frontend');\n }\n }\n\n // dirtyFiles already leaves out documentation and tool-managed files, so a docs-only change selects no package.\n // Only worth the Git calls when the request did not already pick a package and there is more than one to choose from.\n const dirty = type !== 'QUESTION' && type !== 'DOCUMENTATION' && pkgReason.size === 0 && packageDirs(allChecks).length > 1 ? await dirtyFiles(ws.root) : null;\n for (const f of Object.keys(dirty?.files ?? {})) {\n const d = packageDirs(allChecks).find((x) => f === x || f.startsWith(`${x}/`));\n if (d && !pkgReason.has(d)) pkgReason.set(d, 'has uncommitted code changes');\n }\n\n // Facts\n const all = (await loadFacts(ws)).facts;\n const picked = new Map<string, string>();\n const isSinglePackage = pkgReason.size === 1;\n const targetPkg = isSinglePackage ? [...pkgReason.keys()][0] : null;\n\n for (const f of all) {\n // If request confidently targets a single package, avoid pulling in unrelated package facts\n if (targetPkg === 'backend') {\n if (f.source.startsWith('frontend/') || f.key === 'stack.ui' || f.key.startsWith('convention.frontend')) {\n continue;\n }\n } else if (targetPkg === 'frontend') {\n if (f.source.startsWith('backend/') || f.key === 'stack.database' || f.key === 'stack.orm' || f.key.startsWith('testing.db')) {\n continue;\n }\n }\n\n // Match terms against fact key and value; only match source path against specific non-structural request words\n const mText = hit(`${f.key} ${f.value}`);\n const mSource = matchesQuery(f.source, kw.filter((w) => !PATH_STRUCTURAL_TERMS.has(w)));\n const m = [...new Set([...mText, ...mSource])];\n const nonWeak = m.filter(w => !WEAK_TERMS.has(w));\n if (nonWeak.length > 0) picked.set(f.key, `matches \"${nonWeak.slice(0, 3).join('\", \"')}\"`);\n }\n\n const group = (re: RegExp, why: string, also?: (f: Fact) => boolean): void => {\n for (const f of all) {\n if (picked.has(f.key)) continue;\n if (targetPkg === 'backend' && (f.source.startsWith('frontend/') || f.key === 'stack.ui' || f.key.startsWith('convention.frontend'))) continue;\n if (targetPkg === 'frontend' && (f.source.startsWith('backend/') || f.key === 'stack.database' || f.key === 'stack.orm' || f.key.startsWith('testing.db'))) continue;\n if (re.test(f.key) || also?.(f)) picked.set(f.key, why);\n }\n };\n\n // Package layout facts: include in multi-package/cross-package/uncertain contexts, omit global entry points in single-package tasks\n if (type !== 'QUESTION' && type !== 'DOCUMENTATION') {\n if (!isSinglePackage || type === 'ARCHITECTURE') {\n group(/^repo\\.(?:packages|entry-points|monorepo)$/, `package layout (${type})`);\n }\n }\n\n if (type === 'BUG' || type === 'SECURITY') group(ISSUE_KEY, 'known issue / limitation', (f) => f.status === 'STALE' && f.sourceType !== 'detector');\n\n if (BROAD_TYPES.includes(type)) {\n group(/^stack\\.ecosystem$/, `stack and conventions (${type})`);\n if (targetPkg === 'backend' || !isSinglePackage) {\n group(/^(?:arch\\.modules|convention\\.service-layer)$/, `architecture conventions (${type})`);\n group(/^(?:stack\\.framework|stack\\.database|stack\\.orm)$/, `backend stack (${type})`);\n }\n if (targetPkg === 'frontend' || !isSinglePackage) {\n group(/^(?:convention\\.frontend-components|stack\\.ui)$/, `frontend stack (${type})`);\n }\n }\n\n if (type === 'SECURITY') group(/^$/, 'security / authorization rule', (f) => SECURITY_WORDS.test(`${f.key} ${f.value}`));\n if (type === 'DOCUMENTATION') group(/^repo\\.docs$/, 'documentation index');\n const selected = all.filter((f) => picked.has(f.key));\n\n // Compaction: a detector fact whose value equals another selected fact's is folded into it. Human-authored facts are never folded or clipped.\n const aliases: TaskContextResult['aliases'] = [];\n const owners = new Map<string, string>();\n for (const f of [...selected].sort((a, b) => Number(a.sourceType === 'detector') - Number(b.sourceType === 'detector') || a.key.localeCompare(b.key))) {\n if (!owners.has(norm(f.value))) owners.set(norm(f.value), f.key);\n }\n const facts: TaskContextResult['facts'] = [];\n for (const f of [...selected].sort((a, b) => a.key.localeCompare(b.key))) {\n const owner = owners.get(norm(f.value))!;\n if (owner !== f.key && f.sourceType === 'detector') {\n aliases.push({ key: f.key, sameAs: owner });\n continue;\n }\n const clip = f.sourceType === 'detector' && f.value.length > CLIP;\n facts.push(clip ? { ...f, value: f.value.slice(0, CLIP), clipped: f.value.length - CLIP } : f);\n included.push({ kind: 'fact', id: f.key, reason: picked.get(f.key)! });\n }\n\n const usable = allChecks.filter((c) => c.available);\n const scoped = pkgReason.size > 0 ? usable.filter((c) => !c.cwd || c.cwd === '.' || pkgReason.has(c.cwd)) : usable;\n const checks = type === 'QUESTION' || type === 'DOCUMENTATION' ? [] : scoped;\n for (const c of checks) included.push({ kind: 'check', id: `${c.cwd ?? '.'}:${c.id}`, reason: c.cwd && pkgReason.has(c.cwd) ? `package: ${pkgReason.get(c.cwd)}` : `testing contract (${type})` });\n\n // Commands that must not run unguarded stay visible whenever their package's checks are in play.\n const safety: ContextResult['safety'] = [];\n for (const c of checks) {\n const s = classifyCommand(c, await readManifestEvidence(ws.root, c));\n if (s.safety !== 'safe') safety.push({ package: c.cwd ?? '.', check: c.id, command: c.command, safety: s.safety, reasons: s.reasons });\n }\n SAFETY_RULES.forEach((_, i) => included.push({ kind: 'rule', id: `safety-${i + 1}`, reason: 'safety rule, included in every context' }));\n\n // Decisions: titles, context, decision, consequences, and file references\n const decs = (await listDecisions(ws)).decisions;\n const wantAll = type === 'ARCHITECTURE' || type === 'SECURITY';\n const decisions: TaskContextResult['decisions'] = [];\n for (const d of decs) {\n const fullText = `${d.title} ${d.decision} ${d.context} ${d.consequences} ${d.file}`;\n const m = matchesQuery(fullText, expandedTerms);\n const nonWeak = m.filter(w => !WEAK_TERMS.has(w));\n if (d.status === 'superseded' && nonWeak.length === 0) continue;\n if (nonWeak.length > 0 || wantAll) {\n decisions.push({ number: d.number, title: d.title, status: d.status, file: d.file });\n included.push({ kind: 'decision', id: String(d.number).padStart(4, '0'), reason: nonWeak.length > 0 ? `matches \"${nonWeak[0]}\"` : `${type} tasks review all decisions` });\n }\n }\n\n // Documents: referenced, never embedded\n const documents: TaskContextResult['documents'] = [];\n let docCount = 0;\n if (await pathExists(ws.contextDir)) {\n for (const name of (await fs.readdir(ws.contextDir)).filter((n) => n.endsWith('.md')).sort()) {\n docCount++;\n const byType = (DOCS_BY_TYPE[type] ?? []).includes(name);\n const m = matchesQuery(name, expandedTerms);\n if (byType || m.length > 0) {\n documents.push({ name, bytes: (await fs.stat(path.join(ws.contextDir, name))).size });\n included.push({ kind: 'document', id: name, reason: byType ? `reference for ${type}` : `request names \"${m[0]}\"` });\n }\n }\n }\n\n return {\n project: { name: project.name, id: project.projectId },\n request,\n type,\n confidence: cls.confidence,\n readOnly: cls.readOnly,\n facts,\n aliases,\n checks,\n safety,\n rules: SAFETY_RULES,\n decisions,\n documents,\n packages: [...pkgReason.keys()].sort(),\n included,\n counts: { facts: [facts.length, all.length], checks: [checks.length, usable.length], decisions: [decisions.length, decs.length], documents: [documents.length, docCount] },\n };\n}\n\nexport async function getTaskContext(\n o: ServiceOptions,\n opts: { request: string; role?: ContextRole },\n): Promise<TaskContextResult> {\n const base = await buildBaseTaskContext(o, opts.request);\n if (!opts.role) return base;\n return getAgentContextSlice(o, { request: opts.request, role: opts.role, base });\n}\n\nexport async function getAgentContextSlice(\n o: ServiceOptions,\n opts: { request: string; role: ContextRole; base?: TaskContextResult },\n): Promise<TaskContextResult> {\n const ws = await requireWorkspace(o.cwd);\n const base = opts.base ?? (await buildBaseTaskContext(o, opts.request));\n const role = opts.role;\n const kw = words(opts.request);\n const expandedTerms = expandQueryTerms(kw);\n const hit = (text: string): string[] => matchesQuery(text, expandedTerms);\n\n let slicedFacts = [...base.facts];\n let slicedChecks = [...base.checks];\n let slicedDecisions = [...base.decisions];\n let slicedDocuments = [...base.documents];\n let roleGuidance: string[] = [];\n const roleFindings: NonNullable<TaskContextResult['roleFindings']> = {};\n\n if (role === 'explorer') {\n // Explorer: Prioritize entry points, symbols, features, graph connections.\n // Avoid unrelated test commands, entire file contents, complete repo dumps.\n slicedChecks = [];\n slicedFacts = base.facts.filter((f) => {\n if (/^repo\\.(?:entry-points|packages|monorepo)$/.test(f.key)) return true;\n if (STACK_KEY.test(f.key) && !/^convention\\.test/i.test(f.key)) return true;\n const m = hit(`${f.key} ${f.value}`);\n return m.length > 0 && !/^convention\\.test/i.test(f.key);\n });\n\n slicedDecisions = base.decisions.slice(0, 3);\n slicedDocuments = base.documents.filter((d) => ['architecture.md', 'integrations.md'].includes(d.name));\n\n // Entry points from facts or packages\n const epFact = base.facts.find((f) => f.key === 'repo.entry-points');\n const entryPoints: string[] = [];\n if (epFact && epFact.value) {\n for (const p of epFact.value.split(',').map((x) => x.trim()).filter(Boolean)) {\n if (!entryPoints.includes(p)) entryPoints.push(p);\n }\n }\n if (entryPoints.length === 0 && base.packages.length > 0) {\n entryPoints.push(...base.packages);\n }\n if (entryPoints.length > 0) roleFindings.entryPoints = entryPoints.slice(0, 10);\n\n // Feature knowledge map references\n try {\n const featFile = await loadFeatures(ws);\n const matchedFeats = featFile.features.filter((f) => {\n const text = `${f.id} ${f.name} ${f.description ?? ''} ${(f.tags ?? []).join(' ')}`;\n return hit(text).length > 0;\n });\n if (matchedFeats.length > 0) {\n roleFindings.features = matchedFeats.slice(0, 8).map((f) => ({\n id: f.id,\n name: f.name,\n status: f.status,\n }));\n }\n } catch {\n // Graceful fallback if features file unreadable\n }\n\n // Graphify graph lookup\n try {\n const graph = await loadGraphData(ws.root);\n if (graph.exists && graph.data && graph.data.nodes) {\n const matchedNodes: NonNullable<TaskContextResult['roleFindings']>['graphNodes'] = [];\n for (const w of expandedTerms) {\n const n = findMatchingStartNode(graph.data.nodes, w);\n if (n && !matchedNodes.some((x) => x.id === n.id)) {\n matchedNodes.push({\n id: n.id,\n status: typeof n.status === 'string' ? n.status : 'symbol',\n path: n.path || n.file || null,\n symbol: typeof n.name === 'string' ? n.name : null,\n });\n }\n if (matchedNodes.length >= 6) break;\n }\n if (matchedNodes.length > 0) roleFindings.graphNodes = matchedNodes;\n }\n } catch {\n // Graceful fallback if graph lookup fails\n }\n\n roleGuidance = [\n 'Investigate referenced entry points and feature components before reading full files.',\n 'Trace deep call dependencies with \"devworkspace graph trace <symbol>\".',\n 'Conclude exploration with a concise handoff: identified files, uncertainty, and next step.',\n ];\n } else if (role === 'tester') {\n // Tester: Prioritize test files, test framework conventions, verification contracts, zero-test safeguards.\n slicedFacts = base.facts.filter((f) => {\n if (/^convention\\.test/i.test(f.key) || ISSUE_KEY.test(f.key)) return true;\n if (STACK_KEY.test(f.key) && /test/i.test(f.key + f.value)) return true;\n const m = hit(`${f.key} ${f.value}`.toLowerCase());\n return m.length > 0;\n });\n\n slicedChecks = base.checks;\n slicedDocuments = base.documents.filter((d) => d.name === 'testing.md');\n slicedDecisions = base.decisions.filter((d) => /test|verify|quality/i.test(d.title));\n\n roleFindings.zeroTestSafeguards = [\n 'Zero-test pass detection active across Vitest, Jest, Pytest, Mocha, Go, and Cargo.',\n 'Commands exiting code 0 with 0 tests executed are classified as unverified false passes.',\n 'Record baseline before modifications: devworkspace task tests <id> --phase baseline --passed <n> --failed <n>.',\n \"Execute verification via 'devworkspace task run <id> <check>'.\",\n ];\n\n roleGuidance = [\n 'Verify required contract commands for affected packages before claiming completion.',\n 'Write focused regression tests covering defect reproduction or feature acceptance criteria.',\n 'Never run destructive commands or test suites touching unmanaged databases without \"testenv declare\".',\n ];\n } else if (role === 'reviewer') {\n // Reviewer: Prioritize git diff/changed files, permanent safety rules, ADRs, potential regressions.\n slicedFacts = base.facts.filter((f) => {\n if (SECURITY_WORDS.test(`${f.key} ${f.value}`)) return true;\n if (/^convention\\./i.test(f.key)) return true;\n const m = hit(`${f.key} ${f.value}`.toLowerCase());\n return m.length > 0;\n });\n\n // Keep review-relevant checks (lint, typecheck, review, and test suites)\n if (base.checks.length > 0) {\n slicedChecks = base.checks.filter((c) => /lint|typecheck|review|test/i.test(c.id));\n } else {\n try {\n if (await pathExists(ws.commands)) {\n const contract = (await readVersioned(ws.commands, 'commands', SCHEMA_VERSION, validateCommands)).data.checks;\n const usable = contract.filter((c) => c.available && /lint|typecheck|review|test/i.test(c.id));\n slicedChecks = base.packages.length > 0\n ? usable.filter((c) => !c.cwd || c.cwd === '.' || base.packages.includes(c.cwd))\n : usable;\n }\n } catch {\n slicedChecks = [];\n }\n }\n slicedDecisions = base.decisions;\n slicedDocuments = base.documents.filter((d) => ['conventions.md', 'architecture.md'].includes(d.name));\n\n try {\n const dirty = await dirtyFiles(ws.root);\n const dirtyList = dirty ? Object.keys(dirty.files) : [];\n if (dirtyList.length > 0) {\n const preview = dirtyList.slice(0, 5).join(', ') + (dirtyList.length > 5 ? ` (+${dirtyList.length - 5} more)` : '');\n roleFindings.diffNotice = `${dirtyList.length} uncommitted file(s) detected: ${preview}. Inspect exact diff with \"git diff\".`;\n } else {\n roleFindings.diffNotice = 'No uncommitted changes detected in working tree. When reviewing a branch or PR, the caller must supply the target diff or commit range.';\n }\n } catch {\n roleFindings.diffNotice = 'Could not inspect git working tree status. The caller must supply the diff or commit range.';\n }\n\n roleGuidance = [\n 'Audit diff against permanent SAFETY_RULES (no secrets in code/logs, no path traversals, untrusted commands).',\n 'Verify changes strictly comply with recorded decisions (ADRs) and feature contracts.',\n 'Ensure required verification checks have executed results before approving the completion gate.',\n ];\n }\n\n const factKeys = new Set(slicedFacts.map((f) => f.key));\n const checkIds = new Set(slicedChecks.map((c) => `${c.cwd ?? '.'}:${c.id}`));\n const decIds = new Set(slicedDecisions.map((d) => String(d.number).padStart(4, '0')));\n const docNames = new Set(slicedDocuments.map((d) => d.name));\n\n const included: ContextItem[] = base.included.filter((item) => {\n if (item.kind === 'rule') return true;\n if (item.kind === 'fact') return factKeys.has(item.id);\n if (item.kind === 'check') return checkIds.has(item.id);\n if (item.kind === 'decision') return decIds.has(item.id);\n if (item.kind === 'document') return docNames.has(item.id);\n return false;\n });\n\n included.push({\n kind: 'rule',\n id: `role:${role}`,\n reason: `context tailored for ${role} role (Phase 1 role-based context slicing)`,\n });\n\n return {\n ...base,\n role,\n facts: slicedFacts,\n checks: slicedChecks,\n decisions: slicedDecisions,\n documents: slicedDocuments,\n rules: SAFETY_RULES,\n included,\n counts: {\n facts: [slicedFacts.length, base.counts.facts[1]],\n checks: [slicedChecks.length, base.counts.checks[1]],\n decisions: [slicedDecisions.length, base.counts.decisions[1]],\n documents: [slicedDocuments.length, base.counts.documents[1]],\n },\n roleGuidance,\n roleFindings,\n };\n}\n"]}
1
+ {"version":3,"file":"taskContext.js","sourceRoot":"","sources":["../../src/services/taskContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAgC,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,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;QACP,IAAI;QACJ,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,eAAe;QAC1B,SAAS,EAAE,eAAe;QAC1B,KAAK,EAAE,YAAY;QACnB,QAAQ;QACR,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACpD,SAAS,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC7D,SAAS,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SAC9D;QACD,YAAY;QACZ,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { SCHEMA_VERSION, validateCommands, type CommandEntry, type Fact } from '../config/schemas.js';\nimport { loadProject, requireWorkspace } from '../core/workspace.js';\nimport { readVersioned } from '../core/versioned.js';\nimport { listDecisions } from '../decisions/decision.js';\nimport { loadFacts } from '../knowledge/facts.js';\nimport { classifyRequest } from '../tasks/routing.js';\nimport type { TaskType } from '../tasks/task.js';\nimport { pathExists } from '../utils/fs.js';\nimport { classifyCommand, readManifestEvidence } from '../verification/safety.js';\nimport { dirtyFiles, packageDirs } from '../verification/scope.js';\nimport { SAFETY_RULES, type ContextResult } from './knowledge.js';\nimport type { ServiceOptions } from './common.js';\nimport { loadFeatures } from './features.js';\nimport { loadGraphData, findMatchingStartNode } from './graph.js';\n\nexport const CONTEXT_ROLES = ['explorer', 'tester', 'reviewer'] as const;\nexport type ContextRole = (typeof CONTEXT_ROLES)[number];\n\nexport function isContextRole(v: unknown): v is ContextRole {\n return typeof v === 'string' && (CONTEXT_ROLES as readonly string[]).includes(v);\n}\n\nexport interface ContextItem {\n kind: 'fact' | 'check' | 'decision' | 'document' | 'rule';\n id: string;\n /** Why this item is in the context; every item carries one. */\n reason: string;\n}\n\nexport interface TaskContextResult {\n project: { name: string; id: string };\n request: string;\n type: TaskType;\n confidence: 'high' | 'low';\n readOnly: boolean;\n /** `clipped` = characters left out of a long detector-derived value; the full value is in facts.json. */\n facts: (Fact & { clipped?: number })[];\n /** Detector facts folded into another fact with the identical value; nothing is deleted from facts.json. */\n aliases: { key: string; sameAs: string }[];\n checks: CommandEntry[];\n safety: ContextResult['safety'];\n rules: string[];\n decisions: { number: number; title: string; status: string; file: string }[];\n /** Detailed documents are referenced by name, never embedded. */\n documents: { name: string; bytes: number }[];\n packages: string[];\n included: ContextItem[];\n counts: { facts: [number, number]; checks: [number, number]; decisions: [number, number]; documents: [number, number] };\n role?: ContextRole;\n roleGuidance?: string[];\n roleFindings?: {\n entryPoints?: string[];\n graphNodes?: { id: string; status: string; path: string | null; symbol: string | null }[];\n features?: {\n id: string;\n name: string;\n status?: string;\n components?: { type: string; path: string; symbol?: string }[];\n }[];\n testFrameworks?: string[];\n zeroTestSafeguards?: string[];\n diffNotice?: string;\n };\n}\n\nconst STOP = new Set([\n 'the', 'and', 'for', 'with', 'that', 'this', 'from', 'into', 'does', 'how',\n 'what', 'where', 'why', 'when', 'which', 'fix', 'add', 'bug', 'make', 'new',\n 'can', 'are', 'not', 'our', 'all', 'use', 'get', 'set', 'let', 'may'\n]);\nconst WEAK_TERMS = new Set(['error', 'errors', 'check', 'checks', 'data', 'improve', 'update', 'run', 'test', 'handle', 'handling', 'code']);\nconst PATH_STRUCTURAL_TERMS = new Set([\n 'backend', 'frontend', 'service', 'services', 'controller', 'controllers',\n 'worker', 'workers', 'dto', 'dtos', 'src', 'modules', 'app', 'tests',\n 'unit', 'integration', 'test', 'spec', 'ts', 'tsx', 'js', 'jsx', 'json', 'md'\n]);\nconst CLIP = 400;\nconst SECURITY_WORDS = /auth|tenant|permission|rbac|security|isolation|role|session|ownership/i;\nconst ISSUE_KEY = /^(?:issue|limit|known|bug|risk)/i;\n/** Facts that describe the stack and layout; implementation-style tasks need them, a lookup question does not. */\nconst STACK_KEY = /^(?:stack\\.|repo\\.packages|repo\\.monorepo|repo\\.entry-points|convention|style|arch|pattern|testing)/i;\nconst BROAD_TYPES: TaskType[] = ['FEATURE', 'REFACTOR', 'ARCHITECTURE', 'TESTING', 'PERFORMANCE', 'MAINTENANCE', 'RELEASE'];\n\n/** Normalizes words by stripping standard English inflectional suffixes deterministically. */\nfunction normalizeStem(w: string): string {\n const s = w.toLowerCase().trim();\n if (s.endsWith('ies') && s.length > 4) return s.slice(0, -3) + 'y';\n if (s.endsWith('es') && s.length > 4 && /[sxz]|ch|sh$/.test(s.slice(0, -2))) return s.slice(0, -2);\n if (s.endsWith('s') && s.length > 3 && !s.endsWith('ss')) return s.slice(0, -1);\n if (s.endsWith('ing') && s.length > 5) return s.slice(0, -3);\n if (s.endsWith('tion') && s.length > 6) return s.slice(0, -4);\n if (s.endsWith('ed') && s.length > 4) return s.slice(0, -2);\n return s;\n}\n\n/** Explicit domain synonym dictionary grounded in engineering tasks and repository knowledge. */\nconst DOMAIN_SYNONYMS: Record<string, string[]> = {\n // Database, migrations, schema and persistence\n table: ['database', 'schema', 'orm', 'migration', 'sql'],\n column: ['database', 'schema', 'migration', 'sql'],\n schema: ['database', 'orm', 'migration', 'sql', 'drizzle', 'postgres'],\n migration: ['database', 'schema', 'migrate', 'sql', 'drizzle'],\n migrate: ['database', 'schema', 'migration', 'sql'],\n sql: ['database', 'postgres', 'drizzle', 'query'],\n db: ['database', 'postgres', 'drizzle', 'orm'],\n database: ['db', 'schema', 'orm', 'postgres', 'drizzle'],\n drizzle: ['database', 'orm', 'schema'],\n postgres: ['database', 'sql'],\n\n // Authentication, tenancy, and authorization\n auth: ['jwt', 'session', 'security', 'tenant', 'permission'],\n jwt: ['auth', 'session', 'token', 'security'],\n password: ['hash', 'argon2', 'auth', 'security'],\n hash: ['password', 'argon2', 'security'],\n tenant: ['tenancy', 'isolation', 'security', 'auth'],\n tenancy: ['tenant', 'isolation', 'security'],\n isolation: ['tenant', 'tenancy', 'security'],\n\n // Billing and financial\n invoice: ['billing', 'cents', 'precision'],\n billing: ['invoice', 'cents', 'precision'],\n cents: ['billing', 'invoice', 'precision'],\n payment: ['stripe', 'gateway'],\n\n // API, HTTP, and Backend Services\n endpoint: ['api', 'controller', 'service', 'dto'],\n api: ['endpoint', 'controller', 'service', 'dto'],\n supplier: ['supplier', 'dto', 'service'],\n controller: ['service', 'dto', 'api', 'endpoint'],\n dto: ['validation', 'typebox', 'schema', 'controller'],\n\n // Frontend and UI\n component: ['ui', 'frontend', 'page', 'react'],\n pagination: ['ui', 'component', 'frontend', 'table'],\n frontend: ['ui', 'component', 'react'],\n ui: ['component', 'frontend', 'react'],\n react: ['ui', 'component', 'frontend'],\n\n // Inventory and Stock\n stock: ['inventory', 'product', 'service'],\n inventory: ['stock', 'product', 'service'],\n product: ['inventory', 'stock', 'service'],\n sku: ['product', 'inventory', 'barcode'],\n barcode: ['sku', 'product', 'inventory']\n};\n\n/** Extracts words from text without punctuation. */\nexport const words = (text: string): string[] =>\n [...new Set((text.toLowerCase().match(/[a-z0-9_][a-z0-9_.-]{1,}/g) ?? []).filter((w) => !STOP.has(w)))].sort();\n\n/** Expands terms using word stemming and explicit domain synonym clusters. */\nexport function expandQueryTerms(rawWords: string[]): string[] {\n const expanded = new Set<string>(rawWords);\n for (const w of rawWords) {\n const stem = normalizeStem(w);\n if (stem.length >= 2) expanded.add(stem);\n const syns = DOMAIN_SYNONYMS[w] ?? DOMAIN_SYNONYMS[stem];\n if (syns) {\n for (const s of syns) expanded.add(s);\n }\n }\n return [...expanded].sort();\n}\n\n/** Matches terms against text with token/boundary precision. */\nexport function matchesQuery(text: string, terms: string[]): string[] {\n const lower = text.toLowerCase();\n const matched: string[] = [];\n for (const term of terms) {\n if (term.includes('.') || term.includes('/')) {\n if (lower.includes(term)) matched.push(term);\n } else {\n const re = new RegExp(`(?:^|[\\\\s._/:-])${term}(?:$|[\\\\s._/:-])`, 'i');\n if (re.test(lower)) matched.push(term);\n }\n }\n return matched;\n}\n\nconst norm = (s: string): string => s.toLowerCase().replace(/\\s+/g, ' ').trim();\n\n/** Which context documents are worth pointing at for a task type. */\nconst DOCS_BY_TYPE: Partial<Record<TaskType, string[]>> = {\n ARCHITECTURE: ['architecture.md', 'integrations.md'],\n REFACTOR: ['architecture.md', 'conventions.md'],\n FEATURE: ['architecture.md', 'conventions.md'],\n BUG: ['testing.md'],\n TESTING: ['testing.md'],\n SECURITY: ['testing.md', 'architecture.md'],\n PERFORMANCE: ['architecture.md'],\n RELEASE: ['testing.md'],\n};\n\n/**\n * Task-aware context. Selection is deterministic (sorted inputs, no clocks, no randomness) and rule-based: the request is\n * classified, its keywords select facts/decisions/packages, and the type decides which broader groups come along.\n * Safety rules are included for every type; the per-package \"not run automatically\" list whenever checks are included.\n */\nexport async function buildBaseTaskContext(o: ServiceOptions, request: string): Promise<TaskContextResult> {\n const ws = await requireWorkspace(o.cwd);\n const project = await loadProject(ws);\n const cls = classifyRequest(request);\n const type = cls.type;\n const kw = words(request);\n const expandedTerms = expandQueryTerms(kw);\n const included: ContextItem[] = [];\n const hit = (text: string): string[] => matchesQuery(text, expandedTerms);\n\n // Packages and the testing contract\n let allChecks: CommandEntry[] = [];\n if (await pathExists(ws.commands)) allChecks = (await readVersioned(ws.commands, 'commands', SCHEMA_VERSION, validateCommands)).data.checks;\n const pkgReason = new Map<string, string>();\n for (const d of packageDirs(allChecks)) {\n const m = matchesQuery(request, [d]);\n if (m.length > 0) pkgReason.set(d, `request names \"${m[0]}\"`);\n }\n\n // Enhanced package discovery from domain context when not explicitly named\n if (pkgReason.size === 0 && packageDirs(allChecks).length > 1) {\n const hasBackend = matchesQuery(request, ['api', 'endpoint', 'endpoints', 'controller', 'controllers', 'dto', 'dtos', 'database', 'migration', 'migrations', 'migrate', 'sql', 'postgres', 'drizzle', 'orm', 'fastify', 'server', 'jwt', 'argon2', 'service', 'services', 'invoice']).length > 0;\n const hasFrontend = matchesQuery(request, ['ui', 'component', 'components', 'frontend', 'page', 'pages', 'pagination', 'react', 'vite', 'view', 'views', 'button', 'modal']).length > 0;\n const available = packageDirs(allChecks);\n if (hasBackend && !hasFrontend && available.includes('backend')) {\n pkgReason.set('backend', 'inferred from backend domain terminology');\n } else if (hasFrontend && !hasBackend && available.includes('frontend')) {\n pkgReason.set('frontend', 'inferred from frontend UI terminology');\n } else if (hasBackend && hasFrontend) {\n if (available.includes('backend')) pkgReason.set('backend', 'request spans backend');\n if (available.includes('frontend')) pkgReason.set('frontend', 'request spans frontend');\n }\n }\n\n // dirtyFiles already leaves out documentation and tool-managed files, so a docs-only change selects no package.\n // Only worth the Git calls when the request did not already pick a package and there is more than one to choose from.\n const dirty = type !== 'QUESTION' && type !== 'DOCUMENTATION' && pkgReason.size === 0 && packageDirs(allChecks).length > 1 ? await dirtyFiles(ws.root) : null;\n for (const f of Object.keys(dirty?.files ?? {})) {\n const d = packageDirs(allChecks).find((x) => f === x || f.startsWith(`${x}/`));\n if (d && !pkgReason.has(d)) pkgReason.set(d, 'has uncommitted code changes');\n }\n\n // Facts\n const all = (await loadFacts(ws)).facts;\n const picked = new Map<string, string>();\n const isSinglePackage = pkgReason.size === 1;\n const targetPkg = isSinglePackage ? [...pkgReason.keys()][0] : null;\n\n for (const f of all) {\n // If request confidently targets a single package, avoid pulling in unrelated package facts\n if (targetPkg === 'backend') {\n if (f.source.startsWith('frontend/') || f.key === 'stack.ui' || f.key.startsWith('convention.frontend')) {\n continue;\n }\n } else if (targetPkg === 'frontend') {\n if (f.source.startsWith('backend/') || f.key === 'stack.database' || f.key === 'stack.orm' || f.key.startsWith('testing.db')) {\n continue;\n }\n }\n\n // Match terms against fact key and value; only match source path against specific non-structural request words\n const mText = hit(`${f.key} ${f.value}`);\n const mSource = matchesQuery(f.source, kw.filter((w) => !PATH_STRUCTURAL_TERMS.has(w)));\n const m = [...new Set([...mText, ...mSource])];\n const nonWeak = m.filter(w => !WEAK_TERMS.has(w));\n if (nonWeak.length > 0) picked.set(f.key, `matches \"${nonWeak.slice(0, 3).join('\", \"')}\"`);\n }\n\n const group = (re: RegExp, why: string, also?: (f: Fact) => boolean): void => {\n for (const f of all) {\n if (picked.has(f.key)) continue;\n if (targetPkg === 'backend' && (f.source.startsWith('frontend/') || f.key === 'stack.ui' || f.key.startsWith('convention.frontend'))) continue;\n if (targetPkg === 'frontend' && (f.source.startsWith('backend/') || f.key === 'stack.database' || f.key === 'stack.orm' || f.key.startsWith('testing.db'))) continue;\n if (re.test(f.key) || also?.(f)) picked.set(f.key, why);\n }\n };\n\n // Package layout facts: include in multi-package/cross-package/uncertain contexts, omit global entry points in single-package tasks\n if (type !== 'QUESTION' && type !== 'DOCUMENTATION') {\n if (!isSinglePackage || type === 'ARCHITECTURE') {\n group(/^repo\\.(?:packages|entry-points|monorepo)$/, `package layout (${type})`);\n }\n }\n\n if (type === 'BUG' || type === 'SECURITY') group(ISSUE_KEY, 'known issue / limitation', (f) => f.status === 'STALE' && f.sourceType !== 'detector');\n\n if (BROAD_TYPES.includes(type)) {\n group(/^stack\\.ecosystem$/, `stack and conventions (${type})`);\n if (targetPkg === 'backend' || !isSinglePackage) {\n group(/^(?:arch\\.modules|convention\\.service-layer)$/, `architecture conventions (${type})`);\n group(/^(?:stack\\.framework|stack\\.database|stack\\.orm)$/, `backend stack (${type})`);\n }\n if (targetPkg === 'frontend' || !isSinglePackage) {\n group(/^(?:convention\\.frontend-components|stack\\.ui)$/, `frontend stack (${type})`);\n }\n }\n\n if (type === 'SECURITY') group(/^$/, 'security / authorization rule', (f) => SECURITY_WORDS.test(`${f.key} ${f.value}`));\n if (type === 'DOCUMENTATION') group(/^repo\\.docs$/, 'documentation index');\n const selected = all.filter((f) => picked.has(f.key));\n\n // Compaction: a detector fact whose value equals another selected fact's is folded into it. Human-authored facts are never folded or clipped.\n const aliases: TaskContextResult['aliases'] = [];\n const owners = new Map<string, string>();\n for (const f of [...selected].sort((a, b) => Number(a.sourceType === 'detector') - Number(b.sourceType === 'detector') || a.key.localeCompare(b.key))) {\n if (!owners.has(norm(f.value))) owners.set(norm(f.value), f.key);\n }\n const facts: TaskContextResult['facts'] = [];\n for (const f of [...selected].sort((a, b) => a.key.localeCompare(b.key))) {\n const owner = owners.get(norm(f.value))!;\n if (owner !== f.key && f.sourceType === 'detector') {\n aliases.push({ key: f.key, sameAs: owner });\n continue;\n }\n const clip = f.sourceType === 'detector' && f.value.length > CLIP;\n facts.push(clip ? { ...f, value: f.value.slice(0, CLIP), clipped: f.value.length - CLIP } : f);\n included.push({ kind: 'fact', id: f.key, reason: picked.get(f.key)! });\n }\n\n const usable = allChecks.filter((c) => c.available);\n const scoped = pkgReason.size > 0 ? usable.filter((c) => !c.cwd || c.cwd === '.' || pkgReason.has(c.cwd)) : usable;\n const checks = type === 'QUESTION' || type === 'DOCUMENTATION' ? [] : scoped;\n for (const c of checks) included.push({ kind: 'check', id: `${c.cwd ?? '.'}:${c.id}`, reason: c.cwd && pkgReason.has(c.cwd) ? `package: ${pkgReason.get(c.cwd)}` : `testing contract (${type})` });\n\n // Commands that must not run unguarded stay visible whenever their package's checks are in play.\n const safety: ContextResult['safety'] = [];\n for (const c of checks) {\n const s = classifyCommand(c, await readManifestEvidence(ws.root, c));\n if (s.safety !== 'safe') safety.push({ package: c.cwd ?? '.', check: c.id, command: c.command, safety: s.safety, reasons: s.reasons });\n }\n SAFETY_RULES.forEach((_, i) => included.push({ kind: 'rule', id: `safety-${i + 1}`, reason: 'safety rule, included in every context' }));\n\n // Decisions: titles, context, decision, consequences, and file references\n const decs = (await listDecisions(ws)).decisions;\n const wantAll = type === 'ARCHITECTURE' || type === 'SECURITY';\n const decisions: TaskContextResult['decisions'] = [];\n for (const d of decs) {\n const fullText = `${d.title} ${d.decision} ${d.context} ${d.consequences} ${d.file}`;\n const m = matchesQuery(fullText, expandedTerms);\n const nonWeak = m.filter(w => !WEAK_TERMS.has(w));\n if (d.status === 'superseded' && nonWeak.length === 0) continue;\n if (nonWeak.length > 0 || wantAll) {\n decisions.push({ number: d.number, title: d.title, status: d.status, file: d.file });\n included.push({ kind: 'decision', id: String(d.number).padStart(4, '0'), reason: nonWeak.length > 0 ? `matches \"${nonWeak[0]}\"` : `${type} tasks review all decisions` });\n }\n }\n\n // Documents: referenced, never embedded\n const documents: TaskContextResult['documents'] = [];\n let docCount = 0;\n if (await pathExists(ws.contextDir)) {\n for (const name of (await fs.readdir(ws.contextDir)).filter((n) => n.endsWith('.md')).sort()) {\n docCount++;\n const byType = (DOCS_BY_TYPE[type] ?? []).includes(name);\n const m = matchesQuery(name, expandedTerms);\n if (byType || m.length > 0) {\n documents.push({ name, bytes: (await fs.stat(path.join(ws.contextDir, name))).size });\n included.push({ kind: 'document', id: name, reason: byType ? `reference for ${type}` : `request names \"${m[0]}\"` });\n }\n }\n }\n\n return {\n project: { name: project.name, id: project.projectId },\n request,\n type,\n confidence: cls.confidence,\n readOnly: cls.readOnly,\n facts,\n aliases,\n checks,\n safety,\n rules: SAFETY_RULES,\n decisions,\n documents,\n packages: [...pkgReason.keys()].sort(),\n included,\n counts: { facts: [facts.length, all.length], checks: [checks.length, usable.length], decisions: [decisions.length, decs.length], documents: [documents.length, docCount] },\n };\n}\n\nexport async function getTaskContext(\n o: ServiceOptions,\n opts: { request: string; role?: ContextRole },\n): Promise<TaskContextResult> {\n const base = await buildBaseTaskContext(o, opts.request);\n if (!opts.role) return base;\n return getAgentContextSlice(o, { request: opts.request, role: opts.role, base });\n}\n\nexport async function getAgentContextSlice(\n o: ServiceOptions,\n opts: { request: string; role: ContextRole; base?: TaskContextResult },\n): Promise<TaskContextResult> {\n const ws = await requireWorkspace(o.cwd);\n const base = opts.base ?? (await buildBaseTaskContext(o, opts.request));\n const role = opts.role;\n const kw = words(opts.request);\n const expandedTerms = expandQueryTerms(kw);\n const hit = (text: string): string[] => matchesQuery(text, expandedTerms);\n\n let slicedFacts = [...base.facts];\n let slicedChecks = [...base.checks];\n let slicedDecisions = [...base.decisions];\n let slicedDocuments = [...base.documents];\n let roleGuidance: string[] = [];\n const roleFindings: NonNullable<TaskContextResult['roleFindings']> = {};\n\n if (role === 'explorer') {\n // Explorer: Prioritize entry points, symbols, features, graph connections.\n // Avoid unrelated test commands, entire file contents, complete repo dumps.\n slicedChecks = [];\n slicedFacts = base.facts.filter((f) => {\n if (/^repo\\.(?:entry-points|packages|monorepo)$/.test(f.key)) return true;\n if (STACK_KEY.test(f.key) && !/^convention\\.test/i.test(f.key)) return true;\n const m = hit(`${f.key} ${f.value}`);\n return m.length > 0 && !/^convention\\.test/i.test(f.key);\n });\n\n slicedDecisions = base.decisions.slice(0, 3);\n slicedDocuments = base.documents.filter((d) => ['architecture.md', 'integrations.md'].includes(d.name));\n\n // Entry points from facts or packages\n const epFact = base.facts.find((f) => f.key === 'repo.entry-points');\n const entryPoints: string[] = [];\n if (epFact && epFact.value) {\n for (const p of epFact.value.split(',').map((x) => x.trim()).filter(Boolean)) {\n if (!entryPoints.includes(p)) entryPoints.push(p);\n }\n }\n if (entryPoints.length === 0 && base.packages.length > 0) {\n entryPoints.push(...base.packages);\n }\n if (entryPoints.length > 0) roleFindings.entryPoints = entryPoints.slice(0, 10);\n\n // Feature knowledge map references\n try {\n const featFile = await loadFeatures(ws);\n const matchedFeats = featFile.features.filter((f) => {\n const text = `${f.id} ${f.name} ${f.description ?? ''} ${(f.tags ?? []).join(' ')}`;\n return hit(text).length > 0;\n });\n if (matchedFeats.length > 0) {\n roleFindings.features = matchedFeats.slice(0, 8).map((f) => ({\n id: f.id,\n name: f.name,\n status: f.status,\n }));\n }\n } catch {\n // Graceful fallback if features file unreadable\n }\n\n // Graphify graph lookup\n try {\n const graph = await loadGraphData(ws.root);\n if (graph.exists && graph.data && graph.data.nodes) {\n const matchedNodes: NonNullable<TaskContextResult['roleFindings']>['graphNodes'] = [];\n for (const w of expandedTerms) {\n const n = findMatchingStartNode(graph.data.nodes, w);\n if (n && !matchedNodes.some((x) => x.id === n.id)) {\n matchedNodes.push({\n id: n.id,\n status: typeof n.status === 'string' ? n.status : 'symbol',\n path: n.path || n.file || null,\n symbol: typeof n.name === 'string' ? n.name : null,\n });\n }\n if (matchedNodes.length >= 6) break;\n }\n if (matchedNodes.length > 0) roleFindings.graphNodes = matchedNodes;\n }\n } catch {\n // Graceful fallback if graph lookup fails\n }\n\n roleGuidance = [\n 'Investigate referenced entry points and feature components before reading full files.',\n 'Trace deep call dependencies with \"devworkspace graph trace <symbol>\".',\n 'Conclude exploration with a concise handoff: identified files, uncertainty, and next step.',\n ];\n } else if (role === 'tester') {\n // Tester: Prioritize test files, test framework conventions, verification contracts, zero-test safeguards.\n slicedFacts = base.facts.filter((f) => {\n if (/^convention\\.test/i.test(f.key) || ISSUE_KEY.test(f.key)) return true;\n if (STACK_KEY.test(f.key) && /test/i.test(f.key + f.value)) return true;\n const m = hit(`${f.key} ${f.value}`.toLowerCase());\n return m.length > 0;\n });\n\n slicedChecks = base.checks;\n slicedDocuments = base.documents.filter((d) => d.name === 'testing.md');\n slicedDecisions = base.decisions.filter((d) => /test|verify|quality/i.test(d.title));\n\n roleFindings.zeroTestSafeguards = [\n 'Zero-test pass detection active across Vitest, Jest, Pytest, Mocha, Go, and Cargo.',\n 'Commands exiting code 0 with 0 tests executed are classified as unverified false passes.',\n 'Record baseline before modifications: devworkspace task tests <id> --phase baseline --passed <n> --failed <n>.',\n \"Execute verification via 'devworkspace task run <id> <check>'.\",\n ];\n\n roleGuidance = [\n 'Verify required contract commands for affected packages before claiming completion.',\n 'Write focused regression tests covering defect reproduction or feature acceptance criteria.',\n 'Never run destructive commands or test suites touching unmanaged databases without \"testenv declare\".',\n ];\n } else if (role === 'reviewer') {\n // Reviewer: Prioritize git diff/changed files, permanent safety rules, ADRs, potential regressions.\n slicedFacts = base.facts.filter((f) => {\n if (SECURITY_WORDS.test(`${f.key} ${f.value}`)) return true;\n if (/^convention\\./i.test(f.key)) return true;\n const m = hit(`${f.key} ${f.value}`.toLowerCase());\n return m.length > 0;\n });\n\n // Keep review-relevant checks (lint, typecheck, review, and test suites)\n if (base.checks.length > 0) {\n slicedChecks = base.checks.filter((c) => /lint|typecheck|review|test/i.test(c.id));\n } else {\n try {\n if (await pathExists(ws.commands)) {\n const contract = (await readVersioned(ws.commands, 'commands', SCHEMA_VERSION, validateCommands)).data.checks;\n const usable = contract.filter((c) => c.available && /lint|typecheck|review|test/i.test(c.id));\n slicedChecks = base.packages.length > 0\n ? usable.filter((c) => !c.cwd || c.cwd === '.' || base.packages.includes(c.cwd))\n : usable;\n }\n } catch {\n slicedChecks = [];\n }\n }\n slicedDecisions = base.decisions;\n slicedDocuments = base.documents.filter((d) => ['conventions.md', 'architecture.md'].includes(d.name));\n\n try {\n const dirty = await dirtyFiles(ws.root);\n const dirtyList = dirty ? Object.keys(dirty.files) : [];\n if (dirtyList.length > 0) {\n const preview = dirtyList.slice(0, 5).join(', ') + (dirtyList.length > 5 ? ` (+${dirtyList.length - 5} more)` : '');\n roleFindings.diffNotice = `${dirtyList.length} uncommitted file(s) detected: ${preview}. Inspect exact diff with \"git diff\".`;\n } else {\n roleFindings.diffNotice = 'No uncommitted changes detected in working tree. When reviewing a branch or PR, the caller must supply the target diff or commit range.';\n }\n } catch {\n roleFindings.diffNotice = 'Could not inspect git working tree status. The caller must supply the diff or commit range.';\n }\n\n roleGuidance = [\n 'Audit diff against permanent SAFETY_RULES (no secrets in code/logs, no path traversals, untrusted commands).',\n 'Verify changes strictly comply with recorded decisions (ADRs) and feature contracts.',\n 'Ensure required verification checks have executed results before approving the completion gate.',\n ];\n }\n\n const factKeys = new Set(slicedFacts.map((f) => f.key));\n const checkIds = new Set(slicedChecks.map((c) => `${c.cwd ?? '.'}:${c.id}`));\n const decIds = new Set(slicedDecisions.map((d) => String(d.number).padStart(4, '0')));\n const docNames = new Set(slicedDocuments.map((d) => d.name));\n\n const included: ContextItem[] = base.included.filter((item) => {\n if (item.kind === 'rule') return true;\n if (item.kind === 'fact') return factKeys.has(item.id);\n if (item.kind === 'check') return checkIds.has(item.id);\n if (item.kind === 'decision') return decIds.has(item.id);\n if (item.kind === 'document') return docNames.has(item.id);\n return false;\n });\n\n included.push({\n kind: 'rule',\n id: `role:${role}`,\n reason: `context tailored for ${role} role (Phase 1 role-based context slicing)`,\n });\n\n return {\n ...base,\n role,\n facts: slicedFacts,\n checks: slicedChecks,\n decisions: slicedDecisions,\n documents: slicedDocuments,\n rules: SAFETY_RULES,\n included,\n counts: {\n facts: [slicedFacts.length, base.counts.facts[1]],\n checks: [slicedChecks.length, base.counts.checks[1]],\n decisions: [slicedDecisions.length, base.counts.decisions[1]],\n documents: [slicedDocuments.length, base.counts.documents[1]],\n },\n roleGuidance,\n roleFindings,\n };\n}\n"]}
package/docs/mcp.md CHANGED
@@ -11,6 +11,8 @@ The DevWorkspace MCP integration exposes DevWorkspace's deterministic context re
11
11
  - High-level project architecture and stack detection (`get_project_overview`)
12
12
  - Natural-language task context with role slicing (`get_task_context` for `explorer`, `tester`, `reviewer`)
13
13
  - Workspace-relative file context bounded to 32KB (`get_file_context`)
14
+ - Server readiness, context freshness, and agent configuration diagnostics (`check_mcp_health`)
15
+ - Retrieval evidence, domain synonyms, and selection explanations (`explain_context`)
14
16
 
15
17
  The developer does not need to manually copy and paste context into conversation prompts.
16
18
 
@@ -164,12 +166,95 @@ printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion
164
166
 
165
167
  ---
166
168
 
167
- ## 8. What the Agent Can and Cannot Access
169
+ ## 8. Available MCP Tools Specification
170
+
171
+ DevWorkspace advertises 6 tools over the standard MCP protocol:
172
+
173
+ ### 1. `get_project_overview`
174
+ - **Description:** Retrieve the architectural summary, detected stack, health status, context freshness, and context capabilities of the current DevWorkspace project.
175
+ - **Input Schema:**
176
+ - `refresh` (optional boolean): Re-evaluate context staleness against the filesystem.
177
+ - **Returns:**
178
+ - Workspace health, project ID, and Git branch status.
179
+ - Detected stack (languages, frameworks, monorepo packages).
180
+ - Context capabilities (supported role slices, configured verification checks).
181
+ - Context freshness state (`Current`, `Stale`, `Empty`) with stale item details.
182
+
183
+ ### 2. `get_task_context`
184
+ - **Description:** Retrieve deterministic, role-aware project context (facts, rules, checks, decisions, documents) for a natural-language task.
185
+ - **Input Schema:**
186
+ - `task` (required string): Natural-language description of the task (e.g. `"fix rounding error in invoice calculation"`).
187
+ - `role` (optional enum: `"explorer"`, `"tester"`, `"reviewer"`):
188
+ - `explorer`: Prioritizes entry points, feature components, and graph nodes while omitting execution checks.
189
+ - `tester`: Prioritizes verification checks, test framework conventions, and zero-test safeguards.
190
+ - `reviewer`: Prioritizes git diff notices, security rules, and architectural decision records (ADRs).
191
+ - `max_context_chars` (optional number, 500-64000, default 16000): Upper bound on context length in characters.
192
+ - **Context Intelligence Enhancements:**
193
+ - **Fact Ranking, Source Paths & Verification Status:** Facts are ranked by task relevance and authority (`USER_DECISION` > `VERIFIED` / `DETECTED` > `INFERRED`), displaying verification status, normalized source attribution, and staleness warnings: `- **key** [VERIFIED] (source: path): value`.
194
+ - **Ranked Relevant Files to Inspect:** Automatically synthesizes high-signal file recommendations derived from matching facts, feature components (routes, services, models, tests), graph nodes, and ADR files.
195
+ - **Feature Components:** Lists concrete repository paths mapped to the feature.
196
+ - **Missing Information Transparency:** When facts or ADRs for an area are unrecorded, DevWorkspace explicitly explains what is missing rather than omitting sections or hallucinating.
197
+
198
+ ### 3. `get_file_context`
199
+ - **Description:** Retrieve bounded file contents (full file or specific line ranges) and associated knowledge facts, mapped feature tests, and governing ADRs for a workspace-relative file path.
200
+ - **Input Schema:**
201
+ - `path` (required string): Workspace-relative path to inspect (e.g. `"src/index.ts"`).
202
+ - `start_line` (optional integer): 1-indexed starting line number (inclusive) for bounded line retrieval.
203
+ - `end_line` (optional integer): 1-indexed ending line number (inclusive) for bounded line retrieval (maximum window: 1000 lines).
204
+ - **Protection Rules:**
205
+ - Rejects absolute paths (`/etc/passwd`, `C:\...`).
206
+ - Rejects directory traversal escaping workspace root (`../../`).
207
+ - Rejects credential files (`.env`, private keys, secrets).
208
+ - Enforces workspace ignore policies (`.devworkspaceignore`, `.gitignore`, and excluded build/vendor directories).
209
+ - Bounds full file text to 32KB; returns line-numbered code when line ranges are specified.
210
+ - Automatically correlates and appends associated features, mapped test suites, governing ADRs, and knowledge facts referencing this file.
211
+
212
+ ### 4. `check_mcp_health`
213
+ - **Description:** Diagnose DevWorkspace MCP server readiness, workspace detection, knowledge freshness, verification contract, and agent configuration integrity.
214
+ - **Input Schema:**
215
+ - `check_integrations` (optional boolean): Inspect external integrations.
216
+ - **Returns:**
217
+ - Server protocol readiness (`MCP 2024-11-05`, Node version, devworkspace version).
218
+ - Workspace detection and health state.
219
+ - Knowledge base freshness: total facts, fresh vs. stale count, list of stale items.
220
+ - Verification contract: configured checks and required commands.
221
+ - Agent configuration status: checks `.mcp.json`, `CLAUDE.md`, `mcp.json`, `AGENTS.md`, `.antigravity/mcp.json`, and `.antigravity/rules`, verifying configuration presence and balanced `<!-- devworkspace-mcp:start -->` instruction markers.
222
+ - Actionable remediations: numbered, copy-pasteable commands to fix any detected issues.
223
+
224
+ ### 5. `explain_context`
225
+ - **Description:** Explain the deterministic retrieval logic, matched query evidence, domain synonyms, role slicing, and selection reasons behind task-context retrieval.
226
+ - **Input Schema:**
227
+ - `task` (required string): Natural-language description of the task to explain.
228
+ - `role` (optional enum: `"explorer"`, `"tester"`, `"reviewer"`).
229
+ - **Returns:**
230
+ - Request classification (task type, confidence, read-only status).
231
+ - Query analysis: extracted keywords, expanded stems, and matched domain synonym clusters.
232
+ - Identified package scope (e.g. backend vs frontend isolation).
233
+ - Selected context evidence: explicit inclusion reason for every fact, check, ADR, and document.
234
+ - Omissions and slicing rationale: why checks or documents were omitted for the active role slice, and folded detector aliases.
235
+ - Retrieval counts and efficiency percentage.
236
+
237
+ ### 6. `trace_symbol_dependencies`
238
+ - **Description:** Trace symbol call hierarchies, imports, definitions, and relationships in the codebase using the project knowledge graph.
239
+ - **Input Schema:**
240
+ - `symbol` (required string): Symbol name, file path, or node identifier to trace (e.g. `"InvoiceService"`, `"calculateTax"`, `"src/services/invoice.ts"`).
241
+ - `depth` (optional integer): Traversal depth between 1 and 5 (default 2).
242
+ - **Returns:**
243
+ - Root matched node with verification status against the filesystem (`[VERIFIED]` or `[HYPOTHESIS]`).
244
+ - Connected dependency nodes bounded to 50 nodes max, sorted deterministically by depth.
245
+ - Directed relationship edges (e.g. `src/app.ts --[imports]--> src/routes/auth.ts`).
246
+ - Actionable guidance when the graph is missing or when the symbol is not found.
247
+
248
+ ---
249
+
250
+ ## 9. What the Agent Can and Cannot Access
168
251
 
169
252
  ### What the agent CAN access:
170
253
  - **Project architecture summary:** Detected languages, web/UI frameworks, package structure, and health state.
171
254
  - **Task context:** Facts, verification commands (`commands.json`), architectural decision records (`.devworkspace/decisions/`), and safety rules.
172
- - **Specific source files:** Regular files within the project root, bounded to 32KB per call.
255
+ - **Specific source files & line ranges:** Regular files within the project root, bounded to 32KB per call, or specific line-numbered ranges.
256
+ - **Dependency traces:** Call hierarchies, definitions, imports, and symbol relationships from the verified repository knowledge graph.
257
+ - **Health and diagnostics:** Stored knowledge freshness, verification contract status, and agent configuration integrity.
173
258
 
174
259
  ### What the agent CANNOT access:
175
260
  - **No arbitrary shell execution:** The MCP server contains zero execution tools. It cannot run commands, scripts, or package managers.
@@ -179,7 +264,7 @@ printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion
179
264
 
180
265
  ---
181
266
 
182
- ## 9. Secret Exclusions and Workspace Boundaries
267
+ ## 10. Secret Exclusions and Workspace Boundaries
183
268
 
184
269
  DevWorkspace enforces defense-in-depth security:
185
270
 
@@ -200,14 +285,14 @@ DevWorkspace enforces defense-in-depth security:
200
285
 
201
286
  ---
202
287
 
203
- ## 10. Privacy and External Data Transmission
288
+ ## 11. Privacy and External Data Transmission
204
289
 
205
290
  - **Local Execution:** DevWorkspace runs entirely on your local machine. It does not send telemetry, analytics, or file contents to any DevWorkspace server.
206
291
  - **AI Provider Notice:** When an AI coding agent calls DevWorkspace MCP tools, the retrieved context enters the agent's context window. Depending on your agent configuration and AI provider (e.g., Anthropic, OpenAI, Google), the agent will send this context to its cloud model.
207
292
 
208
293
  ---
209
294
 
210
- ## 11. Troubleshooting
295
+ ## 12. Troubleshooting
211
296
 
212
297
  | Issue | Cause | Resolution |
213
298
  | --- | --- | --- |
@@ -219,7 +304,7 @@ DevWorkspace enforces defense-in-depth security:
219
304
 
220
305
  ---
221
306
 
222
- ## 12. Uninstallation and Cleanup
307
+ ## 13. Uninstallation and Cleanup
223
308
 
224
309
  To remove DevWorkspace MCP configuration:
225
310
 
@@ -232,7 +317,7 @@ To remove DevWorkspace MCP configuration:
232
317
 
233
318
  ---
234
319
 
235
- ## 13. Known Client Limitations & PATH Requirements
320
+ ## 14. Known Client Limitations & PATH Requirements
236
321
 
237
322
  - **CLI PATH requirement:** The generated MCP configuration specifies `"command": "devworkspace"`, which requires `devworkspace` to be discoverable in the coding agent's executable `PATH` (for instance, via `npm install -g devworkspace` or having the package manager's bin folder in PATH).
238
323
  - If `devworkspace` is installed locally as a devDependency and not globally in PATH, adjust the agent configuration to use `npx`:
@@ -253,7 +338,7 @@ To remove DevWorkspace MCP configuration:
253
338
 
254
339
  ---
255
340
 
256
- ## 14. Manual Debugging
341
+ ## 15. Manual Debugging
257
342
 
258
343
  To run the MCP server with diagnostic debug logging to stderr:
259
344
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devworkspace",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Project-local AI engineering workspace: deterministic repository discovery, portable project knowledge, tasks, decisions and verification gates for AI coding agents.",
5
5
  "type": "module",
6
6
  "bin": {