diff --git a/README.md b/README.md index 16981af..b09f5da 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,9 @@ npx --no-install torch-lock list # Mark a task as completed (permanent) AGENT_PLATFORM=codex npx --no-install torch-lock complete --agent docs-agent --cadence daily +# Convenience script for the above +npm run lock:complete -- --agent docs-agent --cadence daily + # Initialize TORCH in a new repository npx --no-install torch-lock init @@ -65,6 +68,18 @@ npx --no-install torch-lock remove npx --no-install torch-lock dashboard ``` +### Scheduler + +The scheduler automates the selection and execution of agents in a round-robin rotation. + +```bash +# Run full daily scheduler cycle +npm run scheduler:daily + +# Run full weekly scheduler cycle +npm run scheduler:weekly +``` + ### Memory CLI The `torch-lock` CLI also supports memory operations: diff --git a/TORCH.md b/TORCH.md index 167b102..24eb3bb 100644 --- a/TORCH.md +++ b/TORCH.md @@ -377,6 +377,30 @@ Validation behavior: 3. If failures persist past retry window, follow incident runbook `docs/agent-handoffs/learnings/2026-02-15-relay-health-preflight-job.md` and escalate relay/network remediation. - Relay health snapshots are emitted periodically and whenever lock publish/query fails; snapshots include success rate, timeout rate, rolling latency, and quarantine state per relay. +## Scheduler Usage + +The scheduler is the primary entry point for automated agent execution. It handles lock acquisition, environment setup, agent handoff, and artifact verification. + +```bash +# Run the daily rotation +npm run scheduler:daily + +# Run the weekly rotation +npm run scheduler:weekly +``` + +## Lock Management Usage + +Manage distributed locks manually if needed: + +```bash +# Check status of locks +npm run lock:check:daily + +# Manually complete a task lock +npm run lock:complete -- --agent --cadence +``` + ## Scheduler lock reliability reporting Run the lock reliability summary to aggregate recent scheduler outcomes by platform, cadence, backend error category, and relay endpoint: diff --git a/memory-updates/2026-02-20T03-00-00Z__docs-alignment-agent.md b/memory-updates/2026-02-20T03-00-00Z__docs-alignment-agent.md deleted file mode 100644 index 127b36d..0000000 --- a/memory-updates/2026-02-20T03-00-00Z__docs-alignment-agent.md +++ /dev/null @@ -1,14 +0,0 @@ -# Docs Alignment Update: Scheduler Scripts - -Context: -- `README.md` and `TORCH.md` were missing documentation for key development scripts: `scheduler:daily`, `scheduler:weekly`, and `lock:complete`. - -Observation: -- These scripts exist in `package.json` and are critical for testing the scheduler cycle locally. -- `lock:complete` is essential for manual lock release during debugging. - -Action Taken: -- Added `npm run scheduler:daily`, `npm run scheduler:weekly`, and `npm run lock:complete` to the "NPM Scripts (for development)" sections in both `README.md` and `TORCH.md`. - -Recommendation: -- Future agents should check `package.json` scripts when updating documentation to ensure parity. diff --git a/memory-updates/20260220T023152Z__docs-code-investigator.md b/memory-updates/20260220T023152Z__docs-code-investigator.md deleted file mode 100644 index bf72aef..0000000 --- a/memory-updates/20260220T023152Z__docs-code-investigator.md +++ /dev/null @@ -1,15 +0,0 @@ -# Memory Update - docs-code-investigator - 20260220T023152Z - -## Summary -- Documented `src/services/memory/index.js` with a top-level flow/invariants comment and comprehensive JSDoc across all exports. -- Added `docs/memory-index-overview.md` capturing behavior, API contracts, invariants, side effects, call graph, and change guidance. - -## Validation outcomes -- `npm run lint` passes. -- `npm test` fails on existing environment-sensitive issue in `test/scheduler-preflight-lock.e2e.test.mjs` (platform mismatch: `unknown` vs `codex`). -- `test/memory-telemetry.test.mjs` also fails in this environment due empty captured child-process stdout/stderr. -- Targeted memory behavior subset passed: `test/memory-admin`, `test/memory-index`, `test/memory-ingest`, `test/memory-run-prune-cycle`, `test/memory-stats`. - -## Reusable notes -- For environment-sensitive failures, capture direct non-`--test` runs (`node `) to expose hidden assertion details. -- Keep documentation-only runs non-invasive: do not patch tests without spec-correction basis. diff --git a/src/todo/TODO_2026-02-20T03-00-00Z.md b/src/todo/TODO_2026-02-20T03-00-00Z.md index e50f1ce..368902b 100644 --- a/src/todo/TODO_2026-02-20T03-00-00Z.md +++ b/src/todo/TODO_2026-02-20T03-00-00Z.md @@ -1,13 +1,14 @@ # Todo: Docs Alignment - Script Updates ## Pending -- [ ] Update `README.md` to include `scheduler:daily`, `scheduler:weekly`, and `lock:complete`. -- [ ] Update `TORCH.md` to include `scheduler:daily`, `scheduler:weekly`, and `lock:complete`. -- [ ] Verify updated commands run correctly (where applicable/safe). +- None. ## Completed - [x] Audit `README.md` vs `package.json`. - [x] Audit `TORCH.md` vs `package.json`. +- [x] Update `README.md` to include `scheduler:daily`, `scheduler:weekly`, and `lock:complete`. +- [x] Update `TORCH.md` to include `scheduler:daily`, `scheduler:weekly`, and `lock:complete`. +- [x] Verify updated commands run correctly (where applicable/safe). ## Blocked - None. diff --git a/task-logs/daily/.scheduler-run-state.json b/task-logs/daily/.scheduler-run-state.json deleted file mode 100644 index deba731..0000000 --- a/task-logs/daily/.scheduler-run-state.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "run_date": "2026-02-16", - "lock_deferral": null -} diff --git a/task-logs/daily/2026-02-20T01-13-24Z__deps-security-agent__completed.md b/task-logs/daily/2026-02-20T01-13-24Z__deps-security-agent__completed.md deleted file mode 100644 index f6f750f..0000000 --- a/task-logs/daily/2026-02-20T01-13-24Z__deps-security-agent__completed.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -agent: deps-security-agent -platform: jules ---- - -Run completed successfully. -Security report: reports/security/deps-report-2026-02-20T01-13-24Z.md -Vulnerabilities found: 5 (1 High, 4 Moderate). -No safe upgrades identified. diff --git a/task-logs/daily/2026-02-20T01-57-57Z__const-refactor-agent__failed.md b/task-logs/daily/2026-02-20T01-57-57Z__const-refactor-agent__failed.md deleted file mode 100644 index 9b3c729..0000000 --- a/task-logs/daily/2026-02-20T01-57-57Z__const-refactor-agent__failed.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -agent: const-refactor-agent -cadence: daily -status: failed -platform: codex -failure_class: backend_unavailable -failure_category: lock_backend_error -reason: Lock backend error -prompt_executed: false ---- - -# Task Failed: const-refactor-agent (daily) -- **Timestamp:** 2026-02-20T01:57:57Z -- **Agent:** const-refactor-agent -- **Cadence:** daily -- **Status:** failed -- **Platform:** codex - -## Failure reason -`npm run lock:lock` exited with code `2` due to lock backend publish quorum failure. - -## Lock command -`AGENT_PLATFORM=codex npm run lock:lock -- --agent const-refactor-agent --cadence daily` - -## Backend details -- **backend_category:** `relay_publish_non_retryable` -- **correlation_id:** `a11fda80-8f89-4601-ace6-39d045ecc8a1` -- **attempt_id:** `dedb9700-2a18-4877-a243-c30e1cd9ae15` -- **relay_failures:** - - `wss://nos.lol` (`permanent_validation_error`): Received network error or non-101 status code. - - `wss://relay.damus.io` (`permanent_validation_error`): Received network error or non-101 status code. - - `wss://relay.primal.net` (`permanent_validation_error`): Received network error or non-101 status code. - -## Detail -Retry window guidance: run `npm run lock:health -- --cadence daily`, confirm relay connectivity, then retry `npm run lock:lock -- --agent const-refactor-agent --cadence daily`. - -## Scheduler action -Prompt not executed. Completion publish (`lock:complete`) was not attempted. diff --git a/task-logs/daily/2026-02-20T02-03-56Z__content-audit-agent__completed.md b/task-logs/daily/2026-02-20T02-03-56Z__content-audit-agent__completed.md deleted file mode 100644 index 3d3fe3b..0000000 --- a/task-logs/daily/2026-02-20T02-03-56Z__content-audit-agent__completed.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -agent: content-audit-agent -cadence: daily -status: completed -platform: codex ---- - -# Task Completed: content-audit-agent (daily) -- **Timestamp:** 2026-02-20T02:03:56Z -- **Agent:** content-audit-agent -- **Cadence:** daily -- **Status:** completed -- **Platform:** codex - -## Summary of work -Executed the selected daily prompt handoff (`src/prompts/daily/content-audit-agent.md`). -The spawned run completed baseline reads and produced run artifacts/evidence updates for this cadence. - -## Memory evidence -- Retrieval command: `node scripts/memory/retrieve.mjs` -> `MEMORY_RETRIEVED` -- Storage command: `node scripts/memory/store.mjs` -> `MEMORY_STORED` -- Evidence files confirmed: - - `.scheduler-memory/latest/daily/retrieve.ok` - - `.scheduler-memory/latest/daily/store.ok` - -## Validation -- `npm run lint`: PASSED - -## Completion publish -- `AGENT_PLATFORM=codex npm run lock:complete -- --agent content-audit-agent --cadence daily`: PASSED diff --git a/task-logs/daily/2026-02-20T02-05-36Z__design-system-audit-agent__completed.md b/task-logs/daily/2026-02-20T02-05-36Z__design-system-audit-agent__completed.md deleted file mode 100644 index 775c483..0000000 --- a/task-logs/daily/2026-02-20T02-05-36Z__design-system-audit-agent__completed.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -agent: design-system-audit-agent -cadence: daily -date: 2026-02-20 -platform: gemini -status: completed ---- - -# Design System Audit (Completed) - -## Summary -Performed a daily design system audit of the TORCH dashboard. Identified and fixed a raw hex color violation and a token mapping error in `dashboard/styles.css`. - -## Evidence -- **Remediation Report:** `reports/design-system/design-system-report-2026-02-20.md` -- **Memory Retrieval:** `MEMORY_RETRIEVED` (Marker), `.scheduler-memory/latest/daily/retrieve.ok` (Artifact) -- **Memory Storage:** `MEMORY_STORED` (Marker), `.scheduler-memory/latest/daily/store.ok` (Artifact) -- **Lint Check:** Passed (exit 0) -- **Git Commit:** `fa5ef77` ("chore(ui): design system audit autofixes (agent)") -- **Lock Completion:** `LOCK_STATUS=completed` - -## Actions Taken -- Fixed `.text-white` to use `var(--text-strong)` instead of `#fff`. -- Fixed `.text-accent-strong` to use `var(--accent-strong)` instead of `var(--accent)`. -- Verified dynamic inline style in `dashboard/app.js` is allowed by policy for progress bars. - -## Next Steps -- Continue daily audits to ensure new UI components follow the tokenized system. -- Consider tokenizing remaining raw lengths in `dashboard/styles.css` if they are reused. diff --git a/task-logs/daily/2026-02-20T02-09-00Z__docs-agent__completed.md b/task-logs/daily/2026-02-20T02-09-00Z__docs-agent__completed.md deleted file mode 100644 index 52736d6..0000000 --- a/task-logs/daily/2026-02-20T02-09-00Z__docs-agent__completed.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -agent: docs-agent -cadence: daily -date: 2026-02-20 -platform: jules -status: completed ---- - -# Docs Agent Run - -- **Target:** Documentation audit -- **Result:** Successfully audited `README.md`, `CONTRIBUTING.md`. Removed stale audit targets from `docs-agent.md`. -- **Verification:** Lint and Artifact Verification passed. diff --git a/task-logs/daily/2026-02-20T02-28-25Z__decompose-agent__completed.md b/task-logs/daily/2026-02-20T02-28-25Z__decompose-agent__completed.md deleted file mode 100644 index 1aabab9..0000000 --- a/task-logs/daily/2026-02-20T02-28-25Z__decompose-agent__completed.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -agent: decompose-agent -cadence: daily -date: 2026-02-20 -platform: jules -status: completed ---- - -# Decompose Agent Run - -- **Target:** `src/lock-ops.mjs` -- **Result:** Successfully decomposed into `src/relay-health-manager.mjs` and `src/lock-publisher.mjs`. -- **Reduction:** Original 881 lines -> New < 300 lines. -- **Verification:** Lint and Tests passed. diff --git a/task-logs/daily/2026-02-20T02-38-27Z__docs-code-investigator__completed.md b/task-logs/daily/2026-02-20T02-38-27Z__docs-code-investigator__completed.md deleted file mode 100644 index 51ef3b6..0000000 --- a/task-logs/daily/2026-02-20T02-38-27Z__docs-code-investigator__completed.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -agent: docs-code-investigator -cadence: daily -date: 2026-02-20 -platform: codex -status: completed ---- - -# docs-code-investigator Run - -## Summary - -Successfully documented `src/services/memory/index.js` with comprehensive JSDoc comments and module overview. - -## Changes Made - -- Added module flow/invariant comment at top of `src/services/memory/index.js` -- Added/expanded JSDoc for all exported APIs with `@param`, `@returns`, `@throws`, and `@example` tags -- Created `docs/memory-index-overview.md` with full A→K module analysis -- Created required run artifacts: - - `src/context/CONTEXT_20260220T023152Z.md` - - `src/todo/TODO_20260220T023152Z.md` - - `src/decisions/DECISIONS_20260220T023152Z.md` - - `src/test_logs/TEST_LOG_20260220T023152Z.md` -- Captured unresolved reproducible failures: - - Updated `KNOWN_ISSUES.md` with 2 new active issues - - Added incident note `docs/agent-handoffs/incidents/2026-02-20-codex-test-failures-platform-and-telemetry.md` - -## Validation - -| Command | Result | Notes | -|---------|--------|-------| -| `npm run lint` | PASS | No lint violations | -| `npm test` | FAIL | Existing environment-sensitive failures (platform mismatch, telemetry test) | -| `node --test test/memory-admin.test.mjs test/memory-index.test.mjs test/memory-ingest.test.mjs test/memory-run-prune-cycle.test.mjs test/memory-stats.test.mjs` | PASS | Targeted module tests pass | - -## Memory Contract - -- Retrieval: `MEMORY_RETRIEVED` - evidence in `.scheduler-memory/docs-code-investigator-20260220T023152Z/retrieve.json` -- Storage: `MEMORY_STORED` - evidence in `.scheduler-memory/docs-code-investigator-20260220T023152Z/store.json` - -## Lock Events - -- Lock acquired: `0b4996a22e591ec427d453b037e577ce8658a97a278920cf005b82237889b754` -- Completion published: `0727a8724551d294429f1a4aed907f4fc65a6a6a1e5b9ad3c5aa825d4b12ba03` diff --git a/task-logs/daily/2026-02-20T03-00-00Z__docs-alignment-agent__completed.md b/task-logs/daily/2026-02-20T03-00-00Z__docs-alignment-agent__completed.md deleted file mode 100644 index c534416..0000000 --- a/task-logs/daily/2026-02-20T03-00-00Z__docs-alignment-agent__completed.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -agent: docs-alignment-agent -cadence: daily -date: 2026-02-20 -platform: jules -status: completed -run-start: 2026-02-20T03-00-00Z -run-end: 2026-02-20T03-00-00Z ---- - -# Docs Alignment Agent Run - -## Summary -Audited `README.md` and `TORCH.md` against `package.json` scripts. Added missing documentation for `scheduler:daily`, `scheduler:weekly`, and `lock:complete` to align with available tools. - -## Artifacts -- src/context/CONTEXT_2026-02-20T03-00-00Z.md -- src/todo/TODO_2026-02-20T03-00-00Z.md -- src/decisions/DECISIONS_2026-02-20T03-00-00Z.md -- src/test_logs/TEST_LOG_2026-02-20T03-00-00Z.md - -## Outcomes -- Updated `README.md`. -- Updated `TORCH.md`. -- Verified changes with manual checks (grep) and linting. diff --git a/task-logs/dashboard.log b/task-logs/dashboard.log deleted file mode 100644 index b9f5847..0000000 --- a/task-logs/dashboard.log +++ /dev/null @@ -1,8 +0,0 @@ - -> torch-lock@0.1.0 dashboard:serve -> node bin/torch-lock.mjs dashboard - -Dashboard running at http://null:4173/dashboard/ -Authentication: DISABLED (Dashboard is public) -Serving files from /app -Using configuration from /app diff --git a/task-logs/dashboard_verify.log b/task-logs/dashboard_verify.log deleted file mode 100644 index b9f5847..0000000 --- a/task-logs/dashboard_verify.log +++ /dev/null @@ -1,8 +0,0 @@ - -> torch-lock@0.1.0 dashboard:serve -> node bin/torch-lock.mjs dashboard - -Dashboard running at http://null:4173/dashboard/ -Authentication: DISABLED (Dashboard is public) -Serving files from /app -Using configuration from /app