From bbc1b2ccfbcde3c323228e7d38bf1da56cea673f Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:33:38 -0500 Subject: [PATCH 01/14] docs(rewrite): map every capture module to its Rust crate --- docs/rewrite/crate-map.md | 468 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 468 insertions(+) create mode 100644 docs/rewrite/crate-map.md diff --git a/docs/rewrite/crate-map.md b/docs/rewrite/crate-map.md new file mode 100644 index 000000000..ca3f70959 --- /dev/null +++ b/docs/rewrite/crate-map.md @@ -0,0 +1,468 @@ +# The crate map: every capture module and what replaced it + +The TypeScript tree at the capture commit `242a3001`, walked module by module at +`9c25d743`, and what each module became. One row per file: the capture path, the Rust +module that owns it, the line that proves the ownership, and the disposition. + +**Tree.** Checked against `9c25d743` (the job's base, `rewrite/main`), whose `src/` is the +capture's tree plus the NIP-77 files the porting window added; the ownership blocks name +`242a3001`. The Rust tree at `9c25d743` is 359 `.rs` files and 121,879 lines, 257 of them +under `crates/*/src`. + +## How the body was generated + +The rows are not typed by hand. The body comes from `find src -name '*.ts' | sort` +(357 lines) joined against the ownership bullets in the eight `crates/*/src/lib.rs` files +whose crates have a TypeScript ancestor; brace lists (`src/@types/{a,b}.ts`), globs +(`src/handlers/event-strategies/*-event-strategy.ts`) and directory tokens were expanded to +their files, as `CLAUDE.md`'s ownership rule requires a reader to do. 305 of the 357 files +are named by a `lib.rs` block; the other 52 are named below from a call site, an ADR, or a +recorded reason. + +The per-crate totals over the 357 rows are: `nostream-admin` 69, `nostreamd` 60, +`nostream-core` 44, `nostream-relay` 39, `nostream-cli` 32, `nostream-services` 29, +`nostream-storage` 24, `nostream-config` 8, and 26 rows that name no crate. 28 files are +claimed by two crates; the row names the crate that owns the type first and the other's +share in the same cell, in parentheses. + +**The citation column** is the line that proves the mapping: the `lib.rs` ownership bullet +for a row a block names, and the call site or ADR for a row it does not. The collection is +generated, so a citation proves *whence the row came*; that the first cell is the capture's +file is checked separately by the coverage count (`## Checking this file`). + +## How to read a row + +| cell | meaning | +|---|---| +| capture path | the module at `242a3001`'s tree as it stands at `9c25d743` | +| Rust module | the module the port lives in, named where a same-named port exists, else the crate's `lib.rs` — the ownership declaration | +| citation | the `path:line` in this tree that records the mapping | +| disposition | `moved`, with the seam named when a second crate shares the file, or `not moved (#)` | + +## The map + +| capture module | Rust module | evidence | disposition | +|---|---|---|---| +| `src/@types/adapters.ts` | `crates/nostream-storage/src/backend.rs` | `crates/nostream-storage/src/backend.rs:2` | moved | +| `src/@types/admin-audit.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | moved | +| `src/@types/admin-ops.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | moved | +| `src/@types/admin.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | moved | +| `src/@types/base.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:10` | moved | +| `src/@types/cache.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:26` | not moved (#1336) — the `redis` client type; no cache server is added (ADR 0010) | +| `src/@types/clients.ts` | `crates/nostream-relay/src/connection.rs` | `crates/nostream-relay/src/lib.rs:16` | moved | +| `src/@types/controllers.ts` | `crates/nostream-admin/src/controllers/mod.rs` | `crates/nostream-admin/src/controllers/mod.rs:1-2` | moved | +| `src/@types/database.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/dvm.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:16` | moved | +| `src/@types/event.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:10` | moved | +| `src/@types/invite-code.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/invoice.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/message-handlers.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:16` | moved | +| `src/@types/messages.ts` | `crates/nostream-core/src/messages.rs` | `crates/nostream-core/src/lib.rs:10` | moved | +| `src/@types/negentropy.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/nip77.rs:1-2` | moved | +| `src/@types/nip05.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/notification-outbox.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/operator-notifications.ts` | `crates/nostream-config/src/lib.rs` | `crates/nostream-config/src/lib.rs:8` | moved | +| `src/@types/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | moved | +| `src/@types/report.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/repositories.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/services.ts` | `crates/nostream-services/src/services/mod.rs` | `crates/nostream-services/src/lib.rs:16` | moved | +| `src/@types/settings.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:8` | moved | +| `src/@types/subscription.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-relay/src/lib.rs:16` | moved | +| `src/@types/tor.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:13` | moved | +| `src/@types/user-subscription.ts` | — | `crates/nostream-storage/src/lib.rs:26-28` | not moved (#1036) — `user_subscriptions` has no Rust trait; recurring plans are #1036's | +| `src/@types/user.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | +| `src/@types/utils.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:11` | moved | +| `src/adapters/redis-adapter.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — the Redis cache adapter is not ported (ADR 0010) | +| `src/adapters/web-server-adapter.ts` | `crates/nostreamd/src/acceptor.rs` | `crates/nostreamd/src/lib.rs:9-10` | moved | +| `src/adapters/web-socket-adapter.ts` | `crates/nostream-relay/src/connection.rs` | `crates/nostream-relay/src/lib.rs:10` | moved | +| `src/adapters/web-socket-server-adapter.ts` | `crates/nostream-relay/src/transport.rs` | `crates/nostream-relay/src/lib.rs:10` | moved | +| `src/admin/password-admin-auth-provider.ts` | `crates/nostream-admin/src/utils/password.rs` | `crates/nostream-admin/src/lib.rs:16` | moved | +| `src/app/app.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:6` | moved | +| `src/app/dvm-orchestrator-worker.ts` | `crates/nostream-services/src/workers/dvm_orchestrator.rs` | `crates/nostream-services/src/lib.rs:9` | moved | +| `src/app/maintenance-worker.ts` | `crates/nostream-services/src/workers/maintenance.rs` | `crates/nostream-services/src/lib.rs:9` | moved | +| `src/app/relay-monitor-worker.ts` | — | `crates/nostreamd/src/lib.rs:37-38` | not moved (#865) — the probe worker belongs to #865 and is not registered | +| `src/app/worker.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:6` | moved | +| `src/cache/client.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — no Redis client is added (ADR 0010) | +| `src/clean-db.ts` | `crates/nostream-cli/src/commands/clean_db.rs` | `crates/nostream-cli/src/lib.rs:9` | moved | +| `src/cli/commands/config.ts` | `crates/nostream-cli/src/config.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/dev.ts` | — | `crates/nostream-cli/src/app.rs:74-75` | not moved (#867) — the capture's `dev` command is removed, not ported (R17) | +| `src/cli/commands/export.ts` | `crates/nostream-cli/src/commands/export.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/import.ts` | `crates/nostream-cli/src/commands/import.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/info.ts` | `crates/nostream-cli/src/commands/info.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/invite.ts` | `crates/nostream-cli/src/commands/invite.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/seed.ts` | `crates/nostream-cli/src/commands/seed.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/setup.ts` | `crates/nostream-cli/src/commands/setup.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/start.ts` | `crates/nostream-cli/src/commands/start.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/stop.ts` | `crates/nostream-cli/src/commands/stop.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/commands/update.ts` | `crates/nostream-cli/src/commands/update.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/index.ts` | `crates/nostream-cli/src/app.rs` | `crates/nostream-cli/src/lib.rs:11-14` | moved | +| `src/cli/tui/main.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/menus/configure.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/menus/dev.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/menus/manage.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/menus/start.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/menus/stop.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/prompts.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/state.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/types.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/utils/bootstrap.ts` | `crates/nostream-cli/src/bootstrap.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-cli/src/lib.rs:7`, `crates/nostream-services/src/lib.rs:18` | moved — the command; services owns the spawn seam | +| `src/cli/utils/config.ts` | `crates/nostream-cli/src/config.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/utils/docker.ts` | `crates/nostream-cli/src/compose.rs` | `crates/nostream-cli/src/lib.rs:7` | moved — the command; services owns the spawn seam | +| `src/cli/utils/env-config.ts` | `crates/nostream-cli/src/env_file.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/utils/output.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/utils/paths.ts` | `crates/nostream-cli/src/env_file.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/utils/process.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:7` | moved — the command; services owns the spawn seam | +| `src/constants/adapter.ts` | `crates/nostream-relay/src/transport.rs` | `crates/nostream-relay/src/transport.rs:1-3` | moved — the emitter's event names are not kept; #865 owns the transport's states | +| `src/constants/base.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:7` | moved | +| `src/constants/caching.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1036) — the admission and plan cache keys; the plan surface is #1036's | +| `src/controllers/admin/get-admin-audit-log-controller.ts` | `crates/nostream-admin/src/controllers/get_audit_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-admin-diagnostics-export-controller.ts` | `crates/nostream-admin/src/controllers/get_diagnostics_export.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-health-controller.ts` | `crates/nostream-admin/src/controllers/get_health.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-metrics-controller.ts` | `crates/nostream-admin/src/controllers/get_metrics.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-moderation-limits-controller.ts` | `crates/nostream-admin/src/controllers/get_moderation_limits.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-moderation-stats-controller.ts` | `crates/nostream-admin/src/controllers/get_moderation_stats.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-network-health-controller.ts` | `crates/nostream-admin/src/controllers/get_network_health.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-network-health-history-controller.ts` | `crates/nostream-admin/src/controllers/get_network_health_history.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-notification-delivery-log-controller.ts` | `crates/nostream-admin/src/controllers/get_notification_delivery_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-notifications-controller.ts` | `crates/nostream-admin/src/controllers/get_notifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-ops-nip05-verifications-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_nip05_verifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-ops-storage-counts-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_storage_counts.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-ops-workers-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_workers.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-session-controller.ts` | `crates/nostream-admin/src/controllers/get_session.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-settings-backups-controller.ts` | `crates/nostream-admin/src/controllers/get_settings_backups.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-settings-controller.ts` | `crates/nostream-admin/src/controllers/get_settings.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-settings-schema-controller.ts` | `crates/nostream-admin/src/controllers/get_settings_schema.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/patch-moderation-limits-controller.ts` | `crates/nostream-admin/src/controllers/patch_moderation_limits.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/patch-notifications-controller.ts` | `crates/nostream-admin/src/controllers/patch_notifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/patch-settings-controller.ts` | `crates/nostream-admin/src/controllers/patch_settings.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-admin-network-health-run-controller.ts` | `crates/nostream-admin/src/controllers/post_network_health_run.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-login-controller.ts` | `crates/nostream-admin/src/controllers/post_login.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-logout-controller.ts` | `crates/nostream-admin/src/controllers/post_logout.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-moderation-actions-controller.ts` | `crates/nostream-admin/src/controllers/post_moderation_actions.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-notification-test-controller.ts` | `crates/nostream-admin/src/controllers/post_notification_test.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-ops-nip05-reverify-controller.ts` | `crates/nostream-admin/src/controllers/post_ops_nip05_reverify.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-settings-restore-controller.ts` | `crates/nostream-admin/src/controllers/post_settings_restore.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/post-settings-validate-controller.ts` | `crates/nostream-admin/src/controllers/post_settings_validate.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admission/get-admission-check-controller.ts` | `crates/nostream-relay/src/relay.rs` | `crates/nostream-relay/src/lib.rs:12` | moved | +| `src/controllers/callbacks/lnbits-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | +| `src/controllers/callbacks/nodeless-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | +| `src/controllers/callbacks/opennode-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | +| `src/controllers/callbacks/zebedee-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | +| `src/controllers/invoices/get-invoice-controller.ts` | `crates/nostream-services/src/controllers/invoice_controller.rs` | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | moved | +| `src/controllers/invoices/get-invoice-status-controller.ts` | `crates/nostream-services/src/controllers/invoice_controller.rs` | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | moved | +| `src/controllers/invoices/post-invoice-controller.ts` | `crates/nostream-services/src/controllers/invoice_controller.rs` | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | moved | +| `src/controllers/subscriptions/get-subscription-status-controller.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — the subscription tables are not in the Rust schema | +| `src/database/client.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:9` | moved | +| `src/database/transaction.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:9` | moved | +| `src/factories/admin-auth-provider-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/admin-ops-cache-adapter-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/app-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-audit-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-diagnostics-export-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-health-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-metrics-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-moderation-stats-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-network-health-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-network-health-history-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-notification-delivery-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-notifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-ops-nip05-verifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-ops-storage-counts-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-ops-workers-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-session-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-settings-backups-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-settings-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-settings-schema-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admission-check-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-invoice-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-invoice-status-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-subscription-status-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/lnbits-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/nodeless-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/opennode-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/patch-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/patch-admin-notifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/patch-admin-settings-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-login-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-logout-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-moderation-actions-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-network-health-run-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-notification-test-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-ops-nip05-reverify-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-settings-restore-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-admin-settings-validate-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-invoice-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/zebedee-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/dvm-orchestrator-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/event-repository-factory.ts` | `crates/nostream-storage/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-storage/src/lib.rs:16`, `crates/nostreamd/src/lib.rs:14` | moved — the repository; the daemon composes it | +| `src/factories/event-strategy-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the registry; the daemon composes it | +| `src/factories/logger-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/maintenance-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/maintenance-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/message-handler-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the registry; the daemon composes it | +| `src/factories/notification-outbox-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/mod.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/payments-processors/lnbits-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnbits.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved — the processor; the daemon composes it | +| `src/factories/payments-processors/lnurl-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnurl.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/payments-processors/nodeless-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nodeless.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/payments-processors/nwc-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nwc.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/payments-processors/opennode-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/opennode.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved — the processor; the daemon composes it | +| `src/factories/payments-processors/zebedee-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/zebedee.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved — the processor; the daemon composes it | +| `src/factories/payments-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/rate-limiter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the limiter; the daemon composes it | +| `src/factories/relay-monitor-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/settings-factory.ts` | `crates/nostream-config/src/settings.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-config/src/lib.rs:12`, `crates/nostreamd/src/lib.rs:14` | moved — the loaded value; the daemon owns it | +| `src/factories/subscription-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/web-app-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/websocket-adapter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the transport; the daemon binds it | +| `src/factories/worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/wot-graph-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/handlers/auth-message-handler.ts` | `crates/nostream-relay/src/handlers/auth.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | +| `src/handlers/count-message-handler.ts` | `crates/nostream-relay/src/handlers/count.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | +| `src/handlers/event-message-handler.ts` | `crates/nostream-relay/src/handlers/event.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | +| `src/handlers/event-strategies/contact-list-event-strategy.ts` | `crates/nostream-relay/src/strategies/contact_list.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/default-event-strategy.ts` | `crates/nostream-relay/src/strategies/default.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/delete-event-strategy.ts` | `crates/nostream-relay/src/strategies/delete.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/dvm-job-request-event-strategy.ts` | `crates/nostream-relay/src/strategies/dvm_job_request.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/ephemeral-event-strategy.ts` | `crates/nostream-relay/src/strategies/ephemeral.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/gift-wrap-event-strategy.ts` | `crates/nostream-relay/src/strategies/gift_wrap.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/group-event-strategy.ts` | `crates/nostream-relay/src/strategies/group.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/invite-request-event-strategy.ts` | `crates/nostream-relay/src/strategies/invite_request.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/join-request-event-strategy.ts` | `crates/nostream-relay/src/strategies/join_request.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/leave-request-event-strategy.ts` | `crates/nostream-relay/src/strategies/leave_request.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/parameterized-replaceable-event-strategy.ts` | `crates/nostream-relay/src/strategies/parameterized_replaceable.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/replaceable-event-strategy.ts` | `crates/nostream-relay/src/strategies/replaceable.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/report-event-strategy.ts` | `crates/nostream-relay/src/strategies/report.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/timestamp-event-strategy.ts` | `crates/nostream-relay/src/strategies/timestamp.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/event-strategies/vanish-event-strategy.ts` | `crates/nostream-relay/src/strategies/vanish.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | +| `src/handlers/neg-close-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — no handler module is claimed; NIP-77 is cut against `041fe34e` | +| `src/handlers/neg-msg-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — no handler module is claimed; NIP-77 is cut against `041fe34e` | +| `src/handlers/neg-open-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — no handler module is claimed; NIP-77 is cut against `041fe34e` | +| `src/handlers/request-handlers/admin-auth-middleware.ts` | `crates/nostream-admin/src/controllers/admin_auth_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/admin-enabled-middleware.ts` | `crates/nostream-admin/src/controllers/admin_enabled_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/admin-json-body-middleware.ts` | `crates/nostream-admin/src/controllers/admin_json_body_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/admin-rate-limit-middleware.ts` | `crates/nostream-admin/src/controllers/admin_rate_limit_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/get-admin-dashboard-request-handler.ts` | `crates/nostream-admin/src/controllers/get_dashboard.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/get-health-request-handler.ts` | `crates/nostream-admin/src/controllers/get_health.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/get-privacy-request-handler.ts` | `crates/nostream-admin/src/controllers/get_privacy.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/get-readyz-request-handler.ts` | `crates/nostream-admin/src/controllers/get_readyz.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/get-terms-request-handler.ts` | `crates/nostream-admin/src/controllers/get_terms.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/nodeinfo-handler.ts` | `crates/nostream-admin/src/controllers/nodeinfo.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/rate-limiter-middleware.ts` | `crates/nostream-admin/src/controllers/admin_rate_limit_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/root-request-handler.ts` | `crates/nostream-admin/src/controllers/root.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/with-admin-controller-request-handler.ts` | `crates/nostream-admin/src/controllers/with_admin_controller_request_handler.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/with-controller-request-handler.ts` | `crates/nostream-admin/src/controllers/with_admin_controller_request_handler.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/subscribe-message-handler.ts` | `crates/nostream-relay/src/handlers/subscribe.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | +| `src/handlers/unsubscribe-message-handler.ts` | `crates/nostream-relay/src/handlers/unsubscribe.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | +| `src/import-events.ts` | `crates/nostream-services/src/services/event_import_service.rs` | `crates/nostream-cli/src/lib.rs:9`, `crates/nostream-services/src/lib.rs:15` | moved | +| `src/index.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:8` | moved | +| `src/logger.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:8` | moved | +| `src/payments-processors/lnbits-payment-processor.ts` | `crates/nostream-services/src/payments/processors/lnbits.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/payments-processors/lnurl-payments-processor.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/payments-processors/nodeless-payments-processor.ts` | `crates/nostream-services/src/payments/processors/nodeless.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/payments-processors/null-payments-processor.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/payments-processors/nwc-payments-processor.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/payments-processors/opennode-payments-processor.ts` | `crates/nostream-services/src/payments/processors/opennode.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/payments-processors/zebedee-payments-processor.ts` | `crates/nostream-services/src/payments/processors/zebedee.rs` | `crates/nostream-services/src/lib.rs:12` | moved | +| `src/relay-broadcast/redis-relay-broadcast-fanout.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:11`, `crates/nostream-relay/src/lib.rs:36` | moved | +| `src/repositories/dvm-job-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/event-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/invite-code-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/invoice-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/nip05-verification-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/notification-delivery-log-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/notification-outbox-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/report-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/user-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/repositories/user-subscription-repository.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | +| `src/routes/admin/index.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/routes/admissions/index.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:13` | moved | +| `src/routes/callbacks/index.ts` | `crates/nostream-services/src/controllers/mod.rs` | `crates/nostream-services/src/controllers/mod.rs:1-2` | moved | +| `src/routes/index.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:11` | moved | +| `src/routes/invoices/index.ts` | `crates/nostream-services/src/controllers/mod.rs` | `crates/nostream-services/src/controllers/mod.rs:1-2` | moved | +| `src/routes/subscriptions/index.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — the subscription tables are not in the Rust schema | +| `src/schemas/admin-login-schema.ts` | `crates/nostream-admin/src/controllers/post_login.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | +| `src/schemas/admin-moderation-schema.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | +| `src/schemas/admin-notifications-schema.ts` | `crates/nostream-admin/src/controllers/patch_notifications.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | +| `src/schemas/admin-settings-schema.ts` | `crates/nostream-admin/src/controllers/patch_settings.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | +| `src/schemas/base-schema.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:8` | moved | +| `src/schemas/event-schema.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:8` | moved | +| `src/schemas/filter-schema.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-core/src/lib.rs:9` | moved | +| `src/schemas/lnbits-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | +| `src/schemas/message-schema.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:9` | moved | +| `src/schemas/nodeless-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | +| `src/schemas/opennode-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | +| `src/schemas/zebedee-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | +| `src/scripts/bench-gate.ts` | — | `docs/rewrite/benchmarks.md:248` | not moved (#868) — the gate is the capture's TypeScript tooling; the Rust rig has no gate | +| `src/scripts/benchmark-queries.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:8` | moved | +| `src/scripts/export-events.ts` | `crates/nostream-cli/src/commands/export.rs` | `crates/nostream-cli/src/lib.rs:8` | moved | +| `src/services/event-import-service.ts` | `crates/nostream-services/src/services/event_import_service.rs` | `crates/nostream-services/src/lib.rs:10`, `crates/nostream-services/src/lib.rs:15` | moved | +| `src/services/maintenance-service.ts` | `crates/nostream-services/src/services/maintenance_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/nip66-event-publisher.ts` | `crates/nostream-services/src/services/nip66_event_publisher.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/notification-channels.ts` | `crates/nostream-services/src/services/notification_channels.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/notification-outbox-service.ts` | `crates/nostream-services/src/services/notification_outbox_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/operator-notification-service.ts` | `crates/nostream-services/src/services/operator_notification_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/payments-service.ts` | `crates/nostream-services/src/services/payments_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/subscription-service.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — no subscription service; the tables are not in the Rust schema | +| `src/services/wot-graph-service.ts` | `crates/nostream-services/src/services/wot_graph_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/telemetry/event-metrics.ts` | `crates/nostream-relay/src/metrics.rs` | `crates/nostream-relay/src/lib.rs:19`, `crates/nostreamd/src/lib.rs:12` | moved | +| `src/telemetry/metrics.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:12` | moved | +| `src/telemetry/ops-metrics.ts` | — | `crates/nostream-services/src/lib.rs:30-32` | not moved (#865) — the probe counters go with the probe family | +| `src/tor/client.ts` | `crates/nostream-services/src/tor.rs` | `crates/nostream-services/src/lib.rs:14`, `crates/nostreamd/src/lib.rs:13` | moved | +| `src/utils/adaptive-pow.ts` | `crates/nostream-core/src/adaptive_pow.rs` | `crates/nostream-core/src/lib.rs:12` | moved | +| `src/utils/admin-audit-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-diagnostics-export.ts` | `crates/nostream-admin/src/utils/diagnostics.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-grafana.ts` | `crates/nostream-admin/src/utils/grafana.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-health.ts` | `crates/nostream-admin/src/utils/health.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-metrics.ts` | `crates/nostream-relay/src/metrics.rs` | `crates/nostream-admin/src/lib.rs:14`, `crates/nostream-relay/src/lib.rs:19` | moved | +| `src/utils/admin-moderation-persist.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-moderation-stats.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-moderation.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-notifications-settings.ts` | `crates/nostream-config/src/notifications.rs` | `crates/nostream-admin/src/lib.rs:14`, `crates/nostream-config/src/lib.rs:11` | moved | +| `src/utils/admin-ops-config.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-ops-nip05.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-ops-sanitize.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-ops-storage.ts` | `crates/nostream-admin/src/utils/storage.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-ops-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-password.ts` | `crates/nostream-admin/src/utils/password.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-rate-limit.ts` | `crates/nostream-admin/src/utils/rate_limit.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-session.ts` | `crates/nostream-admin/src/utils/session.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/banner.ts` | — | `crates/nostreamd/src/lib.rs:3-8` | not moved (#1336) — no banner is printed; the daemon's ownership block has no banner entry | +| `src/utils/compression.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:12` | moved | +| `src/utils/event-store.ts` | `crates/nostream-storage/src/event_store.rs` | `crates/nostream-storage/src/lib.rs:11` | moved | +| `src/utils/event.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:12` | moved | +| `src/utils/ewma-rate-limiter.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | +| `src/utils/filter.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-core/src/lib.rs:13` | moved | +| `src/utils/geohash.ts` | `crates/nostream-core/src/geohash.rs` | `crates/nostream-core/src/lib.rs:13` | moved | +| `src/utils/hidden-content-cache.ts` | `crates/nostream-relay/src/hidden_content.rs` (`crates/nostream-storage/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:14`, `crates/nostream-storage/src/lib.rs:11` | moved — the mirror; storage owns the query | +| `src/utils/html.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:13` | moved | +| `src/utils/http.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-admin/src/lib.rs`) | `crates/nostream-core/src/lib.rs:14`, `crates/nostream-admin/src/lib.rs:15` | moved — the request types; admin owns the response half | +| `src/utils/invoice.ts` | `crates/nostream-services/src/invoice.rs` | `crates/nostream-services/src/lib.rs:17` | moved | +| `src/utils/messages.ts` | `crates/nostream-core/src/messages.rs` | `crates/nostream-core/src/lib.rs:14` | moved | +| `src/utils/misc.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:14` | moved | +| `src/utils/moderation-rate-limit-stats.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — the Redis-sorted-set stats panel has no Rust counterpart | +| `src/utils/monitor-identity.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:2` | moved | +| `src/utils/negentropy-sessions.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:48` | moved | +| `src/utils/negentropy.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:15` | moved | +| `src/utils/network-health-mismatches.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — part of the NIP-66 probe family | +| `src/utils/nip03.ts` | `crates/nostream-core/src/nip03.rs` | `crates/nostream-core/src/lib.rs:15` | moved | +| `src/utils/nip05-reverification.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/utils/nip05.rs:2` | moved | +| `src/utils/nip05.ts` | `crates/nostream-core/src/nip05.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:16`, `crates/nostream-services/src/lib.rs:17` | moved — the NIP; services owns the payment surface | +| `src/utils/nip25.ts` | `crates/nostream-core/src/nip25.rs` | `crates/nostream-core/src/lib.rs:16` | moved | +| `src/utils/nip42-session.ts` | `crates/nostream-core/src/nip42.rs` | `crates/nostream-core/src/lib.rs:17` | moved | +| `src/utils/nip42.ts` | `crates/nostream-core/src/nip42.rs` | `crates/nostream-core/src/lib.rs:16` | moved | +| `src/utils/nip43-invites.ts` | `crates/nostream-core/src/nip43.rs` | `crates/nostream-core/src/lib.rs:17` | moved | +| `src/utils/nip43.ts` | `crates/nostream-core/src/nip43.rs` | `crates/nostream-core/src/lib.rs:17` | moved | +| `src/utils/nip44.ts` | `crates/nostream-core/src/nip44.rs` | `crates/nostream-core/src/lib.rs:18` | moved | +| `src/utils/nip56.ts` | `crates/nostream-core/src/nip56.rs` | `crates/nostream-core/src/lib.rs:18` | moved | +| `src/utils/nip65.ts` | `crates/nostream-core/src/nip65.rs` | `crates/nostream-core/src/lib.rs:18` | moved | +| `src/utils/nip66-events.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:19` | moved | +| `src/utils/nip66-nip11-tags.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:19` | moved | +| `src/utils/nip66-schedule.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:20` | moved | +| `src/utils/nip77.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/lib.rs:46` | moved | +| `src/utils/nip98-replay.ts` | `crates/nostream-core/src/nip98.rs` | `crates/nostream-core/src/lib.rs:21` | moved | +| `src/utils/nip98.ts` | `crates/nostream-core/src/nip98.rs` | `crates/nostream-core/src/lib.rs:20` | moved | +| `src/utils/operator-notification-enqueue.ts` | `crates/nostream-services/src/services/operator_notification_service.rs` | `crates/nostream-services/src/services/operator_notification_service.rs:162` | moved | +| `src/utils/ops-trust-notifications.ts` | — | `crates/nostream-services/src/lib.rs:30-32` | not moved (#1036) — named there as a port still owed | +| `src/utils/peering-auth.ts` | — | `crates/nostream-config/src/settings.rs:805` | not moved (#1036) — the settings model exists; the peer authenticator is #1036's | +| `src/utils/prometheus-client.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — the console's Prometheus query client has no Rust counterpart | +| `src/utils/proof-of-work.ts` | `crates/nostream-core/src/pow.rs` | `crates/nostream-core/src/lib.rs:21` | moved | +| `src/utils/record-admin-audit.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:41` | not moved (#867) — the audit log is the admin job's | +| `src/utils/relay-broadcast-deduplicator.ts` | `crates/nostream-relay/src/broadcast.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | +| `src/utils/relay-broadcast-message.ts` | `crates/nostream-relay/src/broadcast.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | +| `src/utils/relay-broadcast-state.ts` | `crates/nostream-relay/src/broadcast.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | +| `src/utils/relay-probe-history.ts` | — | `crates/nostream-services/src/lib.rs:30-32` | not moved (#1036) — probe history retention is #1036's | +| `src/utils/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | moved | +| `src/utils/relay-probe-targets.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:2` | moved | +| `src/utils/relay-probe/dns-cache.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:20` | moved | +| `src/utils/relay-probe/dns-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:20` | moved | +| `src/utils/relay-probe/index.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | +| `src/utils/relay-probe/nip11-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:34` | moved | +| `src/utils/relay-probe/run-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:48` | moved | +| `src/utils/relay-probe/target.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:6` | moved | +| `src/utils/relay-probe/tls-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:27` | moved | +| `src/utils/relay-probe/types.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | +| `src/utils/relay-probe/ws-protocol-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | +| `src/utils/relay-probe/ws-rtt-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:41` | moved | +| `src/utils/report-scoring.ts` | `crates/nostream-core/src/report_scoring.rs` | `crates/nostream-core/src/lib.rs:22` | moved | +| `src/utils/secret.ts` | `crates/nostream-core/src/secret.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:22`, `crates/nostream-services/src/lib.rs:17` | moved — the primitive; services owns the payment surface | +| `src/utils/settings-config.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:9` | moved | +| `src/utils/settings-guided-schema.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:10` | moved | +| `src/utils/settings-paths.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:9` | moved | +| `src/utils/settings-redaction.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:10` | moved | +| `src/utils/settings.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:9` | moved | +| `src/utils/shutdown-state.ts` | `crates/nostream-core/src/lifecycle.rs` | `crates/nostream-core/src/lib.rs:22` | moved | +| `src/utils/sliding-window-rate-limiter.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | +| `src/utils/stream.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:23` | moved | +| `src/utils/subscription.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — recurring membership plans; the tables are not in the Rust schema | +| `src/utils/template-cache.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:23` | moved | +| `src/utils/transform.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:23`, `crates/nostream-services/src/lib.rs:17` | moved — the primitive; services owns the payment surface | +| `src/utils/validation.ts` | `crates/nostream-core/src/validation.rs` | `crates/nostream-core/src/lib.rs:24` | moved | +| `src/utils/wot-pow-policy.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:24` | moved | + +## Rust modules with no TypeScript ancestor + +The map is incomplete in the other direction: these are real modules a reader will meet and +must not read as an omission from the table above. They have no TS ancestor at the capture, +so no row can name them. + +| Rust module | why it has no ancestor | +|---|---| +| `crates/nostream-mcp/src` | the admin MCP server; the capture had no MCP surface (`crates/nostream-mcp/src/lib.rs:1-3`) | +| `crates/nostream-scan/src` | extracted from the services' event-import reader so Kani can prove the element-end scanner (`crates/nostream-scan/src/lib.rs:1-9`) | +| `crates/nostream-storage/src/lmdb` | the LMDB backend, new work: the capture's store is Postgres only (ADR 0011) | +| `crates/nostream-cli/src/commands/migrate.rs` | the PG→LMDB copy, new work: the capture has no migration tool (ADR 0013) | +| `crates/nostream-relay/src/connection_cap.rs` | the per-address connection cap, a runtime concern the cluster model did not need (ADR 0005, ADR 0008) | +| `crates/nostreamd/src/acceptor.rs` | one acceptor task for the one listener; the capture's primary never listens (ADR 0001) | +| `crates/nostreamd/src/settings_gate.rs` | the daemon's `--check` mode and its exit codes (ADR 0015) | +| `crates/nostreamd/src/mcp_stdio.rs` | the `--mcp-stdio` mode: the daemon hosting the MCP server on stdin/stdout (ADR 0014, D19) | +| `crates/nostreamd/src/admin_http.rs` | the admin router's composition onto the one listener (ADR 0014, ADR 0021) | +| `crates/nostreamd/src/stores.rs` | the daemon's backend factory: one resolved event-store bundle for the relay, the services and the admin state | + +Also with no ancestor, and not enumerated above: the storage seam +`crates/nostream-storage/src/migration.rs`, the LMDB opener `crates/nostream-storage/src/opened.rs`, +and `crates/nostream-cli/src/commands/migrate_unsupported.rs` (the Postgres-less build's refusal). +The count of `Phase [1-2] stub` markers these carry is 31; a new stub without its label moves +that count, which is how `CLAUDE.md` keeps the list honest. + +## The files whose disposition is a judgement + +The rows marked `not moved` fall in three classes, and a reader should be able to tell them +apart: + +- **A job already owns the port.** `#865` (the NIP-66 probe family), `#867` (the invoice and + callback controllers, and the console's own utilities) and `#1036` (NIP-77, peering, + recurring plans, the probe/SSL notifications) are open and name these files or their + feature. The row names the tracker; the port is not owed to this document. +- **The tree decided against the surface.** The Redis client type, the Redis cache adapter + and the startup banner have no Rust counterpart because the decision is recorded (ADR 0010 + deletes the cache server; the daemon prints no banner). No issue tracks a decision, so + those rows name `#1336`, the row whose record this is, and the citation is the decision's + own line. A reader who wants a tracker for them has the ADR. +- **The capture's tooling stays the capture's.** `src/scripts/bench-gate.ts` is TypeScript + tooling run over the capture's benchmark artifacts (`docs/rewrite/benchmarks.md:248`); the + Rust rig has no gate, and `#868` owns that gap. + +## Not covered + +- **The TypeScript sources' internals.** A row says where a module went, not what changed on + the way; the ADRs own the behavioural deltas. +- **A per-function mapping.** The unit is the file, as the row names it. A file whose port + folded two modules into one (the six `utils/settings*.ts` files, the three `nip66-*` files) + gets one row per file, both naming the single module. +- **The 40 `.rs` files outside `crates/*/src`.** Tests, examples and the benchmark rig are + the port's own, and have no capture ancestor to map. +- **What each crate weighs.** The line counts and the benchmark are + `docs/rewrite/benchmarks.md`'s; this map counts modules, not lines. +- **The TypeScript tree at `main`.** `main` still ships it and still advances; this map is + `rewrite/main`'s view of the capture, and a later merge moves the left-hand column, not + this document's rule. + +## Checking this file + +``` +comm -23 <(find src -name '*.ts' | sort) \ + <(grep -oE 'src/[A-Za-z0-9_./@-]+\.ts' docs/rewrite/crate-map.md | sort -u) | wc -l # 0 +python3 scripts/citation-meaning.py docs/rewrite/crate-map.md # exits 0 +``` From a054beab43834b843eab0ad0161afc58c963ad18 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:33:38 -0500 Subject: [PATCH 02/14] docs(rewrite): the daemon's store, settings, scrape, console and MCP door --- docs/rewrite/deploying.md | 479 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 479 insertions(+) create mode 100644 docs/rewrite/deploying.md diff --git a/docs/rewrite/deploying.md b/docs/rewrite/deploying.md new file mode 100644 index 000000000..0e9c33466 --- /dev/null +++ b/docs/rewrite/deploying.md @@ -0,0 +1,479 @@ +# Deploying the Rust relay + +What an operator needs to run `nostreamd`, the daemon this branch builds, and what to expect +from each surface. Every command below was run once against `9c25d743` (the tree this branch +is checked out at) and its real output is quoted. The port is the job's, `5744`; the default +is `8008`. + +The decisions behind these surfaces are the ADRs and are linked, not restated here: +the one acceptor in `docs/rewrite/decisions/0001-runtime-and-telemetry.md`, the storage seam +in `0003`, the administrative surface in `0014`, the CLI in `0015`, and the scrape endpoint in +`0021`. What this document owns is the operator's command line and its measured outcome. + +**The two binaries.** `nostreamd` is the daemon (`crates/nostreamd/Cargo.toml:10-13`) and it is +what serves the relay and the admin surface. `nostream-cli` is the operator command line +(`crates/nostream-cli/Cargo.toml:10-13`); its `start` and `stop` drive `docker compose` over the +TypeScript stack (`crates/nostream-cli/src/compose.rs:1-14`) and **do not start `nostreamd`**. +That split is the first thing to know about this deployment: there is no `nostream-cli start` +that starts the Rust daemon. + +## How to read the transcripts + +Each block is one command and what it printed, with the exit code on the next line. Three +things are elided or split and are called out where they occur: + +- A listen address is written with its port **on separate lines**, because a `host:port` pair + is read as a `path:line` citation by `scripts/citation-meaning.py`. +- A home directory in an output line is shown as ``, so no host path lands in this + repository. +- Response headers that carry no operator meaning (the date, and the console's CSP header) are + omitted from the `curl -i` blocks; the status line, the content type and the body are kept. + +## The store + +The backend is chosen by `eventStore.backend`, which is exactly `postgres` or `lmdb` +(`resources/default-settings.yaml:230-232`). The shipped value is `postgres`; the LMDB +backend is the one this branch completes. + +``` +$ nostreamd --config-dir /tmp/046-scratch/cfg --data-dir /tmp/046-scratch/data --listen-port 5744 +INFO event store backend resolved backend=Lmdb +INFO the lmdb search index is being rebuilt path=/tmp/046-scratch/data/lmdb +INFO the lmdb search index is rebuilt path=/tmp/046-scratch/data/lmdb rows=0 keys=0 elapsed_ms=1 +INFO the lmdb store is open path=/tmp/046-scratch/data/lmdb map_size=68719476736 used_bytes=8192 used_percent=1.1920928955078125e-5 +INFO event store opened backend=Lmdb +INFO the acceptor is listening at=0.0.0.0 + :5744 +INFO workers registered workers=1 +INFO Tor hidden service: disabled +exit 0 +``` + +**`--data-dir` is required when the backend is `lmdb`**, and the daemon refuses to guess one. +Without it, the same command prints one line and exits 1: + +``` +$ nostreamd --config-dir /tmp/046-scratch/cfg --listen-port 5744 +INFO event store backend resolved backend=Lmdb +event store: the lmdb backend needs --data-dir +exit 1 +``` + +The flag's own help says it (`crates/nostreamd/src/main.rs:29-34`), and both the CLI and the +migration tool use the same shape: the store root is a directory, the environment lives at +`/lmdb`. + +**The layout is three files in the root's `lmdb` directory** — `data.mdb`, `lock.mdb` and +`search-index.lock` — and the directory is created `0700` regardless of the umask +(`crates/nostream-storage/src/backend.rs:96-110`): + +``` +$ ls -la /tmp/046-scratch/data/lmdb +drwx------ 2 node node 4096 Nov 30 05:23 . +-rw------- 1 node node 102400 Nov 30 05:31 data.mdb +-rw------- 1 node node 32896 Nov 30 05:31 lock.mdb +-rw-r--r-- 1 node node 0 Nov 30 05:23 search-index.lock +``` + +The two LMDB files are `0600` and the directory is `0700`, even when the umask says otherwise. +`search-index.lock` is the one file created without a mode, so it takes the umask; that is +tracked as [#1316](https://github.com/cameri/nostream/issues/1316), a finding this page does not +fix. + +**`map_size` is 64 GiB and never grows.** The number is a constant, +`LMDB_MAP_SIZE = 64 << 30` (`crates/nostream-storage/src/lmdb/mod.rs:51`), and the open log +prints it as `map_size=68719476736`. Usage is read against that bound, not against the disk; a +store that fills it refuses the write rather than growing. The measurements that justify the +size are `docs/rewrite/benchmarks.md`'s. + +**Postgres** is still the default and still works: `eventStore.backend: postgres` reads +`DB_URI`, or the `DB_*` parts, with `DB_URI` winning when both are set +(`crates/nostream-storage/src/postgres/mod.rs:355-373`). Its migrations are 37 `.sql` files +embedded with `sqlx::migrate!` and applied in process +(`crates/nostream-storage/src/postgres/mod.rs:315-316`) — there is no separate migrate step and +no migrate container to watch for. + +## Settings + +**Which files are read, in order.** The config directory is `--config-dir`, else +`NOSTR_CONFIG_DIR`, else `/.nostr`; the shipped defaults are always +`/resources/default-settings.yaml` and the user file is deep-merged over them +(`crates/nostream-config/src/paths.rs:23-39`). Four measurements, each one exit code from the +same binary: + +``` +$ NOSTR_CONFIG_DIR=/tmp/046-scratch/cfg-bad nostreamd --check --config-dir /tmp/046-scratch/cfg +settings valid: 0 issues +exit 0 # the flag wins over the variable + +$ NOSTR_CONFIG_DIR=/tmp/046-scratch/cfg-bad nostreamd --check +eventStore.backend: backend must be one of: postgres, lmdb +settings invalid: 1 issues +exit 2 # the variable is read when the flag is absent + +$ cd /tmp/046-scratch/cwdtest && nostreamd --check +settings valid: 0 issues +exit 0 # neither set: /.nostr, which is empty here + +$ cd /tmp/046-scratch/cwdtest && nostreamd --check # now with .nostr/settings.yaml present +eventStore.backend: backend must be one of: postgres, lmdb +settings invalid: 1 issues +exit 2 +``` + +The defaults file is **cwd-relative, not config-dir-relative**, so the daemon has to be started +from a directory that has `resources/` in it. Started anywhere else, it fails before reading any +setting: + +``` +$ cd /tmp && nostreamd --check --config-dir /tmp/046-scratch/cfg +daemon setup failed: failed to read /tmp/resources/default-settings.yaml: No such file or directory (os error 2) +exit 1 +``` + +**`--check` is the only mode that exits 2.** It validates and stops +(`crates/nostreamd/src/settings_gate.rs:1-11`). The exit codes are 0 for success, 2 for invalid +settings, 1 for anything else (`crates/nostreamd/src/main.rs:97-111`): + +``` +$ nostreamd --check --config-dir /tmp/046-scratch/cfg +settings valid: 0 issues +exit 0 + +$ nostreamd --check --config-dir /tmp/046-scratch/cfg-bad +eventStore.backend: backend must be one of: postgres, lmdb +settings invalid: 1 issues +exit 2 + +$ nostreamd --check --config-dir /tmp/046-scratch/cfg-badyaml +$: failed to load user settings: failed to parse /tmp/046-scratch/cfg-badyaml/settings.yaml: did not find expected ',' or ']' at line 3 column 1, while parsing a flow sequence at line 2 column 12 +settings invalid: 1 issues +exit 2 +``` + +**A bad setting does not stop a run** — the daemon says so and continues on the shipped +defaults, which is the behaviour to know before wondering why a setting had no effect: + +``` +$ nostreamd --config-dir /tmp/046-scratch/cfg-bad --data-dir /tmp/046-scratch/data --listen-port 5744 +eventStore.backend: backend must be one of: postgres, lmdb +nostreamd: continuing on the shipped defaults (1 issue(s) in the user settings) +INFO event store backend resolved backend=Postgres +``` + +**The port** is `--listen-port`, then `PORT`, then `RELAY_PORT`, then `8008` +(`crates/nostreamd/src/main.rs:149-161`). Measured, each with the same `--data-dir`: + +``` +$ PORT=6001 nostreamd --config-dir /tmp/046-scratch/cfg --data-dir /tmp/046-scratch/data --listen-port 5744 +INFO the acceptor is listening at=0.0.0.0 + :5744 # the flag wins + +$ PORT=6001 nostreamd ... (no --listen-port) +INFO the acceptor is listening at=0.0.0.0 + :6001 + +$ RELAY_PORT=6002 nostreamd ... (nothing else set) +INFO the acceptor is listening at=0.0.0.0 + :6002 + +$ nostreamd ... (nothing set) +INFO the acceptor is listening at=0.0.0.0 + :8008 +``` + +**The address is `0.0.0.0`** — every interface — and no setting reaches it +(`crates/nostreamd/src/main.rs:162`). A deployment that used to rely on a loopback bind needs a +firewall rule or a reverse proxy in front, and a second daemon on a busy port says so plainly: + +``` +$ nostreamd --config-dir /tmp/046-scratch/cfg --data-dir /tmp/046-scratch/data --listen-port 5744 +daemon setup failed: bind 0.0.0.0 + :5744: Address already in use (os error 98) +``` + +**`WORKER_COUNT` is the tokio runtime's thread count**, not a number of relay workers: it is +read before the runtime is built, and falls back to `workers.count`, then to the CPU count +(`crates/nostreamd/src/main.rs:165-172`, `crates/nostream-services/src/scheduler.rs:242`). With +four CPUs on this host, the thread count is the runtime's workers plus the blocked ones: + +``` +$ WORKER_COUNT=1 nostreamd ... & ; awk '/^Threads:/{print $2}' /proc/$!/status +3 +$ WORKER_COUNT=4 nostreamd ... & ; awk '/^Threads:/{print $2}' /proc/$!/status +6 +$ WORKER_COUNT=abc nostreamd ... & ; awk '/^Threads:/{print $2}' /proc/$!/status +6 # a non-numeric value is ignored and the CPU count is used +``` + +The value no longer selects a cluster: there is one acceptor and no `SO_REUSEPORT` sharding +(ADR 0001). + +**There is no Redis.** The cache server is deleted from the rewrite's model, and rate limiting +runs in process over the relay's own store (ADR 0010, +`crates/nostream-relay/src/limits.rs`); the storage crate says the adapter is not ported +(`crates/nostream-storage/src/lib.rs:22-24`). No `REDIS_*` variable is read by anything this +branch builds. The rows of `CONFIGURATION.md` that still describe a Redis cache, a Redis stream +fan-out and a Redis NIP-66 snapshot are stale and tracked as +[#1337](https://github.com/cameri/nostream/issues/1337). + +## Metrics + +`METRICS_ENABLED` switches the scrape endpoint on, and it accepts exactly `true` or `1`. The +credential is `METRICS_TOKEN`, sent as a bearer token — the admin session cookie does not +authenticate it. Both are read once at the edge, not per request +(`crates/nostreamd/src/admin_http.rs:219-228`); the endpoint's decision, its counters and the +token's shape are `docs/rewrite/decisions/0021-prometheus-metrics.md:62-71`'s. + +The path is `GET /metrics`, where the prefix is `info.relay_url`'s path and not +`/admin` (`crates/nostream-admin/src/routes/mod.rs:32-35`). + +``` +$ METRICS_ENABLED=true nostreamd ... (no METRICS_TOKEN) +$ curl -isS http://localhost:5744/metrics +HTTP/1.1 401 Unauthorized +content-type: application/json +content-length: 24 + +{"error":"Unauthorized"} +``` + +``` +$ METRICS_ENABLED=true METRICS_TOKEN=s3cr3t-scrape-token nostreamd ... +$ curl -isS -H 'Authorization: Bearer s3cr3t-scrape-token' http://localhost:5744/metrics +HTTP/1.1 200 OK +content-type: text/plain; version=0.0.4; charset=utf-8 +content-length: 1390 + +# HELP nostream_connections_active Current number of active WebSocket connections +# TYPE nostream_connections_active gauge +nostream_connections_active 0 + +$ curl -o /dev/null -w '%{http_code}\n' -H 'Authorization: Bearer wrong' http://localhost:5744/metrics +401 +``` + +The body is 1390 bytes on an idle relay and every line is a `nostream_*` counter; the counters +are `crates/nostream-relay/src/metrics.rs`'s and what each measures is ADR 0021's. + +**The prefix follows `info.relay_url`.** With `info.relay_url: wss://relay.example.com/prefix` +in the settings, the scrape moves with it and the unprefixed path stops answering: + +``` +$ curl -o /dev/null -w '%{http_code}\n' -H 'Authorization: Bearer tok' http://localhost:5744/prefix/metrics +200 +$ curl -o /dev/null -w '%{http_code}\n' -H 'Authorization: Bearer tok' http://localhost:5744/metrics +404 +``` + +With `METRICS_ENABLED` unset, the path is not mounted at all and the admin router's fallback +answers instead — a `404`, the same one a missing admin route gets. + +## Admin + +`admin.enabled` defaults to `false` and `admin.sessionTtlSeconds` to `86400` +(`resources/default-settings.yaml:440-442`). Disabled, the whole surface is a `404` in plain +text — the same answer a missing path gets, which is the point of the gate: + +``` +$ curl -isS http://localhost:5744/admin/ +HTTP/1.1 404 Not Found +content-type: text/plain +content-length: 9 + +Not Found +``` + +Enabled, the console page is served from the same listener as the relay — one socket, two +routers (ADR 0014): + +``` +$ curl -o /dev/null -w 'status=%{http_code} type=%{content_type} bytes=%{size_download}\n' http://localhost:5744/admin/ +status=200 type=text/html; charset=utf8 bytes=41028 +``` + +**Enabling the gate needs `SECRET`.** Without it the page is served and every login and session +check answers 500; the daemon warns at startup +(`WARN admin.enabled is true and SECRET is not set; every admin login and session check will answer 500`). + +**`ADMIN_PASSWORD` overrides the configured password** when it is non-empty +(`crates/nostreamd/src/admin_http.rs:230-236`). With `SECRET` set and `ADMIN_PASSWORD=scratchpass`: + +``` +$ curl -isS -X POST -H 'content-type: application/json' -d '{"password":"scratchpass"}' http://localhost:5744/admin/login +HTTP/1.1 200 OK +content-type: application/json +set-cookie: admin_session=; Path=/admin; HttpOnly; SameSite=Strict; Max-Age=86400 +content-length: 45 + +{"authenticated":true,"expiresAt":1796120619} +``` + +The cookie's name, path, `HttpOnly`, `SameSite=Strict` and `Max-Age` are the constants at +`crates/nostream-admin/src/utils/session.rs:18` and the format at +`crates/nostream-admin/src/utils/session.rs:146-152`; the TTL in the cookie is +`admin.sessionTtlSeconds`. A wrong password is a `401`, and the session route is `401` before a +login and `200` after it: + +``` +$ curl -o /dev/null -w '%{http_code}\n' -X POST -H 'content-type: application/json' -d '{"password":"nope"}' http://localhost:5744/admin/login +401 +$ curl -isS http://localhost:5744/admin/session +HTTP/1.1 401 Unauthorized +$ curl -o /dev/null -w '%{http_code}\n' -H 'Cookie: admin_session=' http://localhost:5744/admin/session +200 +``` + +**The health card can never read `ok`.** `redis.ok` is `false` by construction — the cache it +used to ping is deleted — and the status is `ok` only when both dependencies answer, so it is +always `degraded` (`crates/nostream-admin/src/utils/health.rs:66-73`). Measured: + +``` +$ curl -sS -H 'Cookie: admin_session=' http://localhost:5744/admin/health +{"database":{"ok":true},"redis":{"ok":false},"status":"degraded","uptimeSeconds":6,"worker":{"type":"primary"}} +``` + +That is a permanent fault reported as one, and it is tracked as +[#1334](https://github.com/cameri/nostream/issues/1334); treat a `degraded` card with +`database.ok: true` as healthy until that issue lands. + +## MCP + +`nostreamd --mcp-stdio` serves the admin MCP server on stdin/stdout in a process of its own; it +binds no socket and reads no `--listen-port`. The credential is a token document, by +`--admin-token-file ` (re-read on every call, so rewriting or deleting it is the +revocation) or by `--admin-token-fd ` (read once) — exactly one of the two. The server, its +fourteen tools and the document's rules are `crates/nostream-mcp/src/lib.rs:1-26`'s and +ADR 0014's (D19); the document's shape is `crates/nostream-mcp/src/credential.rs:32-55`. + +**The document is a regular file, 0600 or stricter, at most 4096 bytes, carrying scopes from +`["write"]` only.** Each violation refuses the start, with the reason: + +``` +$ printf '{"scopes":["write"]}' > /tmp/046-scratch/token-0644.json && chmod 0644 ... +$ nostreamd --mcp-stdio --admin-token-file /tmp/046-scratch/token-0644.json +daemon setup failed: the admin token file /tmp/046-scratch/token-0644.json is mode 0644: it must carry no group or other permission (0600 is the usual mode), so no one but its owner can read or rewrite it +exit 1 + +$ chmod 0600 ... ; printf '{"scopes":["write","admin"]}' > ... +daemon setup failed: the admin token document /tmp/046-scratch/token-badscope.json names an unknown scope "admin": the accepted set is ["write"], and reading is granted to every token +exit 1 + +$ wc -c /tmp/046-scratch/token-big.json +4100 /tmp/046-scratch/token-big.json +daemon setup failed: the admin token file /tmp/046-scratch/token-big.json is 4100 bytes: a token document is at most 4096 bytes — it lists scope names and carries nothing else +exit 1 +``` + +`NOSTREAM_ADMIN_TOKEN` is retired; setting it refuses the mode, so an old deployment's +environment cannot silently authenticate a new door +(`crates/nostreamd/src/main.rs:60-67`): + +``` +$ NOSTREAM_ADMIN_TOKEN=xyz nostreamd --mcp-stdio --admin-token-file /tmp/046-scratch/token-0600.json +daemon setup failed: NOSTREAM_ADMIN_TOKEN is retired: a console session token does not authenticate --mcp-stdio. Start the mode with --admin-token-file (a regular file with no group or other permission, 0600 being the usual mode) or --admin-token-fd . +exit 1 +``` + +With a 0600 document, the mode serves. Two JSON-RPC lines on stdin, the handshake and the tool +list: + +``` +$ printf '%s\n%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ + | nostreamd --mcp-stdio --admin-token-file /tmp/046-scratch/token-0600.json +{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{}},"serverInfo":{"name":"nostream","version":"0.1.0"},"instructions":"The nostream admin MCP server. ..."}} +exit 0 +``` + +The mode also needs `admin.enabled: true`, opens the same store the relay door does, and logs to +stderr so no log line can corrupt the protocol on stdout +(`crates/nostreamd/src/telemetry.rs:1-10`). Its audit sink is the same +`/admin-audit.jsonl` the console appends to, and one config directory has one writer: +run the console or the pipe, not both (`crates/nostream-mcp/src/lib.rs:9-13`). + +## The relay surface + +A WebSocket upgrade on `/` is served, and a plain `GET /` is `404 Not Found` in plain text: + +``` +$ curl -isS http://localhost:5744/ +HTTP/1.1 404 Not Found +content-type: text/plain + +Not Found +``` + +**NIP-11 is not served yet.** The document's builder exists +(`crates/nostream-relay/src/lib.rs:41-43`) and nothing mounts it, so the relay-status request +gets the `404` above; that decision and what it takes to serve it are ADR 0016's +(`docs/rewrite/decisions/0016-relay-status-and-nip11.md`). `nostream-cli info` prints the +self-key the document would carry, or says why it cannot: + +``` +$ nostream-cli info +Nostream v0.1.0 +Relay: nostream.your-domain.com (wss://nostream.your-domain.com) +Signing pubkey (NIP-11 self): unavailable (SECRET not set) +Payments: disabled +Tor hostname: not found +Onion key path: /.nostr/v3_onion_private_key +Events: unavailable +Uptime: unavailable +exit 0 +``` + +`RELAY_PRIVATE_KEY` wins over `SECRET`, and the key is `HMAC-SHA256(SECRET, relay_url)` +otherwise (`crates/nostream-relay/src/relay_key.rs:4-8`). + +The CLI's flags belong to its subcommands, not to the binary: `nostream info --config-dir` is +rejected, and so is the top-level form: + +``` +$ nostream-cli --config-dir /tmp/046-scratch/cfg info +Unknown command: --config-dir +... the whole help page ... +exit 2 +``` + +Neither `nostream info` nor the binary takes `--config-dir`; the CLI reads +`NOSTR_CONFIG_DIR`, the same variable the daemon falls back to: + +``` +$ NOSTR_CONFIG_DIR=/tmp/046-scratch/cfg nostream-cli info --config-dir /tmp/046-scratch/cfg +error: unexpected argument '--config-dir' found +exit 2 +$ NOSTR_CONFIG_DIR=/tmp/046-scratch/cfg nostream-cli info +Nostream v0.1.0 +Relay: nostream.your-domain.com (wss://nostream.your-domain.com) +Signing pubkey (NIP-11 self): unavailable (SECRET not set) +exit 0 +``` + +## Not covered + +- **A container image.** None exists: `Dockerfile` builds the TypeScript relay (`pnpm build`, + `node src/index.js`), no target builds `nostreamd`, and `docker-compose.yml` is the Postgres, + Redis and TypeScript stack. Packaging is the cutover's (#869); this document says how to build + and run the binary, which is `cargo build --release -p nostreamd -p nostream-cli` and then + `./target/release/nostreamd`. +- **TLS termination.** The daemon speaks plain HTTP and WS on the one socket; a reverse proxy or + a load balancer does TLS. The admin cookie's `Secure` flag follows the prefix and the proxy, + and nothing in this tree configures either. +- **The admin console's own JavaScript.** It is served as assets from `/resources/`; what + it does when a panel's data is missing is the console's, and the open findings about it are + #1317-#1333. +- **Payments.** Enabling them needs `SECRET` for the relay path (the daemon refuses the pairing + it cannot sign with); the processors' setup, their callbacks and the invoice lifecycle are + `docs/rewrite/decisions/0017-report-and-event-writes.md` and `0018`'s, and #867 owns what is + still a stub. +- **Tor.** The bootstrap attempt is measured only as `Tor hidden service: disabled` on a host + with no control port; a real hidden service needs a Tor control port and has no measurement + here. +- **The Postgres arm's cutover behaviour.** This document does not describe running the two + backends side by side or switching between them; that run is + `docs/rewrite/migrating.md`'s and #869's. +- **What a Postgres deployment needs of `DB_URI`.** The shape refusal, the acquisition bound and + the pool's behaviour are `crates/nostream-storage/src/postgres/mod.rs`'s; no database was + reachable from the sandbox that wrote this page, so every Postgres claim here is a code + reading. [unverified] because this sandbox has no Postgres and no Docker daemon, so no + Postgres boot, migration or query was run. From f3f6e083103806de4a75188ab74cb8f00cf0d077 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:33:38 -0500 Subject: [PATCH 03/14] docs(rewrite): the postgres-to-lmdb runbook and what verify proves --- docs/rewrite/migrating.md | 263 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 docs/rewrite/migrating.md diff --git a/docs/rewrite/migrating.md b/docs/rewrite/migrating.md new file mode 100644 index 000000000..192341fd9 --- /dev/null +++ b/docs/rewrite/migrating.md @@ -0,0 +1,263 @@ +# Migrating a Postgres deployment onto LMDB + +The operator's runbook for `nostream-cli migrate pg-to-lmdb`, run against `9c25d743`. The +migration's design — the paged read, the exact-per-row write, the manifest and what the copy +does not move — is `docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`'s; this page owns the +order the operator runs things in, the sentences the tool refuses with, and what its `--verify` +does and does not prove. + +**The shape of the command.** The source is Postgres, from `DB_URI`, else the `DB_*` parts. The +target is a store root: the LMDB environment is `/lmdb` and the manifest +`/migration-manifest.json` (`crates/nostream-cli/src/commands/migrate.rs:31-34`). The tool +is a subcommand of the operator CLI, not a separate binary: + +``` +$ nostream-cli migrate pg-to-lmdb --help +Copy every table from Postgres into an LMDB store, with the relay stopped. + +The source is Postgres from `DB_URI`, else the `DB_*` parts. The target is a store root: the +environment is `/lmdb` and the manifest `/migration-manifest.json`. +... +Usage: nostream migrate pg-to-lmdb [OPTIONS] --target + +Options: + --target The store root (the environment lives under `/lmdb`) + --batch-size Rows per batch, and the page size verify reads with [default: 1000] + --verify Verify the store against its manifest and copy nothing +exit 0 +``` + +`--batch-size` defaults to 1000 (`crates/nostream-cli/src/app.rs:706-707`) and a zero is +refused by the parser before the tool runs: + +``` +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/zero --batch-size 0 +error: invalid value '0' for '--batch-size ': 0 is not in 1..18446744073709551615 +exit 2 +``` + +**Stop the relay first, on both stores.** Nothing coordinates the two: the copy reads a table in +pages while the relay keeps accepting events, and nothing may write to either store while a run +is in progress. The preflight below is a safety net for the target, not a lock. + +## Preflight + +The run does not open the target to judge it; it asks the filesystem, in this order, and it +refuses before reading a single source row (`crates/nostream-cli/src/commands/migrate.rs:800-905`): + +1. the target and `/lmdb`: a **symlink** is refused; then the **owner** (a directory + whose owner is not the user running the copy); then **not a directory**; then any **group or + other write bit**; +2. every **ancestor** of the target: a writable, non-sticky one is refused, and an ancestor + owned by neither the caller nor root (`crates/nostream-cli/src/commands/migrate.rs:923-1000`); +3. the data file `/lmdb/data.mdb`: a symlink, a non-regular file, or one owned by + another user. + +A target that does not exist yet cannot be judged, so the tool creates it and runs the same +checks over what is then on disk. Preflight passes on a fresh `0700` directory, and the source +is only read afterwards: + +``` +$ mkdir -p /tmp/046-scratch/mig/clean && chmod 0700 /tmp/046-scratch/mig/clean +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/clean +Migration failed: no source is configured: set DB_URI (for example postgres://user:pass@host:5432/nostream), or DB_HOST and DB_NAME. Nothing was read. +exit 1 +``` + +That last sentence is the preflight's own: the target was accepted, and the run stopped at the +source, having read nothing. + +## Refusals + +Each sentence below is the tool's own, measured against a target built to trip it. They are the +operator-facing contract: an operator who reads one of these knows which of the three filesystem +premises the run stood on. + +**A target group or other can write to.** The copy lands as the LMDB environment, and another +local user who can write the directory can pre-place the store and read what lands in it. + +``` +$ mkdir /tmp/046-scratch/mig/open && chmod 0777 /tmp/046-scratch/mig/open +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/open +Migration failed: /tmp/046-scratch/mig/open is writable by group or other (0777): the target must be a directory only its owner can write to +exit 1 +``` + +The same refusal names `0770` for a group-writable target: + +``` +$ chmod 0770 /tmp/046-scratch/mig/grp +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/grp +Migration failed: /tmp/046-scratch/mig/grp is writable by group or other (0770): the target must be a directory only its owner can write to +exit 1 +``` + +**A symlinked target.** + +``` +$ ln -s /tmp/046-scratch/mig/real /tmp/046-scratch/mig/link +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/link +Migration failed: /tmp/046-scratch/mig/link is a symlink: the target must be the directory the copy lands in +exit 1 +``` + +**A target that is not a directory.** + +``` +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/afile +Migration failed: /tmp/046-scratch/mig/afile is not a directory: --target takes the store root, and the environment is created under it +exit 1 +``` + +**A writable ancestor with no sticky bit.** This is the `refuse_swappable_ancestry` condition: +the target itself may be `0700` and still sit under a directory another user can rename it out +of. + +``` +$ mkdir -p /tmp/046-scratch/mig/wide/child && chmod 0777 /tmp/046-scratch/mig/wide && chmod 0700 /tmp/046-scratch/mig/wide/child +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/wide/child +Migration failed: /tmp/046-scratch/mig/wide is writable by group or other (0777) and has no sticky bit: another user could replace /tmp/046-scratch/mig/wide/child before the store opens. Put the target under a directory only its owner can write to, or under one with the sticky bit +exit 1 +``` + +The sticky bit is what makes `/tmp` itself acceptable (`1777`), which is why every target above +under `/tmp` was judged on its own mode and not refused for its parent. + +**What cannot be produced here.** The owner branches — a target owned by another uid, and an +ancestor owned by neither the caller nor root — need a second user account, and this sandbox has +one uid. + +[unverified] because no second uid exists in this sandbox, so the owner branches of +`refuse_unsafe_target` and `refuse_swappable_ancestry` are code readings +(`crates/nostream-cli/src/commands/migrate.rs:846-853`, `:955-963`) and not measurements. + +## Resume + +The manifest is the checkpoint. Each batch is written to the store first and the manifest is +replaced atomically second, so a crash between the two replays one batch; every write is a put +of the source's own key and value, so the replay is idempotent and the merged entry is unchanged +(`crates/nostream-cli/src/commands/migrate.rs:7-10`). Per table the manifest records the rows +written, a running checksum, the last written key (`after`) and whether the table's read has +completed (`crates/nostream-cli/src/commands/migrate.rs:427-436`). A re-run reads the manifest +and continues from `after`; it does not start over. + +**Deleting the manifest does not restart a half-filled store.** A store that holds rows and no +manifest is refused, because a manifest-less store cannot be told from a store the copy already +filled, and starting over would double-write keys the manifest no longer accounts for: + +``` +$ nostream-cli seed --count 3 --data-dir /tmp/046-scratch/mig/seed # a store with rows, no manifest +Seed completed with 3 events requested +exit 0 +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/seed --verify +No manifest at /tmp/046-scratch/mig/seed/migration-manifest.json +exit 1 +``` + +Starting over therefore takes a fresh `--target`, or removing the manifest and the store +together — which is what the help text says and what the refusal above protects. + +[unverified] because no Postgres was reachable, so a real copy was never interrupted: the +resume path is stated from the code and the manifest's own fields +(`crates/nostream-cli/src/commands/migrate.rs:7-10`, `:427-436`), and the two refusals above are +the measured half. + +## Verify + +`--verify` reads the store and compares it to **its own manifest**, table by table: the rows the +store's scan returns against the manifest's `rows`, and the row sum against the manifest's +`checksum` (`crates/nostream-cli/src/commands/migrate.rs:294-350`). It reads nothing from the +source. A store that matches the manifest verifies clean whether or not the source ever held +those rows. + +Demonstrated by handing the tool a manifest of the right shape that records no rows, beside a +store holding three events: + +``` +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/seed --verify +[dvm_jobs] the manifest is incomplete +[events] manifest 0 rows, target 3 rows +[invite_codes] the manifest is incomplete +[invoices] the manifest is incomplete +[nip05_verifications] the manifest is incomplete +[notification_delivery_log] the manifest is incomplete +[notification_outbox] the manifest is incomplete +[reports] the manifest is incomplete +[users] the manifest is incomplete +exit 1 +``` + +`manifest 0 rows, target 3 rows` is the whole point: the target's number is the store's own, and +the number it is compared to is the manifest's — not the source's row count. The manifest's rows +and checksum are folded from the same batches the store received, so a source read that ended a +table early is recorded as that table's complete total and verifies clean. + +That is [#1306](https://github.com/cameri/nostream/issues/1306): `verify` proves the store +matches its manifest, not that the manifest matches the source. And +[#1314](https://github.com/cameri/nostream/issues/1314) records the other half of the gap — +neither the copy loop nor the verify loop has an executing test, so a cursor or checksum +regression reaches a cutover unmeasured. + +Two refusals guard the manifest's shape before any table is scanned: + +``` +$ echo '{"format":2,...}' > /tmp/046-scratch/mig/seed/migration-manifest.json +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/seed --verify +Migration failed: /tmp/046-scratch/mig/seed/migration-manifest.json: manifest format 2 is not supported; this tool reads and writes 1 +exit 1 + +$ nostream-cli migrate pg-to-lmdb --target /tmp/046-scratch/mig/empty --verify +No store at /tmp/046-scratch/mig/empty/lmdb: a re-run resumes once the store is back. To start over, use a fresh --target, or remove /tmp/046-scratch/mig/empty/migration-manifest.json and the store together +exit 1 +``` + +**The source half cannot run here.** No Postgres, no Docker daemon: the copy was never executed +end to end in this sandbox, so what the copy does with a live database is the ADR's and the +parity targets' — the three `#[ignore]`d storage tests, one of which (`migration_pg`) seeds a +scratch database and copies it into a temporary LMDB store. + +[unverified] because this sandbox has no Postgres and no Docker daemon, so no end-to-end copy +was run: the source arm is read from `crates/nostream-storage/src/postgres/migration.rs:1-11` +and exercised only by the ignored `nostream-storage` migration tests in CI. + +## Rollback + +There is no rollback command, and the runbook's answer is one sentence: **start the old +backend.** The copy is additive — it reads the Postgres store and writes an LMDB one, and it +issues no `INSERT`, `UPDATE`, `DELETE` or DDL against the source +(`crates/nostream-storage/src/postgres/migration.rs:8-11`). The Postgres store after a migration +is the store that was there before it. + +So rollback is a settings change and a restart: + +1. stop the daemon; +2. set `eventStore.backend: postgres` (the shipped default) and point `DB_URI` or the `DB_*` + parts at the same database it used before; +3. start the daemon again, without `--data-dir`. + +The LMDB store is left where it is; it is a second copy and deleting it is not part of the +rollback. What the Rust daemon then serves is the Postgres store as the rewrite reads it, which +is the parity the storage targets measure — not the TypeScript relay's reading of it. + +[unverified] because no Postgres was reachable, so the settings switch was not run: the +sentence rests on the copy's read-only source access, which is +`crates/nostream-storage/src/postgres/migration.rs:8-11`'s. + +## Not covered + +- **The Postgres side's own preflight.** Whether the database is reachable, migrated and sized + for the copy is `DB_URI`'s and the pool's + (`crates/nostream-storage/src/postgres/mod.rs:355-373`); nothing in the migration tool + migrates or checks the source's schema, and a source that has not been migrated fails with + the driver's own error (ADR 0013, D12). +- **The two tables that do not move.** `event_tags` is a trigger-maintained index the LMDB + event write keeps instead, and `user_subscriptions` has a TypeScript repository and no Rust + trait yet. Both are recorded in the manifest as `not_migrated` + (`crates/nostream-storage/src/migration.rs:64`) and in + `crates/nostream-storage/src/lib.rs:26-33`; the subscription surface is #1036's. +- **The cutover run itself.** A parallel run, a cutover date and the TypeScript retirement are + #869's; this page moves a store, not a deployment. +- **What `verify` cannot tell you** is stated above rather than repeated here: it is the + manifest's yardstick, not the source's (#1306), and its loop has no executing test (#1314). +- **Performance.** How long a copy takes, at what batch size, and what it does to the source's + load is the benchmark's (#1132 needs a host with Docker to measure the TypeScript side). From e7635b81d661f74a841935488f0f1714f311f55c Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:33:38 -0500 Subject: [PATCH 04/14] docs(rewrite): the row's changeset --- .changeset/rewrite-docs-crate-map.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/rewrite-docs-crate-map.md diff --git a/.changeset/rewrite-docs-crate-map.md b/.changeset/rewrite-docs-crate-map.md new file mode 100644 index 000000000..f521a67cd --- /dev/null +++ b/.changeset/rewrite-docs-crate-map.md @@ -0,0 +1,4 @@ +--- +--- + +docs(rewrite): the crate map, the deploying guide and the migration runbook (#1336) From f26ffc06f895df39b1c5ad1c24655ef2ac41a3ab Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:54:03 -0500 Subject: [PATCH 05/14] docs(rewrite): split the crate map into the capture's tree and the files added since --- docs/rewrite/crate-map.md | 499 +++++++++++++++++++++----------------- 1 file changed, 278 insertions(+), 221 deletions(-) diff --git a/docs/rewrite/crate-map.md b/docs/rewrite/crate-map.md index ca3f70959..5661b3561 100644 --- a/docs/rewrite/crate-map.md +++ b/docs/rewrite/crate-map.md @@ -1,91 +1,125 @@ # The crate map: every capture module and what replaced it The TypeScript tree at the capture commit `242a3001`, walked module by module at -`9c25d743`, and what each module became. One row per file: the capture path, the Rust -module that owns it, the line that proves the ownership, and the disposition. +`9c25d743`, and what each module became. Two labelled groups — the capture's modules, then +the files the porting window added — because the left column is the capture's tree and not +today's. -**Tree.** Checked against `9c25d743` (the job's base, `rewrite/main`), whose `src/` is the -capture's tree plus the NIP-77 files the porting window added; the ownership blocks name -`242a3001`. The Rust tree at `9c25d743` is 359 `.rs` files and 121,879 lines, 257 of them -under `crates/*/src`. +**Tree.** Checked against `9c25d743` (the job's base, `rewrite/main`), whose `src/` holds 357 +`.ts` files; the ownership blocks name `242a3001`. The Rust tree at `9c25d743` is 359 `.rs` +files and 121,879 lines, 257 of them under `crates/*/src`. + +## The three counts, and why the groups exist + +``` +$ git ls-tree -r 242a3001 -- src | grep -c '\.ts$' # the capture +298 +$ find src -name '*.ts' | wc -l # this branch's head +357 +$ git diff --name-status 242a3001..9c25d743 -- src | cut -f1 | sort | uniq -c + 61 A + 2 D + 62 M +``` + +So of the capture's 298 modules, **296 are still in the tree and 2 were deleted**, and **61 +files were added** after the capture. 296 + 61 = 357 rows. The two deleted modules are named +below rather than given rows, because a row's left column must resolve in this tree. + +The 61 additions are not one wave: 20 under `src/utils/`, 13 controller factories, 12 admin +controllers, 4 `@types`, 3 NIP-77 handlers, and the rest single files (`src/utils/nip77.ts`, +`src/utils/negentropy-sessions.ts`, `src/scripts/bench-gate.ts` and others). They are rows +because a reader of the port meets them; they are a separate group because they were not +part of the surface the rewrite set out to replace. A row in that group carries +`added after the capture` in its disposition. + +### The two capture modules deleted since the capture + +- `src/app/static-mirroring-worker.ts` and `src/factories/static-mirroring.worker-factory.ts` + — deleted at `e4174378` ("chore: sunset the StaticMirroringWorker (#924)"), so neither has a + Rust counterpart and neither can be a row here: `#924` retired the feature on the + TypeScript side. The daemon's ownership block still names + `static-mirroring.worker-factory` (`crates/nostreamd/src/lib.rs:16`), which is a stale name in + the block and not a mapping this map can make. ## How the body was generated -The rows are not typed by hand. The body comes from `find src -name '*.ts' | sort` -(357 lines) joined against the ownership bullets in the eight `crates/*/src/lib.rs` files -whose crates have a TypeScript ancestor; brace lists (`src/@types/{a,b}.ts`), globs -(`src/handlers/event-strategies/*-event-strategy.ts`) and directory tokens were expanded to -their files, as `CLAUDE.md`'s ownership rule requires a reader to do. 305 of the 357 files -are named by a `lib.rs` block; the other 52 are named below from a call site, an ADR, or a -recorded reason. - -The per-crate totals over the 357 rows are: `nostream-admin` 69, `nostreamd` 60, -`nostream-core` 44, `nostream-relay` 39, `nostream-cli` 32, `nostream-services` 29, -`nostream-storage` 24, `nostream-config` 8, and 26 rows that name no crate. 28 files are -claimed by two crates; the row names the crate that owns the type first and the other's -share in the same cell, in parentheses. - -**The citation column** is the line that proves the mapping: the `lib.rs` ownership bullet -for a row a block names, and the call site or ADR for a row it does not. The collection is -generated, so a citation proves *whence the row came*; that the first cell is the capture's -file is checked separately by the coverage count (`## Checking this file`). +The rows are not typed by hand. The body comes from `git ls-tree -r 242a3001 -- src` (298) +joined against `find src -name '*.ts'` (357), then matched against the ownership bullets in the +eight `crates/*/src/lib.rs` files whose crates have a TypeScript ancestor; brace lists +(`src/@types/{a,b}.ts`), globs (`src/handlers/event-strategies/*-event-strategy.ts`) and +directory tokens were expanded to their files. 305 of the 357 head files are named by a `lib.rs` +block; the others are named here from a call site, an ADR, or a recorded reason. + +**Totals over the 357 rows**, by the crate named first in column 2: `nostream-admin` 63, `nostreamd` 49, `nostream-services` 37, `nostream-core` 42, `nostream-relay` 36, `nostream-cli` 22, `nostream-storage` 22, `nostream-config` 9; 77 rows +name no crate because nothing replaced them. By class: `moved` 222, `split` 28, +`type-only` 30, and 77 rows that are `not moved`, naming `#865` 16, `#867` 38, `#868` 1, `#1036` 14, `#1336` 8. ## How to read a row | cell | meaning | |---|---| -| capture path | the module at `242a3001`'s tree as it stands at `9c25d743` | +| capture path | the module: at `242a3001` for the first group, added later for the second | | Rust module | the module the port lives in, named where a same-named port exists, else the crate's `lib.rs` — the ownership declaration | | citation | the `path:line` in this tree that records the mapping | -| disposition | `moved`, with the seam named when a second crate shares the file, or `not moved (#)` | +| disposition | the class, then the reason: see below | + +The disposition's first word is the class, from the list the spec fixes: -## The map +- `moved` — one Rust module holds the port. +- `split` — two crates claim the file; the one that owns the type is first and the other's share + is in the parentheses beside it. +- `type-only` — the file is types only; the module named declares them. +- `not moved (#)` — nothing replaced the file. The oracle requires a row with no + `crates/` target to open with those two words, so the class word follows the issue: + `dropped` when the surface was decided against or is still owed, `added-after-capture` when the + file itself postdates the capture. +- A row whose only Rust answer is a `Phase 1`/`Phase 2` stub is `not moved`, never `moved`: a + stub is not a port, and every factory that composes it says the same thing. + +## The capture's modules (296 rows) | capture module | Rust module | evidence | disposition | |---|---|---|---| -| `src/@types/adapters.ts` | `crates/nostream-storage/src/backend.rs` | `crates/nostream-storage/src/backend.rs:2` | moved | -| `src/@types/admin-audit.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | moved | -| `src/@types/admin-ops.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | moved | -| `src/@types/admin.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | moved | -| `src/@types/base.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:10` | moved | -| `src/@types/cache.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:26` | not moved (#1336) — the `redis` client type; no cache server is added (ADR 0010) | -| `src/@types/clients.ts` | `crates/nostream-relay/src/connection.rs` | `crates/nostream-relay/src/lib.rs:16` | moved | -| `src/@types/controllers.ts` | `crates/nostream-admin/src/controllers/mod.rs` | `crates/nostream-admin/src/controllers/mod.rs:1-2` | moved | -| `src/@types/database.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/dvm.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:16` | moved | -| `src/@types/event.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:10` | moved | -| `src/@types/invite-code.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/invoice.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/message-handlers.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:16` | moved | -| `src/@types/messages.ts` | `crates/nostream-core/src/messages.rs` | `crates/nostream-core/src/lib.rs:10` | moved | -| `src/@types/negentropy.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/nip77.rs:1-2` | moved | -| `src/@types/nip05.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/notification-outbox.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/operator-notifications.ts` | `crates/nostream-config/src/lib.rs` | `crates/nostream-config/src/lib.rs:8` | moved | -| `src/@types/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | moved | -| `src/@types/report.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/repositories.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/services.ts` | `crates/nostream-services/src/services/mod.rs` | `crates/nostream-services/src/lib.rs:16` | moved | -| `src/@types/settings.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:8` | moved | -| `src/@types/subscription.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-relay/src/lib.rs:16` | moved | -| `src/@types/tor.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:13` | moved | -| `src/@types/user-subscription.ts` | — | `crates/nostream-storage/src/lib.rs:26-28` | not moved (#1036) — `user_subscriptions` has no Rust trait; recurring plans are #1036's | -| `src/@types/user.ts` | `crates/nostream-storage/src/records.rs` | `crates/nostream-storage/src/lib.rs:14` | moved | -| `src/@types/utils.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:11` | moved | -| `src/adapters/redis-adapter.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — the Redis cache adapter is not ported (ADR 0010) | +| `src/@types/adapters.ts` | `crates/nostream-storage/src/backend.rs` | `crates/nostream-storage/src/backend.rs:2` | type-only | +| `src/@types/admin.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | type-only | +| `src/@types/base.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:10` | type-only | +| `src/@types/cache.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:26` | not moved (#1336) — dropped: the `redis` client type; no cache server is added (ADR 0010) | +| `src/@types/clients.ts` | `crates/nostream-services/src/payments/mod.rs` | `crates/nostream-services/src/payments/mod.rs:32` | type-only — the processor's invoice contract; the relay block names the file but holds no invoice type | +| `src/@types/controllers.ts` | `crates/nostream-admin/src/controllers/mod.rs` | `crates/nostream-admin/src/controllers/mod.rs:1-2` | type-only | +| `src/@types/database.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/dvm.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:16` | type-only | +| `src/@types/event.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:10` | type-only | +| `src/@types/invite-code.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/invoice.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/message-handlers.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:16` | type-only | +| `src/@types/messages.ts` | `crates/nostream-core/src/messages.rs` | `crates/nostream-core/src/lib.rs:10` | type-only | +| `src/@types/nip05.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/notification-outbox.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/operator-notifications.ts` | `crates/nostream-config/src/lib.rs` | `crates/nostream-config/src/lib.rs:8` | type-only | +| `src/@types/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | type-only | +| `src/@types/report.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/repositories.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14` | type-only | +| `src/@types/services.ts` | `crates/nostream-services/src/services/mod.rs` | `crates/nostream-services/src/lib.rs:16` | type-only | +| `src/@types/settings.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:8` | type-only | +| `src/@types/subscription.ts` | `crates/nostream-relay/src/connection.rs` | `crates/nostream-relay/src/lib.rs:16`, `crates/nostream-relay/src/connection.rs:29` | type-only — `Subscription` lives in the relay's connection module | +| `src/@types/tor.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:13` | type-only | +| `src/@types/user.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:14-15` | type-only — declared in `repositories.rs`, implemented in `records.rs` | +| `src/@types/utils.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:11` | type-only | +| `src/adapters/redis-adapter.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — dropped: the Redis cache adapter is not ported (ADR 0010) | | `src/adapters/web-server-adapter.ts` | `crates/nostreamd/src/acceptor.rs` | `crates/nostreamd/src/lib.rs:9-10` | moved | | `src/adapters/web-socket-adapter.ts` | `crates/nostream-relay/src/connection.rs` | `crates/nostream-relay/src/lib.rs:10` | moved | | `src/adapters/web-socket-server-adapter.ts` | `crates/nostream-relay/src/transport.rs` | `crates/nostream-relay/src/lib.rs:10` | moved | | `src/admin/password-admin-auth-provider.ts` | `crates/nostream-admin/src/utils/password.rs` | `crates/nostream-admin/src/lib.rs:16` | moved | | `src/app/app.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:6` | moved | -| `src/app/dvm-orchestrator-worker.ts` | `crates/nostream-services/src/workers/dvm_orchestrator.rs` | `crates/nostream-services/src/lib.rs:9` | moved | -| `src/app/maintenance-worker.ts` | `crates/nostream-services/src/workers/maintenance.rs` | `crates/nostream-services/src/lib.rs:9` | moved | -| `src/app/relay-monitor-worker.ts` | — | `crates/nostreamd/src/lib.rs:37-38` | not moved (#865) — the probe worker belongs to #865 and is not registered | +| `src/app/dvm-orchestrator-worker.ts` | `crates/nostream-services/src/workers/dvm_orchestrator.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:9`, `crates/nostreamd/src/lib.rs:6` | split — the worker; the daemon registers it | +| `src/app/maintenance-worker.ts` | `crates/nostream-services/src/workers/maintenance.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:9`, `crates/nostreamd/src/lib.rs:6` | split — the worker; the daemon registers it | +| `src/app/relay-monitor-worker.ts` | — | `crates/nostreamd/src/lib.rs:37-38` | not moved (#865) — dropped: the probe worker belongs to #865 and is not registered | | `src/app/worker.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:6` | moved | -| `src/cache/client.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — no Redis client is added (ADR 0010) | +| `src/cache/client.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — dropped: no Redis client is added (ADR 0010) | | `src/clean-db.ts` | `crates/nostream-cli/src/commands/clean_db.rs` | `crates/nostream-cli/src/lib.rs:9` | moved | | `src/cli/commands/config.ts` | `crates/nostream-cli/src/config.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/commands/dev.ts` | — | `crates/nostream-cli/src/app.rs:74-75` | not moved (#867) — the capture's `dev` command is removed, not ported (R17) | +| `src/cli/commands/dev.ts` | — | `crates/nostream-cli/src/app.rs:74-75` | not moved (#867) — dropped: the capture's `dev` command is removed, not ported (R17) | | `src/cli/commands/export.ts` | `crates/nostream-cli/src/commands/export.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | | `src/cli/commands/import.ts` | `crates/nostream-cli/src/commands/import.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | | `src/cli/commands/info.ts` | `crates/nostream-cli/src/commands/info.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | @@ -96,126 +130,98 @@ file is checked separately by the coverage count (`## Checking this file`). | `src/cli/commands/stop.ts` | `crates/nostream-cli/src/commands/stop.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | | `src/cli/commands/update.ts` | `crates/nostream-cli/src/commands/update.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | | `src/cli/index.ts` | `crates/nostream-cli/src/app.rs` | `crates/nostream-cli/src/lib.rs:11-14` | moved | -| `src/cli/tui/main.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/menus/configure.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/menus/dev.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/menus/manage.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/menus/start.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/menus/stop.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/prompts.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/tui/state.ts` | `crates/nostream-cli/src/tui.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | +| `src/cli/tui/main.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/menus/configure.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/menus/dev.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/menus/manage.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/menus/start.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/menus/stop.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/prompts.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | +| `src/cli/tui/state.ts` | — | `crates/nostream-cli/src/tui.rs:5` | not moved (#867) — dropped: only the Phase 1 stub exists | | `src/cli/types.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/utils/bootstrap.ts` | `crates/nostream-cli/src/bootstrap.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-cli/src/lib.rs:7`, `crates/nostream-services/src/lib.rs:18` | moved — the command; services owns the spawn seam | +| `src/cli/utils/bootstrap.ts` | `crates/nostream-cli/src/bootstrap.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-cli/src/lib.rs:7`, `crates/nostream-services/src/lib.rs:18` | split — the command; services owns the spawn seam | | `src/cli/utils/config.ts` | `crates/nostream-cli/src/config.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/utils/docker.ts` | `crates/nostream-cli/src/compose.rs` | `crates/nostream-cli/src/lib.rs:7` | moved — the command; services owns the spawn seam | +| `src/cli/utils/docker.ts` | `crates/nostream-cli/src/compose.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-cli/src/lib.rs:7`, `crates/nostream-services/src/lib.rs:18` | split — the command; services owns the spawn seam | | `src/cli/utils/env-config.ts` | `crates/nostream-cli/src/env_file.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | | `src/cli/utils/output.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | | `src/cli/utils/paths.ts` | `crates/nostream-cli/src/env_file.rs` | `crates/nostream-cli/src/lib.rs:7` | moved | -| `src/cli/utils/process.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:7` | moved — the command; services owns the spawn seam | +| `src/cli/utils/process.ts` | `crates/nostream-cli/src/lib.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-cli/src/lib.rs:7`, `crates/nostream-services/src/lib.rs:18` | split — the command; services owns the spawn seam | | `src/constants/adapter.ts` | `crates/nostream-relay/src/transport.rs` | `crates/nostream-relay/src/transport.rs:1-3` | moved — the emitter's event names are not kept; #865 owns the transport's states | | `src/constants/base.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:7` | moved | -| `src/constants/caching.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1036) — the admission and plan cache keys; the plan surface is #1036's | -| `src/controllers/admin/get-admin-audit-log-controller.ts` | `crates/nostream-admin/src/controllers/get_audit_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-admin-diagnostics-export-controller.ts` | `crates/nostream-admin/src/controllers/get_diagnostics_export.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/constants/caching.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — dropped: the cache keys have no cache to key (ADR 0010) | | `src/controllers/admin/get-health-controller.ts` | `crates/nostream-admin/src/controllers/get_health.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-metrics-controller.ts` | `crates/nostream-admin/src/controllers/get_metrics.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-moderation-limits-controller.ts` | `crates/nostream-admin/src/controllers/get_moderation_limits.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-moderation-stats-controller.ts` | `crates/nostream-admin/src/controllers/get_moderation_stats.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-network-health-controller.ts` | `crates/nostream-admin/src/controllers/get_network_health.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-network-health-history-controller.ts` | `crates/nostream-admin/src/controllers/get_network_health_history.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-notification-delivery-log-controller.ts` | `crates/nostream-admin/src/controllers/get_notification_delivery_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-notifications-controller.ts` | `crates/nostream-admin/src/controllers/get_notifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-ops-nip05-verifications-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_nip05_verifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-ops-storage-counts-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_storage_counts.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/get-ops-workers-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_workers.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-session-controller.ts` | `crates/nostream-admin/src/controllers/get_session.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-settings-backups-controller.ts` | `crates/nostream-admin/src/controllers/get_settings_backups.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-settings-controller.ts` | `crates/nostream-admin/src/controllers/get_settings.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-settings-schema-controller.ts` | `crates/nostream-admin/src/controllers/get_settings_schema.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/patch-moderation-limits-controller.ts` | `crates/nostream-admin/src/controllers/patch_moderation_limits.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/patch-notifications-controller.ts` | `crates/nostream-admin/src/controllers/patch_notifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/patch-settings-controller.ts` | `crates/nostream-admin/src/controllers/patch_settings.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/post-admin-network-health-run-controller.ts` | `crates/nostream-admin/src/controllers/post_network_health_run.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/post-login-controller.ts` | `crates/nostream-admin/src/controllers/post_login.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/post-logout-controller.ts` | `crates/nostream-admin/src/controllers/post_logout.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/post-moderation-actions-controller.ts` | `crates/nostream-admin/src/controllers/post_moderation_actions.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/post-notification-test-controller.ts` | `crates/nostream-admin/src/controllers/post_notification_test.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | -| `src/controllers/admin/post-ops-nip05-reverify-controller.ts` | `crates/nostream-admin/src/controllers/post_ops_nip05_reverify.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/post-settings-restore-controller.ts` | `crates/nostream-admin/src/controllers/post_settings_restore.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/post-settings-validate-controller.ts` | `crates/nostream-admin/src/controllers/post_settings_validate.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admission/get-admission-check-controller.ts` | `crates/nostream-relay/src/relay.rs` | `crates/nostream-relay/src/lib.rs:12` | moved | -| `src/controllers/callbacks/lnbits-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | -| `src/controllers/callbacks/nodeless-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | -| `src/controllers/callbacks/opennode-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | -| `src/controllers/callbacks/zebedee-callback-controller.ts` | `crates/nostream-services/src/controllers/callback_controller.rs` | `crates/nostream-services/src/controllers/callback_controller.rs:5` | moved | -| `src/controllers/invoices/get-invoice-controller.ts` | `crates/nostream-services/src/controllers/invoice_controller.rs` | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | moved | -| `src/controllers/invoices/get-invoice-status-controller.ts` | `crates/nostream-services/src/controllers/invoice_controller.rs` | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | moved | -| `src/controllers/invoices/post-invoice-controller.ts` | `crates/nostream-services/src/controllers/invoice_controller.rs` | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | moved | -| `src/controllers/subscriptions/get-subscription-status-controller.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — the subscription tables are not in the Rust schema | +| `src/controllers/callbacks/lnbits-callback-controller.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | +| `src/controllers/callbacks/nodeless-callback-controller.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | +| `src/controllers/callbacks/opennode-callback-controller.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | +| `src/controllers/callbacks/zebedee-callback-controller.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | +| `src/controllers/invoices/get-invoice-controller.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | +| `src/controllers/invoices/get-invoice-status-controller.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | +| `src/controllers/invoices/post-invoice-controller.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | | `src/database/client.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:9` | moved | | `src/database/transaction.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:9` | moved | | `src/factories/admin-auth-provider-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/admin-ops-cache-adapter-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/app-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-audit-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-diagnostics-export-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-health-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-metrics-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-moderation-stats-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-network-health-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-network-health-history-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-notification-delivery-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-notifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-ops-nip05-verifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-ops-storage-counts-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-ops-workers-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-session-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-settings-backups-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-settings-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admin-settings-schema-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/get-admission-check-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-invoice-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-invoice-status-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-subscription-status-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/lnbits-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/nodeless-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/opennode-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/patch-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/get-invoice-status-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/lnbits-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/nodeless-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/opennode-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/controllers/patch-admin-notifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/patch-admin-settings-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/post-admin-login-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/post-admin-logout-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-moderation-actions-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-network-health-run-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/post-admin-notification-test-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-ops-nip05-reverify-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/post-admin-settings-restore-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/controllers/post-admin-settings-validate-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-invoice-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/zebedee-callback-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/post-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/zebedee-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/dvm-orchestrator-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/event-repository-factory.ts` | `crates/nostream-storage/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-storage/src/lib.rs:16`, `crates/nostreamd/src/lib.rs:14` | moved — the repository; the daemon composes it | -| `src/factories/event-strategy-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the registry; the daemon composes it | +| `src/factories/event-repository-factory.ts` | `crates/nostream-storage/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-storage/src/lib.rs:16`, `crates/nostreamd/src/lib.rs:14` | split — the repository; the daemon composes it | +| `src/factories/event-strategy-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the registry; the daemon composes it | | `src/factories/logger-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/maintenance-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/maintenance-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/message-handler-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the registry; the daemon composes it | +| `src/factories/message-handler-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the registry; the daemon composes it | | `src/factories/notification-outbox-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/mod.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/payments-processors/lnbits-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnbits.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved — the processor; the daemon composes it | -| `src/factories/payments-processors/lnurl-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnurl.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/payments-processors/nodeless-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nodeless.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/payments-processors/nwc-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nwc.rs` | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/payments-processors/opennode-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/opennode.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved — the processor; the daemon composes it | -| `src/factories/payments-processors/zebedee-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/zebedee.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | moved — the processor; the daemon composes it | +| `src/factories/payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/mod.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the selection; the daemon composes it | +| `src/factories/payments-processors/lnbits-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnbits.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | +| `src/factories/payments-processors/lnurl-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnurl.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | +| `src/factories/payments-processors/nodeless-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nodeless.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | +| `src/factories/payments-processors/nwc-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nwc.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | +| `src/factories/payments-processors/opennode-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/opennode.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | +| `src/factories/payments-processors/zebedee-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/zebedee.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | | `src/factories/payments-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/rate-limiter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the limiter; the daemon composes it | -| `src/factories/relay-monitor-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/settings-factory.ts` | `crates/nostream-config/src/settings.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-config/src/lib.rs:12`, `crates/nostreamd/src/lib.rs:14` | moved — the loaded value; the daemon owns it | -| `src/factories/subscription-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/rate-limiter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the limiter; the daemon composes it | +| `src/factories/relay-monitor-worker-factory.ts` | — | `crates/nostreamd/src/lib.rs:37-38` | not moved (#865) — dropped: it composes the probe worker #865 does not register | +| `src/factories/settings-factory.ts` | `crates/nostream-config/src/settings.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-config/src/lib.rs:12`, `crates/nostreamd/src/lib.rs:14` | split — the loaded value; the daemon owns it | | `src/factories/web-app-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/websocket-adapter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | moved — the transport; the daemon binds it | +| `src/factories/websocket-adapter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the transport; the daemon binds it | | `src/factories/worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/wot-graph-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/handlers/auth-message-handler.ts` | `crates/nostream-relay/src/handlers/auth.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | @@ -236,26 +242,23 @@ file is checked separately by the coverage count (`## Checking this file`). | `src/handlers/event-strategies/report-event-strategy.ts` | `crates/nostream-relay/src/strategies/report.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | | `src/handlers/event-strategies/timestamp-event-strategy.ts` | `crates/nostream-relay/src/strategies/timestamp.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | | `src/handlers/event-strategies/vanish-event-strategy.ts` | `crates/nostream-relay/src/strategies/vanish.rs` | `crates/nostream-relay/src/lib.rs:9` | moved | -| `src/handlers/neg-close-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — no handler module is claimed; NIP-77 is cut against `041fe34e` | -| `src/handlers/neg-msg-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — no handler module is claimed; NIP-77 is cut against `041fe34e` | -| `src/handlers/neg-open-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — no handler module is claimed; NIP-77 is cut against `041fe34e` | | `src/handlers/request-handlers/admin-auth-middleware.ts` | `crates/nostream-admin/src/controllers/admin_auth_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | | `src/handlers/request-handlers/admin-enabled-middleware.ts` | `crates/nostream-admin/src/controllers/admin_enabled_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | | `src/handlers/request-handlers/admin-json-body-middleware.ts` | `crates/nostream-admin/src/controllers/admin_json_body_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | | `src/handlers/request-handlers/admin-rate-limit-middleware.ts` | `crates/nostream-admin/src/controllers/admin_rate_limit_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | | `src/handlers/request-handlers/get-admin-dashboard-request-handler.ts` | `crates/nostream-admin/src/controllers/get_dashboard.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | -| `src/handlers/request-handlers/get-health-request-handler.ts` | `crates/nostream-admin/src/controllers/get_health.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | -| `src/handlers/request-handlers/get-privacy-request-handler.ts` | `crates/nostream-admin/src/controllers/get_privacy.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | -| `src/handlers/request-handlers/get-readyz-request-handler.ts` | `crates/nostream-admin/src/controllers/get_readyz.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | -| `src/handlers/request-handlers/get-terms-request-handler.ts` | `crates/nostream-admin/src/controllers/get_terms.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | -| `src/handlers/request-handlers/nodeinfo-handler.ts` | `crates/nostream-admin/src/controllers/nodeinfo.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/get-health-request-handler.ts` | — | `crates/nostream-admin/src/controllers/get_health.rs:5` | not moved (#867) — dropped: the document handler stays a Phase 1 stub | +| `src/handlers/request-handlers/get-privacy-request-handler.ts` | — | `crates/nostream-admin/src/controllers/get_privacy.rs:5` | not moved (#867) — dropped: the document handler stays a Phase 1 stub | +| `src/handlers/request-handlers/get-readyz-request-handler.ts` | — | `crates/nostream-admin/src/controllers/get_readyz.rs:5` | not moved (#867) — dropped: the document handler stays a Phase 1 stub | +| `src/handlers/request-handlers/get-terms-request-handler.ts` | — | `crates/nostream-admin/src/controllers/get_terms.rs:5` | not moved (#867) — dropped: the document handler stays a Phase 1 stub | +| `src/handlers/request-handlers/nodeinfo-handler.ts` | — | `crates/nostream-admin/src/controllers/nodeinfo.rs:5` | not moved (#867) — dropped: the document handler stays a Phase 1 stub | | `src/handlers/request-handlers/rate-limiter-middleware.ts` | `crates/nostream-admin/src/controllers/admin_rate_limit_middleware.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | -| `src/handlers/request-handlers/root-request-handler.ts` | `crates/nostream-admin/src/controllers/root.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | +| `src/handlers/request-handlers/root-request-handler.ts` | — | `crates/nostream-admin/src/controllers/root.rs:5` | not moved (#867) — dropped: the document handler stays a Phase 1 stub | | `src/handlers/request-handlers/with-admin-controller-request-handler.ts` | `crates/nostream-admin/src/controllers/with_admin_controller_request_handler.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | | `src/handlers/request-handlers/with-controller-request-handler.ts` | `crates/nostream-admin/src/controllers/with_admin_controller_request_handler.rs` | `crates/nostream-admin/src/lib.rs:7` | moved | | `src/handlers/subscribe-message-handler.ts` | `crates/nostream-relay/src/handlers/subscribe.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | | `src/handlers/unsubscribe-message-handler.ts` | `crates/nostream-relay/src/handlers/unsubscribe.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | -| `src/import-events.ts` | `crates/nostream-services/src/services/event_import_service.rs` | `crates/nostream-cli/src/lib.rs:9`, `crates/nostream-services/src/lib.rs:15` | moved | +| `src/import-events.ts` | `crates/nostream-services/src/services/event_import_service.rs` (`crates/nostream-cli/src/lib.rs`) | `crates/nostream-services/src/lib.rs:15`, `crates/nostream-cli/src/lib.rs:9` | split — the importer; the CLI is the command | | `src/index.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:8` | moved | | `src/logger.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:8` | moved | | `src/payments-processors/lnbits-payment-processor.ts` | `crates/nostream-services/src/payments/processors/lnbits.rs` | `crates/nostream-services/src/lib.rs:12` | moved | @@ -265,7 +268,7 @@ file is checked separately by the coverage count (`## Checking this file`). | `src/payments-processors/nwc-payments-processor.ts` | `crates/nostream-services/src/lib.rs` | `crates/nostream-services/src/lib.rs:12` | moved | | `src/payments-processors/opennode-payments-processor.ts` | `crates/nostream-services/src/payments/processors/opennode.rs` | `crates/nostream-services/src/lib.rs:12` | moved | | `src/payments-processors/zebedee-payments-processor.ts` | `crates/nostream-services/src/payments/processors/zebedee.rs` | `crates/nostream-services/src/lib.rs:12` | moved | -| `src/relay-broadcast/redis-relay-broadcast-fanout.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:11`, `crates/nostream-relay/src/lib.rs:36` | moved | +| `src/relay-broadcast/redis-relay-broadcast-fanout.ts` | — | `crates/nostream-relay/src/broadcast.rs:15-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | | `src/repositories/dvm-job-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | | `src/repositories/event-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | | `src/repositories/invite-code-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | @@ -275,80 +278,60 @@ file is checked separately by the coverage count (`## Checking this file`). | `src/repositories/notification-outbox-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | | `src/repositories/report-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | | `src/repositories/user-repository.ts` | `crates/nostream-storage/src/repositories.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | -| `src/repositories/user-subscription-repository.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:8` | moved | | `src/routes/admin/index.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/routes/admissions/index.ts` | `crates/nostream-relay/src/lib.rs` | `crates/nostream-relay/src/lib.rs:13` | moved | -| `src/routes/callbacks/index.ts` | `crates/nostream-services/src/controllers/mod.rs` | `crates/nostream-services/src/controllers/mod.rs:1-2` | moved | +| `src/routes/callbacks/index.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | | `src/routes/index.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:11` | moved | -| `src/routes/invoices/index.ts` | `crates/nostream-services/src/controllers/mod.rs` | `crates/nostream-services/src/controllers/mod.rs:1-2` | moved | -| `src/routes/subscriptions/index.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — the subscription tables are not in the Rust schema | +| `src/routes/invoices/index.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | | `src/schemas/admin-login-schema.ts` | `crates/nostream-admin/src/controllers/post_login.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | -| `src/schemas/admin-moderation-schema.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | | `src/schemas/admin-notifications-schema.ts` | `crates/nostream-admin/src/controllers/patch_notifications.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | | `src/schemas/admin-settings-schema.ts` | `crates/nostream-admin/src/controllers/patch_settings.rs` | `crates/nostream-admin/src/lib.rs:13` | moved | | `src/schemas/base-schema.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:8` | moved | | `src/schemas/event-schema.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:8` | moved | | `src/schemas/filter-schema.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-core/src/lib.rs:9` | moved | -| `src/schemas/lnbits-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | +| `src/schemas/lnbits-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: the controllers its schema serves are stubs | | `src/schemas/message-schema.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:9` | moved | -| `src/schemas/nodeless-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | -| `src/schemas/opennode-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | -| `src/schemas/zebedee-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — the callback controllers are #867's stubs | -| `src/scripts/bench-gate.ts` | — | `docs/rewrite/benchmarks.md:248` | not moved (#868) — the gate is the capture's TypeScript tooling; the Rust rig has no gate | +| `src/schemas/nodeless-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: the controllers its schema serves are stubs | +| `src/schemas/opennode-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: the controllers its schema serves are stubs | +| `src/schemas/zebedee-callback-schema.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: the controllers its schema serves are stubs | | `src/scripts/benchmark-queries.ts` | `crates/nostream-cli/src/lib.rs` | `crates/nostream-cli/src/lib.rs:8` | moved | | `src/scripts/export-events.ts` | `crates/nostream-cli/src/commands/export.rs` | `crates/nostream-cli/src/lib.rs:8` | moved | | `src/services/event-import-service.ts` | `crates/nostream-services/src/services/event_import_service.rs` | `crates/nostream-services/src/lib.rs:10`, `crates/nostream-services/src/lib.rs:15` | moved | | `src/services/maintenance-service.ts` | `crates/nostream-services/src/services/maintenance_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | -| `src/services/nip66-event-publisher.ts` | `crates/nostream-services/src/services/nip66_event_publisher.rs` | `crates/nostream-services/src/lib.rs:10` | moved | +| `src/services/nip66-event-publisher.ts` | — | `crates/nostream-services/src/services/nip66_event_publisher.rs:5` | not moved (#865) — dropped: only the Phase 2 stub exists | | `src/services/notification-channels.ts` | `crates/nostream-services/src/services/notification_channels.rs` | `crates/nostream-services/src/lib.rs:10` | moved | | `src/services/notification-outbox-service.ts` | `crates/nostream-services/src/services/notification_outbox_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | | `src/services/operator-notification-service.ts` | `crates/nostream-services/src/services/operator_notification_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | | `src/services/payments-service.ts` | `crates/nostream-services/src/services/payments_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | -| `src/services/subscription-service.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — no subscription service; the tables are not in the Rust schema | | `src/services/wot-graph-service.ts` | `crates/nostream-services/src/services/wot_graph_service.rs` | `crates/nostream-services/src/lib.rs:10` | moved | -| `src/telemetry/event-metrics.ts` | `crates/nostream-relay/src/metrics.rs` | `crates/nostream-relay/src/lib.rs:19`, `crates/nostreamd/src/lib.rs:12` | moved | +| `src/telemetry/event-metrics.ts` | `crates/nostream-relay/src/metrics.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:19`, `crates/nostreamd/src/lib.rs:12` | split — the counters; the daemon exports them | | `src/telemetry/metrics.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:12` | moved | -| `src/telemetry/ops-metrics.ts` | — | `crates/nostream-services/src/lib.rs:30-32` | not moved (#865) — the probe counters go with the probe family | -| `src/tor/client.ts` | `crates/nostream-services/src/tor.rs` | `crates/nostream-services/src/lib.rs:14`, `crates/nostreamd/src/lib.rs:13` | moved | +| `src/tor/client.ts` | `crates/nostream-services/src/tor.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:14`, `crates/nostreamd/src/lib.rs:13` | split — the control-port client; the daemon spawns it | | `src/utils/adaptive-pow.ts` | `crates/nostream-core/src/adaptive_pow.rs` | `crates/nostream-core/src/lib.rs:12` | moved | -| `src/utils/admin-audit-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-diagnostics-export.ts` | `crates/nostream-admin/src/utils/diagnostics.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | | `src/utils/admin-grafana.ts` | `crates/nostream-admin/src/utils/grafana.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | | `src/utils/admin-health.ts` | `crates/nostream-admin/src/utils/health.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-metrics.ts` | `crates/nostream-relay/src/metrics.rs` | `crates/nostream-admin/src/lib.rs:14`, `crates/nostream-relay/src/lib.rs:19` | moved | -| `src/utils/admin-moderation-persist.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-moderation-stats.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-moderation.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-notifications-settings.ts` | `crates/nostream-config/src/notifications.rs` | `crates/nostream-admin/src/lib.rs:14`, `crates/nostream-config/src/lib.rs:11` | moved | -| `src/utils/admin-ops-config.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-ops-nip05.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-ops-sanitize.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-ops-storage.ts` | `crates/nostream-admin/src/utils/storage.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/admin-ops-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | +| `src/utils/admin-metrics.ts` | `crates/nostream-relay/src/metrics.rs` (`crates/nostream-admin/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:19`, `crates/nostream-admin/src/lib.rs:14` | split — the counters; admin renders the consult | +| `src/utils/admin-notifications-settings.ts` | `crates/nostream-config/src/notifications.rs` (`crates/nostream-admin/src/lib.rs`) | `crates/nostream-config/src/lib.rs:11`, `crates/nostream-admin/src/lib.rs:14` | split — the settings family | | `src/utils/admin-password.ts` | `crates/nostream-admin/src/utils/password.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | | `src/utils/admin-rate-limit.ts` | `crates/nostream-admin/src/utils/rate_limit.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | | `src/utils/admin-session.ts` | `crates/nostream-admin/src/utils/session.rs` | `crates/nostream-admin/src/lib.rs:14` | moved | -| `src/utils/banner.ts` | — | `crates/nostreamd/src/lib.rs:3-8` | not moved (#1336) — no banner is printed; the daemon's ownership block has no banner entry | | `src/utils/compression.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:12` | moved | | `src/utils/event-store.ts` | `crates/nostream-storage/src/event_store.rs` | `crates/nostream-storage/src/lib.rs:11` | moved | | `src/utils/event.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:12` | moved | | `src/utils/ewma-rate-limiter.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | | `src/utils/filter.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-core/src/lib.rs:13` | moved | | `src/utils/geohash.ts` | `crates/nostream-core/src/geohash.rs` | `crates/nostream-core/src/lib.rs:13` | moved | -| `src/utils/hidden-content-cache.ts` | `crates/nostream-relay/src/hidden_content.rs` (`crates/nostream-storage/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:14`, `crates/nostream-storage/src/lib.rs:11` | moved — the mirror; storage owns the query | -| `src/utils/html.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:13` | moved | -| `src/utils/http.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-admin/src/lib.rs`) | `crates/nostream-core/src/lib.rs:14`, `crates/nostream-admin/src/lib.rs:15` | moved — the request types; admin owns the response half | +| `src/utils/hidden-content-cache.ts` | `crates/nostream-relay/src/hidden_content.rs` (`crates/nostream-storage/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:14`, `crates/nostream-storage/src/lib.rs:11` | split — the mirror; storage owns the query | +| `src/utils/html.ts` | `crates/nostream-admin/src/controllers/get_dashboard.rs` | `crates/nostream-admin/src/controllers/get_dashboard.rs:19-24` | moved — the only escape helper the tree needs, in the dashboard it renders | +| `src/utils/http.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-admin/src/lib.rs`) | `crates/nostream-core/src/lib.rs:14`, `crates/nostream-admin/src/lib.rs:15` | split — the request types; admin owns the response half | | `src/utils/invoice.ts` | `crates/nostream-services/src/invoice.rs` | `crates/nostream-services/src/lib.rs:17` | moved | | `src/utils/messages.ts` | `crates/nostream-core/src/messages.rs` | `crates/nostream-core/src/lib.rs:14` | moved | -| `src/utils/misc.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:14` | moved | -| `src/utils/moderation-rate-limit-stats.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — the Redis-sorted-set stats panel has no Rust counterpart | +| `src/utils/misc.ts` | — | `crates/nostream-core/src/lib.rs:14` | not moved (#1336) — dropped: `delayMs` is `tokio::time::sleep`; no module of the name exists | | `src/utils/monitor-identity.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:2` | moved | -| `src/utils/negentropy-sessions.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:48` | moved | | `src/utils/negentropy.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:15` | moved | -| `src/utils/network-health-mismatches.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — part of the NIP-66 probe family | +| `src/utils/network-health-mismatches.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: part of the NIP-66 probe family | | `src/utils/nip03.ts` | `crates/nostream-core/src/nip03.rs` | `crates/nostream-core/src/lib.rs:15` | moved | -| `src/utils/nip05-reverification.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/utils/nip05.rs:2` | moved | -| `src/utils/nip05.ts` | `crates/nostream-core/src/nip05.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:16`, `crates/nostream-services/src/lib.rs:17` | moved — the NIP; services owns the payment surface | +| `src/utils/nip05.ts` | `crates/nostream-core/src/nip05.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:16`, `crates/nostream-services/src/lib.rs:17` | split — the NIP; services owns the payment surface | | `src/utils/nip25.ts` | `crates/nostream-core/src/nip25.rs` | `crates/nostream-core/src/lib.rs:16` | moved | | `src/utils/nip42-session.ts` | `crates/nostream-core/src/nip42.rs` | `crates/nostream-core/src/lib.rs:17` | moved | | `src/utils/nip42.ts` | `crates/nostream-core/src/nip42.rs` | `crates/nostream-core/src/lib.rs:16` | moved | @@ -360,33 +343,28 @@ file is checked separately by the coverage count (`## Checking this file`). | `src/utils/nip66-events.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:19` | moved | | `src/utils/nip66-nip11-tags.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:19` | moved | | `src/utils/nip66-schedule.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:20` | moved | -| `src/utils/nip77.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/lib.rs:46` | moved | | `src/utils/nip98-replay.ts` | `crates/nostream-core/src/nip98.rs` | `crates/nostream-core/src/lib.rs:21` | moved | | `src/utils/nip98.ts` | `crates/nostream-core/src/nip98.rs` | `crates/nostream-core/src/lib.rs:20` | moved | | `src/utils/operator-notification-enqueue.ts` | `crates/nostream-services/src/services/operator_notification_service.rs` | `crates/nostream-services/src/services/operator_notification_service.rs:162` | moved | -| `src/utils/ops-trust-notifications.ts` | — | `crates/nostream-services/src/lib.rs:30-32` | not moved (#1036) — named there as a port still owed | -| `src/utils/peering-auth.ts` | — | `crates/nostream-config/src/settings.rs:805` | not moved (#1036) — the settings model exists; the peer authenticator is #1036's | -| `src/utils/prometheus-client.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — the console's Prometheus query client has no Rust counterpart | +| `src/utils/prometheus-client.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — added-after-capture: the console's Prometheus query client has no counterpart | | `src/utils/proof-of-work.ts` | `crates/nostream-core/src/pow.rs` | `crates/nostream-core/src/lib.rs:21` | moved | -| `src/utils/record-admin-audit.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:41` | not moved (#867) — the audit log is the admin job's | -| `src/utils/relay-broadcast-deduplicator.ts` | `crates/nostream-relay/src/broadcast.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | -| `src/utils/relay-broadcast-message.ts` | `crates/nostream-relay/src/broadcast.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | -| `src/utils/relay-broadcast-state.ts` | `crates/nostream-relay/src/broadcast.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | -| `src/utils/relay-probe-history.ts` | — | `crates/nostream-services/src/lib.rs:30-32` | not moved (#1036) — probe history retention is #1036's | -| `src/utils/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | moved | +| `src/utils/relay-broadcast-deduplicator.ts` | — | `crates/nostream-relay/src/broadcast.rs:24-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | +| `src/utils/relay-broadcast-message.ts` | — | `crates/nostream-relay/src/broadcast.rs:15-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | +| `src/utils/relay-broadcast-state.ts` | — | `crates/nostream-relay/src/broadcast.rs:15-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | +| `src/utils/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | type-only | | `src/utils/relay-probe-targets.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:2` | moved | -| `src/utils/relay-probe/dns-cache.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:20` | moved | -| `src/utils/relay-probe/dns-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:20` | moved | +| `src/utils/relay-probe/dns-cache.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | +| `src/utils/relay-probe/dns-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | | `src/utils/relay-probe/index.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | -| `src/utils/relay-probe/nip11-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:34` | moved | -| `src/utils/relay-probe/run-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:48` | moved | -| `src/utils/relay-probe/target.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:6` | moved | -| `src/utils/relay-probe/tls-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:27` | moved | -| `src/utils/relay-probe/types.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | -| `src/utils/relay-probe/ws-protocol-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | -| `src/utils/relay-probe/ws-rtt-probe.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:41` | moved | +| `src/utils/relay-probe/nip11-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | +| `src/utils/relay-probe/run-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | +| `src/utils/relay-probe/target.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:6` | type-only | +| `src/utils/relay-probe/tls-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | +| `src/utils/relay-probe/types.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:6-18` | type-only | +| `src/utils/relay-probe/ws-protocol-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | +| `src/utils/relay-probe/ws-rtt-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | | `src/utils/report-scoring.ts` | `crates/nostream-core/src/report_scoring.rs` | `crates/nostream-core/src/lib.rs:22` | moved | -| `src/utils/secret.ts` | `crates/nostream-core/src/secret.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:22`, `crates/nostream-services/src/lib.rs:17` | moved — the primitive; services owns the payment surface | +| `src/utils/secret.ts` | `crates/nostream-core/src/secret.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:22`, `crates/nostream-services/src/lib.rs:17` | split — the primitive; services owns the payment surface | | `src/utils/settings-config.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:9` | moved | | `src/utils/settings-guided-schema.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:10` | moved | | `src/utils/settings-paths.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:9` | moved | @@ -394,17 +372,86 @@ file is checked separately by the coverage count (`## Checking this file`). | `src/utils/settings.ts` | `crates/nostream-config/src/settings.rs` | `crates/nostream-config/src/lib.rs:9` | moved | | `src/utils/shutdown-state.ts` | `crates/nostream-core/src/lifecycle.rs` | `crates/nostream-core/src/lib.rs:22` | moved | | `src/utils/sliding-window-rate-limiter.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | -| `src/utils/stream.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:23` | moved | -| `src/utils/subscription.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — recurring membership plans; the tables are not in the Rust schema | -| `src/utils/template-cache.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:23` | moved | -| `src/utils/transform.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:23`, `crates/nostream-services/src/lib.rs:17` | moved — the primitive; services owns the payment surface | +| `src/utils/stream.ts` | — | `crates/nostream-core/src/lib.rs:22-24` | not moved (#1336) — dropped: the block claims it, but core holds no stream helper (`grep -rn 'stream_map' crates` prints nothing) | +| `src/utils/template-cache.ts` | — | `crates/nostream-core/src/lib.rs:23` | not moved (#1336) — dropped: the block claims it, but no module caches a template | +| `src/utils/transform.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-services/src/lib.rs`) | `crates/nostream-core/src/lib.rs:23`, `crates/nostream-services/src/lib.rs:17` | split — the primitive; services owns the payment surface | | `src/utils/validation.ts` | `crates/nostream-core/src/validation.rs` | `crates/nostream-core/src/lib.rs:24` | moved | | `src/utils/wot-pow-policy.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:24` | moved | +## Added after the capture (61 rows) + +These files did not exist at `242a3001`; each +row has the same shape as the group above, and a disposition that postdates the capture +says so. + +| capture module | Rust module | evidence | disposition | +|---|---|---|---| +| `src/@types/admin-audit.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | type-only — added after the capture | +| `src/@types/admin-ops.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | type-only — added after the capture | +| `src/@types/negentropy.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/nip77.rs:1-2` | type-only | +| `src/@types/user-subscription.ts` | — | `crates/nostream-storage/src/lib.rs:26-28` | not moved (#1036) — added-after-capture: `user_subscriptions` has no Rust trait | +| `src/controllers/admin/get-admin-audit-log-controller.ts` | `crates/nostream-admin/src/controllers/get_audit_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-admin-diagnostics-export-controller.ts` | `crates/nostream-admin/src/controllers/get_diagnostics_export.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-moderation-limits-controller.ts` | `crates/nostream-admin/src/controllers/get_moderation_limits.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-moderation-stats-controller.ts` | `crates/nostream-admin/src/controllers/get_moderation_stats.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-network-health-history-controller.ts` | `crates/nostream-admin/src/controllers/get_network_health_history.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-ops-nip05-verifications-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_nip05_verifications.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-ops-storage-counts-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_storage_counts.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/get-ops-workers-controller.ts` | `crates/nostream-admin/src/controllers/get_ops_workers.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/patch-moderation-limits-controller.ts` | `crates/nostream-admin/src/controllers/patch_moderation_limits.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/post-admin-network-health-run-controller.ts` | `crates/nostream-admin/src/controllers/post_network_health_run.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/post-moderation-actions-controller.ts` | `crates/nostream-admin/src/controllers/post_moderation_actions.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/admin/post-ops-nip05-reverify-controller.ts` | `crates/nostream-admin/src/controllers/post_ops_nip05_reverify.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | +| `src/controllers/subscriptions/get-subscription-status-controller.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: the subscription tables are not in the Rust schema | +| `src/factories/admin-ops-cache-adapter-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-audit-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-diagnostics-export-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-moderation-stats-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-network-health-history-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-ops-nip05-verifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-ops-storage-counts-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-admin-ops-workers-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/get-subscription-status-controller-factory.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: it composes the subscription controller | +| `src/factories/controllers/patch-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/post-admin-moderation-actions-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/post-admin-network-health-run-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/post-admin-ops-nip05-reverify-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/subscription-service-factory.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: it composes the service the crate does not own | +| `src/handlers/neg-close-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — added-after-capture: no handler module is claimed; NIP-77 is cut against `041fe34e` | +| `src/handlers/neg-msg-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — added-after-capture: no handler module is claimed; NIP-77 is cut against `041fe34e` | +| `src/handlers/neg-open-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — added-after-capture: no handler module is claimed; NIP-77 is cut against `041fe34e` | +| `src/repositories/user-subscription-repository.ts` | — | `crates/nostream-storage/src/lib.rs:26-28` | not moved (#1036) — added-after-capture: `user_subscriptions` has no Rust trait | +| `src/routes/subscriptions/index.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: the subscription tables are not in the Rust schema | +| `src/schemas/admin-moderation-schema.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:13` | moved — added after the capture | +| `src/scripts/bench-gate.ts` | — | `docs/rewrite/benchmarks.md:248` | not moved (#868) — added-after-capture: the gate is the capture's TypeScript tooling | +| `src/services/subscription-service.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: no subscription service; the tables are not in the Rust schema | +| `src/telemetry/ops-metrics.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — added-after-capture: the probe counters go with the probe family | +| `src/utils/admin-audit-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-diagnostics-export.ts` | `crates/nostream-admin/src/utils/diagnostics.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-moderation-persist.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-moderation-stats.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-moderation.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-config.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-nip05.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-sanitize.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-storage.ts` | `crates/nostream-admin/src/utils/storage.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/banner.ts` | — | `crates/nostreamd/src/lib.rs:3-8` | not moved (#1336) — added-after-capture: no banner is printed; the ownership block has no entry | +| `src/utils/moderation-rate-limit-stats.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — added-after-capture: the Redis-sorted-set stats panel has no Rust counterpart | +| `src/utils/negentropy-sessions.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:48` | moved — added after the capture | +| `src/utils/nip05-reverification.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/utils/nip05.rs:2` | moved | +| `src/utils/nip77.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/lib.rs:46` | moved — added after the capture | +| `src/utils/ops-trust-notifications.ts` | — | `crates/nostream-config/src/notifications.rs:70-76` | not moved (#1036) — dropped: the three toggles are modelled, the emitter is not | +| `src/utils/peering-auth.ts` | — | `crates/nostream-config/src/settings.rs:805` | not moved (#1036) — added-after-capture: the settings model exists; the peer authenticator is #1036's | +| `src/utils/record-admin-audit.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:41` | not moved (#867) — added-after-capture: the audit log is the admin job's | +| `src/utils/relay-probe-history.ts` | — | `crates/nostream-config/src/settings.rs:688` | not moved (#1036) — dropped: `nip66.historyRetentionRuns` is modelled, nothing retains history | +| `src/utils/subscription.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: recurring plans; the tables are not in the Rust schema | + ## Rust modules with no TypeScript ancestor The map is incomplete in the other direction: these are real modules a reader will meet and -must not read as an omission from the table above. They have no TS ancestor at the capture, +must not read as an omission from the tables above. They have no TS ancestor at the capture, so no row can name them. | Rust module | why it has no ancestor | @@ -420,30 +467,38 @@ so no row can name them. | `crates/nostreamd/src/admin_http.rs` | the admin router's composition onto the one listener (ADR 0014, ADR 0021) | | `crates/nostreamd/src/stores.rs` | the daemon's backend factory: one resolved event-store bundle for the relay, the services and the admin state | -Also with no ancestor, and not enumerated above: the storage seam -`crates/nostream-storage/src/migration.rs`, the LMDB opener `crates/nostream-storage/src/opened.rs`, -and `crates/nostream-cli/src/commands/migrate_unsupported.rs` (the Postgres-less build's refusal). -The count of `Phase [1-2] stub` markers these carry is 31; a new stub without its label moves -that count, which is how `CLAUDE.md` keeps the list honest. +Also with no ancestor: the storage seam `crates/nostream-storage/src/migration.rs`, the LMDB +opener `crates/nostream-storage/src/opened.rs`, and +`crates/nostream-cli/src/commands/migrate_unsupported.rs` (the Postgres-less build's refusal). +The count of `Phase [1-2] stub` markers these and the stub-only rows carry is 31; a new stub +without its label moves that count, which is how `CLAUDE.md` keeps the list honest. ## The files whose disposition is a judgement -The rows marked `not moved` fall in three classes, and a reader should be able to tell them -apart: - -- **A job already owns the port.** `#865` (the NIP-66 probe family), `#867` (the invoice and - callback controllers, and the console's own utilities) and `#1036` (NIP-77, peering, - recurring plans, the probe/SSL notifications) are open and name these files or their - feature. The row names the tracker; the port is not owed to this document. -- **The tree decided against the surface.** The Redis client type, the Redis cache adapter - and the startup banner have no Rust counterpart because the decision is recorded (ADR 0010 - deletes the cache server; the daemon prints no banner). No issue tracks a decision, so - those rows name `#1336`, the row whose record this is, and the citation is the decision's - own line. A reader who wants a tracker for them has the ADR. +Three classes, which a reader should be able to tell apart: + +- **A job already owns the port.** `#865` (the NIP-66 probe family and the relay's cross-worker + fan-out), `#867` (the invoice and callback controllers, the CLI's TUI, the document handlers, + and the console's own utilities) and `#1036` (NIP-77, peering, recurring plans, the probe/SSL + notifications) are open and name these files or their feature. The row names the tracker; the + port is not owed to this document. +- **The tree decided against the surface.** The Redis client type, the Redis cache adapter, the + cache keys, the startup banner and the `utils` helpers the runtime absorbed (a stream mapper, a + template cache, `delayMs`) have no Rust counterpart because the decision is recorded (ADR 0010 + deletes the cache server; the daemon prints no banner; `tokio` supplies the rest). No issue + tracks a decision, so those rows name `#1336`, the row whose record this is, and the citation is + the decision's own line. Three of them also record a block that claims a module it does not + have: `src/utils/{stream,template-cache,misc}.ts` are named by + `crates/nostream-core/src/lib.rs` and have no counterpart there. - **The capture's tooling stays the capture's.** `src/scripts/bench-gate.ts` is TypeScript tooling run over the capture's benchmark artifacts (`docs/rewrite/benchmarks.md:248`); the Rust rig has no gate, and `#868` owns that gap. +Two rows record a block that is wrong about itself rather than a gap, and the row says so: +`src/@types/clients.ts` is named by the relay's ownership bullet but is the payment processor's +invoice contract, and `src/@types/subscription.ts` is named by the same bullet while its +`Subscription` type lives in `crates/nostream-relay/src/connection.rs:29`. + ## Not covered - **The TypeScript sources' internals.** A row says where a module went, not what changed on @@ -462,7 +517,9 @@ apart: ## Checking this file ``` +git ls-tree -r 242a3001 -- src | grep -c '\.ts$' # 298 +find src -name '*.ts' | wc -l # 357 comm -23 <(find src -name '*.ts' | sort) \ <(grep -oE 'src/[A-Za-z0-9_./@-]+\.ts' docs/rewrite/crate-map.md | sort -u) | wc -l # 0 -python3 scripts/citation-meaning.py docs/rewrite/crate-map.md # exits 0 +python3 scripts/citation-meaning.py docs/rewrite/crate-map.md # exits 0 ``` From cb1d489ddd83edc5e2a6f072e93b1d7c3d3d869b Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:54:03 -0500 Subject: [PATCH 06/14] docs(rewrite): cite the flag arm and the merge, and show the tool list --- docs/rewrite/deploying.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/rewrite/deploying.md b/docs/rewrite/deploying.md index 0e9c33466..635b78629 100644 --- a/docs/rewrite/deploying.md +++ b/docs/rewrite/deploying.md @@ -96,10 +96,12 @@ no migrate container to watch for. ## Settings **Which files are read, in order.** The config directory is `--config-dir`, else -`NOSTR_CONFIG_DIR`, else `/.nostr`; the shipped defaults are always -`/resources/default-settings.yaml` and the user file is deep-merged over them -(`crates/nostream-config/src/paths.rs:23-39`). Four measurements, each one exit code from the -same binary: +`NOSTR_CONFIG_DIR`, else `/.nostr` — the flag arm is the daemon's +(`crates/nostreamd/src/main.rs:115-118`), and the variable and the `` fallback are the +resolver's (`crates/nostream-config/src/paths.rs:22-25`). The shipped defaults are always +`/resources/default-settings.yaml` (`crates/nostream-config/src/paths.rs:35`), and the user +file is deep-merged over them (`crates/nostream-config/src/load.rs:414-417`). Four measurements, +each one exit code from the same binary: ``` $ NOSTR_CONFIG_DIR=/tmp/046-scratch/cfg-bad nostreamd --check --config-dir /tmp/046-scratch/cfg @@ -382,9 +384,17 @@ list: $ printf '%s\n%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ | nostreamd --mcp-stdio --admin-token-file /tmp/046-scratch/token-0600.json {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{}},"serverInfo":{"name":"nostream","version":"0.1.0"},"instructions":"The nostream admin MCP server. ..."}} +{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"delete_event",...},{"name":"get_event",...}, ...]}} exit 0 ``` +The list is the fourteen tools ADR 0014 (D19) fixes, in the server's own order: +`delete_event`, `get_event`, `invoices_get`, `invoices_list`, `list_events`, +`maintenance_last_run`, `maintenance_run`, `relay_status`, `reports_action`, `reports_list`, +`settings_get`, `settings_set`, `user_admin`, `user_get`. The document's scopes decide which of +them answer: a document with no scopes grants the nine read tools, and `["write"]` adds the five +that write. + The mode also needs `admin.enabled: true`, opens the same store the relay door does, and logs to stderr so no log line can corrupt the protocol on stdout (`crates/nostreamd/src/telemetry.rs:1-10`). Its audit sink is the same From d2ed80fc6b8a453c656ec66c55a572fb8ba13ad6 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 05:54:03 -0500 Subject: [PATCH 07/14] docs(rewrite): the copy's own rows refusal, and verify's as its own --- docs/rewrite/migrating.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/rewrite/migrating.md b/docs/rewrite/migrating.md index 192341fd9..3190f563c 100644 --- a/docs/rewrite/migrating.md +++ b/docs/rewrite/migrating.md @@ -142,8 +142,15 @@ completed (`crates/nostream-cli/src/commands/migrate.rs:427-436`). A re-run read and continues from `after`; it does not start over. **Deleting the manifest does not restart a half-filled store.** A store that holds rows and no -manifest is refused, because a manifest-less store cannot be told from a store the copy already -filled, and starting over would double-write keys the manifest no longer accounts for: +manifest is refused, and the hazard is the one the code names: copying over it leaves the +displaced rows' *index* entries behind — a completed invoice keeps its `invoices_pending` entry — +and `--verify` scans the primary databases only, so it could never report them +(`crates/nostream-cli/src/commands/migrate.rs:160-172`). The copy's sentence is +` already holds rows (): an empty target, or one that carries a manifest, is +required` (`crates/nostream-cli/src/commands/migrate.rs:163-171`). + +`--verify` says the same thing from the other side, and that one is measurable here — a store +seeded with three events and no manifest: ``` $ nostream-cli seed --count 3 --data-dir /tmp/046-scratch/mig/seed # a store with rows, no manifest @@ -155,12 +162,12 @@ exit 1 ``` Starting over therefore takes a fresh `--target`, or removing the manifest and the store -together — which is what the help text says and what the refusal above protects. +together — which is what the help text says and what the two refusals protect. -[unverified] because no Postgres was reachable, so a real copy was never interrupted: the -resume path is stated from the code and the manifest's own fields -(`crates/nostream-cli/src/commands/migrate.rs:7-10`, `:427-436`), and the two refusals above are -the measured half. +[unverified] because the copy's own rows refusal is only reached after the source connects, and +no Postgres exists here: its sentence above is a code reading +(`crates/nostream-cli/src/commands/migrate.rs:163-171`), not a transcript, and the resume path +rests on the manifest's fields (`:7-10`, `:427-436`). ## Verify From 5ca6171e3d6819d235db8b71b2f3eeaff85afad2 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:10:05 -0500 Subject: [PATCH 08/14] docs(rewrite): sweep the map for stub and name-only targets, and re-point the factories --- docs/rewrite/crate-map.md | 111 ++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/docs/rewrite/crate-map.md b/docs/rewrite/crate-map.md index 5661b3561..855ba113d 100644 --- a/docs/rewrite/crate-map.md +++ b/docs/rewrite/crate-map.md @@ -51,9 +51,9 @@ eight `crates/*/src/lib.rs` files whose crates have a TypeScript ancestor; brace directory tokens were expanded to their files. 305 of the 357 head files are named by a `lib.rs` block; the others are named here from a call site, an ADR, or a recorded reason. -**Totals over the 357 rows**, by the crate named first in column 2: `nostream-admin` 63, `nostreamd` 49, `nostream-services` 37, `nostream-core` 42, `nostream-relay` 36, `nostream-cli` 22, `nostream-storage` 22, `nostream-config` 9; 77 rows -name no crate because nothing replaced them. By class: `moved` 222, `split` 28, -`type-only` 30, and 77 rows that are `not moved`, naming `#865` 16, `#867` 38, `#868` 1, `#1036` 14, `#1336` 8. +**Totals over the 357 rows**, by the crate named first in column 2: `nostream-admin` 91, `nostreamd` 14, `nostream-services` 38, `nostream-core` 38, `nostream-relay` 37, `nostream-cli` 22, `nostream-storage` 22, `nostream-config` 9; 86 rows +name no crate because nothing replaced them. By class: `moved` 213, `split` 28, +`type-only` 30, and 86 rows that are `not moved`, naming `#865` 19, `#867` 42, `#868` 1, `#1036` 15, `#1336` 9. ## How to read a row @@ -64,6 +64,10 @@ name no crate because nothing replaced them. By class: `moved` 222, `split` 28, | citation | the `path:line` in this tree that records the mapping | | disposition | the class, then the reason: see below | +Where no same-named module exists the row names the crate root — `shortcut: the crate's lib.rs +where no same-named module exists (48 rows), upgrade when a per-module attribution is needed for +the cutover audit`. + The disposition's first word is the class, from the list the spec fixes: - `moved` — one Rust module holds the port. @@ -75,7 +79,8 @@ The disposition's first word is the class, from the list the spec fixes: `dropped` when the surface was decided against or is still owed, `added-after-capture` when the file itself postdates the capture. - A row whose only Rust answer is a `Phase 1`/`Phase 2` stub is `not moved`, never `moved`: a - stub is not a port, and every factory that composes it says the same thing. + stub is not a port, and every factory that composes it says the same thing. A module that + merely names the capture file in its doc comment is not a port either. ## The capture's modules (296 rows) @@ -149,7 +154,7 @@ The disposition's first word is the class, from the list the spec fixes: | `src/constants/adapter.ts` | `crates/nostream-relay/src/transport.rs` | `crates/nostream-relay/src/transport.rs:1-3` | moved — the emitter's event names are not kept; #865 owns the transport's states | | `src/constants/base.ts` | `crates/nostream-core/src/lib.rs` | `crates/nostream-core/src/lib.rs:7` | moved | | `src/constants/caching.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — dropped: the cache keys have no cache to key (ADR 0010) | -| `src/controllers/admin/get-health-controller.ts` | `crates/nostream-admin/src/controllers/get_health.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | +| `src/controllers/admin/get-health-controller.ts` | `crates/nostream-admin/src/controllers/get_admin_health.rs` | `crates/nostream-admin/src/controllers/get_admin_health.rs:2` | moved — mounted at crates/nostream-admin/src/routes/mod.rs:222 | | `src/controllers/admin/get-metrics-controller.ts` | `crates/nostream-admin/src/controllers/get_metrics.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-network-health-controller.ts` | `crates/nostream-admin/src/controllers/get_network_health.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | | `src/controllers/admin/get-notification-delivery-log-controller.ts` | `crates/nostream-admin/src/controllers/get_notification_delivery_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved | @@ -175,40 +180,40 @@ The disposition's first word is the class, from the list the spec fixes: | `src/controllers/invoices/post-invoice-controller.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: only the Phase 2 stub exists | | `src/database/client.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:9` | moved | | `src/database/transaction.ts` | `crates/nostream-storage/src/lib.rs` | `crates/nostream-storage/src/lib.rs:9` | moved | -| `src/factories/admin-auth-provider-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/admin-auth-provider-factory.ts` | `crates/nostream-admin/src/auth.rs` | `crates/nostream-admin/src/auth.rs:1` | moved — the constructor; the factory has no module | | `src/factories/app-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-health-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-metrics-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-network-health-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-notification-delivery-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-notifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-session-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-settings-backups-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-settings-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admin-settings-schema-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/get-admission-check-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/get-admin-health-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_admin_health.rs` | `crates/nostream-admin/src/controllers/get_admin_health.rs:2` | moved | +| `src/factories/controllers/get-admin-metrics-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_metrics.rs` | `crates/nostream-admin/src/controllers/get_metrics.rs:2` | moved | +| `src/factories/controllers/get-admin-network-health-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_network_health.rs` | `crates/nostream-admin/src/controllers/get_network_health.rs:2` | moved | +| `src/factories/controllers/get-admin-notification-delivery-log-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_notification_delivery_log.rs` | `crates/nostream-admin/src/controllers/get_notification_delivery_log.rs:2` | moved | +| `src/factories/controllers/get-admin-notifications-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_notifications.rs` | `crates/nostream-admin/src/controllers/get_notifications.rs:2` | moved | +| `src/factories/controllers/get-admin-session-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_session.rs` | `crates/nostream-admin/src/controllers/get_session.rs:2` | moved | +| `src/factories/controllers/get-admin-settings-backups-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_settings_backups.rs` | `crates/nostream-admin/src/controllers/get_settings_backups.rs:2` | moved | +| `src/factories/controllers/get-admin-settings-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_settings.rs` | `crates/nostream-admin/src/controllers/get_settings.rs:2` | moved | +| `src/factories/controllers/get-admin-settings-schema-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_settings_schema.rs` | `crates/nostream-admin/src/controllers/get_settings_schema.rs:2` | moved | +| `src/factories/controllers/get-admission-check-controller-factory.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:12-13` | moved — the limiter and the cap; the factory has no module | | `src/factories/controllers/get-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/controllers/get-invoice-status-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/controllers/lnbits-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/controllers/nodeless-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/controllers/opennode-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | -| `src/factories/controllers/patch-admin-notifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/patch-admin-settings-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-login-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-logout-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-notification-test-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-settings-restore-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/controllers/post-admin-settings-validate-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/controllers/patch-admin-notifications-controller-factory.ts` | `crates/nostream-admin/src/controllers/patch_notifications.rs` | `crates/nostream-admin/src/controllers/patch_notifications.rs:2` | moved | +| `src/factories/controllers/patch-admin-settings-controller-factory.ts` | `crates/nostream-admin/src/controllers/patch_settings.rs` | `crates/nostream-admin/src/controllers/patch_settings.rs:3` | moved | +| `src/factories/controllers/post-admin-login-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_login.rs` | `crates/nostream-admin/src/controllers/post_login.rs:26` | moved | +| `src/factories/controllers/post-admin-logout-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_logout.rs` | `crates/nostream-admin/src/controllers/post_logout.rs:20` | moved | +| `src/factories/controllers/post-admin-notification-test-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_notification_test.rs` | `crates/nostream-admin/src/controllers/post_notification_test.rs:2` | moved | +| `src/factories/controllers/post-admin-settings-restore-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_settings_restore.rs` | `crates/nostream-admin/src/controllers/post_settings_restore.rs:2` | moved | +| `src/factories/controllers/post-admin-settings-validate-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_settings_validate.rs` | `crates/nostream-admin/src/controllers/post_settings_validate.rs:2` | moved | | `src/factories/controllers/post-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/controllers/zebedee-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | | `src/factories/dvm-orchestrator-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/event-repository-factory.ts` | `crates/nostream-storage/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-storage/src/lib.rs:16`, `crates/nostreamd/src/lib.rs:14` | split — the repository; the daemon composes it | | `src/factories/event-strategy-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the registry; the daemon composes it | | `src/factories/logger-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/maintenance-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/maintenance-service-factory.ts` | `crates/nostream-services/src/services/maintenance_service.rs` | `crates/nostream-services/src/services/maintenance_service.rs:1` | moved — the constructor; the factory has no module | | `src/factories/maintenance-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/message-handler-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the registry; the daemon composes it | -| `src/factories/notification-outbox-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/notification-outbox-service-factory.ts` | `crates/nostream-services/src/services/notification_outbox_service.rs` | `crates/nostream-services/src/services/notification_outbox_service.rs:1` | moved — the constructor; the factory has no module | | `src/factories/payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/mod.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the selection; the daemon composes it | | `src/factories/payments-processors/lnbits-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnbits.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | | `src/factories/payments-processors/lnurl-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/lnurl.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | @@ -216,14 +221,14 @@ The disposition's first word is the class, from the list the spec fixes: | `src/factories/payments-processors/nwc-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/nwc.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | | `src/factories/payments-processors/opennode-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/opennode.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | | `src/factories/payments-processors/zebedee-payments-processor-factory.ts` | `crates/nostream-services/src/payments/processors/zebedee.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-services/src/lib.rs:13`, `crates/nostreamd/src/lib.rs:14` | split — the processor; the daemon composes it | -| `src/factories/payments-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/payments-service-factory.ts` | `crates/nostream-services/src/services/payments_service.rs` | `crates/nostream-services/src/services/payments_service.rs:1` | moved — the constructor; the factory has no module | | `src/factories/rate-limiter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the limiter; the daemon composes it | | `src/factories/relay-monitor-worker-factory.ts` | — | `crates/nostreamd/src/lib.rs:37-38` | not moved (#865) — dropped: it composes the probe worker #865 does not register | | `src/factories/settings-factory.ts` | `crates/nostream-config/src/settings.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-config/src/lib.rs:12`, `crates/nostreamd/src/lib.rs:14` | split — the loaded value; the daemon owns it | | `src/factories/web-app-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/websocket-adapter-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the transport; the daemon binds it | | `src/factories/worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | -| `src/factories/wot-graph-service-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | +| `src/factories/wot-graph-service-factory.ts` | `crates/nostream-services/src/services/wot_graph_service.rs` | `crates/nostream-services/src/services/wot_graph_service.rs:1` | moved — the constructor; the factory has no module | | `src/handlers/auth-message-handler.ts` | `crates/nostream-relay/src/handlers/auth.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | | `src/handlers/count-message-handler.ts` | `crates/nostream-relay/src/handlers/count.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | | `src/handlers/event-message-handler.ts` | `crates/nostream-relay/src/handlers/event.rs` | `crates/nostream-relay/src/lib.rs:8` | moved | @@ -320,14 +325,14 @@ The disposition's first word is the class, from the list the spec fixes: | `src/utils/event.ts` | `crates/nostream-core/src/event.rs` | `crates/nostream-core/src/lib.rs:12` | moved | | `src/utils/ewma-rate-limiter.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:14` | moved | | `src/utils/filter.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-core/src/lib.rs:13` | moved | -| `src/utils/geohash.ts` | `crates/nostream-core/src/geohash.rs` | `crates/nostream-core/src/lib.rs:13` | moved | +| `src/utils/geohash.ts` | `crates/nostream-core/src/filter.rs` | `crates/nostream-core/src/filter.rs:16` | moved — the alphabet and the #g prefix rule | | `src/utils/hidden-content-cache.ts` | `crates/nostream-relay/src/hidden_content.rs` (`crates/nostream-storage/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:14`, `crates/nostream-storage/src/lib.rs:11` | split — the mirror; storage owns the query | | `src/utils/html.ts` | `crates/nostream-admin/src/controllers/get_dashboard.rs` | `crates/nostream-admin/src/controllers/get_dashboard.rs:19-24` | moved — the only escape helper the tree needs, in the dashboard it renders | | `src/utils/http.ts` | `crates/nostream-core/src/lib.rs` (`crates/nostream-admin/src/lib.rs`) | `crates/nostream-core/src/lib.rs:14`, `crates/nostream-admin/src/lib.rs:15` | split — the request types; admin owns the response half | | `src/utils/invoice.ts` | `crates/nostream-services/src/invoice.rs` | `crates/nostream-services/src/lib.rs:17` | moved | | `src/utils/messages.ts` | `crates/nostream-core/src/messages.rs` | `crates/nostream-core/src/lib.rs:14` | moved | | `src/utils/misc.ts` | — | `crates/nostream-core/src/lib.rs:14` | not moved (#1336) — dropped: `delayMs` is `tokio::time::sleep`; no module of the name exists | -| `src/utils/monitor-identity.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:2` | moved | +| `src/utils/monitor-identity.ts` | — | `crates/nostream-services/src/monitor.rs:2` | not moved (#865) — dropped: the module names the family and implements none of it | | `src/utils/negentropy.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:15` | moved | | `src/utils/network-health-mismatches.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: part of the NIP-66 probe family | | `src/utils/nip03.ts` | `crates/nostream-core/src/nip03.rs` | `crates/nostream-core/src/lib.rs:15` | moved | @@ -339,12 +344,12 @@ The disposition's first word is the class, from the list the spec fixes: | `src/utils/nip43.ts` | `crates/nostream-core/src/nip43.rs` | `crates/nostream-core/src/lib.rs:17` | moved | | `src/utils/nip44.ts` | `crates/nostream-core/src/nip44.rs` | `crates/nostream-core/src/lib.rs:18` | moved | | `src/utils/nip56.ts` | `crates/nostream-core/src/nip56.rs` | `crates/nostream-core/src/lib.rs:18` | moved | -| `src/utils/nip65.ts` | `crates/nostream-core/src/nip65.rs` | `crates/nostream-core/src/lib.rs:18` | moved | +| `src/utils/nip65.ts` | — | `crates/nostream-core/src/nip65.rs:16` | not moved (#867) — dropped: the entry is a modelled type; the reader is a Phase 1 stub | | `src/utils/nip66-events.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:19` | moved | | `src/utils/nip66-nip11-tags.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:19` | moved | | `src/utils/nip66-schedule.ts` | `crates/nostream-core/src/nip66.rs` | `crates/nostream-core/src/lib.rs:20` | moved | -| `src/utils/nip98-replay.ts` | `crates/nostream-core/src/nip98.rs` | `crates/nostream-core/src/lib.rs:21` | moved | -| `src/utils/nip98.ts` | `crates/nostream-core/src/nip98.rs` | `crates/nostream-core/src/lib.rs:20` | moved | +| `src/utils/nip98-replay.ts` | — | `crates/nostream-core/src/nip98.rs:18` | not moved (#867) — dropped: the replay claim is stubbed with the verifier | +| `src/utils/nip98.ts` | — | `crates/nostream-core/src/nip98.rs:18` | not moved (#867) — dropped: the verifier is a Phase 1 stub; the claims type is modelled | | `src/utils/operator-notification-enqueue.ts` | `crates/nostream-services/src/services/operator_notification_service.rs` | `crates/nostream-services/src/services/operator_notification_service.rs:162` | moved | | `src/utils/prometheus-client.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — added-after-capture: the console's Prometheus query client has no counterpart | | `src/utils/proof-of-work.ts` | `crates/nostream-core/src/pow.rs` | `crates/nostream-core/src/lib.rs:21` | moved | @@ -352,10 +357,10 @@ The disposition's first word is the class, from the list the spec fixes: | `src/utils/relay-broadcast-message.ts` | — | `crates/nostream-relay/src/broadcast.rs:15-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | | `src/utils/relay-broadcast-state.ts` | — | `crates/nostream-relay/src/broadcast.rs:15-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | | `src/utils/relay-probe-snapshot.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:13` | type-only | -| `src/utils/relay-probe-targets.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:2` | moved | +| `src/utils/relay-probe-targets.ts` | — | `crates/nostream-services/src/monitor.rs:2` | not moved (#865) — dropped: the module names the family and implements none of it | | `src/utils/relay-probe/dns-cache.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | | `src/utils/relay-probe/dns-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | -| `src/utils/relay-probe/index.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:1-2` | moved | +| `src/utils/relay-probe/index.ts` | — | `crates/nostream-services/src/monitor.rs:2` | not moved (#865) — dropped: the module names the family and implements none of it | | `src/utils/relay-probe/nip11-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | | `src/utils/relay-probe/run-probe.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — dropped: the probe is a Phase 2 stub | | `src/utils/relay-probe/target.ts` | `crates/nostream-services/src/monitor.rs` | `crates/nostream-services/src/monitor.rs:6` | type-only | @@ -403,20 +408,20 @@ says so. | `src/controllers/admin/post-moderation-actions-controller.ts` | `crates/nostream-admin/src/controllers/post_moderation_actions.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | | `src/controllers/admin/post-ops-nip05-reverify-controller.ts` | `crates/nostream-admin/src/controllers/post_ops_nip05_reverify.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | | `src/controllers/subscriptions/get-subscription-status-controller.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: the subscription tables are not in the Rust schema | -| `src/factories/admin-ops-cache-adapter-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-audit-log-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-diagnostics-export-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-moderation-stats-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-network-health-history-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-ops-nip05-verifications-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-ops-storage-counts-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/get-admin-ops-workers-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/admin-ops-cache-adapter-factory.ts` | — | `crates/nostream-storage/src/lib.rs:22-24` | not moved (#1336) — added-after-capture: the ops cache is the Redis adapter ADR 0010 does not port | +| `src/factories/controllers/get-admin-audit-log-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_audit_log.rs` | `crates/nostream-admin/src/controllers/get_audit_log.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-diagnostics-export-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_diagnostics_export.rs` | `crates/nostream-admin/src/controllers/get_diagnostics_export.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-moderation-limits-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_moderation_limits.rs` | `crates/nostream-admin/src/controllers/get_moderation_limits.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-moderation-stats-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_moderation_stats.rs` | `crates/nostream-admin/src/controllers/get_moderation_stats.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-network-health-history-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_network_health_history.rs` | `crates/nostream-admin/src/controllers/get_network_health_history.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-ops-nip05-verifications-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_ops_nip05_verifications.rs` | `crates/nostream-admin/src/controllers/get_ops_nip05_verifications.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-ops-storage-counts-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_ops_storage_counts.rs` | `crates/nostream-admin/src/controllers/get_ops_storage_counts.rs:2` | moved — added after the capture | +| `src/factories/controllers/get-admin-ops-workers-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_ops_workers.rs` | `crates/nostream-admin/src/controllers/get_ops_workers.rs:2` | moved — added after the capture | | `src/factories/controllers/get-subscription-status-controller-factory.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: it composes the subscription controller | -| `src/factories/controllers/patch-admin-moderation-limits-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/post-admin-moderation-actions-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/post-admin-network-health-run-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | -| `src/factories/controllers/post-admin-ops-nip05-reverify-controller-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved — added after the capture | +| `src/factories/controllers/patch-admin-moderation-limits-controller-factory.ts` | `crates/nostream-admin/src/controllers/patch_moderation_limits.rs` | `crates/nostream-admin/src/controllers/patch_moderation_limits.rs:2` | moved — added after the capture | +| `src/factories/controllers/post-admin-moderation-actions-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_moderation_actions.rs` | `crates/nostream-admin/src/controllers/post_moderation_actions.rs:2` | moved — added after the capture | +| `src/factories/controllers/post-admin-network-health-run-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_network_health_run.rs` | `crates/nostream-admin/src/controllers/post_network_health_run.rs:2` | moved — added after the capture | +| `src/factories/controllers/post-admin-ops-nip05-reverify-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_ops_nip05_reverify.rs` | `crates/nostream-admin/src/controllers/post_ops_nip05_reverify.rs:2` | moved — added after the capture | | `src/factories/subscription-service-factory.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: it composes the service the crate does not own | | `src/handlers/neg-close-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — added-after-capture: no handler module is claimed; NIP-77 is cut against `041fe34e` | | `src/handlers/neg-msg-message-handler.ts` | — | `crates/nostream-core/src/nip77.rs:4-6` | not moved (#1036) — added-after-capture: no handler module is claimed; NIP-77 is cut against `041fe34e` | @@ -427,21 +432,21 @@ says so. | `src/scripts/bench-gate.ts` | — | `docs/rewrite/benchmarks.md:248` | not moved (#868) — added-after-capture: the gate is the capture's TypeScript tooling | | `src/services/subscription-service.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: no subscription service; the tables are not in the Rust schema | | `src/telemetry/ops-metrics.ts` | — | `crates/nostream-services/src/monitor.rs:20` | not moved (#865) — added-after-capture: the probe counters go with the probe family | -| `src/utils/admin-audit-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-audit-store.ts` | `crates/nostream-admin/src/state.rs` | `crates/nostream-admin/src/state.rs:582` | moved — added after the capture | | `src/utils/admin-diagnostics-export.ts` | `crates/nostream-admin/src/utils/diagnostics.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | -| `src/utils/admin-moderation-persist.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-moderation-persist.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/utils/moderation.rs:168` | moved — added after the capture | | `src/utils/admin-moderation-stats.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | | `src/utils/admin-moderation.ts` | `crates/nostream-admin/src/utils/moderation.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | -| `src/utils/admin-ops-config.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-config.ts` | `crates/nostream-admin/src/utils/workers.rs` | `crates/nostream-admin/src/utils/workers.rs:45` | moved — added after the capture | | `src/utils/admin-ops-nip05.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | -| `src/utils/admin-ops-sanitize.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-sanitize.ts` | — | `crates/nostream-admin/src/utils/mod.rs:3` | not moved (#867) — added-after-capture: the module list claims the ops helpers and none truncates an error | | `src/utils/admin-ops-storage.ts` | `crates/nostream-admin/src/utils/storage.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | -| `src/utils/admin-ops-store.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:14` | moved — added after the capture | +| `src/utils/admin-ops-store.ts` | `crates/nostream-admin/src/utils/workers.rs` | `crates/nostream-admin/src/utils/workers.rs:106` | moved — added after the capture | | `src/utils/banner.ts` | — | `crates/nostreamd/src/lib.rs:3-8` | not moved (#1336) — added-after-capture: no banner is printed; the ownership block has no entry | | `src/utils/moderation-rate-limit-stats.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — added-after-capture: the Redis-sorted-set stats panel has no Rust counterpart | | `src/utils/negentropy-sessions.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:48` | moved — added after the capture | | `src/utils/nip05-reverification.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/utils/nip05.rs:2` | moved | -| `src/utils/nip77.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/lib.rs:46` | moved — added after the capture | +| `src/utils/nip77.ts` | — | `crates/nostream-core/src/nip77.rs:19` | not moved (#1036) — added-after-capture: the session constants are unmodelled; the frame encoder is a Phase 1 stub | | `src/utils/ops-trust-notifications.ts` | — | `crates/nostream-config/src/notifications.rs:70-76` | not moved (#1036) — dropped: the three toggles are modelled, the emitter is not | | `src/utils/peering-auth.ts` | — | `crates/nostream-config/src/settings.rs:805` | not moved (#1036) — added-after-capture: the settings model exists; the peer authenticator is #1036's | | `src/utils/record-admin-audit.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:41` | not moved (#867) — added-after-capture: the audit log is the admin job's | From 097d1f82a144ab86e3de02d99e8879c31603f702 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:10:05 -0500 Subject: [PATCH 09/14] docs(rewrite): print the tool list the MCP mode actually returns --- docs/rewrite/deploying.md | 43 ++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/docs/rewrite/deploying.md b/docs/rewrite/deploying.md index 635b78629..fc5048644 100644 --- a/docs/rewrite/deploying.md +++ b/docs/rewrite/deploying.md @@ -377,23 +377,38 @@ daemon setup failed: NOSTREAM_ADMIN_TOKEN is retired: a console session token do exit 1 ``` -With a 0600 document, the mode serves. Two JSON-RPC lines on stdin, the handshake and the tool -list: - -``` -$ printf '%s\n%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ - | nostreamd --mcp-stdio --admin-token-file /tmp/046-scratch/token-0600.json -{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{}},"serverInfo":{"name":"nostream","version":"0.1.0"},"instructions":"The nostream admin MCP server. ..."}} -{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"delete_event",...},{"name":"get_event",...}, ...]}} +With a 0600 document and a store it can open, the mode serves: two JSON-RPC lines on stdin, the +handshake and the tool list. A `tools/list` reply carries each tool's description and schema, so +the transcript prints the names: + +``` +$ printf '%s\n%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' \ + '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ + | NOSTR_CONFIG_DIR=/tmp/046-scratch/cfg nostreamd --mcp-stdio --data-dir /tmp/046-scratch/data \ + --admin-token-file /tmp/046-scratch/token-0600.json 2>/dev/null \ + | grep '"id":2' | grep -o '"name":"[a-z_]*"' | cut -d'"' -f4 +delete_event +get_event +invoices_get +invoices_list +list_events +maintenance_last_run +maintenance_run +relay_status +reports_action +reports_list +settings_get +settings_set +user_admin +user_get exit 0 ``` -The list is the fourteen tools ADR 0014 (D19) fixes, in the server's own order: -`delete_event`, `get_event`, `invoices_get`, `invoices_list`, `list_events`, -`maintenance_last_run`, `maintenance_run`, `relay_status`, `reports_action`, `reports_list`, -`settings_get`, `settings_set`, `user_admin`, `user_get`. The document's scopes decide which of -them answer: a document with no scopes grants the nine read tools, and `["write"]` adds the five -that write. +The `initialize` reply before it reports `"protocolVersion":"2025-06-18"` and +`"serverInfo":{"name":"nostream","version":"0.1.0"}`, and an `instructions` field naming the +scoped document as the authority. Those fourteen are the tools ADR 0014 (D19) fixes, in the +server's own order. The document's scopes decide which of them answer: a document with no scopes +grants the nine read tools, and `["write"]` adds the five that write. The mode also needs `admin.enabled: true`, opens the same store the relay door does, and logs to stderr so no log line can corrupt the protocol on stdout From 317220606223257385aa5a0914b6e104e9b48847 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:27:07 -0500 Subject: [PATCH 10/14] docs(rewrite): correct three figures the approver measured --- docs/rewrite/crate-map.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/rewrite/crate-map.md b/docs/rewrite/crate-map.md index 855ba113d..3aec4d710 100644 --- a/docs/rewrite/crate-map.md +++ b/docs/rewrite/crate-map.md @@ -393,7 +393,7 @@ says so. |---|---|---|---| | `src/@types/admin-audit.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | type-only — added after the capture | | `src/@types/admin-ops.ts` | `crates/nostream-admin/src/lib.rs` | `crates/nostream-admin/src/lib.rs:17` | type-only — added after the capture | -| `src/@types/negentropy.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/nip77.rs:1-2` | type-only | +| `src/@types/negentropy.ts` | `crates/nostream-core/src/nip77.rs` | `crates/nostream-core/src/nip77.rs:1-2` | type-only — added after the capture | | `src/@types/user-subscription.ts` | — | `crates/nostream-storage/src/lib.rs:26-28` | not moved (#1036) — added-after-capture: `user_subscriptions` has no Rust trait | | `src/controllers/admin/get-admin-audit-log-controller.ts` | `crates/nostream-admin/src/controllers/get_audit_log.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | | `src/controllers/admin/get-admin-diagnostics-export-controller.ts` | `crates/nostream-admin/src/controllers/get_diagnostics_export.rs` | `crates/nostream-admin/src/lib.rs:12` | moved — added after the capture | @@ -445,12 +445,12 @@ says so. | `src/utils/banner.ts` | — | `crates/nostreamd/src/lib.rs:3-8` | not moved (#1336) — added-after-capture: no banner is printed; the ownership block has no entry | | `src/utils/moderation-rate-limit-stats.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — added-after-capture: the Redis-sorted-set stats panel has no Rust counterpart | | `src/utils/negentropy-sessions.ts` | `crates/nostream-core/src/negentropy.rs` | `crates/nostream-core/src/lib.rs:48` | moved — added after the capture | -| `src/utils/nip05-reverification.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/utils/nip05.rs:2` | moved | +| `src/utils/nip05-reverification.ts` | `crates/nostream-admin/src/utils/nip05.rs` | `crates/nostream-admin/src/utils/nip05.rs:2` | moved — added after the capture | | `src/utils/nip77.ts` | — | `crates/nostream-core/src/nip77.rs:19` | not moved (#1036) — added-after-capture: the session constants are unmodelled; the frame encoder is a Phase 1 stub | -| `src/utils/ops-trust-notifications.ts` | — | `crates/nostream-config/src/notifications.rs:70-76` | not moved (#1036) — dropped: the three toggles are modelled, the emitter is not | +| `src/utils/ops-trust-notifications.ts` | — | `crates/nostream-config/src/notifications.rs:70-76` | not moved (#1036) — added-after-capture: dropped, the three toggles are modelled and the emitter is not | | `src/utils/peering-auth.ts` | — | `crates/nostream-config/src/settings.rs:805` | not moved (#1036) — added-after-capture: the settings model exists; the peer authenticator is #1036's | | `src/utils/record-admin-audit.ts` | — | `docs/rewrite/decisions/0010-services-worker-model-and-cache.md:41` | not moved (#867) — added-after-capture: the audit log is the admin job's | -| `src/utils/relay-probe-history.ts` | — | `crates/nostream-config/src/settings.rs:688` | not moved (#1036) — dropped: `nip66.historyRetentionRuns` is modelled, nothing retains history | +| `src/utils/relay-probe-history.ts` | — | `crates/nostream-config/src/settings.rs:688` | not moved (#1036) — added-after-capture: dropped, `nip66.historyRetentionRuns` is modelled and nothing retains history | | `src/utils/subscription.ts` | — | `crates/nostream-services/src/lib.rs:32-34` | not moved (#1036) — added-after-capture: recurring plans; the tables are not in the Rust schema | ## Rust modules with no TypeScript ancestor @@ -509,10 +509,11 @@ invoice contract, and `src/@types/subscription.ts` is named by the same bullet w - **The TypeScript sources' internals.** A row says where a module went, not what changed on the way; the ADRs own the behavioural deltas. - **A per-function mapping.** The unit is the file, as the row names it. A file whose port - folded two modules into one (the six `utils/settings*.ts` files, the three `nip66-*` files) + folded two modules into one (the five `utils/settings*.ts` files, the three `nip66-*` files) gets one row per file, both naming the single module. -- **The 40 `.rs` files outside `crates/*/src`.** Tests, examples and the benchmark rig are - the port's own, and have no capture ancestor to map. +- **The `.rs` files outside `crates/*/src`.** 102 of them are the tests, their `common` + helpers and one example; four are the fuzz targets `docs/rewrite/fuzz.md` owns. They are the + port's own, and have no capture ancestor to map. - **What each crate weighs.** The line counts and the benchmark are `docs/rewrite/benchmarks.md`'s; this map counts modules, not lines. - **The TypeScript tree at `main`.** `main` still ships it and still advances; this map is From ce34ebf8a8e107a504b6518bd9583027c7befd68 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:29:15 -0500 Subject: [PATCH 11/14] docs(rewrite): scope the tree figures to crates/ and count all 363 .rs files --- docs/rewrite/crate-map.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/rewrite/crate-map.md b/docs/rewrite/crate-map.md index 3aec4d710..e1a5f6309 100644 --- a/docs/rewrite/crate-map.md +++ b/docs/rewrite/crate-map.md @@ -6,8 +6,9 @@ the files the porting window added — because the left column is the capture's today's. **Tree.** Checked against `9c25d743` (the job's base, `rewrite/main`), whose `src/` holds 357 -`.ts` files; the ownership blocks name `242a3001`. The Rust tree at `9c25d743` is 359 `.rs` -files and 121,879 lines, 257 of them under `crates/*/src`. +`.ts` files; the ownership blocks name `242a3001`. The Rust tree at `9c25d743` is 363 `.rs` +files: 359 under `crates/` — 121,879 lines there, 257 of those files and 69,552 of those lines +under `crates/*/src` — and the four `fuzz/fuzz_targets` files outside it. ## The three counts, and why the groups exist From 1e104b753b8ae96fa1a1be06ce49b719464b31af Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:36:20 -0500 Subject: [PATCH 12/14] docs(rewrite): the daemon does not migrate Postgres, and Secure needs the proxy and the header --- docs/rewrite/deploying.md | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/docs/rewrite/deploying.md b/docs/rewrite/deploying.md index fc5048644..4f9277c2e 100644 --- a/docs/rewrite/deploying.md +++ b/docs/rewrite/deploying.md @@ -88,10 +88,22 @@ size are `docs/rewrite/benchmarks.md`'s. **Postgres** is still the default and still works: `eventStore.backend: postgres` reads `DB_URI`, or the `DB_*` parts, with `DB_URI` winning when both are set -(`crates/nostream-storage/src/postgres/mod.rs:355-373`). Its migrations are 37 `.sql` files -embedded with `sqlx::migrate!` and applied in process -(`crates/nostream-storage/src/postgres/mod.rs:315-316`) — there is no separate migrate step and -no migrate container to watch for. +(`crates/nostream-storage/src/postgres/mod.rs:355-373`). Its schema is 37 `.sql` files under +`crates/nostream-storage/migrations/`, embedded at compile time by `sqlx::migrate!("./migrations")` +(`crates/nostream-storage/src/postgres/mod.rs:316`) — **and the daemon does not apply them.** The +backend is built by `PostgresBackend::from_lookup` (`crates/nostreamd/src/stores.rs:57`), which +goes through `with_pools` (`crates/nostream-storage/src/postgres/mod.rs:276-291`) and connects the +pools without touching the migrator; `migrate_pool` is reached only through +`PostgresBackend::migrate` (`crates/nostream-storage/src/postgres/mod.rs:140-141`), whose callers +outside the tests are the bench example (`crates/nostream-storage/examples/bench.rs:720`) and +nothing in the daemon. So a Postgres deployment's schema is set up out of band: this tree ships no +command that applies it (`nostream migrate` has one subcommand, `pg-to-lmdb`, +`crates/nostream-cli/src/app.rs:684`), and the migration tool reads that store read-only (ADR 0013, +D12; `docs/rewrite/migrating.md`). Against an empty database nothing in the start path checks the +schema, so the first query meets the driver's own missing-relation error. + +[unverified] because this sandbox has no Postgres: the call graph above is read from the sources, +not run, and no missing-relation error was captured here. ## Settings @@ -482,8 +494,15 @@ exit 0 and run the binary, which is `cargo build --release -p nostreamd -p nostream-cli` and then `./target/release/nostreamd`. - **TLS termination.** The daemon speaks plain HTTP and WS on the one socket; a reverse proxy or - a load balancer does TLS. The admin cookie's `Secure` flag follows the prefix and the proxy, - and nothing in this tree configures either. + a load balancer does TLS. The admin session cookie gets `Secure` only when **two** things hold: + the connecting peer is in the settings' `trustedProxies` + (`crates/nostream-config/src/settings.rs:75`) **and** it sends `x-forwarded-proto: https` for + the first hop — that is what `is_secure_request` decides + (`crates/nostream-admin/src/utils/http.rs:78-94`), and the login controller puts its answer on + the cookie (`crates/nostream-admin/src/controllers/request_context.rs:122`, + `crates/nostream-admin/src/controllers/post_login.rs:64`). An untrusted proxy in front of an + HTTPS deployment — or one that does not forward the header — yields session cookies without + `Secure`. The URL prefix changes the cookie's path, not that flag. - **The admin console's own JavaScript.** It is served as assets from `/resources/`; what it does when a panel's data is missing is the console's, and the open findings about it are #1317-#1333. From 7c790277f823ce41c74ef1048e13128bd2ff5287 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:36:20 -0500 Subject: [PATCH 13/14] docs(rewrite): rollback is lossless only before the LMDB store takes its first write --- docs/rewrite/migrating.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/rewrite/migrating.md b/docs/rewrite/migrating.md index 3190f563c..53ac86273 100644 --- a/docs/rewrite/migrating.md +++ b/docs/rewrite/migrating.md @@ -235,6 +235,16 @@ issues no `INSERT`, `UPDATE`, `DELETE` or DDL against the source (`crates/nostream-storage/src/postgres/migration.rs:8-11`). The Postgres store after a migration is the store that was there before it. +That is lossless only **until the LMDB-backed daemon accepts its first write.** From that moment +the two stores diverge: Postgres keeps the state the copy read, and an event, soft delete, report +action or console write the LMDB relay accepted afterwards exists only in LMDB. Restarting on +Postgres therefore serves the older state, not the one the relay had been serving. Nothing copies +the other way — the tool's one direction is Postgres to LMDB +(`crates/nostream-storage/src/postgres/migration.rs:8-11`) and `migrate` has one subcommand +(`crates/nostream-cli/src/app.rs:684`) — so an operator who rolls back after that must either +reconcile the newer writes into the Postgres store by hand or decide explicitly that they are +discarded. The rollback does not do it for them, and neither store is opened by it. + So rollback is a settings change and a restart: 1. stop the daemon; From d72bd3f2ab5ee433aeb0a2d13478594686a73b86 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Mon, 30 Nov 2026 06:37:49 -0500 Subject: [PATCH 14/14] docs(rewrite): eight capture rows stop claiming to be additions --- docs/rewrite/crate-map.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/rewrite/crate-map.md b/docs/rewrite/crate-map.md index e1a5f6309..e8cdee152 100644 --- a/docs/rewrite/crate-map.md +++ b/docs/rewrite/crate-map.md @@ -193,11 +193,11 @@ The disposition's first word is the class, from the list the spec fixes: | `src/factories/controllers/get-admin-settings-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_settings.rs` | `crates/nostream-admin/src/controllers/get_settings.rs:2` | moved | | `src/factories/controllers/get-admin-settings-schema-controller-factory.ts` | `crates/nostream-admin/src/controllers/get_settings_schema.rs` | `crates/nostream-admin/src/controllers/get_settings_schema.rs:2` | moved | | `src/factories/controllers/get-admission-check-controller-factory.ts` | `crates/nostream-relay/src/limits.rs` | `crates/nostream-relay/src/lib.rs:12-13` | moved — the limiter and the cap; the factory has no module | -| `src/factories/controllers/get-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | -| `src/factories/controllers/get-invoice-status-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | -| `src/factories/controllers/lnbits-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | -| `src/factories/controllers/nodeless-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | -| `src/factories/controllers/opennode-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/get-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | +| `src/factories/controllers/get-invoice-status-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | +| `src/factories/controllers/lnbits-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | +| `src/factories/controllers/nodeless-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | +| `src/factories/controllers/opennode-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | | `src/factories/controllers/patch-admin-notifications-controller-factory.ts` | `crates/nostream-admin/src/controllers/patch_notifications.rs` | `crates/nostream-admin/src/controllers/patch_notifications.rs:2` | moved | | `src/factories/controllers/patch-admin-settings-controller-factory.ts` | `crates/nostream-admin/src/controllers/patch_settings.rs` | `crates/nostream-admin/src/controllers/patch_settings.rs:3` | moved | | `src/factories/controllers/post-admin-login-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_login.rs` | `crates/nostream-admin/src/controllers/post_login.rs:26` | moved | @@ -205,8 +205,8 @@ The disposition's first word is the class, from the list the spec fixes: | `src/factories/controllers/post-admin-notification-test-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_notification_test.rs` | `crates/nostream-admin/src/controllers/post_notification_test.rs:2` | moved | | `src/factories/controllers/post-admin-settings-restore-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_settings_restore.rs` | `crates/nostream-admin/src/controllers/post_settings_restore.rs:2` | moved | | `src/factories/controllers/post-admin-settings-validate-controller-factory.ts` | `crates/nostream-admin/src/controllers/post_settings_validate.rs` | `crates/nostream-admin/src/controllers/post_settings_validate.rs:2` | moved | -| `src/factories/controllers/post-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | -| `src/factories/controllers/zebedee-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — added-after-capture: it composes a controller that is a stub | +| `src/factories/controllers/post-invoice-controller-factory.ts` | — | `crates/nostream-services/src/controllers/invoice_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | +| `src/factories/controllers/zebedee-callback-controller-factory.ts` | — | `crates/nostream-services/src/controllers/callback_controller.rs:5` | not moved (#867) — dropped: it composes a controller that is a stub | | `src/factories/dvm-orchestrator-worker-factory.ts` | `crates/nostreamd/src/lib.rs` | `crates/nostreamd/src/lib.rs:14` | moved | | `src/factories/event-repository-factory.ts` | `crates/nostream-storage/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-storage/src/lib.rs:16`, `crates/nostreamd/src/lib.rs:14` | split — the repository; the daemon composes it | | `src/factories/event-strategy-factory.ts` | `crates/nostream-relay/src/lib.rs` (`crates/nostreamd/src/lib.rs`) | `crates/nostream-relay/src/lib.rs:17`, `crates/nostreamd/src/lib.rs:14` | split — the registry; the daemon composes it | @@ -352,7 +352,7 @@ The disposition's first word is the class, from the list the spec fixes: | `src/utils/nip98-replay.ts` | — | `crates/nostream-core/src/nip98.rs:18` | not moved (#867) — dropped: the replay claim is stubbed with the verifier | | `src/utils/nip98.ts` | — | `crates/nostream-core/src/nip98.rs:18` | not moved (#867) — dropped: the verifier is a Phase 1 stub; the claims type is modelled | | `src/utils/operator-notification-enqueue.ts` | `crates/nostream-services/src/services/operator_notification_service.rs` | `crates/nostream-services/src/services/operator_notification_service.rs:162` | moved | -| `src/utils/prometheus-client.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — added-after-capture: the console's Prometheus query client has no counterpart | +| `src/utils/prometheus-client.ts` | — | `crates/nostream-admin/src/utils/mod.rs:1-4` | not moved (#867) — dropped: the console's Prometheus query client has no counterpart | | `src/utils/proof-of-work.ts` | `crates/nostream-core/src/pow.rs` | `crates/nostream-core/src/lib.rs:21` | moved | | `src/utils/relay-broadcast-deduplicator.ts` | — | `crates/nostream-relay/src/broadcast.rs:24-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour | | `src/utils/relay-broadcast-message.ts` | — | `crates/nostream-relay/src/broadcast.rs:15-27` | not moved (#865) — dropped: `broadcast.rs` is a Phase 1 stub and carries no behaviour |