Commit Graph
5407 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 538fce992e docs(ai): improve onboarding steps
- Add `npm run lint` to README verification steps.
- Update CONTRIBUTING.md to clarify build prerequisites for linting.
- Update .devcontainer/devcontainer.json to use `npx playwright install --with-deps`.
- Generate ONBOARDING_REPORT.md.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 08:40:21 +00:00
thePR0M3TH3AN a090864bc2 Merge pull request #2371 from PR0M3TH3AN/fix-ci-and-visual-tests-990569406279712647
Fix CI configuration and unskip visual tests
2026-02-11 19:22:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3571b52b13 fix(ci): unskip visual tests and align node versions
- Unskip `mobile sidebar shares desktop rail behavior` in `tests/visual/overlay-layers.spec.ts`.
- Enable visibility check in `tests/visual/moderation.spec.ts` (removed TODO).
- Update `daily-design-system-audit.yml` and `agent-pr-review.yml` to use Node.js 22.
- Set `fetch-depth: 0` in `ci.yml` build job to ensure `sw-compat` lint check runs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 22:41:18 +00:00
thePR0M3TH3AN 37b1f48f1a Merge pull request #2370 from PR0M3TH3AN/nip-compliance-audit-4843223870475612808
NIP Compliance Audit & Verification Tests
2026-02-11 17:13:58 -05:00
thePR0M3TH3AN 1470434e3d Merge branch 'unstable' into nip-compliance-audit-4843223870475612808 2026-02-11 17:12:07 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7054401c37 feat: add NIP compliance audit artifacts and regression tests
- Added `NIP_INVENTORY.md` tracking compliance status for all referenced NIPs/Kinds.
- Added `nip-report-2025-02-12.md` summarizing audit findings.
- Added `CONTEXT.md`, `TODO.md`, `DECISIONS.md`, `TEST_LOG.md`.
- Added automated regression tests in `tests/compliance/`:
  - `nip04_44_compliance.test.mjs`: Verifies encryption fallback logic.
  - `nip65_compliance.test.mjs`: Verifies relay list loading (Kind 10002).
  - `video_note_compliance.test.mjs`: Verifies video note (Kind 30078) structure and NIP-71 tagging.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 21:37:21 +00:00
thePR0M3TH3AN 78355b685b Merge pull request #2369 from PR0M3TH3AN/perf/bound-relay-concurrency-233457197976374344
perf: bound relay background concurrency to 3
2026-02-11 16:33:50 -05:00
google-labs-jules[bot]andPR0M3TH3AN d3fa684e45 perf: bound relay background concurrency to 3
Replaces unbounded `Promise.all(relays.map(...))` calls with `pMap` using a concurrency limit of 3 for background operations like history hydration, metadata fetching, and DM sending.
This prevents network saturation and potential main-thread jank when many relays are configured.
Includes benchmark verification script `benchmarks/relay_concurrency_repro.mjs`.
Audited upload docs and confirmed accuracy.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 21:31:53 +00:00
thePR0M3TH3AN 0607367f1a Merge pull request #2368 from PR0M3TH3AN/decompose-profile-modal-controller-1637476114002717833
Decompose ProfileModalController
2026-02-11 16:17:07 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7300977a6d [decompose] extract DM and Relay controllers from ProfileModalController
Extracted ProfileDirectMessageController (split into Controller, Actions, Renderer, Helper) and ProfileRelayController from ProfileModalController to reduce file size and improve maintainability.

ProfileModalController.js size reduced from ~12000 lines to ~8750 lines.
Updated unit tests to reflect the new structure.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 21:15:06 +00:00
thePR0M3TH3AN 244f5f80a8 Merge pull request #2367 from PR0M3TH3AN/claude/fix-sync-and-dm-issues-NMShC
Fix NIP-07 adapter support and improve signer resolution
2026-02-11 15:01:35 -05:00
Claude 53b8a2609c fix: recognize NIP-07 signer type for extension permission pre-granting
The NIP-07 adapter uses type "nip07" but all permission pre-granting
checks only matched type "extension", causing NIP-07 browser extension
users to fail decryption for block/mute lists, subscriptions, DMs, and
watch history. Hashtag preferences appeared to work because their read
path had a separate fix, masking the systemic issue.

Changes:
- shouldRequestExtensionPermissions() now matches both "extension" and
  "nip07" signer types (central fix affecting DM signals, comments,
  publish helpers, and watch history fetch)
- buildDmDecryptContext() pre-grants extension permissions for NIP-07
- userBlocks.js: remove capabilities-gated decryptor check that failed
  with lazy NIP-07 module injection (same fix already in subscriptions.js);
  always resolve signer regardless of allowPermissionPrompt; increase
  fast-path relay timeout from 6s to 10s
- watchHistoryService: recognize NIP-07 type and always resolve signer
- All publish paths (blocks, subscriptions, hashtags, relays, uploads,
  sharing, moderation) now pre-grant permissions for NIP-07 signers

https://claude.ai/code/session_01PipsdaTQmw7wBTJ1LmJjkk
2026-02-11 19:41:53 +00:00
thePR0M3TH3AN b22ab427c8 Merge pull request #2366 from PR0M3TH3AN/ai/load-test-20250211-1287785161033109563
Load Test Report and Verification
2026-02-11 14:38:01 -05:00
google-labs-jules[bot]andPR0M3TH3AN f9d8f1737f Load Test Report and Verification
Executed the `scripts/agent/load-test.mjs` script with 1000 clients for 60 seconds against a local relay. The test passed successfully with ~86 events/sec throughput and <2ms latency.

Attached the generated load report: `artifacts/load-report-20260211.json`.

No cryptographic bottlenecks were identified (avg signing time 0.74ms).

Note: Added `!artifacts/load-report-*.json` to `.gitignore` to allow tracking of load reports.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 19:29:29 +00:00
thePR0M3TH3AN 617ec08666 Merge pull request #2363 from PR0M3TH3AN/perf-optimization-worker-transfer-9240404854716586294
⚡ Optimize Explore Data Worker Transfer
2026-02-11 12:38:10 -05:00
thePR0M3TH3AN 4862c7aea4 Merge pull request #2362 from PR0M3TH3AN/docs-playback-alignment-10640790855097534081
📘 Align development docs with codebase behavior
2026-02-11 12:30:48 -05:00
google-labs-jules[bot]andPR0M3TH3AN 99e904d7c1 Optimize explore data worker transfer with lightweight video objects
- Implements `toLightweightVideo` helper in `js/services/exploreDataService.js` to strip large fields (content, signatures, etc.) from video objects before sending to the worker.
- Updates `buildWatchHistoryTagCounts` and `buildTagIdf` to use lightweight objects.
- Adds `tests/services/exploreDataService.optimization.test.mjs` to verify correctness.
- Adds `benchmarks/worker_transfer_lightweight_bench.js` demonstrating ~40% improvement in transfer time.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 17:15:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN 761a5a2dd2 docs: align playback strategy documentation with codebase behavior
Updates AGENTS.md and README.md to reflect the configurable hybrid playback strategy (URL vs. WebTorrent) instead of asserting a strict "URL-First" rule, which contradicted the default configuration.

- Updated "Mission" in AGENTS.md to "Hybrid Playback Strategy".
- Clarified that `DEFAULT_PLAYBACK_SOURCE` controls priority.
- Updated README.md "How playback works" section.
- Adjusted QA checklists to focus on "configured priority" rather than "URL-first".

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 17:00:12 +00:00
thePR0M3TH3AN 1d2118d15e Merge pull request #2361 from PR0M3TH3AN/ds-audit/2026-02-11-14522978470477659374
Update Daily Design System Audit Report
2026-02-11 11:25:35 -05:00
google-labs-jules[bot]andPR0M3TH3AN 288fd053c7 chore: Update Daily Design System Audit Report and Script
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:56:51 +00:00
thePR0M3TH3AN d07bf6308f Merge pull request #2360 from PR0M3TH3AN/ai/doc-events-cache-20250209-13537943595919351490
chore(ai): document js/nostr/managers/EventsCacheStore.js
2026-02-11 10:33:26 -05:00
thePR0M3TH3AN f89c812580 Merge pull request #2359 from PR0M3TH3AN/refactor-comment-normalization-8775062398993018564
Refactor normalizeCommentTarget into a class
2026-02-11 10:32:40 -05:00
google-labs-jules[bot]andPR0M3TH3AN 676f41d76d chore(ai): doc js/nostr/managers/EventsCacheStore.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:30:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7c462693a5 fix(ci): authenticate git fetch upstream with GITHUB_TOKEN
Explicitly injects the GITHUB_TOKEN into the upstream remote URL in the agent-pr-review workflow. This prevents authentication failures when fetching the upstream repository in CI environments where plain HTTPS URLs trigger interactive credential prompts.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:26:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 78e53a8a1d refactor: simplify comment target normalization logic
Introduces `CommentTargetNormalizer` class to decompose the complex `normalizeCommentTarget` function into smaller, state-managed methods. This improves readability and maintainability without changing the external API or behavior.

- Extracted logic into `extractPointers`, `resolveEventsAndTags`, `extractInitialValues`, `enrichFromTags`, and `applyDefaults`.
- Preserved all fallback logic and tag parsing rules.
- Ensured strict string normalization in `extractInitialValues` to match original behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:23:45 +00:00
thePR0M3TH3AN d218baae4d Merge pull request #2358 from PR0M3TH3AN/testing-improvement-s3uploadservice-13802788661266692247
🧪 Add tests for S3UploadService and refactor for testability
2026-02-11 09:54:36 -05:00
thePR0M3TH3AN 89d26c9d2f Merge pull request #2357 from PR0M3TH3AN/ai/docs-update-20250222-10909080055527982820
Update Documentation: Quickstart and Typo Fix
2026-02-11 09:54:17 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3078c46b89 feat(tests): add S3UploadService tests and refactor for testability
- Refactor `S3UploadService` to accept dependencies in constructor
- Move `resolveUploadIdentifier` to class method for mocking
- Add comprehensive unit tests for `S3UploadService` covering event emitter, validation, and upload logic
- Ensure `WebTorrent` dependency is mocked or polyfilled in test environment

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 14:42:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5f7d1e4457 docs(ai): update quickstart and contributing (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 14:39:48 +00:00
thePR0M3TH3AN c140ba82c3 Merge pull request #2355 from PR0M3TH3AN/test-trust-bootstrap-5083279599781390703
Add unit tests for trustBootstrap.js
2026-02-11 09:27:29 -05:00
thePR0M3TH3AN a289cb455f Merge pull request #2356 from PR0M3TH3AN/fix-version-info-visibility-4429726862848521512
Fix version info visibility and build robustness
2026-02-11 09:27:13 -05:00
google-labs-jules[bot]andPR0M3TH3AN 6a284e0b2d fix: Ensure version info visibility and build robustness
- Moved `<!-- VERSION_INFO -->` out of `.fade-in` container in `index.html` to prevent visibility issues if JS fails.
- Added verification in `scripts/build-dist.mjs` to ensure `dist/components` exists and is not empty.
- Added logging to `scripts/build-dist.mjs` for version injection status.
- Updated `scripts/verify-dist-deploy-artifact.mjs` regex to accommodate HTML structure change.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 14:15:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6fa8df5006 test(services): add unit tests for trustBootstrap.js
Adds a new test file `tests/services/trustBootstrap.test.mjs` to cover the functionality of `bootstrapTrustedSeeds` in `js/services/trustBootstrap.js`.

The test suite covers:
- Feature flag validation
- Successful seed application when access control is ready
- Subscription to access control changes
- Fallback/timeout handling for access control readiness
- Retry logic for relay readiness

Uses `node:test` and mocks dependencies `accessControl`, `moderationService`, `nostrService` via dynamic imports to handle singleton instantiation side effects.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 14:15:31 +00:00
thePR0M3TH3AN 7219b815a3 Merge pull request #2354 from PR0M3TH3AN/ai/lint-20241024-15846807811732190724
chore(ai): lint check
2026-02-11 09:07:34 -05:00
google-labs-jules[bot]andPR0M3TH3AN f2d122839b chore(ai): lint check (no changes)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 13:22:30 +00:00
thePR0M3TH3AN 5add5a7304 Merge pull request #2353 from PR0M3TH3AN/fix-node-version-enforcement-15391969983766320156
Enforce Node >=22 in package.json to match requirements
2026-02-11 08:09:45 -05:00
google-labs-jules[bot]andPR0M3TH3AN 64d862ffb3 fix(build): enforce Node >=22 in package.json
Updates the `engines.node` field in `package.json` from `>=20` to `>=22` to align with the project's documentation (`README.md`) and requirements. This change ensures that build environments (e.g., 4everland) fail early if an incompatible Node.js version is used, prompting necessary environment upgrades and preventing silent build failures or missing version injection.

References:
- README.md: "The project requires Node.js v22 or higher."
- Issue: Missing version footer on deployed site due to Node 20 environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 13:07:40 +00:00
thePR0M3TH3AN 6210b1045d Merge pull request #2352 from PR0M3TH3AN/fix-deployment-version-injection-5739441893263452551
Fix missing version info in deployment by enabling Node 20 build and hardening injection logic
2026-02-11 07:49:17 -05:00
google-labs-jules[bot]andPR0M3TH3AN bc2f082fca Fix: Enable build on Node 20 and harden version injection
- Relaxed `engines.node` in `package.json` from `>=22` to `>=20` to match the hosting environment (Node 20.x), resolving strict engine failures during install.
- Modified `scripts/build-dist.mjs` to throw an error (instead of warning) if version injection fails, preventing silent failures.
- Updated `npm run build` to include `verify:dist:deploy-artifact` as a mandatory post-build step, ensuring the final artifact contains the expected version markup.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:45:56 +00:00
thePR0M3TH3AN 9fc845cd1a Merge pull request #2351 from PR0M3TH3AN/perf-resolve-timestamp-parallel-12548316095717606632
⚡ Parallelize timestamp resolution in feed engine
2026-02-11 07:45:10 -05:00
google-labs-jules[bot]andPR0M3TH3AN e62cb15c0e perf: parallelize timestamp resolution in feed engine
Replaces sequential await loop with Promise.any to resolve video timestamps in parallel.
This significantly reduces latency when multiple resolvers are present, especially if the first one is slow.

- Uses Promise.any to take the first valid finite timestamp.
- Wraps resolvers to reject on invalid values.
- Preserves error logging for genuine resolver errors.
- Benchmarks showed improvement from ~100ms to ~11ms in simulated slow scenarios.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:38:20 +00:00
thePR0M3TH3AN 0bd179068d Merge pull request #2350 from PR0M3TH3AN/test-link-preview-settings-9780741811939813635
🧪 Test: Add unit tests for linkPreviewSettings.js
2026-02-11 07:30:38 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1bcf88e584 test: add unit tests for linkPreviewSettings utility
- Creates `tests/utils/linkPreviewSettings.test.mjs` to cover `js/utils/linkPreviewSettings.js`.
- Implements comprehensive tests for default state, storage persistence, domain management, event emission, and subscription.
- Polyfills JSDOM Event constructors in the test file to support `CustomEvent` emission.
- Ensures tests are isolated using `beforeEach`/`afterEach` to clear `localStorage`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:28:42 +00:00
thePR0M3TH3AN c12705c612 Merge pull request #2349 from PR0M3TH3AN/ai/reproducers-multiple-20260211-9563226113495163824
Add Minimal Reproducers for Known Flaky Tests
2026-02-11 07:14:39 -05:00
google-labs-jules[bot]andPR0M3TH3AN 738c839302 add minimal reproducers for hashtag preferences and moderation flakiness issues
- Adds `examples/reproducers/issue-hashtag-prefs/reproduce_issue.mjs` to reproduce flaky hashtag preferences unit test.
- Adds `examples/reproducers/issue-moderation-flake/reproduce_flake.spec.ts` to reproduce flaky moderation visual test in headless mode.
- Includes README instructions for running each reproducer.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:12:30 +00:00
thePR0M3TH3AN a61b6c4e19 Merge pull request #2348 from PR0M3TH3AN/batch-resolve-posted-at-14136623411216121457
⚡ Batch video timestamp resolution to eliminate N+1 network requests
2026-02-11 07:04:17 -05:00
google-labs-jules[bot]andPR0M3TH3AN b28e62963f perf: Batch video timestamp resolution to reduce N+1 network requests
- Implemented `hydrateVideoHistoryBatch` in `NostrClient` to fetch missing root events and sparse histories in a single `pool.list` request.
- Refactored `hydrateVideoHistory` to use shared helper methods `getLocalVideoHistory` and `_processAndCacheEvent`.
- Added `resolveVideoPostedAtBatch` to `PlaybackCoordinator` which delegates to the batched client method.
- Updated `VideoListView` to collect videos needing timestamp resolution and call the batch method, falling back to individual calls if necessary.
- Added regression test `tests/performance/resolvePostedAt.test.mjs` to verify reduced network calls.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 12:01:39 +00:00
thePR0M3TH3AN 7164475c5e Merge pull request #2344 from PR0M3TH3AN/ai/tests-core-modules-20250212-2377726082644067938
Add unit tests for core modules
2026-02-11 06:25:58 -05:00
google-labs-jules[bot]andPR0M3TH3AN ab72036a4f test(ai): add unit tests for authUtils, decryptionSchemeCache, videoPayloadBuilder (agent)
Added focused unit tests for three core modules to improve coverage:
- `js/services/authUtils.js`: Tested `normalizeProviderId` and `normalizeAuthType`.
- `js/nostr/decryptionSchemeCache.js`: Tested caching logic, TTL expiration, and cache clearing.
- `js/nostr/videoPayloadBuilder.js`: Tested payload extraction and event preparation, including NIP-71 metadata handling.

Tests use `node:test` and `node:assert/strict` and are integrated into the existing test suite.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 11:15:09 +00:00
thePR0M3TH3AN 2ca348bdac Merge pull request #2343 from PR0M3TH3AN/refactor-client-send-dm-1580382256443769824
Refactor sendDirectMessage to use strategy pattern for NIP-04/17
2026-02-11 05:49:50 -05:00