{"_id":"@certaworks/goal-drift-monitor","name":"@certaworks/goal-drift-monitor","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@certaworks/goal-drift-monitor","version":"0.1.0","description":"Tracks whether long-running agents are still aligned with their original goal. Alerts when behavior diverges.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"goal-drift":"dist/cli.js"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"npm run build && vitest run","test:unit":"vitest run","serve":"node dist/http/server.js","mcp":"node dist/mcp/server.js"},"dependencies":{"openai":"^4.104.0"},"devDependencies":{"@types/node":"^22.0.0","tsx":"^4.19.0","typescript":"^5.8.0","vitest":"^3.2.0"},"engines":{"node":">=18"},"license":"MIT","author":{"name":"CertaWorks Labs LLC"},"homepage":"https://certaworks.dev","bugs":{"url":"https://github.com/plantBase369/certaworks-site/issues","email":"blair.hall@certaworks.dev"},"repository":{"type":"git","url":"git+https://github.com/plantBase369/certaworks-site.git"},"publishConfig":{"access":"public"},"keywords":["certaworks","mcp","ai-agent","agent-safety","goal-drift","alignment","monitoring"],"_id":"@certaworks/goal-drift-monitor@0.1.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-oAWGH7iKlqmPI7RHd54qL6fqvdW7Chav/jCNaYydORhum3w2BV6ew6WURjxua/f1QK0B6ZhEQ/ksgMmyI862RQ==","shasum":"bd4ccbec34a9c5bb565d63cd723ed474c5a43ad2","tarball":"https://registry.npmjs.org/@certaworks/goal-drift-monitor/-/goal-drift-monitor-0.1.0.tgz","fileCount":39,"unpackedSize":171849,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2QGRutODtdLQkQgRkg1w/eJVPtO02ME4xp2ndlm8DFQIhAIqtOilWzNFwhnMkIY/zXUQXyKbsA9vXbfPDAoVuHxK9"}]},"_npmUser":{"name":"blairhall","email":"Blair.Hall@certaworks.dev"},"directories":{},"maintainers":[{"name":"blairhall","email":"Blair.Hall@certaworks.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/goal-drift-monitor_0.1.0_1779947812778_0.49409988346754274"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-28T05:56:52.617Z","0.1.0":"2026-05-28T05:56:52.927Z","modified":"2026-05-28T05:56:53.156Z"},"maintainers":[{"name":"blairhall","email":"Blair.Hall@certaworks.dev"}],"description":"Tracks whether long-running agents are still aligned with their original goal. Alerts when behavior diverges.","homepage":"https://certaworks.dev","keywords":["certaworks","mcp","ai-agent","agent-safety","goal-drift","alignment","monitoring"],"repository":{"type":"git","url":"git+https://github.com/plantBase369/certaworks-site.git"},"author":{"name":"CertaWorks Labs LLC"},"bugs":{"url":"https://github.com/plantBase369/certaworks-site/issues","email":"blair.hall@certaworks.dev"},"license":"MIT","readme":"# Goal Drift Monitor\n\n**Type:** Local Monitor / API / MCP Server / Dashboard\n\n**Value:** Tracks whether long-running agents are still aligned with the original goal and alerts when behavior starts to diverge.\n\n## Current Status\n\nComplete as a local monitor / CLI / MCP / HTTP dashboard slice. It persists local sessions, scores each turn, and exposes alert receipts for local review workflows.\n\n## Shipped Local Scope\n\n- Durable local goal sessions and turn history\n- Turn-by-turn lexical drift scoring\n- Drift threshold alerts\n- Webhook delivery receipts for drift alerts\n- CLI for creating sessions, adding turns, summaries, history, alerts, and serving the dashboard\n- MCP tools for create, score, summarize, history, alert receipts, list, and delete\n- Local HTTP API and dashboard\n- Regression tests for persistence, CLI, MCP validation, HTTP/dashboard, and core scoring\n\n## Commands\n\n```bash\nnpm install\nnpm test\nnpm run build\n```\n\n```bash\ngoal-drift session create --goal \"Keep the agent focused on refund policy questions\" --threshold 0.35\ngoal-drift turn add --session <id> --content \"The agent is discussing vacation planning\"\ngoal-drift summary --session <id>\ngoal-drift history --session <id>\ngoal-drift alerts --session <id>\ngoal-drift serve --port 4321\n```\n\nThe dashboard is available at `http://127.0.0.1:4321/dashboard` after `goal-drift serve`.\n\n## Local API\n\n- `GET /health`\n- `POST /api/sessions`\n- `GET /api/sessions`\n- `GET /api/sessions/:id`\n- `DELETE /api/sessions/:id`\n- `POST /api/sessions/:id/turns`\n- `GET /api/sessions/:id/history`\n- `GET /api/sessions/:id/summary`\n- `GET /api/sessions/:id/alerts`\n- `GET /dashboard`\n\n## Local Store\n\nBy default, local sessions are stored at:\n\n```text\n.goal-drift-monitor/sessions.json\n```\n\nOverride with:\n\n```bash\nGOAL_DRIFT_MONITOR_STORE_PATH=/path/to/sessions.json\n```\n\n## Current Guardrails\n\n- External HTTP and MCP inputs are validated before mutating state.\n- Invalid MCP envelopes return JSON-RPC `-32600`.\n- Invalid MCP tool params return JSON-RPC `-32602`.\n- Webhook threshold breaches and delivery receipts are separate: `alertFired` means drift threshold breached, while `alertDeliveryStatus` records whether delivery was configured, delivered, or failed.\n\n## Current Limits\n\n- This is a local product slice, not a hosted multi-user SaaS service.\n- No public npm publication, hosted account system, billing, team workspace, or live checkout is included.\n- Scoring defaults to deterministic lexical matching. Semantic scoring exists in the SDK but MCP/CLI/API currently expose lexical scoring for predictable local operation.\n- Email alerts are not implemented; webhook receipts are implemented.\n- Delete currently removes the session from the local store. Compliance-grade immutable audit retention remains future scope.\n\n## Verification\n\nFresh suite verification on 2026-05-28:\n\n- `npm test` passed, 19/19 tests.\n- `npm run build` passed.\n","readmeFilename":"README.md","_rev":"1-92225d7c2f5bbfe3c20f5fb4374c41f8"}