This commit is contained in:
thePR0M3TH3AN committed 2026-02-19 21:09:43 -05:00
commit 0cfb40a410
34 files changed
+1464 -789

No files matched your search

@@ -0,0 +1,18 @@
Run Start: 2026-02-19T10-00-00Z
Cadence: daily
Agent: decompose-agent
Prompt: src/prompts/daily/decompose-agent.md
# Context: Decompose src/lock-ops.mjs
**Target File:** `src/lock-ops.mjs` (880 lines)
**Reason:** Largest JS file in `src/` exceeding the size limit.
**Commit SHA:** e10528141db40674c793884007255fb3c46ed795
**Node Version:** v22.22.0
**Extraction Plan:**
1. Extract `RelayHealthManager` and related functions (`summarizeRelayMetrics`, `computeRelayScore`, `buildRelayHealthConfig`, `defaultHealthManager`, `_resetRelayHealthState`) into `src/relay-health-manager.mjs`.
2. Extract `LockPublisher` and related functions (`classifyPublishError`, `isTransientPublishCategory`, `PUBLISH_ERROR_CODES`, `PUBLISH_FAILURE_CATEGORIES`, `secureRandom`, `calculateBackoffDelayMs`, `publishToRelays`, `publishLock`) into `src/lock-publisher.mjs`.
3. Move shared utilities (`withTimeout`, `relayListLabel`, `mergeRelayList`) to `src/lock-utils.mjs` or ensure correct imports.
4. Update `src/lock-ops.mjs` to import these dependencies.
**Goal:** Reduce `src/lock-ops.mjs` by at least 200 lines.
@@ -0,0 +1,20 @@
# Context: Content Audit Agent Run
Agent: content-audit-agent
Prompt: src/prompts/daily/content-audit-agent.md
Cadence: daily
Run Start: 2026-02-19T22-29-56Z
Run ID: session-1771540169
## Goal
Audit `docs/` for user-facing upload, contribution, and media claims. Verify against code/runtime and update docs where necessary.
## Scope
- Directory: `docs/`
- Target: User-facing documentation (guides, API references).
## Constraints
- Do not invent APIs.
- Prefer docs changes over code changes.
This run is executed by the **content-audit-agent** using the prompt at **src/prompts/daily/content-audit-agent.md**.
@@ -0,0 +1,17 @@
# Context
Agent: deps-security-agent
Cadence: daily
Run Start: 2026-02-20T01-13-24Z
Prompt: src/prompts/daily/deps-security-agent.md
## Goal
Perform daily security audit of dependencies.
## Scope
- Production and Development dependencies in `package.json`.
- `package-lock.json` analysis.
## Constraints
- No breaking changes.
- Safe upgrades only.
- Manual review for crypto/protocol libraries.
@@ -0,0 +1,34 @@
# Context: Decompose src/lock-ops.mjs
## File Selection
- **File:** `src/lock-ops.mjs`
- **Size:** 881 lines (Excess: 581 lines)
- **Selection Reason:** Single largest grandfathered source file available for decomposition.
- **Recent History:** Last significant commit was a merge (`e1052814`). No recent decomposition or major refactor found in `git log`.
## Decomposition Plan
The file contains three major cohesive blocks:
1. **RelayHealthManager**: A class for tracking relay health, scoring, and metrics.
2. **LockPublisher**: A class for publishing lock events with retries and fallback logic.
3. **Lock Operations**: The core `queryLocks` and `parseLockEvent` logic.
### Extraction Strategy
1. **Extract `RelayHealthManager`** into `src/relay-health-manager.mjs`.
- Includes: `RelayHealthManager` class, `defaultHealthManager` instance, `summarizeRelayMetrics`, `computeRelayScore`, `buildRelayHealthConfig`.
- Exports: `RelayHealthManager`, `defaultHealthManager`, `buildRelayHealthConfig`.
2. **Extract `LockPublisher`** into `src/lock-publisher.mjs`.
- Includes: `LockPublisher` class, `publishLock`, `publishToRelays`.
- Includes: `classifyPublishError` and related constants (`PUBLISH_ERROR_CODES`, `PUBLISH_FAILURE_CATEGORIES`).
- Includes: `secureRandom`, `calculateBackoffDelayMs`.
- Internal Helpers (duplicated): `withTimeout`, `relayListLabel`.
- Exports: `publishLock`, `LockPublisher`.
3. **Refactor `src/lock-ops.mjs`**.
- Import `defaultHealthManager`, `buildRelayHealthConfig`, `publishLock`.
- Remove extracted code.
- Retain `queryLocks`, `parseLockEvent`, `filterActiveLocks`.
- Retain `withTimeout` and `relayListLabel` (for local use).
## Goal
Reduce `src/lock-ops.mjs` by > 200 lines.