diff --git a/.gitignore b/.gitignore index 70d0f37..44d646d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules dist/ -.scheduler-memory/ diff --git a/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/retrieve.json b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/retrieve.json new file mode 100644 index 0000000..6edfe31 --- /dev/null +++ b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/retrieve.json @@ -0,0 +1,18 @@ +{ + "cadence": "daily", + "operation": "retrieve", + "runId": "adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7", + "servicePath": "src/services/memory/index.js#getRelevantMemories", + "inputs": { + "agentId": "style-agent", + "promptPath": "src/prompts/daily/style-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "query": "scheduler | daily | agent | style-agent | intent | Required startup + artifacts + memory + issue capture", + "events": 1 + }, + "outputs": { + "ingestedCount": 1, + "retrievedCount": 1 + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/retrieve.ok b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/store.json b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/store.json new file mode 100644 index 0000000..ba1d6e6 --- /dev/null +++ b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/store.json @@ -0,0 +1,20 @@ +{ + "cadence": "daily", + "operation": "store", + "runId": "adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7", + "servicePath": "src/services/memory/index.js#ingestEvents", + "inputs": { + "agentId": "style-agent", + "promptPath": "src/prompts/daily/style-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "events": 1, + "sourceFile": "memory-update.md" + }, + "outputs": { + "storedCount": 1, + "summaries": [ + "Lint passed, no changes needed." + ] + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/store.ok b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/adffd02af53cf5fb38e640608155fae3aa10adac6249a4d3e462c8f5b56ac6b7/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/.scheduler-memory/initial-seed/retrieve.json b/.scheduler-memory/initial-seed/retrieve.json new file mode 100644 index 0000000..359f64b --- /dev/null +++ b/.scheduler-memory/initial-seed/retrieve.json @@ -0,0 +1,18 @@ +{ + "cadence": "daily", + "operation": "retrieve", + "runId": "initial-seed", + "servicePath": "src/services/memory/index.js#getRelevantMemories", + "inputs": { + "agentId": "onboarding-audit-agent", + "promptPath": "src/prompts/daily/onboarding-audit-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "query": "scheduler | daily | agent | onboarding-audit-agent | intent | Required startup + artifacts + memory + issue capture", + "events": 1 + }, + "outputs": { + "ingestedCount": 1, + "retrievedCount": 2 + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/initial-seed/retrieve.ok b/.scheduler-memory/initial-seed/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/initial-seed/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/initial-seed/store.json b/.scheduler-memory/initial-seed/store.json new file mode 100644 index 0000000..56c0833 --- /dev/null +++ b/.scheduler-memory/initial-seed/store.json @@ -0,0 +1,19 @@ +{ + "cadence": "daily", + "operation": "store", + "runId": "initial-seed", + "servicePath": "src/services/memory/index.js#ingestEvents", + "inputs": { + "agentId": "onboarding-audit-agent", + "promptPath": "src/prompts/daily/onboarding-audit-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "events": 2 + }, + "outputs": { + "storedCount": 1, + "summaries": [ + "Store memory event A for daily :: Required startup + artifacts + memory + issue capture Store memory event B for daily :: Required startup + artifacts + memory + issue capture" + ] + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/initial-seed/store.ok b/.scheduler-memory/initial-seed/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/initial-seed/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/.scheduler-memory/latest/daily/memories.md b/.scheduler-memory/latest/daily/memories.md new file mode 100644 index 0000000..55bdfd5 --- /dev/null +++ b/.scheduler-memory/latest/daily/memories.md @@ -0,0 +1 @@ +- Memory retrieval seed for daily :: Required startup + artifacts + memory + issue capture \ No newline at end of file diff --git a/.scheduler-memory/latest/daily/retrieve.ok b/.scheduler-memory/latest/daily/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/latest/daily/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/latest/daily/store.ok b/.scheduler-memory/latest/daily/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/latest/daily/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/.scheduler-memory/latest/weekly/memories.md b/.scheduler-memory/latest/weekly/memories.md new file mode 100644 index 0000000..a0766a0 --- /dev/null +++ b/.scheduler-memory/latest/weekly/memories.md @@ -0,0 +1 @@ +- Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture \ No newline at end of file diff --git a/.scheduler-memory/latest/weekly/retrieve.ok b/.scheduler-memory/latest/weekly/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/latest/weekly/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/latest/weekly/store.ok b/.scheduler-memory/latest/weekly/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/latest/weekly/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/.scheduler-memory/memory-store.json b/.scheduler-memory/memory-store.json new file mode 100644 index 0000000..b3dab5c --- /dev/null +++ b/.scheduler-memory/memory-store.json @@ -0,0 +1,250 @@ +[ + [ + "638c2d47-3218-42f5-bc2d-e3adeb4626d0", + { + "schema_version": 1, + "id": "638c2d47-3218-42f5-bc2d-e3adeb4626d0", + "agent_id": "test-agent", + "session_id": "test-run", + "type": "batch_window", + "content": "Store memory event A for daily :: scheduler memory store\nStore memory event B for daily :: scheduler memory store", + "summary": "Store memory event A for daily :: scheduler memory store Store memory event B for daily :: scheduler memory store", + "tags": [ + "scheduler", + "daily", + "store" + ], + "importance": 0.55, + "embedding_id": null, + "created_at": 1771295950236, + "last_seen": 1771295958659, + "source": "scheduler-store", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "5c458e0c-8239-46f9-99d1-b61cf05acc34", + { + "schema_version": 1, + "id": "5c458e0c-8239-46f9-99d1-b61cf05acc34", + "agent_id": "test-agent", + "session_id": "test-run-2", + "type": "batch_window", + "content": "Memory retrieval seed for daily :: scheduler memory retrieval", + "summary": "Memory retrieval seed for daily :: scheduler memory retrieval", + "tags": [ + "scheduler", + "daily", + "retrieve" + ], + "importance": 0.4, + "embedding_id": null, + "created_at": 1771295958645, + "last_seen": 1771295958659, + "source": "scheduler-retrieve", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "2e9129bd-c366-4d82-ac2b-7e50574532a9", + { + "schema_version": 1, + "id": "2e9129bd-c366-4d82-ac2b-7e50574532a9", + "agent_id": "onboarding-audit-agent", + "session_id": "initial-seed", + "type": "batch_window", + "content": "Store memory event A for daily :: Required startup + artifacts + memory + issue capture\nStore memory event B for daily :: Required startup + artifacts + memory + issue capture", + "summary": "Store memory event A for daily :: Required startup + artifacts + memory + issue capture Store memory event B for daily :: Required startup + artifacts + memory + issue capture", + "tags": [ + "scheduler", + "daily", + "store" + ], + "importance": 0.55, + "embedding_id": null, + "created_at": 1771296574057, + "last_seen": 1771296574172, + "source": "scheduler-store", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "2612b9ce-1aa7-4731-acb2-c3a852eeaac6", + { + "schema_version": 1, + "id": "2612b9ce-1aa7-4731-acb2-c3a852eeaac6", + "agent_id": "onboarding-audit-agent", + "session_id": "initial-seed", + "type": "batch_window", + "content": "Memory retrieval seed for daily :: Required startup + artifacts + memory + issue capture", + "summary": "Memory retrieval seed for daily :: Required startup + artifacts + memory + issue capture", + "tags": [ + "scheduler", + "daily", + "retrieve" + ], + "importance": 0.4, + "embedding_id": null, + "created_at": 1771296574158, + "last_seen": 1771296574172, + "source": "scheduler-retrieve", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "facf005a-dad0-4066-921c-49a8e408665c", + { + "schema_version": 1, + "id": "facf005a-dad0-4066-921c-49a8e408665c", + "agent_id": "agent-telemetry", + "session_id": "s-telemetry", + "type": "batch_window", + "content": "customer token ABC123 secret", + "summary": "customer token ABC123 secret", + "tags": [ + "incident" + ], + "importance": 0.25, + "embedding_id": null, + "created_at": 1771296636016, + "last_seen": 1771301051605, + "source": "ingest", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "19ef312e-a725-4544-850e-651713e2d9dc", + { + "schema_version": 1, + "id": "19ef312e-a725-4544-850e-651713e2d9dc", + "agent_id": "bug-reproducer-agent", + "session_id": "session-mlq2vq5p", + "type": "batch_window", + "content": "Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture", + "summary": "Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture", + "tags": [ + "scheduler", + "weekly", + "retrieve" + ], + "importance": 0.4, + "embedding_id": null, + "created_at": 1771300999213, + "last_seen": 1771300999222, + "source": "scheduler-retrieve", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "bfbb3c6e-095d-4ccd-ad5a-140b6927421c", + { + "schema_version": 1, + "id": "bfbb3c6e-095d-4ccd-ad5a-140b6927421c", + "agent_id": "agent-telemetry", + "session_id": "s-telemetry", + "type": "batch_window", + "content": "customer token ABC123 secret", + "summary": "customer token ABC123 secret", + "tags": [ + "incident" + ], + "importance": 0.25, + "embedding_id": null, + "created_at": 1771301051598, + "last_seen": 1771301051605, + "source": "ingest", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "d74e3e34-6cf1-465e-b4a8-64acd0a8d803", + { + "schema_version": 1, + "id": "d74e3e34-6cf1-465e-b4a8-64acd0a8d803", + "agent_id": "bug-reproducer-agent", + "session_id": "session-mlq2ysd2", + "type": "batch_window", + "content": "Reproduced npm test timeout issue. Created reproduction script in artifacts/reproducers/npm-test-timeout/. Confirmed that `npm test` hangs/times out as expected.", + "summary": "Reproduced npm test timeout issue. Created reproduction script in artifacts/reproducers/npm-test-timeout/. Confirmed that `npm test` hangs/times out as expected.", + "tags": [ + "scheduler", + "weekly", + "store", + "insight" + ], + "importance": 0.8, + "embedding_id": null, + "created_at": 1771301142040, + "last_seen": 1771301142040, + "source": "agent-output", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "3df7bccf-f3f1-45b9-ab15-88a1a30c6453", + { + "schema_version": 1, + "id": "3df7bccf-f3f1-45b9-ab15-88a1a30c6453", + "agent_id": "changelog-agent", + "session_id": "session-mlq51t0r", + "type": "batch_window", + "content": "Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture", + "summary": "Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture", + "tags": [ + "scheduler", + "weekly", + "retrieve" + ], + "importance": 0.4, + "embedding_id": null, + "created_at": 1771304642091, + "last_seen": 1771304642101, + "source": "scheduler-retrieve", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ], + [ + "5b32be34-78f9-44ac-b7b1-e301e34f04d0", + { + "schema_version": 1, + "id": "5b32be34-78f9-44ac-b7b1-e301e34f04d0", + "agent_id": "changelog-agent", + "session_id": "session-mlq53the", + "type": "batch_window", + "content": "# Changelog Update - 2026-02-17\n\nGenerated draft release notes covering 212 commits.\nKey areas:\n- Scheduler automation improvements\n- Memory management features\n- Codebase modularization", + "summary": "# Changelog Update - 2026-02-17\n\nGenerated draft release notes covering 212 commits.\nKey areas:\n- Scheduler automation improvements\n- Memory management features\n- Codebase modularization", + "tags": [ + "scheduler", + "weekly", + "store", + "insight" + ], + "importance": 0.8, + "embedding_id": null, + "created_at": 1771304736005, + "last_seen": 1771304736005, + "source": "agent-output", + "ttl_days": null, + "merged_into": null, + "pinned": false + } + ] +] \ No newline at end of file diff --git a/.scheduler-memory/session-mlq2vq5p/retrieve.json b/.scheduler-memory/session-mlq2vq5p/retrieve.json new file mode 100644 index 0000000..1499afa --- /dev/null +++ b/.scheduler-memory/session-mlq2vq5p/retrieve.json @@ -0,0 +1,18 @@ +{ + "cadence": "weekly", + "operation": "retrieve", + "runId": "session-mlq2vq5p", + "servicePath": "src/services/memory/index.js#getRelevantMemories", + "inputs": { + "agentId": "bug-reproducer-agent", + "promptPath": "src/prompts/weekly/bug-reproducer-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "query": "scheduler | weekly | agent | bug-reproducer-agent | intent | Required startup + artifacts + memory + issue capture", + "events": 1 + }, + "outputs": { + "ingestedCount": 1, + "retrievedCount": 1 + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/session-mlq2vq5p/retrieve.ok b/.scheduler-memory/session-mlq2vq5p/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/session-mlq2vq5p/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/session-mlq2ysd2/store.json b/.scheduler-memory/session-mlq2ysd2/store.json new file mode 100644 index 0000000..4cd1b70 --- /dev/null +++ b/.scheduler-memory/session-mlq2ysd2/store.json @@ -0,0 +1,20 @@ +{ + "cadence": "weekly", + "operation": "store", + "runId": "session-mlq2ysd2", + "servicePath": "src/services/memory/index.js#ingestEvents", + "inputs": { + "agentId": "bug-reproducer-agent", + "promptPath": "src/prompts/weekly/bug-reproducer-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "events": 1, + "sourceFile": "memory-update.md" + }, + "outputs": { + "storedCount": 1, + "summaries": [ + "Reproduced npm test timeout issue. Created reproduction script in artifacts/reproducers/npm-test-timeout/. Confirmed that `npm test` hangs/times out as expected." + ] + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/session-mlq2ysd2/store.ok b/.scheduler-memory/session-mlq2ysd2/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/session-mlq2ysd2/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/.scheduler-memory/session-mlq51t0r/retrieve.json b/.scheduler-memory/session-mlq51t0r/retrieve.json new file mode 100644 index 0000000..8037930 --- /dev/null +++ b/.scheduler-memory/session-mlq51t0r/retrieve.json @@ -0,0 +1,18 @@ +{ + "cadence": "weekly", + "operation": "retrieve", + "runId": "session-mlq51t0r", + "servicePath": "src/services/memory/index.js#getRelevantMemories", + "inputs": { + "agentId": "changelog-agent", + "promptPath": "src/prompts/weekly/changelog-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "query": "scheduler | weekly | agent | changelog-agent | intent | Required startup + artifacts + memory + issue capture", + "events": 1 + }, + "outputs": { + "ingestedCount": 1, + "retrievedCount": 1 + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/session-mlq51t0r/retrieve.ok b/.scheduler-memory/session-mlq51t0r/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/session-mlq51t0r/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/session-mlq53the/store.json b/.scheduler-memory/session-mlq53the/store.json new file mode 100644 index 0000000..2215eca --- /dev/null +++ b/.scheduler-memory/session-mlq53the/store.json @@ -0,0 +1,20 @@ +{ + "cadence": "weekly", + "operation": "store", + "runId": "session-mlq53the", + "servicePath": "src/services/memory/index.js#ingestEvents", + "inputs": { + "agentId": "changelog-agent", + "promptPath": "src/prompts/weekly/changelog-agent.md", + "promptIntent": "Required startup + artifacts + memory + issue capture", + "events": 1, + "sourceFile": "memory-update.md" + }, + "outputs": { + "storedCount": 1, + "summaries": [ + "# Changelog Update - 2026-02-17\n\nGenerated draft release notes covering 212 commits.\nKey areas:\n- Scheduler automation improvements\n- Memory management features\n- Codebase modularization" + ] + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/session-mlq53the/store.ok b/.scheduler-memory/session-mlq53the/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/session-mlq53the/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/.scheduler-memory/test-run-2/retrieve.json b/.scheduler-memory/test-run-2/retrieve.json new file mode 100644 index 0000000..7bee6f5 --- /dev/null +++ b/.scheduler-memory/test-run-2/retrieve.json @@ -0,0 +1,18 @@ +{ + "cadence": "daily", + "operation": "retrieve", + "runId": "test-run-2", + "servicePath": "src/services/memory/index.js#getRelevantMemories", + "inputs": { + "agentId": "test-agent", + "promptPath": "", + "promptIntent": "scheduler memory retrieval", + "query": "scheduler | daily | agent | test-agent | intent | scheduler memory retrieval", + "events": 1 + }, + "outputs": { + "ingestedCount": 1, + "retrievedCount": 2 + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/test-run-2/retrieve.ok b/.scheduler-memory/test-run-2/retrieve.ok new file mode 100644 index 0000000..84b1719 --- /dev/null +++ b/.scheduler-memory/test-run-2/retrieve.ok @@ -0,0 +1 @@ +MEMORY_RETRIEVED diff --git a/.scheduler-memory/test-run/store.json b/.scheduler-memory/test-run/store.json new file mode 100644 index 0000000..0caccd2 --- /dev/null +++ b/.scheduler-memory/test-run/store.json @@ -0,0 +1,19 @@ +{ + "cadence": "daily", + "operation": "store", + "runId": "test-run", + "servicePath": "src/services/memory/index.js#ingestEvents", + "inputs": { + "agentId": "test-agent", + "promptPath": "", + "promptIntent": "scheduler memory store", + "events": 2 + }, + "outputs": { + "storedCount": 1, + "summaries": [ + "Store memory event A for daily :: scheduler memory store Store memory event B for daily :: scheduler memory store" + ] + }, + "status": "ok" +} \ No newline at end of file diff --git a/.scheduler-memory/test-run/store.ok b/.scheduler-memory/test-run/store.ok new file mode 100644 index 0000000..1e40bb6 --- /dev/null +++ b/.scheduler-memory/test-run/store.ok @@ -0,0 +1 @@ +MEMORY_STORED diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 10b8c80..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,112 +0,0 @@ -# AGENTS.md — Repository-Agnostic Agent Operating Guide - -This file defines how agents should work in this repository **before any project-specific customization exists**. - -## Purpose - -- Keep agent work predictable, auditable, and safe. -- Minimize repeated discovery work across sessions. -- Capture durable learnings so future agents can move faster. - -## Session startup checklist (run every session) - -1. Read `AGENTS.md`. -2. Read `CLAUDE.md` for execution workflow details. -3. Read `CONTRIBUTING.md` for commit and PR expectations. -4. Read `KNOWN_ISSUES.md` for active blockers and workarounds. -5. Read `docs/agent-handoffs/README.md`. -6. Scan recent notes in: - - `docs/agent-handoffs/learnings/` - - `docs/agent-handoffs/incidents/` -7. If present, review the current run artifacts in: - - `src/context/` - - `src/todo/` - - `src/decisions/` - - `src/test_logs/` - - `src/issues/` - -## Core operating principles - -- Default to generic guidance and neutral language. -- Make the smallest safe change that satisfies the request. -- Avoid unrelated refactors. -- Preserve backward compatibility unless explicitly asked otherwise. -- Prefer explicit commands and documented behavior over assumptions. -- Record assumptions clearly in your final summary. - -## Validation policy - -- Run the most relevant checks for changed files (tests, lint, typecheck, build, or targeted scripts). -- Never claim a check passed unless it was actually executed. -- If a check cannot run, record: - - command attempted, - - why it could not complete, - - what fallback validation was performed. - -## Knowledge-sharing protocol - -### What belongs where - -- `KNOWN_ISSUES.md` - - Active, reproducible issues only. - - Include status, impact, workaround, and last verification date. -- `docs/agent-handoffs/learnings/` - - Proven patterns, repeatable fixes, and successful implementation guidance. -- `docs/agent-handoffs/incidents/` - - Failures, root causes, mitigations, and prevention guidance. -- `src/context/` - - Snapshot of current task context (goal, scope, constraints). -- `src/todo/` - - Actionable checklist for in-progress work. -- `src/decisions/` - - Key implementation decisions and rationale. -- `src/test_logs/` - - Commands run and their outcomes. -- `src/issues/` - - One-off investigative or audit outputs not yet promoted to `KNOWN_ISSUES.md`. - -### Naming standard (generic) - -Use: `YYYY-MM-DD-short-topic.md` - -Examples: - -- `2026-02-14-validation-before-summary.md` -- `2026-02-14-missing-baseline-context.md` - -Naming rules: - -- Keep names concise and descriptive. -- Avoid company, product, team, customer, and environment names. -- Prefer neutral technical terms. - -### Required sections for reusable notes - -Use these headings in learning/incident notes: - -1. Context -2. Observation -3. Action taken -4. Validation performed -5. Recommendation for next agents - -### Update decision tree - -When you discover reusable context: - -1. Check if an existing note already covers it. -2. If yes, update that note. -3. If no, add a new note in `learnings/` or `incidents/`. -4. If the issue is still active/reproducible, add or update `KNOWN_ISSUES.md`. - -## Priority order when guidance conflicts - -1. System/developer/user instructions in the active session -2. `AGENTS.md` -3. `CLAUDE.md` -4. `CONTRIBUTING.md` -5. Inline code comments and prompt templates - -## Keep this file generic - -Only add project-specific details after they are truly needed and explicitly labeled as repository-specific. diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 78be0ca..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,108 +0,0 @@ -# CLAUDE.md — Generic Agent Execution Workflow - -This guide defines an execution flow that works across repositories and tech stacks. - -## Default workflow - -1. **Load baseline context** - - `AGENTS.md` - - `CONTRIBUTING.md` - - `KNOWN_ISSUES.md` - - `docs/agent-handoffs/README.md` - - Recent notes in `docs/agent-handoffs/learnings/` and `docs/agent-handoffs/incidents/` -2. **Clarify the task** - - Restate the requested outcome. - - Identify constraints, risks, and assumptions. -3. **Plan minimal changes** - - Keep scope tight. - - Avoid touching unrelated files. -4. **Implement** - - Apply small, reversible edits. - - Favor readability and maintainability. -5. **Validate** - - Run relevant checks for impacted files. - - Capture exact commands and outcomes. -6. **Document and hand off** - - Summarize what changed and why. - - Record reusable learnings/incidents when appropriate. - -## Working files for session state - -Use the following folders as lightweight coordination artifacts: - -- `src/context/` — Current objective, scope, constraints. -- `src/todo/` — Task checklist and blockers. -- `src/decisions/` — Important design/implementation choices. -- `src/test_logs/` — Validation commands and results. -- `src/issues/` — Investigations or audits that may become tracked issues. - -### Recommended content templates - -#### Context note template - -- Goal -- Scope -- Constraints -- Open questions - -#### Todo note template - -- Pending tasks -- Completed tasks -- Blocked tasks - -#### Decision note template - -- Decision -- Alternatives considered -- Rationale -- Consequences/follow-ups - -#### Test log template - -- Command -- Result (pass/fail/warn) -- Notes (environmental limits, retries, artifacts) - -## Knowledge-sharing protocol - -### Where to write durable knowledge - -- `docs/agent-handoffs/learnings/` for reusable successes. -- `docs/agent-handoffs/incidents/` for failures and mitigations. -- `KNOWN_ISSUES.md` for active, reproducible unresolved issues. - -### File naming - -Use `YYYY-MM-DD-short-topic.md`. - -### Required structure for learning/incident notes - -1. Context -2. Observation -3. Action taken -4. Validation performed -5. Recommendation for next agents - -## Quality checklist before completion - -- Scope matches request. -- Documentation remains repository-agnostic unless explicitly needed. -- No unsupported claims about testing. -- Assumptions and limitations are called out. -- Changes are easy to revert. - -## Anti-patterns to avoid - -- Embedding product/company-specific guidance in baseline docs. -- Large refactors when a focused change is sufficient. -- Skipping validation without recording why. -- Creating duplicate notes when an update would suffice. - -## Customization policy - -This file should stay generic until real repository-specific patterns emerge. When customizing: - -- Add a clearly labeled section: `Repository-specific overrides`. -- Keep generic workflow unchanged. -- Include evidence (commands, failures, repeated incidents) for each override. diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 94befb4..0f2046f 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -45,6 +45,16 @@ Track only **active, reproducible, unresolved** issues. - **Impact:** CI/local testing blocked. - **Last verified:** 2026-02-14 +### `npm test` hangs/times out in full suite run +- **Status:** Active +- **Area:** Test +- **Symptom:** `npm test` times out after 400s when running all tests together. +- **Trigger/Conditions:** Running `npm test` in CI/Sandbox. +- **Workaround:** Run individual test files or subsets (`npm run validate:scheduler`, `npm run test:integration:e2e`, then specific unit tests). +- **Impact:** Cannot verify all tests in a single pass. +- **Related notes:** `docs/agent-handoffs/incidents/2026-02-16-npm-test-timeout.md` +- **Last verified:** 2026-02-16 + ### Recurring scheduler lock backend failures in recent task logs - **Status:** Monitoring - **Area:** Runtime diff --git a/PROTOCOL_INVENTORY.md b/PROTOCOL_INVENTORY.md index af8d232..037ac57 100644 --- a/PROTOCOL_INVENTORY.md +++ b/PROTOCOL_INVENTORY.md @@ -6,20 +6,36 @@ This file tracks external protocol specifications and libraries used in this rep | Protocol / Spec | Implementation Points | Compliance Status | Notes | | :--- | :--- | :--- | :--- | -| **NIP-01** (Basic Protocol) | `src/lib.mjs`, `src/lock-ops.mjs` | Compliant | Uses `nostr-tools` for event creation, signing, and relay communication. | +| **NIP-01** (Basic Protocol) | `src/lib.mjs`, `src/lock-ops.mjs`, `src/relay-health.mjs` | Compliant | Uses `nostr-tools` for event creation, signing, and relay communication. | | **NIP-04** (Encrypted Direct Message) | N/A | Unknown | Not explicitly used in lock logic, but mentioned in test prompts. | +| **NIP-33** (Parameterized Replaceable Events) | `src/lock-ops.mjs` | Compliant | Defines the mechanics for Kind 30078 updates (d-tags). | +| **NIP-40** (Expiration Timestamp) | `src/lock-ops.mjs` | Compliant | Parses `expiration` tag to filter active locks. | | **NIP-42** (Authentication) | N/A | Unknown | Not currently implemented in lock logic. | -| **NIP-33** (Parameterized Replaceable Events) | `src/lock-ops.mjs` | Compliant | Used for lock events (Kind 30078 is used, which is Application Specific Data, functionally similar to replaceable events). | +| **NIP-78** (Application-specific Data) | `src/lock-ops.mjs` | Compliant | Uses Kind 30078 for distributed lock state. | + +## Other Protocols + +| Protocol | Implementation Points | Compliance Status | Notes | +| :--- | :--- | :--- | :--- | +| **HTTP/1.1** | `src/dashboard.mjs`, `dashboard/` | Compliant | Dashboard server uses Node.js `http` module. | +| **WebSocket** | `src/relay-health.mjs` | Compliant | Raw `ws` usage for health probes; `nostr-tools` for standard relay comms. | +| **JSON** | `src/lock-ops.mjs`, `src/ops.mjs` | Compliant | Ubiquitous for event content and config files. | + +## Internal / Custom Protocols + +| Name | Kind / ID | Implementation | Notes | +| :--- | :--- | :--- | :--- | +| **Relay Health Probe** | Kind `27235` | `src/relay-health.mjs` | Custom ephemeral event kind used for deep reachability checks. | ## Libraries | Library | Version | Usage | Risks | | :--- | :--- | :--- | :--- | -| `nostr-tools` | `2.19.4` | Core Nostr primitives (keys, events, pool). | Supply chain risk. pinned version recommended. | -| `ws` | `8.19.0` | WebSocket client for Node.js. | standard library for Node.js websocket support. | +| `nostr-tools` | `2.19.4` | Core Nostr primitives (keys, events, pool). | Supply chain risk. Pinned version recommended. | +| `ws` | `8.19.0` | WebSocket client for Node.js. | Standard library for Node.js websocket support. | ## Implementation details -- **Locking Mechanism**: Uses Kind 30078 (Application Specific Data) for lock events. +- **Locking Mechanism**: Uses Kind 30078 (NIP-78) with NIP-33 semantics (d-tags) and NIP-40 expiration. - **Relay Communication**: Uses `SimplePool` from `nostr-tools` for querying and publishing. -- **Health Checks**: Uses raw `WebSocket` connections in `src/relay-health.mjs` for deep health probes. +- **Health Checks**: Uses raw `WebSocket` connections in `src/relay-health.mjs` for deep health probes (Kind 27235). diff --git a/src/docs/TORCH.md b/TORCH.md similarity index 68% rename from src/docs/TORCH.md rename to TORCH.md index e26da11..6058b51 100644 --- a/src/docs/TORCH.md +++ b/TORCH.md @@ -1,6 +1,135 @@ # TORCH: Task Orchestration via Relay-Coordinated Handoff -TORCH is a decentralized task-locking protocol for multi-agent software development. +TORCH is a decentralized task-locking protocol for multi-agent software development. This document serves as the primary manual for both human operators and AI agents working within a TORCH-enabled repository. + +--- + +## Agent Operating Guide + +This section defines how agents should work in this repository. + +### Purpose + +- Keep agent work predictable, auditable, and safe. +- Minimize repeated discovery work across sessions. +- Capture durable learnings so future agents can move faster. + +### Session startup checklist (run every session) + +1. **Read `TORCH.md`** (this file). +2. Read `CONTRIBUTING.md` for commit and PR expectations. +3. Read `KNOWN_ISSUES.md` for active blockers and workarounds. +4. Read `docs/agent-handoffs/README.md`. +5. Scan recent notes in: + - `docs/agent-handoffs/learnings/` + - `docs/agent-handoffs/incidents/` +6. If present, review the current run artifacts in: + - `src/context/` + - `src/todo/` + - `src/decisions/` + - `src/test_logs/` + - `src/issues/` + +### Core operating principles + +- Default to generic guidance and neutral language. +- Make the smallest safe change that satisfies the request. +- Avoid unrelated refactors. +- Preserve backward compatibility unless explicitly asked otherwise. +- Prefer explicit commands and documented behavior over assumptions. +- Record assumptions clearly in your final summary. + +### Validation policy + +- Run the most relevant checks for changed files (tests, lint, typecheck, build, or targeted scripts). +- Never claim a check passed unless it was actually executed. +- If a check cannot run, record: + - command attempted, + - why it could not complete, + - what fallback validation was performed. + +### Execution Workflow + +1. **Load baseline context** (see Session startup checklist above). +2. **Clarify the task** + - Restate the requested outcome. + - Identify constraints, risks, and assumptions. +3. **Plan minimal changes** + - Keep scope tight. + - Avoid touching unrelated files. +4. **Implement** + - Apply small, reversible edits. + - Favor readability and maintainability. +5. **Validate** + - Run relevant checks for impacted files. + - Capture exact commands and outcomes. +6. **Document and hand off** + - Summarize what changed and why. + - Record reusable learnings/incidents when appropriate. + +### Working files for session state + +Use the following folders as lightweight coordination artifacts: + +- `src/context/` — Current objective, scope, constraints. +- `src/todo/` — Task checklist and blockers. +- `src/decisions/` — Important design/implementation choices. +- `src/test_logs/` — Validation commands and results. +- `src/issues/` — Investigations or audits that may become tracked issues. + +#### Content templates + +**Context note:** Goal, Scope, Constraints, Open questions. +**Todo note:** Pending tasks, Completed tasks, Blocked tasks. +**Decision note:** Decision, Alternatives considered, Rationale, Consequences/follow-ups. +**Test log:** Command, Result (pass/fail/warn), Notes (environmental limits, retries, artifacts). + +### Knowledge-sharing protocol + +#### What belongs where + +- `KNOWN_ISSUES.md`: Active, reproducible issues only. Include status, impact, workaround, and last verification date. +- `docs/agent-handoffs/learnings/`: Proven patterns, repeatable fixes, and successful implementation guidance. +- `docs/agent-handoffs/incidents/`: Failures, root causes, mitigations, and prevention guidance. +- `src/context/`, `src/todo/`, etc.: Ephemeral session state. + +#### Naming standard + +Use: `YYYY-MM-DD-short-topic.md` (e.g., `2026-02-14-validation-before-summary.md`). +Keep names concise, descriptive, and neutral. + +#### Required sections for reusable notes + +1. Context +2. Observation +3. Action taken +4. Validation performed +5. Recommendation for next agents + +#### Update decision tree + +When you discover reusable context: +1. Check if an existing note already covers it. +2. If yes, update that note. +3. If no, add a new note in `learnings/` or `incidents/`. +4. If the issue is still active/reproducible, add or update `KNOWN_ISSUES.md`. + +### Quality checklist before completion + +- Scope matches request. +- Documentation remains repository-agnostic unless explicitly needed. +- No unsupported claims about testing. +- Assumptions and limitations are called out. +- Changes are easy to revert. + +### Anti-patterns to avoid + +- Embedding product/company-specific guidance in baseline docs. +- Large refactors when a focused change is sufficient. +- Skipping validation without recording why. +- Creating duplicate notes when an update would suffice. + +--- ## Dashboard & Protocol Overview diff --git a/artifacts/onboarding-audit-agent/report.md b/artifacts/onboarding-audit-agent/report.md new file mode 100644 index 0000000..8682692 --- /dev/null +++ b/artifacts/onboarding-audit-agent/report.md @@ -0,0 +1,51 @@ +# Onboarding Audit Report + +**Date:** 2026-02-16 +**Agent:** onboarding-audit-agent + +## Headline +⚠️ Onboarding failures found + +## Environment +- **Platform:** Jules Sandbox (Linux) +- **Node Version:** v22.22.0 +- **npm Version:** 11.10.0 + +## Steps Executed +1. `npm ci` +2. `npm run build` +3. `npm test` +4. `npm run lint` + +## Results + +| Command | Result | Exit Code | Notes | +|---------|--------|-----------|-------| +| `npm ci` | Pass | 0 | Installed dependencies cleanly. | +| `npm run build` | Pass | 0 | Build output to `dist/`. | +| `npm test` | **Fail** | Timeout | Command timed out after 400s. | +| `npm run lint` | Pass | 0 | 12 warnings found (no errors). | + +## Failures + +### `npm test` Timeout +The command `npm test` (which runs `npm run validate:scheduler && npm run test:integration:e2e && node --test test/*.test.mjs tests/*.test.js`) timed out after 401 seconds. + +**Investigation:** +- `npm run validate:scheduler` passed (200ms). +- `npm run test:integration:e2e` passed (692ms). +- `node --test test/*.test.mjs tests/*.test.js` is the likely cause of the timeout. +- Individual runs of `test/lock-ops.test.mjs`, `test/lock-ops-publish-retry.test.mjs`, `test/relay-fanout-quorum.integration.test.mjs`, `test/lock-acquisition-resilience.integration.test.mjs`, and `tests/memory.test.js` all passed quickly. +- The timeout suggests either a deadlock or extreme slowness when running the full suite in this environment. + +### Lint Warnings +`npm run lint` passed but emitted 12 warnings (mostly `no-unused-vars`). These should be addressed but did not break the build. + +## Recommendations +1. **Investigate Test Suite Performance:** The test suite takes too long or hangs in the sandbox environment. Investigate `test/*.test.mjs` for potential deadlocks or resource contention. +2. **Address Lint Warnings:** Clean up unused variables to keep the codebase clean. +3. **Docs Update:** No documentation changes required as the commands are correct, but the execution reliability needs improvement. + +## Actions Taken +- Verified individual test files passed. +- Recorded full timeout failure. diff --git a/artifacts/reproducers/npm-test-timeout/README.md b/artifacts/reproducers/npm-test-timeout/README.md new file mode 100644 index 0000000..3cbc8f1 --- /dev/null +++ b/artifacts/reproducers/npm-test-timeout/README.md @@ -0,0 +1,15 @@ +# npm test timeout reproduction + +## Issue +`npm test` hangs/times out in full suite run. It takes over 400s and times out in sandbox environment. + +## Reproduction +This directory contains a script `repro.sh` that attempts to run `npm test` and times out after 30s to demonstrate the issue without waiting the full duration. + +## Run +```bash +bash artifacts/reproducers/npm-test-timeout/repro.sh +``` + +## Logs +Output is captured in `npm_test_output.log`. diff --git a/artifacts/reproducers/npm-test-timeout/npm_test_output.log b/artifacts/reproducers/npm-test-timeout/npm_test_output.log new file mode 100644 index 0000000..abb95f3 --- /dev/null +++ b/artifacts/reproducers/npm-test-timeout/npm_test_output.log @@ -0,0 +1,805 @@ + +> torch-lock@0.1.0 test +> npm run validate:scheduler && npm run test:integration:e2e && node --test test/*.test.mjs tests/*.test.js + + +> torch-lock@0.1.0 validate:scheduler +> node scripts/validate-scheduler-roster.mjs && node scripts/validate-prompt-contract.mjs && node scripts/validate-scheduler-flow-parity.mjs && npm run validate:scheduler-failure-schema + +Scheduler tables, roster, and prompt filenames are in sync. +Prompt contract validated for all daily/weekly prompts. +Scheduler flow parity validated for prompts and scheduler implementation. + +> torch-lock@0.1.0 validate:scheduler-failure-schema +> node --test test/scheduler-lock-failure-schema.contract.test.mjs + +TAP version 13 +# Subtest: scheduler lock backend failure artifact matches required frontmatter schema +ok 1 - scheduler lock backend failure artifact matches required frontmatter schema + --- + duration_ms: 161.154264 + type: 'test' + ... +# Subtest: schema contract catches missing required lock-backend field +ok 2 - schema contract catches missing required lock-backend field + --- + duration_ms: 2.871179 + type: 'test' + ... +# Subtest: schema contract catches misnamed lock-backend key +ok 3 - schema contract catches misnamed lock-backend key + --- + duration_ms: 0.834819 + type: 'test' + ... +1..3 +# tests 3 +# suites 0 +# pass 3 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 318.644346 + +> torch-lock@0.1.0 test:integration:e2e +> node --test test/scheduler-preflight-lock.e2e.test.mjs + +TAP version 13 +# Subtest: lock preflight e2e: successful lock writes completed status snapshot +ok 1 - lock preflight e2e: successful lock writes completed status snapshot + --- + duration_ms: 452.810254 + type: 'test' + ... +# Subtest: lock preflight e2e: exit code 2 quorum failure persists failed backend status and prompt-not-started marker +ok 2 - lock preflight e2e: exit code 2 quorum failure persists failed backend status and prompt-not-started marker + --- + duration_ms: 102.636238 + type: 'test' + ... +# Subtest: lock preflight e2e: non-lock failure exits failed without prompt parse/schema classification +ok 3 - lock preflight e2e: non-lock failure exits failed without prompt parse/schema classification + --- + duration_ms: 180.269665 + type: 'test' + ... +1..3 +# tests 3 +# suites 0 +# pass 3 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 824.280539 +TAP version 13 +# Subtest: Build artifacts verification + # Subtest: dist directory exists + not ok 1 - dist directory exists + --- + duration_ms: 1.943115 + type: 'test' + location: '/app/test/build_verification.test.mjs:9:11' + failureType: 'testCodeFailure' + error: |- + dist directory should exist + + false !== true + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + actual: false + operator: 'strictEqual' + stack: |- + TestContext. (file:///app/test/build_verification.test.mjs:10:12) + Test.runInAsyncScope (node:async_hooks:214:14) + Test.run (node:internal/test_runner/test:1047:25) + Test.start (node:internal/test_runner/test:944:17) + TestContext.test (node:internal/test_runner/test:373:20) + TestContext. (file:///app/test/build_verification.test.mjs:9:11) + Test.runInAsyncScope (node:async_hooks:214:14) + Test.run (node:internal/test_runner/test:1047:25) + Test.start (node:internal/test_runner/test:944:17) + startSubtestAfterBootstrap (node:internal/test_runner/harness:296:17) + ... + # Subtest: Critical files exist in dist + not ok 2 - Critical files exist in dist + --- + duration_ms: 0.501843 + type: 'test' + location: '/app/test/build_verification.test.mjs:13:11' + failureType: 'testCodeFailure' + error: |- + File index.html should exist in dist + + false !== true + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + actual: false + operator: 'strictEqual' + stack: |- + file:///app/test/build_verification.test.mjs:25:14 + Array.forEach () + TestContext. (file:///app/test/build_verification.test.mjs:23:19) + Test.runInAsyncScope (node:async_hooks:214:14) + Test.run (node:internal/test_runner/test:1047:25) + Test.start (node:internal/test_runner/test:944:17) + TestContext.test (node:internal/test_runner/test:373:20) + TestContext. (file:///app/test/build_verification.test.mjs:13:11) + async Test.run (node:internal/test_runner/test:1054:7) + async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3) + ... + # Subtest: TORCH.md content is not empty + not ok 3 - TORCH.md content is not empty + --- + duration_ms: 0.240573 + type: 'test' + location: '/app/test/build_verification.test.mjs:29:11' + failureType: 'testCodeFailure' + error: "ENOENT: no such file or directory, open '/app/dist/src/docs/TORCH.md'" + code: 'ENOENT' + stack: |- + Object.readFileSync (node:fs:440:20) + TestContext. (file:///app/test/build_verification.test.mjs:31:24) + Test.runInAsyncScope (node:async_hooks:214:14) + Test.run (node:internal/test_runner/test:1047:25) + Test.start (node:internal/test_runner/test:944:17) + TestContext.test (node:internal/test_runner/test:373:20) + TestContext. (file:///app/test/build_verification.test.mjs:29:11) + async Test.run (node:internal/test_runner/test:1054:7) + async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3) + ... + 1..3 +not ok 1 - Build artifacts verification + --- + duration_ms: 4.188468 + type: 'test' + location: '/app/test/build_verification.test.mjs:8:1' + failureType: 'subtestsFailed' + error: '3 subtests failed' + code: 'ERR_TEST_FAILURE' + ... +# Subtest: parseArgs should parse basic command +ok 2 - parseArgs should parse basic command + --- + duration_ms: 1.628077 + type: 'test' + ... +# Subtest: parseArgs should parse agent and cadence +ok 3 - parseArgs should parse agent and cadence + --- + duration_ms: 0.273442 + type: 'test' + ... +# Subtest: parseArgs should parse equals sign syntax +ok 4 - parseArgs should parse equals sign syntax + --- + duration_ms: 3.043129 + type: 'test' + ... +# Subtest: parseArgs should parse dry-run flag +ok 5 - parseArgs should parse dry-run flag + --- + duration_ms: 0.396494 + type: 'test' + ... +# Subtest: parseArgs should parse port with default +ok 6 - parseArgs should parse port with default + --- + duration_ms: 0.220731 + type: 'test' + ... +# Subtest: parseArgs should parse custom port +ok 7 - parseArgs should parse custom port + --- + duration_ms: 0.175744 + type: 'test' + ... +# Subtest: parseArgs should parse ignore-logs flag +ok 8 - parseArgs should parse ignore-logs flag + --- + duration_ms: 0.527959 + type: 'test' + ... +# Subtest: parseArgs should parse memory flags +ok 9 - parseArgs should parse memory flags + --- + duration_ms: 1.240767 + type: 'test' + ... +# Subtest: parseArgs should parse memory flags with equals +ok 10 - parseArgs should parse memory flags with equals + --- + duration_ms: 0.722583 + type: 'test' + ... +# Subtest: src/lib.mjs + # Subtest: cmdCheck + # Subtest: returns correct structure with empty locks + ok 1 - returns correct structure with empty locks + --- + duration_ms: 2.660305 + type: 'test' + ... + # Subtest: identifies locked agents + ok 2 - identifies locked agents + --- + duration_ms: 0.566843 + type: 'test' + ... + # Subtest: excludes paused agents + ok 3 - excludes paused agents + --- + duration_ms: 0.667234 + type: 'test' + ... + # Subtest: identifies unknown locked agents + ok 4 - identifies unknown locked agents + --- + duration_ms: 0.719212 + type: 'test' + ... + 1..4 + ok 1 - cmdCheck + --- + duration_ms: 5.847049 + type: 'suite' + ... + # Subtest: cmdLock + # Subtest: successfully locks an available agent + ok 1 - successfully locks an available agent + --- + duration_ms: 11.539654 + type: 'test' + ... + # Subtest: fails if agent is not in roster + ok 2 - fails if agent is not in roster + --- + duration_ms: 1.014006 + type: 'test' + ... + # Subtest: fails if agent is already locked + ok 3 - fails if agent is already locked + --- + duration_ms: 0.439892 + type: 'test' + ... + # Subtest: fails if agent is already completed + ok 4 - fails if agent is already completed + --- + duration_ms: 0.594932 + type: 'test' + ... + # Subtest: fails if race check is lost + ok 5 - fails if race check is lost + --- + duration_ms: 2.839858 + type: 'test' + ... + # Subtest: handles race condition with identical timestamps using eventId tie-breaker (we win) + ok 6 - handles race condition with identical timestamps using eventId tie-breaker (we win) + --- + duration_ms: 13.94634 + type: 'test' + ... + # Subtest: handles race condition with identical timestamps using eventId tie-breaker (we lose) + ok 7 - handles race condition with identical timestamps using eventId tie-breaker (we lose) + --- + duration_ms: 1.184325 + type: 'test' + ... + # Subtest: dry run does not publish + ok 8 - dry run does not publish + --- + duration_ms: 0.411616 + type: 'test' + ... + 1..8 + ok 2 - cmdLock + --- + duration_ms: 33.349845 + type: 'suite' + ... + # Subtest: cmdList + # Subtest: lists active locks + ok 1 - lists active locks + --- + duration_ms: 0.770961 + type: 'test' + ... + # Subtest: warns about unknown agents + ok 2 - warns about unknown agents + --- + duration_ms: 0.399904 + type: 'test' + ... + # Subtest: handles no locks + ok 3 - handles no locks + --- + duration_ms: 0.367057 + type: 'test' + ... + 1..3 + ok 3 - cmdList + --- + duration_ms: 1.797004 + type: 'suite' + ... + # Subtest: cmdComplete + # Subtest: successfully completes an active lock + ok 1 - successfully completes an active lock + --- + duration_ms: 1.126175 + type: 'test' + ... + # Subtest: fails if no active lock found + ok 2 - fails if no active lock found + --- + duration_ms: 0.374503 + type: 'test' + ... + # Subtest: detects already completed task + ok 3 - detects already completed task + --- + duration_ms: 0.251288 + type: 'test' + ... + 1..3 + ok 4 - cmdComplete + --- + duration_ms: 1.913573 + type: 'suite' + ... + 1..4 +ok 11 - src/lib.mjs + --- + duration_ms: 43.819865 + type: 'suite' + ... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# Published to 1/3 relays (required=1, timeout=25ms) +# [publish:primary] Publishing to 2 relays (wss://relay-a, wss://relay-b)... +# [publish:primary] Publishing to 2 relays (wss://relay-a, wss://relay-b)... +# Published to 2/2 relays (required=2, timeout=25ms) +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# [publish:primary] Publishing to 3 relays (wss://relay-a, wss://relay-b, wss://relay-c)... +# Published to 2/3 relays (required=2, timeout=25ms) +# (node:2900) ExperimentalWarning: The MockTimers API is an experimental feature and might change at any time +# (Use `node --trace-warnings ...` to show where the warning was created) +# Subtest: ci-resilience lock acquisition under unstable relays + # Subtest: recovers after all relays are down for an initial outage window + ok 1 - recovers after all relays are down for an initial outage window + --- + duration_ms: 23.840291 + type: 'test' + ... + # Subtest: survives intermittent timeout spikes and reaches quorum with bounded retries + ok 2 - survives intermittent timeout spikes and reaches quorum with bounded retries + --- + duration_ms: 7.936966 + type: 'test' + ... + # Subtest: handles staggered relay recovery and never exceeds retry budget + ok 3 - handles staggered relay recovery and never exceeds retry budget + --- + duration_ms: 4.671589 + type: 'test' + ... + 1..3 +ok 12 - ci-resilience lock acquisition under unstable relays + --- + duration_ms: 38.603362 + type: 'suite' + ... +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# Published to 1/1 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# Published to 1/1 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# [publish:primary] Publishing to 1 relays (wss://relay-a)... +# (node:2906) ExperimentalWarning: The MockTimers API is an experimental feature and might change at any time +# (Use `node --trace-warnings ...` to show where the warning was created) +# Subtest: publishLock retry behavior + # Subtest: succeeds immediately on first attempt without retries + ok 1 - succeeds immediately on first attempt without retries + --- + duration_ms: 5.474069 + type: 'test' + ... + # Subtest: retries a transient failure then succeeds within retry budget with bounded jitter + ok 2 - retries a transient failure then succeeds within retry budget with bounded jitter + --- + duration_ms: 3.032713 + type: 'test' + ... + # Subtest: returns terminal relay_publish_quorum_failure after exhausting retry budget + ok 3 - returns terminal relay_publish_quorum_failure after exhausting retry budget + --- + duration_ms: 6.480207 + type: 'test' + ... + # Subtest: short-circuits non-retryable failures without extra attempts + ok 4 - short-circuits non-retryable failures without extra attempts + --- + duration_ms: 4.454286 + type: 'test' + ... + 1..4 +ok 13 - publishLock retry behavior + --- + duration_ms: 21.111696 + type: 'suite' + ... +# [publish:primary] Publishing to 2 relays (wss://primary-a, wss://primary-b)... +# [publish:primary] Publishing to 2 relays (wss://primary-a, wss://primary-b)... +# Published to 2/2 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 1 relays (wss://primary-down)... +# [publish:primary] Publishing to 1 relays (wss://primary-down)... +# [publish:primary] Publishing to 1 relays (wss://primary-down)... +# [publish:primary] Publishing to 1 relays (wss://primary-bad)... +# [publish:primary] Publishing to 5 relays (relay-timeout, wss://dns, wss://tcp, wss://tls, wss://ws)... +# [publish:primary] Publishing to 2 relays (wss://relay-bad, wss://relay-ok)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"elapsedMs":1}],"totalElapsedMs":1} +# Published to 1/2 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 1 relays (wss://primary-bad)... +# [publish:fallback] Publishing to 1 relays (wss://fallback-ok)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"elapsedMs":0}],"totalElapsedMs":0} +# Published to 1/2 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 2 relays (wss://bad, wss://healthy)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"elapsedMs":0}],"totalElapsedMs":0} +# Published to 1/2 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 2 relays (wss://healthy, wss://bad)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":2,"elapsedMs":0}],"totalElapsedMs":0} +# Published to 1/2 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 1 relays (wss://healthy)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":1,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":1,"elapsedMs":0}],"totalElapsedMs":0} +# Published to 1/1 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 1 relays (wss://healthy)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":1,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":1,"elapsedMs":0}],"totalElapsedMs":0} +# Published to 1/1 relays (required=1, timeout=200ms) +# [publish:primary] Publishing to 2 relays (wss://primary-a, wss://primary-b)... +# [publish:fallback] Publishing to 1 relays (wss://fallback-healthy)... +# {"event":"lock_publish_quorum_met","correlationId":"none","attemptId":"1","publishAttempt":1,"successCount":1,"relayAttemptedCount":3,"requiredSuccesses":1,"timeoutMs":200,"retryTimeline":[{"publishAttempt":1,"successCount":1,"relayAttemptedCount":3,"elapsedMs":0}],"totalElapsedMs":0} +# Published to 1/3 relays (required=1, timeout=200ms) +# Subtest: lock-ops + # Subtest: parseLockEvent + # Subtest: parses a valid lock event correctly + ok 1 - parses a valid lock event correctly + --- + duration_ms: 1.716055 + type: 'test' + ... + 1..1 + ok 1 - parseLockEvent + --- + duration_ms: 3.018249 + type: 'suite' + ... + # Subtest: queryLocks + # Subtest: falls back to fallback relays when primary query fails + ok 1 - falls back to fallback relays when primary query fails + --- + duration_ms: 16.736135 + type: 'test' + ... + 1..1 + ok 2 - queryLocks + --- + duration_ms: 17.017963 + type: 'suite' + ... + # Subtest: publishLock + # Subtest: retries transient failures and succeeds on a later attempt + ok 1 - retries transient failures and succeeds on a later attempt + --- + duration_ms: 6.464641 + type: 'test' + ... + # Subtest: fails after retry budget is exhausted for persistent transient failures + ok 2 - fails after retry budget is exhausted for persistent transient failures + --- + duration_ms: 2.486588 + type: 'test' + ... + # Subtest: fails without retry for persistent validation failures + ok 3 - fails without retry for persistent validation failures + --- + duration_ms: 1.482804 + type: 'test' + ... + # Subtest: includes per-relay reason categories and retry metadata in failure diagnostics + ok 4 - includes per-relay reason categories and retry metadata in failure diagnostics + --- + duration_ms: 1.999629 + type: 'test' + ... + # Subtest: returns success when mixed relay outcomes still satisfy quorum + ok 5 - returns success when mixed relay outcomes still satisfy quorum + --- + duration_ms: 1.501278 + type: 'test' + ... + # Subtest: uses fallback relays to satisfy min success quorum + ok 6 - uses fallback relays to satisfy min success quorum + --- + duration_ms: 1.321733 + type: 'test' + ... + # Subtest: quarantines repeatedly failing relays and still reaches quorum with one healthy relay + ok 7 - quarantines repeatedly failing relays and still reaches quorum with one healthy relay + --- + duration_ms: 1.884675 + type: 'test' + ... + # Subtest: uses fallback and min active pool to reintroduce quarantined relay when needed + ok 8 - uses fallback and min active pool to reintroduce quarantined relay when needed + --- + duration_ms: 1.10908 + type: 'test' + ... + 1..8 + ok 3 - publishLock + --- + duration_ms: 19.320605 + type: 'suite' + ... + 1..3 +ok 14 - lock-ops + --- + duration_ms: 40.427275 + type: 'suite' + ... +# memory_telemetry { +# event: 'memory:ingested', +# payload: { +# memory_id: 'bfbb3c6e-095d-4ccd-ad5a-140b6927421c', +# agent_id: 'agent-telemetry', +# dedupe_key: '5054d3273b526ef45167a03a7543de870139af75b9b12cfd920ce80e715e7a88', +# chunk_events: 1, +# window_start: 0, +# window_end: 1771301051599 +# }, +# ts: 1771301051603 +# } +# memory_metric { +# metric: 'memory_ingested_total', +# payload: { count: 1 }, +# ts: 1771301051604 +# } +# memory_metric { +# metric: 'memory_retrieved_total', +# payload: { count: 2, cache_hit: false }, +# ts: 1771301051607 +# } +# memory_telemetry { +# event: 'memory:pruned', +# payload: { pruned_count: 1, retention_ms: 1000, dry_run: true }, +# ts: 1771301051608 +# } +# memory_metric { +# metric: 'memory_pruned_total', +# payload: { count: 0, retention_ms: 1000, dry_run: true }, +# ts: 1771301051608 +# } +# memory_telemetry { +# event: 'memory:prune_skipped', +# payload: { reason: 'flag_disabled', retention_ms: 1000 }, +# ts: 1771301051609 +# } +# Subtest: listMemories, inspectMemory, pinMemory, and unpinMemory support admin hooks +ok 15 - listMemories, inspectMemory, pinMemory, and unpinMemory support admin hooks + --- + duration_ms: 2.688735 + type: 'test' + ... +# Subtest: triggerPruneDryRun returns candidate metadata without deleting records +ok 16 - triggerPruneDryRun returns candidate metadata without deleting records + --- + duration_ms: 0.525091 + type: 'test' + ... +# Subtest: memoryStats reports counts/rates and retrieval telemetry remains redaction-safe +ok 17 - memoryStats reports counts/rates and retrieval telemetry remains redaction-safe + --- + duration_ms: 9.591187 + type: 'test' + ... +# Subtest: runPruneCycle respects prune feature-flag modes +ok 18 - runPruneCycle respects prune feature-flag modes + --- + duration_ms: 1.379088 + type: 'test' + ... +# Subtest: stores runtime events in signer/session namespace and clears scope +ok 19 - stores runtime events in signer/session namespace and clears scope + --- + duration_ms: 2.59644 + type: 'test' + ... +# Subtest: expires runtime events and records expiration metrics +ok 20 - expires runtime events and records expiration metrics + --- + duration_ms: 10.478883 + type: 'test' + ... +# Subtest: enforces LRU bounds and tracks eviction metrics +ok 21 - enforces LRU bounds and tracks eviction metrics + --- + duration_ms: 0.718567 + type: 'test' + ... +# Subtest: blocks decrypted/session-sensitive data from durable promotion without sanitizer pass +ok 22 - blocks decrypted/session-sensitive data from durable promotion without sanitizer pass + --- + duration_ms: 0.37624 + type: 'test' + ... +# Subtest: createEmbedderAdapter selects in-memory backend and supports vector CRUD +ok 23 - createEmbedderAdapter selects in-memory backend and supports vector CRUD + --- + duration_ms: 1.638314 + type: 'test' + ... +# Subtest: createEmbedderAdapter reads backend from environment +ok 24 - createEmbedderAdapter reads backend from environment + --- + duration_ms: 2.709345 + type: 'test' + ... +# Subtest: memory feature flags parse defaults and canary allow-lists +ok 25 - memory feature flags parse defaults and canary allow-lists + --- + duration_ms: 1.303503 + type: 'test' + ... +# Subtest: memory prune flag supports off, dry-run, and active modes +ok 26 - memory prune flag supports off, dry-run, and active modes + --- + duration_ms: 0.302096 + type: 'test' + ... +# Subtest: ingestMemoryWindow gathers sources, redacts pii, chunks, embeds, links, and emits telemetry +ok 27 - ingestMemoryWindow gathers sources, redacts pii, chunks, embeds, links, and emits telemetry + --- + duration_ms: 6.119984 + type: 'test' + ... +# Subtest: ingestMemoryWindow dedupes overlapping windows by hashed content + agent + timestamp bucket +ok 28 - ingestMemoryWindow dedupes overlapping windows by hashed content + agent + timestamp bucket + --- + duration_ms: 0.828632 + type: 'test' + ... +# Subtest: createLifecyclePlan respects delete safety constraints and logs reasons +ok 29 - createLifecyclePlan respects delete safety constraints and logs reasons + --- + duration_ms: 2.398993 + type: 'test' + ... +# Subtest: createLifecyclePlan condenses near-duplicates and archives merged source records +ok 30 - createLifecyclePlan condenses near-duplicates and archives merged source records + --- + duration_ms: 0.943965 + type: 'test' + ... +# Subtest: applyLifecycleActions executes keep/archive/delete and merge markers +ok 31 - applyLifecycleActions executes keep/archive/delete and merge markers + --- + duration_ms: 1.383097 + type: 'test' + ... +# Subtest: filterAndRankMemories applies metadata filters and composite score +ok 32 - filterAndRankMemories applies metadata filters and composite score + --- + duration_ms: 2.851358 + type: 'test' + ... +# Subtest: formatMemoriesForPrompt returns prompt blocks and enforces token budget trimming +ok 33 - formatMemoriesForPrompt returns prompt blocks and enforces token budget trimming + --- + duration_ms: 2.468796 + type: 'test' + ... +# Subtest: isMemoryRetrievalEnabled supports global toggle and agent canary list +ok 34 - isMemoryRetrievalEnabled supports global toggle and agent canary list + --- + duration_ms: 0.407381 + type: 'test' + ... +# Subtest: renderPromptWithMemoryContext injects bounded memory block before base prompt +ok 35 - renderPromptWithMemoryContext injects bounded memory block before base prompt + --- + duration_ms: 0.818684 + type: 'test' + ... +# Subtest: createDbAdvisoryLockProvider acquires and releases postgres advisory locks +ok 36 - createDbAdvisoryLockProvider acquires and releases postgres advisory locks + --- + duration_ms: 2.092452 + type: 'test' + ... +# Subtest: startMemoryMaintenanceScheduler runs all jobs and emits metrics including retries +ok 37 - startMemoryMaintenanceScheduler runs all jobs and emits metrics including retries + --- + duration_ms: 26.35814 + type: 'test' + ... +# Subtest: startMemoryMaintenanceScheduler skips jobs when feature flags disable memory +ok 38 - startMemoryMaintenanceScheduler skips jobs when feature flags disable memory + --- + duration_ms: 11.279543 + type: 'test' + ... +# Subtest: normalizeMemoryItem applies durable schema defaults and coercions +ok 39 - normalizeMemoryItem applies durable schema defaults and coercions + --- + duration_ms: 2.535683 + type: 'test' + ... +# Subtest: validateMemoryItem reports field-level errors +ok 40 - validateMemoryItem reports field-level errors + --- + duration_ms: 0.538811 + type: 'test' + ... +# Subtest: ingestEvents rejects invalid writes and logs structured validation details +ok 41 - ingestEvents rejects invalid writes and logs structured validation details + --- + duration_ms: 5.412329 + type: 'test' + ... +# Subtest: loadMemoryPromptTemplates loads all memory prompt templates from disk +ok 42 - loadMemoryPromptTemplates loads all memory prompt templates from disk + --- + duration_ms: 1.458487 + type: 'test' + ... +# Subtest: summarizeEvents retries with repair prompt when first response is malformed JSON +ok 43 - summarizeEvents retries with repair prompt when first response is malformed JSON + --- + duration_ms: 2.152071 + type: 'test' + ... +# Subtest: summarizeEvents falls back to deterministic minimal summary with conservative importance when parsing fails twice +ok 44 - summarizeEvents falls back to deterministic minimal summary with conservative importance when parsing fails twice + --- + duration_ms: 1.661533 + type: 'test' + ... +# Subtest: CLI Smoke Test + # Subtest: should print usage when no args provided + ok 1 - should print usage when no args provided + --- + duration_ms: 169.974982 + type: 'test' + ... + # Subtest: should fail when checking without cadence + ok 2 - should fail when checking without cadence + --- + duration_ms: 168.833829 + type: 'test' + ... + # Subtest: should include paused agents in check output + ok 3 - should include paused agents in check output + --- + duration_ms: 1032.406098 + type: 'test' + ... + 1..3 +ok 45 - CLI Smoke Test + --- + duration_ms: 1374.103911 + type: 'suite' + ... diff --git a/artifacts/reproducers/npm-test-timeout/repro.sh b/artifacts/reproducers/npm-test-timeout/repro.sh new file mode 100644 index 0000000..9edea6b --- /dev/null +++ b/artifacts/reproducers/npm-test-timeout/repro.sh @@ -0,0 +1,17 @@ +#!/bin/bash +echo "Starting reproduction of npm test timeout..." + +# Run npm test with a timeout to simulate the hang/slow behavior. +# The actual issue is a 400s timeout, but we demonstrate it by showing it doesn't complete quickly. +timeout 30s npm test > npm_test_output.log 2>&1 +EXIT_CODE=$? + +if [ $EXIT_CODE -eq 124 ]; then + echo "Reproduced: npm test timed out after 30s (demonstration)." + echo "See npm_test_output.log for partial output." +elif [ $EXIT_CODE -ne 0 ]; then + echo "npm test failed with exit code $EXIT_CODE" + echo "See npm_test_output.log for output." +else + echo "npm test passed (unexpected for reproduction, or it was very fast)" +fi diff --git a/build.mjs b/build.mjs index b45245e..72c5e53 100644 --- a/build.mjs +++ b/build.mjs @@ -8,7 +8,8 @@ const __dirname = path.dirname(__filename); const DIST_DIR = path.join(__dirname, 'dist'); const LANDING_SRC = path.join(__dirname, 'landing'); const DASHBOARD_SRC = path.join(__dirname, 'dashboard'); -const DOCS_SRC = path.join(__dirname, 'src', 'docs'); +const DOCS_SRC = path.join(__dirname, 'docs'); +const TORCH_MD_SRC = path.join(__dirname, 'TORCH.md'); const CONSTANTS_SRC = path.join(__dirname, 'src', 'constants.mjs'); const PROMPTS_SRC = path.join(__dirname, 'src', 'prompts', 'META_PROMPTS.md'); const CONFIG_SRC = path.join(__dirname, 'torch-config.json'); @@ -38,10 +39,15 @@ const distDashboard = path.join(DIST_DIR, 'dashboard'); fs.mkdirSync(distDashboard, { recursive: true }); fs.cpSync(DASHBOARD_SRC, distDashboard, { recursive: true }); -// 3. Copy src/docs/ -> dist/src/docs/ +// 3. Copy docs/ -> dist/src/docs/ const distDocs = path.join(DIST_DIR, 'src', 'docs'); fs.mkdirSync(distDocs, { recursive: true }); -fs.cpSync(DOCS_SRC, distDocs, { recursive: true }); +if (fs.existsSync(DOCS_SRC)) { + fs.cpSync(DOCS_SRC, distDocs, { recursive: true }); +} +if (fs.existsSync(TORCH_MD_SRC)) { + fs.copyFileSync(TORCH_MD_SRC, path.join(distDocs, 'TORCH.md')); +} // 3.5. Copy src/constants.mjs -> dist/src/constants.mjs fs.copyFileSync(CONSTANTS_SRC, path.join(DIST_DIR, 'src', 'constants.mjs')); diff --git a/daily-perf-report-2026-02-16.md b/daily-perf-report-2026-02-16.md new file mode 100644 index 0000000..2be666d --- /dev/null +++ b/daily-perf-report-2026-02-16.md @@ -0,0 +1,23 @@ +# Daily Perf Report: 2026-02-16 + +## Summary +Found and fixed a background CPU usage issue in the Agent Dashboard. No content documentation to audit. + +## P0/P1/P2 Findings + +### P1: Dashboard Background Rendering +- **File**: `dashboard/index.html` +- **Impact**: Unnecessary DOM updates/reflows every 30s when tab is hidden. +- **Fix**: Added `document.hidden` check to `setInterval` and added `visibilitychange` listener. +- **PR**: `perf: visibility-gate dashboard render loop` + +## Metrics +- **Login Time**: N/A (Static Analysis) +- **Decrypt Queue**: N/A +- **Hits Found**: 3 (1 actionable) + +## Blockers +- None. + +## Decisions +- See `src/decisions/DECISIONS_2026-02-16.md` diff --git a/daily-perf-report-2026-02-17.md b/daily-perf-report-2026-02-17.md new file mode 100644 index 0000000..793afb8 --- /dev/null +++ b/daily-perf-report-2026-02-17.md @@ -0,0 +1,7 @@ +# Daily Perf Report 2026-02-17 + +## Summary +Performance scan completed. + +## Findings +See perf/hits-2026-02-17.json for raw hits. diff --git a/dashboard/index.html b/dashboard/index.html index cc15186..f4d7810 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -76,6 +76,13 @@
0 events +
+ + + -