- Replaced innerHTML assignment in dashboard/app.js with DOMParser.
- Updated baseline count in scripts/check-innerhtml.mjs.
- Generated context, todo, decisions, and test logs for innerhtml-migration-agent.
- Executed full scheduler daily flow and published lock/completion.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Extracted scheduler logic into `scheduler-config.mjs`, `scheduler-logger.mjs`, and `scheduler-state.mjs`.
- Updated `run-scheduler-cycle.mjs` to import from these new modules.
- Updated `scripts/validate-scheduler-flow-parity.mjs` to check the new modules for required prompt snippets.
- Updated `test/scheduler-lock-failure-schema.contract.test.mjs` to copy the new dependency modules into the test fixture.
- Reduced `run-scheduler-cycle.mjs` size by ~333 lines.
Co-authored-by: PR0M3TH3AN <[email protected]>
Extracted logic into scheduler-config.mjs, scheduler-logger.mjs, and scheduler-state.mjs to improve maintainability and reduce file size (1160 -> 827 lines). Corrected module imports and verified via linting and dry-run usage.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Implement `scripts/agent/simple-relay.mjs` for local load testing
- Execute `load-test-agent` prompt via scheduler flow
- Generate load test reports and run artifacts
- Complete daily task for `load-test-agent`
Co-authored-by: PR0M3TH3AN <[email protected]>
- Moved `withTimeout` implementation to `src/lock-utils.mjs` and exported it correctly.
- Removed duplicate local definitions of `withTimeout`, `mergeRelayList`, and `secureRandom` in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Fixed imports in `src/lock-ops.mjs`, `src/lock-publisher.mjs`, and `src/relay-health.mjs` to use `src/lock-utils.mjs` consistently.
- Updated `test/utils.test.mjs` and `test/utils-async.test.mjs` to fix broken imports and test definitions.
- Verified `npm run lock:complete` and `npm run scheduler:daily` execute correctly.
- Updated `src/todo/TODO_2026-02-20T03-00-00Z.md` to mark verification task as completed.
- Verified `src/relay-health.mjs` does not use `MINUTE_MS` locally, despite mysterious CI error. Confirmed imports are correct.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Scanned codebase for `setInterval`, `Promise.all`, and other async patterns.
- Generated `reports/performance/hits-2026-02-20.json`.
- Identified potential unbounded concurrency in `src/services/memory`.
- Created daily performance report.
- Updated run artifacts and memory.
Co-authored-by: PR0M3TH3AN <[email protected]>
Adds a cadence-aware time-window check that runs after the Nostr relay lock
check to exclude agents that already ran within the current window (24h daily,
7d weekly). This closes the cross-midnight edge case where the relay's
date-scoped d-tag rolls over but the agent ran minutes ago.
Changes:
- scheduler-utils.mjs: export log-parsing helpers (parseDateValue,
parseTimestampFromFilename, parseAgentFromFilename, isStrictSchedulerLogFilename,
parseFrontmatterCreatedAt, parseFrontmatterAgent, parseFrontmatterValue) plus
CADENCE_WINDOW_MS constant and buildRecentlyRunExclusionSet(). Helpers are
exported so they can be unit-tested independently. Adds 'node:path' import.
- run-scheduler-cycle.mjs: import the moved helpers from utils (removes ~45 lines
of duplicate definitions), call buildRecentlyRunExclusionSet after excludedSet
is built from relay data, merge results, log newly-excluded agents. Adds cycle
saturation detection: when all roster agents are covered by the time-window
guard, exit 0 with a clear "Cycle complete" message instead of a failure.
- test/scheduler-time-window.test.mjs: 30 new scenario-first unit tests covering
SCN-TWG-01..11 (in-window exclusion, out-of-window pass-through, cross-midnight,
frontmatter precedence, weekly threshold, empty dir, missing dir, deferred
log passthrough, mixed rosters, anti-cheat for non-log files).
All 30 new tests pass. Existing scheduler-ratchet tests (7) still pass.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- run-selected-prompt.mjs: set SCHEDULER_MEMORY_FILE env var before spawning each agent so
store.mjs has a well-known path to read from (memory-updates/<ts>__<agent>.md)
- retrieve.mjs: format memories.md using m.summary + date/tags in readable markdown sections
instead of raw m.content blobs; agents can now scan injected context at a glance
- store.mjs: remove semantically-empty fallback placeholder events that polluted the store
and degraded retrieval quality; also fix default cadence 'weekly' -> 'daily' to match retrieve
- scheduler-flow.md: replace vague "write insights" instruction with a concrete three-section
template (Key findings / Patterns / Warnings) and clarify that $SCHEDULER_MEMORY_FILE is
set by the scheduler automatically
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Updated `src/utils.mjs` to detect 'claude' platform via `CLAUDE_API_KEY`, `ANTHROPIC_API_KEY`, or `CLAUDE_SESSION_ID`.
- Updated `scripts/agent/scheduler-utils.mjs` `getSafeEnv` to preserve `JULES_`, `CODEX_`, `CLAUDE_`, `ANTHROPIC_`, and `GOOSE_` environment variables when spawning child processes.
- Updated `scripts/agent/run-scheduler-cycle.mjs` to use `detectPlatform()` as a fallback for `AGENT_PLATFORM` instead of hardcoding `'codex'`, ensuring the correct platform is used for lock creation.
- Added unit tests for `detectPlatform` in `test/utils.test.mjs`.
This resolves the issue where lock cards displayed "Unknown" or incorrect platforms.
Co-authored-by: PR0M3TH3AN <[email protected]>
Implement a comprehensive governance system to manage agent prompt changes safely.
Key features:
- **Proposal Workflow:** Prompt changes are now "proposals" stored in `src/proposals/` with metadata and diffs.
- **Governance Agent:** A new `governance-agent` reviews and applies proposals using `scripts/governance/process-proposals.mjs`.
- **Validation:** Strict validation ensures changes are limited to allowed directories (`src/prompts/daily|weekly`) and preserve required headers.
- **Lock Enhancements:** Lock events now include `promptHash`, `promptPath`, and `gitCommit` for full auditability.
- **Rollback:** New `torch-lock rollback` command restores prompts from local history (`.torch/prompt-history/`) or git.
- **CLI:** Added `proposal` (create, list, show, apply, reject) and `rollback` commands.
This establishes a "Stage -> Evaluate -> Apply" gate for prompt evolution, preventing silent drift and ensuring constitutional stability.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Create scripts/agent/load-test.mjs with nostr-tools and ws.
- Generate load test report in reports/load-test/.
- Verify with dry run.
- Scheduler cycle completion log for load-test-agent.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added "Clean Repo Standard" to `AGENTS.md` and `CLAUDE.md`, explicitly forbidding root-level logs/artifacts.
- Moved clutter files (`test_output_full.txt`, `benchmark-after.txt`, `dashboard.log`, etc.) to `test_logs/`, `task-logs/`, and `reports/performance/`.
- Moved `INITIAL_BASELINE.md` and other baseline files to `reports/performance/`.
- Updated `src/prompts/daily/perf-agent.md` and `src/prompts/daily/const-refactor-agent.md` to reference the new location of `INITIAL_BASELINE.md`.
- Updated `.gitignore` to ignore logs and temporary artifacts in the new directories.
- Moved `DIAGNOSIS.md` to `reports/performance/`.
- Moved `perf/` data files to `reports/performance/`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Executed daily scheduler cycle.
- Selected `decompose-agent` (next in roster).
- Decomposed `scripts/agent/run-scheduler-cycle.mjs` (1127 lines) into `scripts/agent/scheduler-utils.mjs` (195 lines) and `scripts/agent/scheduler-lock.mjs` (173 lines).
- Resulting main file size: 788 lines (339 lines reduction).
- Fixed lint warnings.
- Updated `test/scheduler-preflight-lock.e2e.test.mjs`, `test/run-scheduler-cycle-memory-policy.test.mjs`, `test/scheduler-lock-failure-schema.contract.test.mjs` to copy new modules into test fixtures.
- Updated `test/scheduler-ratchet.test.mjs` to verify moved functions in `scheduler-lock.mjs`.
- Note: `scripts/check-file-size.mjs` was not updated as it lacks the baseline feature referenced in the prompt.
- Created artifacts: `src/context/CONTEXT_...`, `src/decisions/DECISIONS_...`, `src/test_logs/TEST_LOG_...`, `src/todo/TODO_...`.
- Created scheduler log: `task-logs/daily/2026-02-17T22-29-00Z__decompose-agent__completed.md`.
Co-authored-by: PR0M3TH3AN <[email protected]>
`frontend-console-debug-agent` run:
- Fixed a 403 Forbidden error in `src/dashboard.mjs` preventing `src/constants.mjs` from loading by adding it to the `allowedPaths` whitelist.
- Refactored `src/lock-ops.mjs` to fix a critical syntax error in `LockPublisher` class.
- Fixed a typo in `src/cmd-check.mjs` (`queryLocksFn` -> `queryLocks`).
- Added `@playwright/test` for frontend debugging.
- Added `scripts/agent/debug_frontend.mjs` for reproduction.
Co-authored-by: PR0M3TH3AN <[email protected]>