Merge pull request #2548 from PR0M3TH3AN/agents/daily/content-audit-agent-8847531088272676405

daily: content-audit-agent
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-16 06:17:25 -05:00
commit 8f24dd91c2
86 files changed
+21 -1176

No files matched your search

-23
View File
@@ -1,23 +0,0 @@
# Decisions Log - Decompose Agent
## Changes
Extracted "Similar Video" and pointer derivation logic from \`js/ui/components/VideoModal.js\` into a new module \`js/ui/components/VideoModalSimilarHelpers.js\`.
## Rationale
- \`js/ui/components/VideoModal.js\` was the second largest file (6334 lines).
- Similar Video logic formed cohesive blocks with clear dependencies.
- Pointer derivation was a helper function reused internally.
## Implementation Details
- Created \`js/ui/components/VideoModalSimilarHelpers.js\` containing:
- \`derivePointerKeyFromInput\`
- \`buildSimilarCardIdentity\`
- \`prepareSimilarVideoCard\`
- \`attachSimilarCardViewCounter\`
- \`getViewCountLabel\`
- \`formatViewCountLabel\`
- Updated \`js/ui/components/VideoModal.js\` to import these functions and pass dependencies (\`this.helpers\`, \`this.DEFAULT_PROFILE_AVATAR\`, \`this.dispatch\`, \`this.log\`).
- Updated \`scripts/check-file-size.mjs\` baseline for \`VideoModal.js\` to 6045 lines.
## Next Steps
- Further decomposition of \`VideoModal.js\` (e.g. More Menu logic) in future runs.
@@ -1,6 +0,0 @@
# Decisions
- Used `npm` as the package manager because `package-lock.json` exists (per prompt detection rule), even though `pnpm-lock.yaml` is also present.
- Continued with read-only audit/outdated collection after `npm ci` failed, because `npm audit --json` and `npm outdated --json` still produced valid artifacts.
- Did **not** attempt dependency upgrades in this run due to Node engine incompatibility (`required >=22`, actual `20.19.6`), to avoid non-reproducible lockfile churn and invalid test evidence.
- Marked this daily run as completed with warnings rather than failed, since required artifacts and triage report were produced successfully.
@@ -1,12 +0,0 @@
# DECISIONS: innerHTML Migration for js/channelProfile.js
- **Zap Panel (`panel.innerHTML`)**: The HTML is static and large. Replacing it with `createElement` calls will make the code verbose. However, this is the standard way to avoid `innerHTML`. I will extract the creation logic into a helper function `createZapPanelContent` to keep the main `setupZapButton` function clean.
- **Subscribe Button**: The HTML is small. I will use `createElement`.
- **Loading/Error States**: These are simple. I will use `createElement`.
- **Clearing Content**: Using `replaceChildren()` is the modern, safe way to clear an element.
## Strategy for Zap Panel
Since the Zap Panel HTML is complex, I'll break it down into logical sections (header, form, etc.) within the helper function.
## Strategy for Subscribe Button
The button has dynamic text based on `alreadySubscribed`. I will create the button and icon elements and set their properties.
@@ -1,6 +0,0 @@
# Decisions
## Visibility Gating for VideoEventBuffer
- **Problem**: `VideoEventBuffer` flushes every 75ms if events are arriving, triggering UI updates via `onVideo` callback even if the tab is hidden.
- **Solution**: Check `document.hidden` in `flush()`. If hidden, process events into internal state (`activeMap`) but skip `onVideo` and buffer the updated video objects. On `visibilitychange` (visible), flush the buffered video objects to UI.
- **Tradeoff**: Memory usage might increase slightly to hold pending video references, but CPU usage on main thread (layout/paint) will decrease significantly.
@@ -1,3 +0,0 @@
# Decisions: NIP Research Agent Run 2026-02-13
- Decided to use local mock implementation for bytesToHex in tests to avoid dependency issues.
- Verified Kind 30078 using internal schema definition.
@@ -1,7 +0,0 @@
# Decisions
- **File:** `js/subscriptions.js`
- **Migration:** Replaced `innerHTML` assignments with `replaceChildren()` and `document.createElement()`.
- **Helpers:** Added `_renderStatusMessage` and `_renderLoading` to `SubscriptionsManager` to encapsulate DOM creation for status and loading states.
- **Dependency:** Removed dependency on `getSidebarLoadingMarkup` (which returned a string) in this file, preferring local DOM creation.
- **Baseline:** Updated baseline for `js/subscriptions.js` from 7 to 0.
-3
View File
@@ -1,3 +0,0 @@
# Decisions - Content Audit Agent 2026-02-14
*(None yet)*
@@ -1,13 +0,0 @@
# Decisions: NIP-07 and NIP-46 Timeout Refactor
## NIP-07 Extension Timeout
- **Value**: `5000` ms.
- **Constant**: `NIP07_EXTENSION_WAIT_TIMEOUT_MS`.
- **Location**: `js/nostr/nip07Permissions.js`.
- **Reasoning**: This module exports `waitForNip07Extension`, so it is the natural home for the default timeout constant. `SignerManager.js` imports it from there.
## NIP-46 Ping Timeout
- **Value**: `5000` ms.
- **Constant**: `NIP46_PING_TIMEOUT_MS`.
- **Location**: `js/nostr/nip46Client.js`.
- **Reasoning**: Specific to the `ping()` RPC call in this client. Kept local to the file as it's not widely shared.
@@ -1,5 +0,0 @@
# Decisions: Content Audit
- **Decision:** Trust the codebase as the source of truth.
- **Decision:** If documentation matches code, no changes are needed, but artifacts must be produced to prove the audit was performed.
- **Decision:** "Recommended" limits in docs are acceptable even if not strictly enforced by server code, as they reflect client-side constraints (hashing memory).
@@ -1,18 +0,0 @@
# Decisions: Daily Dependency Audit
- **Date**: 2026-02-14
## Decision 1: Skip Auto-Upgrade of `nostr-tools`
- **Context**: `nostr-tools` has a minor update available (2.19.4 -> 2.23.1).
- **Rationale**: The agent instructions explicitly state: "Do not auto-upgrade cryptographic/protocol libraries... without maintainers’ approval."
- **Outcome**: Logged in report, no action taken.
## Decision 2: Skip Major Upgrades
- **Context**: `tailwindcss`, `stylelint`, `postcss-import`, `pixelmatch` have major updates.
- **Rationale**: Major upgrades are risky and require manual testing/migration.
- **Outcome**: Logged in report.
## Decision 3: Skip Minor DevDeps
- **Context**: `prettier-plugin-tailwindcss` has a minor update.
- **Rationale**: To keep the daily run clean and focused on reporting first, skipping minor dev dep bump for now.
- **Outcome**: Logged in report.
@@ -1,16 +0,0 @@
# Decisions: 2026-02-14
## Triage Decisions
### nostr-tools (2.19.4 -> 2.23.1)
- **Decision**: SKIP (Requires Review)
- **Reason**: Security-sensitive library (NIP-46, NIP-07, Crypto). Policy prohibits auto-upgrade without human review.
### stylelint (16.12.0 -> 16.26.1)
- **Decision**: CANDIDATE (Safe)
- **Reason**: Minor version update within same major version (16.x). Low risk devDependency.
- **Action**: Deferred to manual PR or separate task to keep scheduler run clean.
### Major Upgrades (pixelmatch, postcss-import, stylelint-config-standard, tailwindcss)
- **Decision**: SKIP (Major)
- **Reason**: Major version bumps require breaking change analysis and potential migration.
@@ -1,30 +0,0 @@
# Decisions - RevertModal innerHTML Migration
## Context
`js/ui/components/RevertModal.js` had 10 assignments to `innerHTML`, making it a high-priority target for migration to safe DOM APIs. The file builds complex UI structures for revision history, including metadata, tags, and media variants.
## Strategies
### 1. DOM Construction
Replaced template strings with `document.createElement`.
- Created helper methods (`createPlaceholder`, `createListEmpty`, `createLinkMarkup`) to standardize element creation.
- Used `DocumentFragment` where appropriate to minimize reflows, though direct appending to parent was used for simplicity in linear structures.
### 2. Complex Renderers Extraction
The file size of `RevertModal.js` grew significantly (from ~1660 lines to ~1900 lines) due to the verbosity of DOM API vs template strings.
- **Decision:** Extracted complex rendering logic (IMeta variants, tracks, segments, participants, etc.) into a new module: `js/ui/components/revertModalRenderers.js`.
- This reduced the main file size and kept it compliant with linting rules.
- Dependencies (`createPlaceholder`, etc.) are passed to these renderers via a `utils` object to avoid tight coupling or circular dependencies.
### 3. Initialization
- Replaced `wrapper.innerHTML = html` in `load()` with `DOMParser`.
- Replaced `this.details.innerHTML = this.detailsDefaultHTML` in `reset()` with `DOMParser`.
- While `detailsDefaultHTML` is trusted (sourced from static template), using `DOMParser` ensures 0 usages of `innerHTML` in the file.
### 4. Tests
- Updated `tests/modal-accessibility.test.mjs` to mock `DOMParser` in the Node.js test environment (JSDOM).
## Results
- `innerHTML` count for `RevertModal.js`: 0 (removed from baseline).
- File size violation resolved by extraction.
- Functionality preserved (verified via unit tests).
-5
View File
@@ -1,5 +0,0 @@
# Decisions
- Using `grep` to find performance patterns.
- Focusing on `js/ui/loginModalController.js` for visibility gating as suggested by memory.
- Will verify `/content` docs against code.
Whitespace-only changes.
@@ -1,5 +0,0 @@
# Decisions - Scheduler Update Agent Run
## 1. No changes applied
- **Rationale**: The rosters in `daily-scheduler.md` and `weekly-scheduler.md` already perfectly match the file inventory on disk.
- **Action**: Skipped writing to scheduler files to avoid unnecessary commits/churn.
@@ -1,3 +0,0 @@
# Decisions
- Using `test-audit/` directory for temporary artifacts.
@@ -1,3 +0,0 @@
# Test Audit Decisions - 2026-02-15_22-02-44
No decisions made yet.
@@ -1,3 +0,0 @@
# Decisions: Daily Audit Agent Run
- **Comparison Baseline**: Using `artifacts/audit/2026-02-12/` as the baseline for comparison since it's the most recent report available in the artifacts directory.