Commit Graph
52 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 32ba0d2621 perf(scheduler): parallelize log file reading in getLatestFile
Optimizes the `getLatestFile` function in `scripts/agent/run-scheduler-cycle.mjs` by parallelizing the reading and parsing of log files using `Promise.all`. This replaces the sequential `for...of` loop which caused I/O bottlenecks when processing large numbers of log files.

Measured improvement: ~56% faster (530ms -> 207ms) for 1000 log files.

Also removed a tracked `test_output.log` file that shouldn't be in the repository.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:37:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN fa4c9ca175 perf: optimize lock failure reason summarization
Replace inefficient `[...events].reverse().find()` with `events.findLast()`.
This avoids a shallow copy of the array and an in-place reverse,
improving performance from O(N) space/time to O(1) space and O(N) time
(where N is the number of events searched).

In benchmarks with 100,000 events:
- Element near the end: 99.9% improvement (~0.8ms vs ~950ms)
- Element at the beginning: ~42% improvement (~145ms vs ~250ms)

Node.js v18.6.0+ is required for `findLast`, which is supported in the
current environment (v22.22.0).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:11:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2a39713189 feat(scheduler): generate unique memory update files per run to avoid merge conflicts
- Modified `scripts/agent/run-scheduler-cycle.mjs` to generate a unique `memory-updates/<timestamp>__<agent>.md` path and pass it via `SCHEDULER_MEMORY_FILE` env var.
- Updated `scripts/memory/store.mjs` to prioritize `SCHEDULER_MEMORY_FILE` for ingestion.
- Updated `src/prompts/scheduler-flow.md` to instruct agents to write to the unique memory file.
- Updated `src/prompts/daily/torch-garbage-collection-agent.md` to include `memory-updates/*.md` in the cleanup scope.
- Moved existing `memory-update.md` to `memory-updates/legacy-memory-update-<timestamp>.md` to clear the root.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 15:19:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 825d596a59 Weekly dead-code-agent execution: removed scripts/fix-duplication.mjs and src/services/memory/db-adapter.js
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 14:33:14 +00:00
google-labs-jules[bot]andPR0M3TH3AN 44884cc0c0 Make memory system usable by agents via file-based I/O
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 02:50:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 58c4f14d57 docs(prompts): sync roster.json and scheduler rosters
- Updated roster.json based on prompt directory scan.
- Regenerated daily and weekly scheduler markdown tables.
- Added run artifacts and task log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 02:10:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN d23e6ff0b3 Refactor memory scripts and fix configuration for new installs
- Replaced fragile inline Node.js scripts in `torch-config.json` with dedicated modules: `scripts/memory/retrieve.mjs` and `scripts/memory/store.mjs`.
- Updated `src/ops.mjs` initialization logic to dynamically configure `scheduler.memoryPolicyByCadence` with correct paths based on the installation directory.
- Added default memory policy configuration to `torch-config.example.json` to guide users.
- Injected `torch:memory:list` and `torch:memory:inspect` convenience scripts into the host `package.json` during `init`.
- Removed legacy shell scripts (`run-memory-retrieval.sh`, `run-memory-store.sh`).
- Verified memory scripts function correctly and pass linting.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:19:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN d02fa41079 fix(scheduler): relax prompt validation and correct default lint command
- Update `scripts/agent/run-scheduler-cycle.mjs` to allow prompt files to start with a blockquote (`>`) in addition to a markdown header (`#`), unblocking agents with shared contract headers.
- Fix default validation command from `['npm', 'run', 'lint']` to `['npm run lint']` to prevent `npm` usage errors.
- Include daily task logs demonstrating successful scheduler cycle execution (skipping failed locks and completing `load-test-agent`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:33:37 +00:00
thePR0M3TH3AN 118c365022 Merge branch 'main' into feat/nostr-platform-model-info-17811919130475421613 2026-02-15 17:41:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN 754a1c2ce1 feat: support platform and model info in nostr lock events
This change enables agents to report their execution platform (e.g., Jules, Codex, Goose) and model (e.g., DeepSeek 3.2) in the Nostr lock events.

Key changes:
- Updated `torch-lock` CLI to accept `--platform` and `--model` arguments.
- Implemented `detectPlatform` utility to infer platform from environment variables if not provided.
- Updated `src/lib.mjs` to include these fields in the event content.
- Updated `scripts/agent/run-scheduler-cycle.mjs` to propagate `--model` and `AGENT_MODEL`.
- Updated `dashboard/index.html` to display the model information on the lock card.
- Fixed a regression in `scripts/validate-scheduler-flow-parity.mjs` and `test/scheduler-ratchet.test.mjs` caused by argument string matching.
- Deleted `repro_test.mjs` temporary file.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 20:18:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 512a0413c7 feat: truncate logs and inject memory into prompts to reduce token burn
This change implements several optimizations to reduce token consumption and improve agent context:

1.  **Log Truncation**: `scripts/agent/run-scheduler-cycle.mjs` now truncates the echoed output of spawned processes to 20KB per stream (stdout/stderr). This prevents the scheduler agent's context from being flooded with excessive logs from sub-agents.
2.  **Memory Injection**: `torch-config.json`'s `retrieveCommand` has been updated to write retrieved memories to `.scheduler-memory/latest/<cadence>/memories.md`. `scripts/agent/run-selected-prompt.mjs` now checks for this file and injects its content into the agent's prompt, providing immediate context from the memory system.
3.  **CLI Optimization**: The `torch-lock list-memories` command now truncates the `content` field of memories to 200 characters by default. A new `--full` flag has been added to `src/cli-parser.mjs` and `src/lib.mjs` to view the full content when needed.

These changes aim to make the agent process more efficient ("error on the side of caution") and leverage the memory system more effectively.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 19:55:20 +00:00
thePR0M3TH3AN 3156ee0bb5 Merge branch 'main' of https://github.com/PR0M3TH3AN/TORCH 2026-02-15 14:27:20 -05:00
thePR0M3TH3AN c20af61643 making Torch more Goose friendly 2026-02-15 14:27:11 -05:00
google-labs-jules[bot]andPR0M3TH3AN 64f22cd741 feat(scheduler): implement smoke-agent and complete weekly run
- Added `scripts/agent/smoke-test.mjs` for automated smoke testing.
- Executed smoke test against `wss://relay.damus.io`.
- Verified event publication and retrieval.
- Completed scheduler cycle for `smoke-agent`.
- Added completion log `task-logs/weekly/2026-02-15T19-00-40Z__smoke-agent__completed.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 19:01:58 +00:00
google-labs-jules[bot]andPR0M3TH3AN f5e857b3d0 feat: support linux platform in agent runner
- Updated scripts/agent/run-selected-prompt.mjs to support AGENT_PLATFORM=linux.
- Updated src/docs/TORCH.md to document the new platform support.
- Generated weekly task log for repo-fit-agent.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 16:23:37 +00:00
google-labs-jules[bot]andPR0M3TH3AN eddfbd7039 Weekly prompt-safety-agent run: Audited 41 prompts
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 01:46:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN eff5f1db81 chore: run daily perf-agent and fix validation
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 01:35:36 +00:00
thePR0M3TH3AN 969b72d3e1 Add scheduler error rendering snapshot coverage 2026-02-14 20:10:26 -05:00
thePR0M3TH3AN c1d0de071c test: add scheduler lock failure frontmatter contract coverage 2026-02-14 20:01:32 -05:00
thePR0M3TH3AN ccc76d8b51 Add scheduler lock preflight e2e coverage 2026-02-14 19:56:25 -05:00
thePR0M3TH3AN 874747de91 Classify scheduler failures and document lock remediation 2026-02-14 19:42:03 -05:00
thePR0M3TH3AN 1e97118e8b Add relay health preflight job and scheduler deferral handling 2026-02-14 19:35:56 -05:00
thePR0M3TH3AN 46198a500e Improve lock publish diagnostics and scheduler failure summaries 2026-02-14 19:30:00 -05:00
thePR0M3TH3AN 9aad0d933d Add lock deferral policy for scheduler backend failures 2026-02-14 19:23:37 -05:00
google-labs-jules[bot]andPR0M3TH3AN dd27f28f3b feat(ai): add load-test-agent script
- Added `scripts/agent/load-test.mjs` for daily load testing.
- Includes `DRY_RUN` mode for safe simulation.
- Includes real publishing logic using `nostr-tools/relay` and `nostr-tools/pure`.
- Generated sample report in `artifacts/`.
- Updated `task-logs/daily/` with completion status.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 00:01:16 +00:00
thePR0M3TH3AN ecb26dfa99 Improve scheduler lock observability and reliability reporting 2026-02-14 18:42:52 -05:00
thePR0M3TH3AN bc51e2f2e8 Add scheduler relay health preflight gate 2026-02-14 18:36:01 -05:00
thePR0M3TH3AN 9c069f75a6 Add scheduler lock retries for backend failures 2026-02-14 18:29:55 -05:00
thePR0M3TH3AN c38dfe1258 Enrich scheduler lock backend failure logging 2026-02-14 18:23:52 -05:00
thePR0M3TH3AN 827c7038c9 Harden scheduler log candidate selection 2026-02-14 18:10:29 -05:00
thePR0M3TH3AN 909a7f9541 Strengthen run-artifact verification metadata and issue linkage 2026-02-14 18:05:54 -05:00
thePR0M3TH3AN e4f700bdab Add scheduler flow parity validation script 2026-02-14 17:49:48 -05:00
thePR0M3TH3AN aec210b195 Strengthen run artifact content validation 2026-02-14 17:46:11 -05:00
thePR0M3TH3AN 26b65f273f Add scheduler handoff runner for selected prompts 2026-02-14 17:38:20 -05:00
thePR0M3TH3AN 5e74287a57 Align scheduler flow docs with runtime behavior 2026-02-14 17:28:31 -05:00
thePR0M3TH3AN 0076f3eb1d Normalize daily/weekly prompt contract and add validator 2026-02-14 17:24:49 -05:00
thePR0M3TH3AN 711f2bc62f docs(prompts): fix canonical artifact paths and lint invalid refs 2026-02-14 17:10:17 -05:00
thePR0M3TH3AN d997963ea7 Enforce scheduler memory workflow and verification 2026-02-14 17:05:47 -05:00
thePR0M3TH3AN 5221225a1f Add scheduler run artifact compliance gate 2026-02-14 17:01:23 -05:00
thePR0M3TH3AN a48f8743f4 Require scheduler handoff command for valid task execution 2026-02-14 16:58:56 -05:00
thePR0M3TH3AN fce1256200 feat(scheduler): add single-command scheduler cycle runner 2026-02-14 16:51:55 -05:00
thePR0M3TH3AN 5b0cf980e9 Align scheduler tables with roster and add drift check 2026-02-14 16:09:00 -05:00
thePR0M3TH3AN 30d758ae21 Merge branch 'main' into perf/dashboard-async-io-13493420652733485580 2026-02-14 12:11:33 -05:00
thePR0M3TH3AN 47763bd123 Merge pull request #69 from PR0M3TH3AN/refactor/configurable-exclusions-982175267044475659
Refactor check scripts to support configurable exclusions
2026-02-14 09:30:56 -05:00
google-labs-jules[bot]andPR0M3TH3AN 0448ed2932 Optimize dashboard static file serving with async I/O
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:18:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN cd7b19ead7 Optimize dashboard static file serving with async I/O
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6fdc092441 refactor: make exclusions in check scripts configurable
Refactor `scripts/check-file-size.mjs` and `scripts/check-innerhtml.mjs` to use `node:util.parseArgs` for parsing command-line arguments. This allows users to configure directory and file exclusions via `--exclude-dir`, `--exclude-file`, and `--no-defaults`, instead of relying on hardcoded lists.

This change improves versatility while maintaining backward compatibility by keeping the original hardcoded lists as defaults. It also adds support for `--max-lines` in `check-file-size.mjs` and `--help` in both scripts.

Verification:
- Manually verified that both scripts respect the new flags and defaults.
- Confirmed that `--report` mode still works as expected.
- Confirmed that unknown flags (like `--update`) are safely ignored (due to `strict: false`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9716fe3812 perf: parallelize daily/weekly lock queries in list command
- Modified `src/lib.mjs` to execute `queryLocks` for all cadences in parallel.
- Added `scripts/perf-benchmark.mjs` for measuring CLI performance.
- Added `weekly-perf-report-2026-02-14.md` with baseline and verification data.
- Added `task-logs/weekly/2026-02-14T13-14-38Z__perf-deepdive-agent__completed.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:17:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 36cd585fba fuzz-agent: fix parseLockEvent crash on null content
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 08:57:47 +00:00
thePR0M3TH3AN ec8969dde7 Merge branch 'main' into audit-agent-fix-2548023414882189291 2026-02-14 01:23:03 -05:00