diff --git a/.daemon/logs/signet-2026-02-19.log b/.daemon/logs/signet-2026-02-19.log index 238a20b4c..bb8f7675f 100644 --- a/.daemon/logs/signet-2026-02-19.log +++ b/.daemon/logs/signet-2026-02-19.log @@ -1759,3 +1759,23 @@ {"timestamp":"2026-02-19T13:31:39.031Z","level":"info","category":"watcher","message":"File added","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} {"timestamp":"2026-02-19T13:31:39.031Z","level":"info","category":"watcher","message":"File added","data":{"path":"/home/nicholai/.agents/memory/memories.db-wal"}} {"timestamp":"2026-02-19T13:31:39.293Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:44.296Z","level":"warn","category":"git","message":"Git add failed"} +{"timestamp":"2026-02-19T13:31:44.309Z","level":"info","category":"git","message":"Auto-committed","data":{"message":"2026-02-19T13-31-44_auto_memory/memories.db-shm, memory/memories.db-wal, me","filesChanged":3}} +{"timestamp":"2026-02-19T13:31:45.000Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/debug.log"}} +{"timestamp":"2026-02-19T13:31:45.000Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/debug.log"}} +{"timestamp":"2026-02-19T13:31:49.840Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:49.843Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-wal"}} +{"timestamp":"2026-02-19T13:31:49.854Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db"}} +{"timestamp":"2026-02-19T13:31:49.840Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:49.843Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-wal"}} +{"timestamp":"2026-02-19T13:31:49.853Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db"}} +{"timestamp":"2026-02-19T13:31:53.300Z","level":"info","category":"watcher","message":"File added","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:53.300Z","level":"info","category":"watcher","message":"File added","data":{"path":"/home/nicholai/.agents/memory/memories.db-wal"}} +{"timestamp":"2026-02-19T13:31:53.650Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:53.302Z","level":"info","category":"watcher","message":"File added","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:53.302Z","level":"info","category":"watcher","message":"File added","data":{"path":"/home/nicholai/.agents/memory/memories.db-wal"}} +{"timestamp":"2026-02-19T13:31:53.651Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:54.627Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:54.696Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/memories.db-shm"}} +{"timestamp":"2026-02-19T13:31:55.638Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/debug.log"}} +{"timestamp":"2026-02-19T13:31:55.638Z","level":"info","category":"watcher","message":"File changed","data":{"path":"/home/nicholai/.agents/memory/debug.log"}} diff --git a/memory/debug.log b/memory/debug.log index 7001a893d..b59606199 100644 --- a/memory/debug.log +++ b/memory/debug.log @@ -687,3 +687,6 @@ We are synthesizing a WORKING MEMORY document for Nicholai. Focus is on CURRENT 2026-02-19T05:48:23.516658 auto-save: session cleared, skipping 2026-02-19T06:17:21.361661 auto-save: session cleared, skipping 2026-02-19T06:30:04.733615 auto-save: session cleared, skipping +2026-02-19T06:31:45.000317 auto-save: no memories extracted +2026-02-19T06:31:55.637571 extract_memories_local: Command '['ollama', 'run', 'qwen3:4b', '/no_think\nExtract ONLY significant, contextual facts from this coding session transcript.\n\nSTRICT RULES:\n1. DO NOT save: user messages verbatim, assistant responses, temporary states, routine operations\n2. DO save: user preferences, technical decisions with reasoning, solved issues with solutions, project-specific configs\n3. Each memory MUST have enough context to be useful standalone (not "the user wants X" but "nicholai prefers X because Y")\n4. Maximum 5 memories per session. If nothing significant, return []\n5. importance scale: 0.3-0.5 (most auto-extracted should be low)\n\nReturn ONLY a JSON array:\n[{"content": "...", "type": "fact|decision|preference|issue|learning", "tags": "tag1,tag2", "importance": 0.3-0.5}]\n\nTranscript:\n{"parentUuid":null,"isSidechain":false,"teamName":"hook-migration","agentName":"connectors-cli","userType":"external","cwd":"/home/nicholai/signet/signetai","sessionId":"94bf2e61-1631-4fb6-9444-8ff8c4aadb43","version":"2.1.47","gitBranch":"main","type":"user","message":{"role":"user","content":"\\nYou are Agent 2 (connectors-cli) on the hook-migration team. You are blocked by Agent 1 (daemon-core) but can start scaffolding immediately.\\n\\n## Your Task (Task #2)\\n\\nUpdate all three connectors and CLI to call the daemon API instead of memory.py. Mark task #2 as in_progress when you start, completed when done.\\n\\n## Working Directory\\n/home/nicholai/signet/signetai\\n\\n## Files You Own\\n- packages/cli/src/cli.ts\\n- packages/connector-claude-code/src/index.ts\\n- packages/connector-opencode/src/index.ts\\n- packages/connector-opencode/src/templates/memory.mjs.ts\\n- packages/connector-openclaw/src/index.ts\\n\\n## What to Do\\n\\n### 1. Update fetchFromDaemon() in cli.ts (around line 3268)\\n\\nAdd optional timeout parameter:\\n```typescript\\nasync function fetchFromDaemon(\\n path: string,\\n opts?: RequestInit & { timeout?: number },\\n): Promise {\\n const { timeout: timeoutMs, ...fetchOpts } = opts || {};\\n try {\\n const res = await fetch(`http://localhost:${DEFAULT_PORT}${path}`, {\\n signal: AbortSignal.timeout(timeoutMs || 5000),\\n ...fetchOpts,\\n });\\n if (!res.ok) return null;\\n return (await res.json()) as T;\\n } catch {\\n return null;\\n }\\n}\\n```\\n\\n### 2. Add `signet hook user-prompt-submit` command in cli.ts\\n\\nAfter the existing session-start command (around line 3762), add:\\n```typescript\\n// signet hook user-prompt-submit\\nhookCmd\\n .command(\\"user-prompt-submit\\")\\n .description(\\"Get relevant memories for a user prompt\\")\\n .requiredOption(\\"-H, --harness \\", \\"Harness name\\")\\n .option(\\"--project \\", \\"Project path\\")\\n .action(async (options) => {\\n // Read stdin for user prompt JSON\\n let userPrompt = \\"\\";\\n try {\\n const chunks: Buffer[] = [];\\n for await (const chunk of process.stdin) {\\n chunks.push(chunk);\\n }\\n const input = Buffer.concat(chunks).toString(\\"utf-8\\").trim();\\n if (input) {\\n const parsed = JSON.parse(input);\\n userPrompt = parsed.user_prompt || parsed.userPrompt || \\"\\";\\n }\\n } catch {\\n // No stdin or invalid JSON\\n }\\n \\n const data = await fetchFromDaemon<{\\n inject?: string;\\n memoryCount?: number;\\n error?: string;\\n }>(\\"/api/hooks/user-prompt-submit\\", {\\n method: \\"POST\\",\\n headers: { \\"Content-Type\\": \\"application/json\\" },\\n body: JSON.stringify({\\n harness: options.harness,\\n project: options.project,\\n userPrompt,\\n }),\\n });\\n \\n if (!data) {\\n process.stderr.write(\\"[signet] daemon not running, hook skipped\\\\n\\");\\n process.exit(0);\\n }\\n \\n if (data.inject) {\\n console.log(data.inject);\\n }\\n });\\n```\\n\\n### 3. Add `signet hook session-end` command in cli.ts\\n\\n```typescript\\n// signet hook session-end\\nhookCmd\\n .command(\\"session-end\\")\\n .description(\\"Extract and save memories from session transcript\\")\\n .requiredOption(\\"-H, --harness \\", \\"Harness name\\")\\n .action(async (options) => {\\n // Read stdin for session end JSON\\n let body: Record = {};\\n try {\\n const chunks: Buffer[] = [];\\n for await (const chunk of process.stdin) {\\n chunks.push(chunk);\\n }\\n const input = Buffer.concat(chunks).toString(\\"utf-8\\").trim();\\n if (input) {\\n body = JSON.parse(input);\\n }\\n } catch {\\n // No stdin or invalid JSON\\n }\\n \\n const data = await fetchFromDaemon<{\\n memoriesSaved?: number;\\n error?: string;\\n }>(\\"/api/hooks/session-end\\", {\\n method: \\"POST\\",\\n headers: { \\"Content-Type\\": \\"application/json\\" },\\n body: JSON.stringify({\\n harness: options.harness,\\n transcriptPath: body.transcript_path || body.transcriptPath,\\n sessionId: body.session_id || body.sessionId,\\n cwd: body.cwd,\\n reason: body.reason,\\n }),\\n timeout: 60000, // 60s for ollama\\n });\\n \\n if (!data) {\\n process.stderr.write(\\"[signet] daemon not running, hook skipped\\\\n\\");\\n process.exit(0);\\n }\\n \\n if (data.memoriesSaved !== undefined && data.memoriesSaved > 0) {\\n process.stderr.write(`[signet] ${data.memoriesSaved} memories saved\\\\n`);\\n }\\n });\\n```\\n\\n### 4. Update existing session-start command to add --project and graceful fallback\\n\\nUpdate the existing session-start command (around line 3724). Add `--project` option and graceful fallback:\\n\\n```typescript\\nhookCmd\\n .command(\\"session-start\\")\\n .description(\\"Get context/memories for a new session\\")\\n .requiredOption(\\"-H, --harness \\", \\"Harness name\\")\\n .option(\\"--project \\", \\"Project path\\")\\n .option(\\"--agent-id \\", \\"Agent ID\\")\\n .option(\\"--context \\", \\"Additional context\\")\\n .option(\\"--json\\", \\"Output as JSON\\")\\n .action(async (options) => {\\n const data = await fetchFromDaemon<{\\n identity?: { name: string; description?: string };\\n memories?: Array<{ content: string }>;\\n inject?: string;\\n error?: string;\\n }>(\\"/api/hooks/session-start\\", {\\n method: \\"POST\\",\\n headers: { \\"Content-Type\\": \\"application/json\\" },\\n body: JSON.stringify({\\n harness: options.harness,\\n project: options.project,\\n agentId: options.agentId,\\n context: options.context,\\n }),\\n });\\n \\n if (!data) {\\n process.stderr.write(\\"[signet] daemon not running, hook skipped\\\\n\\");\\n process.exit(0);\\n }\\n \\n if (data.error) {\\n console.error(chalk.red(`Error: ${data.error}`));\\n process.exit(1);\\n }\\n \\n if (options.json) {\\n console.log(JSON.stringify(data, null, 2));\\n } else {\\n if (data.inject) {\\n console.log(data.inject);\\n }\\n }\\n });\\n```\\n\\n### 5. Update Claude Code Connector (connector-claude-code/src/index.ts)\\n\\n**a) Update configureHooks() (line 264)**\\n\\nReplace the memory.py commands with signet CLI commands:\\n```typescript\\nprivate async configureHooks(basePath: string): Promise {\\n const settingsPath = this.getConfigPath();\\n const claudeDir = join(homedir(), \\".claude\\");\\n mkdirSync(claudeDir, { recursive: true });\\n\\n let settings: Record = {};\\n if (existsSync(settingsPath)) {\\n try {\\n settings = JSON.parse(readFileSync(settingsPath, \\"utf-8\\"));\\n } catch {\\n settings = {};\\n }\\n }\\n\\n const hooksConfig = this.config.hooks || {\\n sessionStart: true,\\n userPromptSubmit: true,\\n sessionEnd: true,\\n };\\n\\n const hooks: Record = {};\\n\\n if (hooksConfig.sessionStart !== false) {\\n hooks.SessionStart = [{\\n hooks: [{\\n type: \\"command\\",\\n command: \'signet hook session-start -H claude-code --project \\"$(pwd)\\"\',\\n timeout: 3000,\\n }],\\n }];\\n }\\n\\n if (hooksConfig.userPromptSubmit !== false) {\\n hooks.UserPromptSubmit = [{\\n hooks: [{\\n type: \\"command\\",\\n command: \'signet hook user-prompt-submit -H claude-code --project \\"$(pwd)\\"\',\\n timeout: 2000,\\n }],\\n }];\\n }\\n\\n if (hooksConfig.sessionEnd !== false) {\\n hooks.SessionEnd = [{\\n hooks: [{\\n type: \\"command\\",\\n command: \\"signet hook session-end -H claude-code\\",\\n timeout: 15000,\\n }],\\n }];\\n }\\n\\n settings.hooks = {\\n ...(settings.hooks as Record),\\n ...hooks,\\n };\\n\\n writeFileSync(settingsPath, JSON.stringify(settings, null, 2));\\n}\\n```\\n\\nRemove the `memoryScript` parameter from configureHooks() signature and the in\n']' timed out after 45 seconds +2026-02-19T06:31:55.637690 auto-save: no memories extracted diff --git a/memory/memories.db b/memory/memories.db index 4fbf8a423..ca5ba919a 100644 Binary files a/memory/memories.db and b/memory/memories.db differ