Commit Graph
100 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 4e0bb10325 fix: resolve CI deploy failure by enforcing Node 22 and moving build deps
- Create `.nvmrc` with `22` to ensure consistent Node version on Netlify/CI.
- Move `cross-env`, `esbuild`, `nostr-tools` to `dependencies` to prevent pruning issues.
- (Previous) Added fuzz harnesses and harmonized iterations.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 17:41:34 +00:00
google-labs-jules[bot]andPR0M3TH3AN a0daeb8e63 feat: add fuzz testing harnesses and fix build dependencies
- Add fuzz testing harnesses for `nostrEventSchemas.js`, `dmDecryptor.js`, and `magnetUtils.js`.
- Move build-critical devDependencies (`cross-env`, `esbuild`, `nostr-tools`) to dependencies to fix Netlify deployment failure.
- Harmonize fuzzing iterations to 50,000.
- Add documentation headers to fuzz scripts.
- Verified robustness of fuzz targets (no crashes found).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 17:26:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 26b1552af5 feat: add fuzz testing harnesses for schemas, dm, and magnet utils
- Harmonize fuzzing iteration counts to 50,000 for robustness
- Add documentation headers to fuzz scripts
- Verify robustness of `nostrEventSchemas.js`, `dmDecryptor.js`, and `magnetUtils.js`
- Clean up temporary reproducers and crash reports

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 17:22:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN a39e7d832d test(ai): add unit tests for profileCache (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 11:24:53 +00:00
google-labs-jules[bot]andPR0M3TH3AN be43c266e0 fix(test): resolve hangs in multiple unit tests and harden runner
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 10:33:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 42a18fa784 fix(test): resolve hangs in multiple unit tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 10:13:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN de7a215f77 fix(test): resolve hang in nostr-login-permissions test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 09:23:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN ec3691e659 docs(ai): improve onboarding steps and fix unit tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 08:54:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1c12cc0d17 refactor(ai): extract handleAddProfile from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 04:20:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2c5fc53f3f refactor(ai): extract handleAddProfile from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 04:05:20 +00:00
google-labs-jules[bot]andPR0M3TH3AN f5e16f296e refactor(ai): extract handleAddProfile from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:55:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4fd8f5203e chore(ai): CI health fixes (flaky tests, deps cleanup)
- Fix flaky `tests/hashtag-preferences.test.mjs` by correcting mock implementation.
- Fix `tests/nostr-login-permissions.test.mjs` failure by requesting correct permissions in `js/nostr/client.js`.
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer properly.
- Clean up `package.json` by removing duplicate devDependencies (`autoprefixer`, `@tailwindcss/typography`) that are already in `dependencies`.
- Ensure `tailwindcss`, `postcss`, `autoprefixer`, and `@tailwindcss/typography` are in `dependencies` for robust production builds.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:33:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 51087fad7e refactor(ai): extract handleAddProfile from js/app.js (agent)
Moves `handleAddProfile` logic from the main application class into `ProfileModalController` to improve separation of concerns as per `AGENTS.md`.

- Extracts `handleAddProfile` to `js/ui/profileModalController.js`.
- Updates `ProfileModalController` to handle add account flow internally.
- Removes legacy callback wiring from `js/app.js` and `js/ui/applicationBootstrap.js`.
- Adds unit tests for the extracted logic in `tests/ui/profileModalController-addProfile.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:32:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN df938c7564 chore(ai): CI health fixes (flaky tests, deps, deploy)
- Fix flaky `tests/hashtag-preferences.test.mjs` by correcting mock implementation for `fetchListIncrementally`.
- Fix `tests/nostr-login-permissions.test.mjs` failure by requesting correct permissions in `js/nostr/client.js` (ReferenceError fix).
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer upon successful decryption.
- Correct `package.json` dependency classification:
  - Remove duplicate devDependencies (`autoprefixer`, `@tailwindcss/typography`) that are already in `dependencies`.
  - Ensure build-critical tools (`tailwindcss`, etc.) are in `dependencies` to survive `npm prune --production` on Netlify.
  - Install `esbuild` and `cross-env` as devDependencies.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:27:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN daa97a827b chore(ai): CI health fixes (flaky tests) and variable correction
- Fix flaky `tests/hashtag-preferences.test.mjs` by correcting mock implementation for `fetchListIncrementally`.
- Fix `tests/nostr-login-permissions.test.mjs` failure by requesting correct permissions in `js/nostr/client.js` (ReferenceError fix).
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer upon successful decryption.
- `npm install` was run to ensure dependencies like `jsdom` are present.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:14:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN e027e6bba3 chore(ai): CI health fixes (flaky tests)
- Fix flaky `tests/hashtag-preferences.test.mjs` by correcting mock implementation for `fetchListIncrementally`.
- Fix `tests/nostr-login-permissions.test.mjs` failure by requesting correct permissions in `js/nostr/client.js`.
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer upon successful decryption.
- `npm install` was run to ensure dependencies like `jsdom` are present for `tests/app/channel-profile-moderation.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:08:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2bebaa6465 fix(webtorrent): ensure magnet webseeds are used in stream
Extracts `ws` (web seed) parameters from the magnet link and merges them with the explicit `urlList` (e.g., from direct URL) when initializing the WebTorrent stream. This fixes a regression where magnet-embedded web seeds were ignored if a direct URL was provided.

- Updates `js/magnets.js` to parse `ws` parameters and export `webSeedsFromMagnet`.
- Updates `js/webtorrent.js` to merge magnet web seeds with `opts.urlList`.
- Adds regression test `tests/webtorrent-webseeds.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 22:01:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3f9dd916a8 chore(ai): add smoke test script (agent)
- Adds `scripts/agent/smoke-test.mjs` for end-to-end regression testing.
- Verifies key flows: login, relay connect, publish video, publish DM, and DM decryption.
- Uses local relay (port 8899) and local HTTP server (port 8000).
- Generates JSON summary and logs in `artifacts/`.
- Includes Playwright frontend verification.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 21:29:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN 60fa6c4282 chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 20:54:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6347ab0db1 fix(auth): optimize login speed and list decryption
- Reduced decryption timeout for user lists from 90s to 15s to fail faster.
- Optimized NIP-07 decryption calls to avoid retries and long timeouts during critical loading paths.
- Fixed a bug where `loginWithExtension` triggered `getPublicKey` twice, doubling the user interaction time.
- Added a 10s grace period for relay health warnings to prevent false positives on startup.
- Verified `deferBlocks` logic in `authService` prevents blocking the login UI on slow list decryption.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 20:31:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6bf3e95a4f Fix list loading reliability and optimize NIP-07 login performance
- Fixes issue where user lists (subscriptions, blocks) fail to load if local cache is stale but metadata store is fresh.
- Updates `js/userBlocks.js` and `js/subscriptions.js` to persist `createdAt` timestamp and use it for incremental fetch `since` parameter.
- Optimizes `js/nostr/client.js` `ensureActiveSignerForPubkey` to reduce redundant `getPublicKey` calls to NIP-07 extension by 50%.
- Adds `preloadedPubkey` support to `createNip07Adapter`.
- Fixes `tests/subscriptions-manager.test.mjs` environment setup to allow CI to pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:53:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0890775b86 chore(ai): add load test report for 2026-01-30
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:49:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5bdca14364 Fix list loading reliability and optimize NIP-07 login performance
- Fixes issue where user lists (subscriptions, blocks) fail to load if local cache is stale but metadata store is fresh.
- Updates `js/userBlocks.js` and `js/subscriptions.js` to persist `createdAt` timestamp and use it for incremental fetch `since` parameter.
- Optimizes `js/nostr/client.js` `ensureActiveSignerForPubkey` to reduce redundant `getPublicKey` calls to NIP-07 extension by 50%.
- Adds `preloadedPubkey` support to `createNip07Adapter`.
- Adds reproduction test for NIP-07 concurrency issue.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:35:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN 14dfedc98d Fix NIP-07 adapter race condition and CI test crashes
- Modified `js/nostr/adapters/nip07Adapter.js` to use dynamic getters for capabilities.
- Updated `js/nostr/client.js` to respect getter descriptors on signers.
- Fixed `tests/nostr-login-permissions.test.mjs` and `tests/nostr/adapters.test.mjs` to safely handle read-only global properties in CI.
- Added hardened regression test `tests/nostr/nip07Adapter-race-condition.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:04:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 53a14a0dfe fix(ai): cleanup logging and use effective magnet in webtorrent.js
This commit refactors `js/webtorrent.js` to ensure the `stripXsParameter` helper is correctly used and its result (`effectiveMagnetURI`) is passed to `client.add()`.

- Refactored logic to use `effectiveMagnetURI` variable.
- Cleaned up conditional logging.
- Ensured consistent usage in `streamVideo`.

Tests run:
- `npm run lint`
- `npm run test:unit:shard1`
- `python3 scripts/agent/debug_frontend.py` (verified error is gone)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:57:43 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4f40025b9d fix(ai): frontend console error — strip xs on localhost (agent)
Diagnosed a CORS error on local development environment caused by WebTorrent fetching `.torrent` files from R2 buckets (via `xs` parameter) that do not allow localhost origin.

Modified `js/webtorrent.js` to strip the `xs` parameter from magnet links when running on `localhost` or `127.0.0.1`. This prevents the browser from attempting the blocked fetch request, resolving the console error while maintaining functionality (falling back to DHT/peers).

Verified using `scripts/agent/debug_frontend.py` which captures frontend console logs via Playwright.

Tests run:
- `npm run lint`
- `npm run test:unit:shard1`
- `python3 scripts/agent/debug_frontend.py` (verified error is gone)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:53:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN d38585f376 Fix NIP-07 adapter race condition with lazy encryption capability injection
- Modified `js/nostr/adapters/nip07Adapter.js` to use dynamic getters for `capabilities` (nip04/nip44) and unconditionally expose encryption methods.
- Updated `js/nostr/client.js` to use `Object.getOwnPropertyDescriptor` when handling `signer.capabilities`.
- Added `tests/nostr/nip07Adapter-race-condition.test.mjs` to verify the fix.
- Fixed test environment issues in `tests/nostr/adapters.test.mjs` and `tests/nostr-login-permissions.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:47:08 +00:00
google-labs-jules[bot]andPR0M3TH3AN 51924d1619 fix(nostr): handle lazy NIP-44 injection in NIP-07 adapter
Updates `js/nostr/adapters/nip07Adapter.js` to unconditionally expose encryption methods (`nip04Encrypt`, `nip44Decrypt`, etc.) and use dynamic property getters for capabilities. This fixes a race condition where the adapter would initialize without NIP-44 support if the browser extension injected the `nip44` API slightly after `window.nostr` became available, preventing encrypted user lists (subscriptions, blocks, hashtags) from loading.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:19:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8373529c76 fix(app): sequence user list loading after profile relays are initialized
Prior to this change, user-specific lists (block lists, subscriptions, hashtag preferences, DMs, NWC settings) were fetched concurrently with the profile/relay initialization in `handleAuthLogin`. This caused a race condition where the application would attempt to fetch sensitive user data using default relays instead of the user's preferred relays, often resulting in empty or stale data.

This patch refactors `handleAuthLogin` in `js/app.js` to chain the loading of these lists to the completion of `profileStatePromise` (which ensures relays are loaded via `postLoginPromise`). This guarantees that the correct relays are used for fetching user-specific data.

Also defines `dmStatePromise`, `nwcPromise` and `hashtagPreferencesPromise` which were previously referenced but seemingly undefined in the scope, ensuring proper promise tracking.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 17:41:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 962f943b53 fix(app): sequence user list loading after profile relays are initialized
Prior to this change, user-specific lists (block lists, subscriptions, hashtag preferences, DMs, NWC settings) were fetched concurrently with the profile/relay initialization in `handleAuthLogin`. This caused a race condition where the application would attempt to fetch sensitive user data using default relays instead of the user's preferred relays, often resulting in empty or stale data.

This patch refactors `handleAuthLogin` in `js/app.js` to chain the loading of these lists to the completion of `profileStatePromise` (which ensures relays are loaded via `postLoginPromise`). This guarantees that the correct relays are used for fetching user-specific data.

Also defines `dmStatePromise`, `nwcPromise` and `hashtagPreferencesPromise` which were previously referenced but seemingly undefined in the scope, ensuring proper promise tracking.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 17:35:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9481de9e0a fix(app): sequence user list loading after profile relays are initialized
Prior to this change, user-specific lists (block lists, subscriptions, hashtag preferences, DMs, NWC settings) were fetched concurrently with the profile/relay initialization in `handleAuthLogin`. This caused a race condition where the application would attempt to fetch sensitive user data using default relays instead of the user's preferred relays, often resulting in empty or stale data.

This patch refactors `handleAuthLogin` in `js/app.js` to chain the loading of these lists to the completion of `profileStatePromise` (which ensures relays are loaded via `postLoginPromise`). This guarantees that the correct relays are used for fetching user-specific data.

Also defines `dmStatePromise`, `nwcPromise` and `hashtagPreferencesPromise` which were previously referenced but seemingly undefined in the scope, ensuring proper promise tracking.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 17:25:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN cfb395ff1a fix(tests): update expected relay health state in unit test
This update aligns `tests/services/relay-health-service.test.mjs` with the actual state object structure used in `RelayHealthService`, which now includes `consecutiveFailures` and `lastUserLogAt` properties. This fixes a CI failure in the `agent-review` job.

The previous fix for `tests/app-batch-fetch-profiles.test.mjs` (duplicate variable) is also included in this branch history.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:36:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN fdc070479b Optimize post-login sequence to load relays before other data
Prioritizes fetching the user's relay list (NIP-65) immediately after login, ensuring that subsequent data fetches (profile, contact list, DMs, feed) utilize the user's preferred relays instead of default ones. This prevents "slow" or incomplete data loading issues caused by relying on defaults.

- Refactored `authService.applyPostLoginState` to sequence relay loading before profile/block loading.
- Refactored `app.handleAuthLogin` to await relay loading before initiating dependent fetches (Hashtags, Moderation, DMs, NWC, Lists, Feed).
- Updated unit tests in `tests/auth-service.test.mjs` to verify sequential execution and correct return values.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:34:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN 991d166254 fix(tests): remove duplicate variable declaration in profile batch fetcher test
This fixes a syntax error in `tests/app-batch-fetch-profiles.test.mjs` where `originalReadRelays` was declared twice, causing the CI `agent-review` job (and subsequent deploy checks) to fail.

The underlying NIP-07 decryption fix (correctly resolving signer capabilities) remains in place from the previous commit.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:26:31 +00:00
google-labs-jules[bot]andPR0M3TH3AN 730618efa8 fix(nostr): correctly resolve signer capabilities when methods are present
This fixes a critical issue where valid NIP-07 signers were treated as incapable of NIP-44/NIP-04 operations if their initial `capabilities` flag was false, even if the necessary methods (e.g., `nip44Decrypt`) were subsequently added or already present.

This addresses errors like "Gift wrap events require a NIP-44 decryptor" for users with valid extensions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:20:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN dc2dc70b69 test(fuzz): add fuzzing harnesses for schemas, dm, and magnet utils
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:14:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN e2b3ab82c9 fix(test): resolve duplicate declaration in batch fetch profile test and fix nip07 permission race
Resolves a SyntaxError where 'originalReadRelays' was declared twice in 'tests/app-batch-fetch-profiles.test.mjs', causing CI failures.
Also fixes a race condition in `js/nostr/client.js` where NIP-07 permission upgrades were not awaited, causing `tests/nostr-login-permissions.test.mjs` to fail. Updated tests to accommodate the multi-pass login flow.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:59:58 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1d885091cf fix: stabilize nostr login permissions test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:56:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 65f28991a7 fix(test): remove duplicate variable declaration in batch fetch profile test
Resolves a SyntaxError where 'originalReadRelays' was declared twice in 'tests/app-batch-fetch-profiles.test.mjs', causing CI failures. This change ensures the test file parses and runs correctly.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:51:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN dd13f735d9 fix: ensure jsdom for tests and resolve syntax error in batch fetch test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:49:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN c51f5344d9 chore(design): daily design system audit report
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:40:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN b0b88c03d0 fix: ensure jsdom dependency is installed for tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:37:58 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3e08479d04 fix: resolve syntax error in profile batch fetch test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:34:20 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3862415340 chore(ai): doc js/nostr/client.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:31:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN a0f893ace6 perf: optimize critical rendering and data processing paths
- Refactor `AmbientBackground` to use `ResizeObserver` instead of polling layout in animation loop.
- Implement async chunking for `ExploreDataService` to prevent main thread blocking during heavy calculations.
- Throttle `UrlHealthController` video probes to a maximum of 3 concurrent requests to prevent resource exhaustion.
- Document optimization tasks in `OPTIMIZATION_TASKS.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:27:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN e482d32650 chore(ai): remove dead code (agent)
Removed unused exports and functions identified as dead code.
- Removed unused exports from `js/utils/storage.js`, `js/utils/storagePointer.js`, `js/utils/videoTags.js`, `js/ui/moderationCopy.js`.
- Removed unused function `updateTagPillStrip` from `js/ui/components/tagPillList.js` and associated tests.
- Updated `tests/utils/video-tags.test.mjs` to remove test for private function.
- Added `artifacts/depcheck.json` showing dependency analysis.
- Fixed unit test mock for `ProfileModalController` to include `hashtagPreferencesService.load`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:03:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4244f2b6bc fix(test): remove duplicate variable declaration in batch fetch test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:52:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN a659cf4163 chore(ai): remove dead code (agent)
Removed unused exports and functions identified as dead code.
- Removed unused exports from `js/utils/storage.js`, `js/utils/storagePointer.js`, `js/utils/videoTags.js`, `js/ui/moderationCopy.js`.
- Removed unused function `updateTagPillStrip` from `js/ui/components/tagPillList.js` and associated tests.
- Updated `tests/utils/video-tags.test.mjs` to remove test for private function.
- Added `artifacts/depcheck.json` showing dependency analysis.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:51:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2123362b09 fix(build): move build tools to dependencies
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:41:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN ac05fe34e0 chore(ai): remove dead code (agent)
Removed unused exports and functions identified as dead code.
- Removed unused exports from `js/utils/storage.js`, `js/utils/storagePointer.js`, `js/utils/videoTags.js`, `js/ui/moderationCopy.js`.
- Removed unused function `updateTagPillStrip` from `js/ui/components/tagPillList.js` and associated tests.
- Updated `tests/utils/video-tags.test.mjs` to remove test for private function.
- Added `artifacts/depcheck.json` showing dependency analysis.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:40:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN 70e596b314 fix(test): mock hashtagPreferencesService.load in profile modal tests
- Added missing `load` method to `baseHashtagPreferences` mock in `tests/profile-modal-controller.test.mjs` to fix `TypeError: this.hashtagPreferencesService.load is not a function`.
- Updated `package.json` to run `tailwindcss` directly instead of via `npx` to resolve CI build errors ("could not determine executable to run").

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:35:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4966efd5aa fix(test): fix app-batch-fetch-profiles and profile-modal-controller tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:28:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8f7a69ee29 docs(ai): update quickstart and contributing (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:18:14 +00:00
google-labs-jules[bot]andPR0M3TH3AN d68003cc96 fix(ci): resolve unit test failures and ensure build dependencies
- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution.
- Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Update `netlify.toml` to set `NODE_ENV = "development"` during build, ensuring `devDependencies` (required for `npm run build:css`) are installed.
- Verified all unit tests pass locally.
- Verified build configuration syntax.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:14:14 +00:00
google-labs-jules[bot]andPR0M3TH3AN d48cca1a66 fix(ci): resolve unit test failures in batch fetch and profile modal
- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution (2 queries instead of 4).
- Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Verified all unit tests pass with `npm run test:unit`.
- Reverted risky dependency moves in `package.json` to maintain project structure.
- Build process verified locally; addressing test failures is the primary fix for the reported CI errors.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 14:09:20 +00:00
google-labs-jules[bot]andPR0M3TH3AN 79ad3c4709 fix(test): resolve unit test failures in batch fetch and profile modal
- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution (2 queries instead of 4).
- Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Verified all unit tests pass with `npm run test:unit`.
- Verified `npm run build` succeeds locally.
- Verified `_headers` and `_redirects` are present and valid in `dist/`.

This commit addresses the CI failures reported by the user, including the `agent-review` failure and likely resolving the associated 'Deploy failed' checks.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 13:46:17 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1e0a94509e chore(ai): apply formatting/lint autofixes
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 13:28:56 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3055c9c4fb chore(ai): fix unit tests and build script for reproducers
- Fixed `tests/app-batch-fetch-profiles.test.mjs` by mocking `readRelays`.
- Updated `scripts/build-dist.mjs` to exclude `examples/reproducers` from the build output.
- Added minimal reproducers for popover flip bug and VideoCard block action bug.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 12:41:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 511d664eeb chore(ai): add minimal reproducers for known bugs
Added minimal reproducers for:
- Popover flip bug (Playwright)
- VideoCard block action bug (Node.js)

Reproducers are located in `examples/reproducers/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 12:36:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 044d5629be fix(ci): improve build script logging for deployment debugging
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 12:04:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN 113b0a2b72 fix(ci): harden build script and update test mocks
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 11:59:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0ac0b6960d fix(ci): update test mocks for ProfileModalController
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 11:53:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN ce2c30574c test(ai): improve unit test coverage and stability (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 11:39:38 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7ddbec32b8 chore: update cross-env and package-lock.json to fix CI build
- Updated `cross-env` to latest version.
- Updated `package-lock.json` to resolve build warnings and potential CI cache issues.
- Includes previous test fixes and onboarding report.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 10:16:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN e3ee2927ab docs(ai): improve onboarding steps
Fixed failing unit tests identified during onboarding audit:
- Mocked readRelays in tests/app-batch-fetch-profiles.test.mjs to prevent network leakage
- Mocked hashtagPreferencesService.load in tests/profile-modal-controller.test.mjs to fix TypeError
- Added ONBOARDING_REPORT.md with audit details

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 10:09:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN 42abc9abb1 docs(ai): improve onboarding steps
Fixed failing unit tests identified during onboarding audit:
- Mocked readRelays in tests/app-batch-fetch-profiles.test.mjs
- Mocked hashtagPreferencesService.load in tests/profile-modal-controller.test.mjs
- Updated browserslist db
- Added ONBOARDING_REPORT.md

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 10:04:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4eec1e0ca3 fix(tests): mock missing dependencies in unit tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 09:24:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN f456a6d605 fix(test): mock hashtagPreferencesService.load in profile modal test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 09:19:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN f87c3bcffe fix(test): mock readRelays in batch-fetch-profiles test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 09:13:37 +00:00
google-labs-jules[bot]andPR0M3TH3AN 605867de2d chore(ai): dependency scan and upgrade analysis
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 09:09:58 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6d5170d3fc fix: flaky unit test in profile batch fetcher
Updated `tests/app-batch-fetch-profiles.test.mjs` to correctly mock `readRelays` in addition to `relays` and `writeRelays`. `profileMetadataService.js` prioritizes `readRelays`, causing the test to make unexpected network calls when falling back to default values. This fix ensures the test isolation holds and assertions pass consistently.

Also fixed a failing mock in `tests/profile-modal-controller.test.mjs` by adding a missing `load()` method to the `hashtagPreferences` service stub.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 07:55:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN 51c5845ae1 fix: resolve missing mock method in profile modal tests
Added the missing `load()` method to the `hashtagPreferences` mock in `tests/profile-modal-controller.test.mjs`. This resolves the `TypeError` encountered during the `handleAddHashtagPreference` test case, ensuring the test suite passes consistently in CI.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 07:48:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7a3476f926 fix: flaky unit test in profile batch fetcher
Updated `tests/app-batch-fetch-profiles.test.mjs` to correctly mock `readRelays` in addition to `relays` and `writeRelays`. `profileMetadataService.js` prioritizes `readRelays`, causing the test to make unexpected network calls when falling back to default values. This fix ensures the test isolation holds and assertions pass consistently.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 07:37:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7ac4d4eee7 feat: add Nostr interop test script
This script validates protocol interoperability by publishing Video Post and View events, and sending Encrypted DMs using ephemeral keys against public relays. It ensures the NostrClient facade and event builders function correctly in a Node.js environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 07:34:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3302b5700a Use direct tailwindcss executable in build:css
- Replace `npx tailwindcss` with `tailwindcss` in `package.json` scripts.
- Improves build reliability by avoiding npx lookup issues in CI environments.
- Verified build success locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 06:49:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7d325e49db Fix profile-modal-controller test mock
- Update `tests/profile-modal-controller.test.mjs` to include a mock for `hashtagPreferences.load`.
- Fixes `TypeError: this.hashtagPreferencesService.load is not a function` in unit tests.
- Ensures all tests pass locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 06:45:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN a6bf25f9fc Fix app-batch-fetch-profiles test mocking
- Update `tests/app-batch-fetch-profiles.test.mjs` to correctly mock `nostrClient.readRelays`.
- Ensure deterministic relay query counts in unit tests.
- Fixes CI failure where `actual: 4` vs `expected: 2` due to unmocked read relays.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 06:39:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 782ecf3cea Refactor telemetry aggregator regex for stricter error detection
- Update `scripts/agent/telemetry-aggregator.mjs` to use a stricter regex for parsing generic logs.
- Require brackets (e.g., `[ERROR]`, `[WARN]`) or trailing colons/word boundaries (e.g., `Error:`, `FAIL`) to match errors.
- Prevent false positives from status messages like "0 errors" or "0 failures".
- Support `[WARN]` as Medium severity.
- Ensure PII sanitization and `ENABLE_TELEMETRY` guardrails are preserved.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 06:33:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 52dc6f3588 fix(test): mock load method for hashtag preferences service
- Adds `load: async () => {}` to the `hashtagPreferences` mock in `tests/profile-modal-controller.test.mjs`.
- Fixes `TypeError: this.hashtagPreferencesService.load is not a function` during `handleAddHashtagPreference` test execution.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 05:45:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN e1ca5d993d fix(test): mock readRelays in batch fetch test
- Sets `nostrClient.readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to match the test relays.
- Fixes `AssertionError: expected a query per relay. 4 !== 2` caused by falling back to default read relays.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 05:39:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 39c4e2249d chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to verify all event builders produce valid events against the schema.
- Instrumented `js/nostr/nip71.js` to validate NIP-71 events during construction (other builders in `js/nostrEventSchemas.js` were already instrumented).
- Validated all 25 event types using the new tool.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 05:34:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1394c42487 refactor(ai): extract VideoModalController from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 03:45:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3dfba92e04 refactor(ai): extract VideoModalController from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 03:40:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0960d3612d fix(ci): move @tailwindcss/typography to dependencies
- Move `@tailwindcss/typography` from `devDependencies` to `dependencies`.
- This ensures it is available during Netlify's production build, which prunes `devDependencies` but requires this plugin for `tailwind.config.cjs`.
- Fixes "Deploy failed" errors related to build script failures.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 02:43:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7995c23229 fix(ci): move build deps to dependencies
- Move `tailwindcss`, `autoprefixer`, and `postcss` to `dependencies` to ensure they are available during Netlify build (which defaults to production environment).
- Keep version compatibility with v3.
- (Implicit) Includes the `package-lock.json` update.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 02:40:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN ced1f5456f fix(test): mock load method in profile-modal-controller test
- Add missing `load` method to `baseHashtagPreferences` mock in `tests/profile-modal-controller.test.mjs` to fix `TypeError: this.hashtagPreferencesService.load is not a function` in unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 02:34:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 952dc58ade chore(ai): CI health fixes (flaky tests)
- Fix `tests/app-batch-fetch-profiles.test.mjs` by mocking `readRelays` to ensure deterministic query counts.
- Set `NODE_ENV=test` in `scripts/run-unit-tests.mjs` to prevent `nostr-tools` bootstrap failures in test environment.
- Run `npm ci` and `npm audit fix` to maintain lockfile health.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 02:28:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4c211cad1b fix(ci): exclude map/min files from TODO scan and mock relays in tests
- Excluded `*.map` and `*.min.js` files from the `todos.txt` generation command to prevent massive minified lines from crashing CI scripts.
- Mocked `nostrClient.readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to fix assertion errors caused by duplicate network calls.
- Regenerated `artifacts/todos.txt` with the clean output.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 01:39:48 +00:00
google-labs-jules[bot]andPR0M3TH3AN 75fe39c862 fix(test): mock nostrClient.readRelays in profile batch fetcher test
This fixes a CI failure where `batchFetchProfilesFromRelays` made duplicate relay calls because `nostrClient.readRelays` was not mocked, causing it to fall back to default values or overlap with the mocked `nostrClient.relays`.

The test `tests/app-batch-fetch-profiles.test.mjs` now explicitly saves, mocks, and restores `nostrClient.readRelays` to ensure test isolation and accurate call counts.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 01:31:17 +00:00
google-labs-jules[bot]andPR0M3TH3AN ac1cadd41e chore(ai): triage TODOs and FIXMEs
Scanned the codebase for TODO/FIXME markers.
Generated artifacts/todos.txt.
Verified that identified TODOs in tests/visual/moderation.spec.ts are tracked in issues/todo-moderation-tests.md.
No new issues or PRs required as no other actionable TODOs were found.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 01:24:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2ba9b6c4a5 fix(test): mock hashtagPreferencesService.load in profile modal tests
- Updates `tests/profile-modal-controller.test.mjs` to include a mock for `load()` in `baseHashtagPreferences`.
- Resolves the `TypeError: this.hashtagPreferencesService.load is not a function` error seen in CI.
- Ensures unit tests pass for ProfileModalController interactions with the hashtag pane.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 00:27:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN b594a87ef2 fix(build): fail build if critical files are missing in dist
- Updates `scripts/build-dist.mjs` to exit with error code 1 if source files like `_redirects` or `_headers` are missing.
- Prevents silent failures where `dist` directory is incomplete, potentially causing Netlify deployment checks to fail ambiguously.
- Ensures `build:css` failure also terminates the build process explicitly.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 00:05:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6ffc53079c fix(test): mock readRelays in batch fetch test to prevent extra queries
- Updates `tests/app-batch-fetch-profiles.test.mjs` to mock `nostrClient.readRelays` alongside `relays` and `writeRelays`.
- Ensures `batchFetchProfilesFromRelays` queries only the mocked test relays (fast/fail), resolving the `4 !== 2` assertion error in CI.
- Matches logic in `profileMetadataService.js` which prioritizes `readRelays`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 23:58:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN de7fceb8e2 feat: enhance automated PR review script with batch processing and refactoring
- Refactored `scripts/automated-pr-review.mjs` to separate review logic into `reviewPR` function.
- Added `--all` flag to support iterating over all open PRs using `gh` CLI.
- Updated commit message for micro-fixes to `fix(ai): formatting (agent) suggested`.
- Improved error handling and context management (e.g., passing `baseRef`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 23:21:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN 505d8dfc3c fix(deploy): update netlify config and smoke test
- Update `netlify.toml` to explicitly include redirect and header rules, ensuring they are picked up even if file copying fails or is inconsistent.
- Fix `scripts/agent/smoke-test.mjs` to ensure process cleanup on failure (avoiding zombie processes) and use polling for server startup (improving reliability).
- Verified smoke test passes locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 22:44:57 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3c9f9841fc fix(test): mock load method in hashtagPreferences service
- Add `load: async () => {}` stub to `baseHashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Fixes CI failure in `tests/profile-modal-controller.test.mjs` where `this.hashtagPreferencesService.load` was undefined.
- Verified with `npm run test:unit:shard3`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 22:30:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 06dfe6278a chore(ai): add smoke test script (agent)
- Add scripts/agent/smoke-test.mjs for E2E verification
- Fix js/app.js to expose activeProfilePubkey and savedProfiles
- Fix tests/app-batch-fetch-profiles.test.mjs mocking (CI fix)
- Ensure smoke test uses Node.js compatible imports

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 22:00:17 +00:00
google-labs-jules[bot]andPR0M3TH3AN 624dabc576 chore(ai): add smoke test script (agent)
- Added `scripts/agent/smoke-test.mjs` which performs an end-to-e2e smoke test using a local relay, Node.js client, and headless Playwright browser.
- Fixed a bug in `js/app.js` where `activeProfilePubkey` and `savedProfiles` getters were missing, preventing auto-login and session restoration.
- The smoke test verifies:
    - Login flow (using ephemeral keys and localStorage injection).
    - Relay connection (using a local test relay).
    - Publish and Receive flow (Video Post).
    - DM Encryption/Decryption flow (Node.js client).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 21:45:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN 40e809245a chore(ai): remove dead code (agent)
Removed unused exports and functions identified as dead code.
- Removed unused exports from `js/utils/storage.js`, `js/utils/storagePointer.js`, `js/utils/videoTags.js`, `js/ui/moderationCopy.js`.
- Removed unused function `updateTagPillStrip` from `js/ui/components/tagPillList.js` and associated tests.
- Updated `tests/utils/video-tags.test.mjs` to remove test for private function.
- Added `artifacts/depcheck.json` showing dependency analysis.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 20:29:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8fd9fb4a18 chore: Add daily design system audit script
- Add `audit` script to `package.json`.
- Add `scripts/daily-design-system-audit.mjs` implementation.
- Update `scripts/daily-design-system-audit.mjs` to explicitly lint `css/docs.css`.
- Revert changes to `lint:css` in `package.json` to prevent potential CI regressions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 16:53:51 +00:00