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

-10
View File
@@ -1,10 +0,0 @@
# Decompose Agent Context
## Target File
`js/ui/components/VideoModal.js` (approx 6334 lines).
## Rationale
This is the second largest file in the codebase. The largest (`profileModalController.js`) was recently refactored with a facade pattern. `VideoModal.js` was touched recently but likely only for minor updates or formatting, and contains distinct blocks of logic suitable for extraction.
## Plan
Extract "Similar Video" related logic into a helper module.
-11
View File
@@ -1,11 +0,0 @@
# Context
**Goal:** Execute the `bitvid-deps-security-agent` daily task.
**Scope:** Run dependency security checks and update agent state/log artifacts per the prompt.
**Focus:** Produce a current vulnerability report and track execution in agent logs.
**Definition of Done:**
- [ ] Claim task with draft PR and CSV `started` entry.
- [ ] Follow `docs/agents/prompts/daily/bitvid-deps-security-agent.md` end-to-end.
- [ ] Update `CONTEXT.md`, `TODO.md`, `DECISIONS.md`, and `TEST_LOG.md`.
- [ ] Append final `completed`/`failed` status row in `docs/agents/AGENT_TASK_LOG.csv`.
-10
View File
@@ -1,10 +0,0 @@
# Context Update
- **Goal:** Execute weekly `event-schema-agent` task to validate Nostr event schemas.
- **Scope:** `js/nostrEventSchemas.js`, `scripts/agent/validate-events.mjs`.
- **Status:** Completed.
- **Changes:**
- Created `scripts/agent/validate-events.mjs` to exercise all builders.
- Updated `buildWatchHistoryEvent` in `js/nostrEventSchemas.js` to default `monthIdentifier` if missing, fixing a schema violation.
- Verified all builders produce valid events.
- Verified unit tests pass.
-12
View File
@@ -1,12 +0,0 @@
# Docs Alignment Agent Context (2026-02-13)
## Goal
Align development documentation with the current codebase behavior.
## Scope
- `CLAUDE.md`: Update feature flags table to match `js/constants.js`.
- `docs/nostr-event-schemas.md`: Add missing detailed schema sections for NIP-17/Gift Wrap kinds.
## Mismatches Identified
- `CLAUDE.md` missing `FEATURE_TRUSTED_HIDE_CONTROLS` and `FEATURE_IMPROVED_COMMENT_FETCHING`.
- `docs/nostr-event-schemas.md` missing detailed sections for Kinds 1059, 13, 14, 15, 20001, 20002, 10050.
-11
View File
@@ -1,11 +0,0 @@
# Weekly Agent Context: frontend-console-debug-agent
- **Date:** 2026-02-13
- **Agent:** frontend-console-debug-agent
- **Goal:** Detect and fix frontend console errors using Playwright.
- **Scope:**
- Create/Update `scripts/agent/debug_frontend.py` to capture errors.
- Run the script against local server.
- Fix the first blocking error found.
- Verify with lint/test.
- **Assumptions:** Playwright Python environment is available.
-14
View File
@@ -1,14 +0,0 @@
# Context: innerHTML Migration for js/channelProfile.js
- **Date:** 2026-02-13
- **Agent:** innerhtml-migration-agent
- **Target File:** `js/channelProfile.js`
- **Reason:** High innerHTML count (10 assignments).
- **Node Version:** (from preflight)
- **NPM Version:** (from preflight)
## Plan
1. Replace `list.innerHTML = ""` with `replaceChildren()` or `textContent = ""`.
2. Replace static HTML in `panel.innerHTML` (Zap Panel) with `createElement` calls.
3. Replace static HTML in `container.innerHTML` (Subscribe Button) with `createElement` calls.
4. Replace static HTML in `container.innerHTML` (Loading/Empty/Error states) with `createElement` calls.
-9
View File
@@ -1,9 +0,0 @@
# Load Test Agent Task Context
**Date:** 2026-02-13
**Agent:** load-test-agent
**Goal:** Run the daily load test task as per `docs/agents/prompts/daily/bitvid-load-test-agent.md`.
**Scope:**
- Create/maintain `scripts/agent/load-test.mjs`.
- Run load test against local/dedicated relay.
- Produce report in `artifacts/`.
-18
View File
@@ -1,18 +0,0 @@
# Context
## Goal
Improve application responsiveness by optimizing background tasks and ensuring documentation accuracy.
## Scope
- Analyze codebase for performance bottlenecks (timers, loops, concurrency).
- Fix: Visibility-gate `VideoEventBuffer` to prevent UI thrashing when hidden.
- Audit: Verify upload documentation matches implementation.
## Assumptions
- `document.hidden` is reliable.
- `VideoEventBuffer` is the primary feed ingestion path.
## Definition of Done
- `VideoEventBuffer` pauses UI updates when hidden.
- `daily-perf-report` generated.
- Lint passes.
@@ -1,21 +0,0 @@
# Context for Documentation: js/ui/components/VideoModal.js
- **Agent:** docs-code-investigator (daily scheduler)
- **Date:** 2026-02-13
- **Target File:** `js/ui/components/VideoModal.js`
- **Line Count:** 6284 lines
- **Reason for Selection:**
- Identified as one of the largest source files in the codebase (ranking #2 after `profileModalController.js`).
- No existing overview documentation found (`docs/VideoModal-overview.md` is missing).
- Contains critical UI logic for video playback, menu rendering, and interaction handling.
- High complexity with multiple imported controllers (`CommentsController`, `ReactionsController`, etc.).
## Plan
1. Analyze the file structure to understand the `VideoModal` class and its main execution flows.
2. Create `docs/VideoModal-overview.md` to document the high-level architecture, public API, and key invariants.
3. Add JSDoc to the exported `VideoModal` class and its primary methods (`constructor`, `open`, `close`).
4. Add inline comments for complex logic blocks (e.g., rendering, data fetching).
5. Verify changes with `npm run lint` and `npm run test:unit` (to ensure no regressions).
## Goal
Improve maintainability and developer understanding of this critical UI component by providing clear documentation and entry points.
-18
View File
@@ -1,18 +0,0 @@
# Context: Weekly Fuzz Agent Run (2026-02-13)
## Goal
Improve input robustness by fuzzing high-risk parsers/decoders in `js/nostrEventSchemas.js`.
## Scope
- Target: `js/nostrEventSchemas.js`
- Task: Implement a fuzz harness to generate invalid inputs for event builder functions and validators.
- Deliverables:
- `scripts/agent/fuzz-nostr-schemas.mjs` (harness)
- `examples/reproducers/` (if failures found)
- `artifacts/fuzz-report-nostr-schemas-2026-02-13.json` (report)
- Potential fixes in `js/nostrEventSchemas.js`
## Constraints
- Do not fuzz public relays.
- Keep crypto paths safe.
- Minimal dependencies.
@@ -1,2 +0,0 @@
# Context: NIP Research Agent Run 2026-02-13
Goal: Verify NIP compliance for P0 items and update inventory.
@@ -1,16 +0,0 @@
# Context
- **File:** `js/subscriptions.js`
- **Reason:** Migrating `innerHTML` assignments to safe DOM APIs as part of security hardening.
- **Date:** 2026-02-13
- **Commit:** (will be added)
- **Node:** v22.22.0
- **npm:** 11.7.0
## Plan
1. Replace `innerHTML` assignments with `textContent` where possible.
2. Implement `renderStatusMessage` helper for simple messages.
3. Implement `renderLoadingIndicator` helper to replace `getSidebarLoadingMarkup`.
4. Verify changes with lint and tests.
5. Update `check-innerhtml` baseline.
-13
View File
@@ -1,13 +0,0 @@
# Context - Content Audit Agent 2026-02-14
## Mission
Make the public-facing help, guides and contribution docs in `/content` true, actionable, and executable — focusing especially on the uploading/contribution flows (accepted media, limits, resumability, metadata, moderation, attribution).
## Scope
- Docs: `content/`
- Code: `js/` (especially upload/playback logic), `config/`
- Goal: Align `/content` with actual code behavior.
## Metadata
- Date: 2026-02-14
- Agent: bitvid-content-audit-agent (via daily scheduler)
-13
View File
@@ -1,13 +0,0 @@
# Context: NIP-07 and NIP-46 Timeout Refactor
## Goal
Refactor duplicate `5000` ms timeout literals in Nostr-related modules to use semantic constants.
## Scope
- `js/nostr/nip07Permissions.js`: Define `NIP07_EXTENSION_WAIT_TIMEOUT_MS`.
- `js/nostr/managers/SignerManager.js`: Use `NIP07_EXTENSION_WAIT_TIMEOUT_MS`.
- `js/nostr/nip46Client.js`: Define `NIP46_PING_TIMEOUT_MS`.
## Baseline
- Branch: `unstable` (assumed)
- Node: `v22.22.0`
-13
View File
@@ -1,13 +0,0 @@
# Context: Content Audit Agent
**Date:** 2026-02-14
**Agent:** content-audit-agent
**Goal:** Audit user documentation in `/content` against the codebase to ensure accuracy of upload/contribution flows.
## Scope
- Documentation: `content/docs/getting-started.md`, `content/docs/guides/upload-content.md`.
- Code: `js/ui/components/UploadModal.js`, `components/upload-modal.html`, `js/services/videoNotePayload.js`, `js/storage/s3-multipart.js`.
## Assumptions
- The codebase in `js/` represents the current runtime reality.
- `docs/agents/prompts/daily/bitvid-content-audit-agent.md` instructions are the primary guide.
-13
View File
@@ -1,13 +0,0 @@
# Context: Daily Dependency & Security Audit
- **Date**: 2026-02-14
- **Agent**: deps-security-agent (scheduler: jules)
- **Environment**:
- Node: v22.22.0
- NPM: 11.7.0
- Branch: unstable
- **Scope**:
- Audit dependencies for vulnerabilities.
- Check for outdated packages.
- Generate reports.
- No auto-upgrades performed due to constraints (nostr-tools is protocol critical, others are major bumps).
-11
View File
@@ -1,11 +0,0 @@
# Context
**File Chosen:** `js/ui/profileModalController.js`
**Size:** 8159 lines (Grandfathered)
**Reason:** Largest grandfathered file not decomposed recently. Contains mixed concerns including Admin management and Moderation settings which are distinct from the main profile modal logic.
**Extraction Plan:**
1. **Admin Logic**: Extract methods related to Admin/Moderator management (add/remove moderators, whitelist, blacklist, notifications) into `js/ui/profileModal/ProfileAdminController.js`.
2. **Moderation Logic**: Extract methods related to Moderation settings (blur threshold, autoplay, mute/hide logic) into `js/ui/profileModal/ProfileModerationController.js`.
**Goal:** Reduce `js/ui/profileModalController.js` by at least 200 lines (likely much more).
-11
View File
@@ -1,11 +0,0 @@
# Context: 2026-02-14
## Environment
- Node: v22.22.0
- NPM: 10.9.2 (Assuming based on node version, but I'll cat the file)
- Package Manager: npm
- CI Matrix: Linux x64
## Run Metadata
- Agent: deps-security-agent
- Timestamp: 2026-02-14T13:35:20Z
-23
View File
@@ -1,23 +0,0 @@
# Context: Documentation of js/ui/profileModalController.js
**Date:** 2026-02-14
**Agent:** docs-code-investigator (via Daily Scheduler)
**Target:** `js/ui/profileModalController.js` (~6200 lines)
## Selection Reason
This file is the largest UI controller in the codebase. It manages the complex Profile Modal, which includes:
- Account switching and login/logout.
- Relay management.
- Direct messages interface (a mini-app inside the modal).
- Wallet settings.
- Moderation tools (blocking/muting).
- Subscription management.
Despite its size and complexity, it lacks comprehensive JSDoc and architectural documentation. Documenting it is high priority for maintainability and future refactoring.
## Plan
1. **Analyze**: Map the dependencies and sub-controllers (DM, Relay, Wallet, etc.).
2. **JSDoc**: Add JSDoc to the class, constructor, and key lifecycle methods (`load`, `show`, `hide`, `handleAuthLogin`).
3. **Flow Comments**: Add comments explaining the initialization and pane switching logic.
4. **Overview Doc**: Create `docs/profileModalController-overview.md` describing the architecture (facade pattern over sub-controllers) and state management.
5. **Verify**: Run `npm run lint` and `npm run test:unit` (specifically `tests/profile-modal-controller.test.mjs` if it exists).
-6
View File
@@ -1,6 +0,0 @@
# Context
* **File:** `js/ui/components/RevertModal.js`
* **Reason:** Highest innerHTML usage count (10) in the daily report.
* **Date:** 2026-02-14
* **Plan:** Migrate `innerHTML` assignments to `document.createElement`, `textContent`, and safe DOM manipulation.
-18
View File
@@ -1,18 +0,0 @@
# Context
**Goal**: Daily measurable improvement of app responsiveness and documentation alignment.
**Scope**:
- Identify performance bottlenecks (CPU/network).
- Apply small, safe fixes (visibility gating, bounded concurrency).
- Audit and update `/content` documentation.
**Assumptions**:
- `unstable` branch is the target.
- Tests must pass.
- Changes must be documented.
**Definition of Done**:
- `perf/hits-YYYY-MM-DD.json` created.
- `perf/daily-perf-report-YYYY-MM-DD.md` created.
- At least one small fix or docs update (if applicable).
-10
View File
@@ -1,10 +0,0 @@
# Context for NIP Research Agent (2026-02-15_00-50-45)
## Goal
Research NIPs, update inventory, fetch missing specs, and verify compliance.
## Scope
- Scan codebase for NIP references.
- Fetch missing NIP specs.
- Verify compliance for key NIPs.
- Produce report.
-12
View File
@@ -1,12 +0,0 @@
# Context - Scheduler Update Agent Run
## Goal
Keep the daily and weekly scheduler rosters in sync with the actual prompt files on disk.
## Status
Completed.
## Findings
- Daily prompts: 21 files. Roster matches.
- Weekly prompts: 16 files. Roster matches.
- No changes needed to scheduler files.
-14
View File
@@ -1,14 +0,0 @@
# Context: Daily Test Audit
**Goal**: Run a daily audit of the test suite to verify test quality, identify flakiness, and ensure critical paths are covered.
**Scope**:
- Run unit tests with coverage.
- Detect flaky tests by re-running.
- Static analysis for anti-patterns.
- Generate a report.
**Definition of Done**:
- `test-audit-report-YYYY-MM-DD.md` created.
- Logs saved in `test_logs/`.
- Artifacts in `test-audit/`.
-11
View File
@@ -1,11 +0,0 @@
# Test Audit Context - 2026-02-15_22-02-44
## Mission
Run daily audit of the test suite to verify tests actually test the behaviors they claim to, find fragile or missing tests, and propose small, high-confidence fixes.
## DoD
- [ ] Run tests with coverage
- [ ] Check for flakiness
- [ ] Static analysis of tests
- [ ] Generate report
- [ ] Create simple fixes if possible
-8
View File
@@ -1,8 +0,0 @@
# Context: Daily Audit Agent Run
- **Target Branch**: `unstable`
- **Date**: 2026-02-16
- **Agent**: bitvid-audit-agent (via daily scheduler)
- **Node Version**: v22.22.0
- **OS**: Linux
- **Purpose**: Run static audit scripts, collect metrics, and generate a regression report.