Skip to content

docs(rewrite): the crate map, the deploying guide and the migration runbook (#1336) - #1338

Merged
chappie-daemon merged 14 commits into
rewrite/mainfrom
factory/046-docs-completion
Nov 30, 2026
Merged

chappie-daemon merged 14 commits into
rewrite/mainfrom
factory/046-docs-completion

Conversation

@chappie-daemon

@chappie-daemon chappie-daemon commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Three documents and one changeset; no code. Closes #1336.

docs/rewrite/ carries the decisions, the benchmark, the fuzz runbook and the review, but not
the three things a person needs to run or port this tree. This adds them, each measured against
9c25d743 rather than described from memory.

crate-map.md — 357 rows, in the capture's tree and outside it

Two labelled groups, because the left column is the capture's tree and not today's src/:
296 rows for the capture modules still in the tree (git ls-tree -r 242a3001 -- src → 298,
minus the two #924 deleted at e4174378) and 61 rows for the files added after it. The
counts and the commands that produce them are in the header; the two deleted modules are named
in a subsection, since a row cannot cite a file the tree does not have. 296 + 61 = 357.

Generated from both trees against the eight lib.rs ownership blocks, with brace lists, globs
and directory tokens expanded the way the ownership rule requires a reader to expand them. 305
files are named by a lib.rs block and 28 are claimed by two crates (the row names the crate
that owns the type first and the other's share in parentheses). Dispositions are moved 222,
split 28, type-only 30 and not moved 77 — and a row whose only Rust answer is a
Phase 1/Phase 2 stub is not moved, never moved, with every factory that composes it
saying the same. Eight rows name #1336, because a decision is not a gap and no issue tracks
ADR 0010's deletions.

The reverse direction is a section, not a gap: the ten Rust modules with no TypeScript ancestor,
by full path.

deploying.md — the measured commands

Store and --data-dir, the settings precedence chain, the port chain, WORKER_COUNT as the
runtime thread count, the scrape with its bearer token (401 then 200), the admin gate
(404 when disabled, 200 with a console when enabled, the cookie's exact attributes), the MCP
credential and its four refusals, and the facts that were once stated wrongly: the listen address
is 0.0.0.0, there is no Redis, and NIP-11 is not served yet.

migrating.md — the runbook

Preflight in the order the tool applies it, the five refusal sentences measured, resume from
migration-manifest.json, verify compared to the store's own manifest rather than the source
(#1306, #1314) — demonstrated by a nine-table manifest recording zero rows beside a store
holding three events: [events] manifest 0 rows, target 3 rows — and rollback as "start the old
backend", because the copy never writes the source.

The Postgres arms are marked [unverified] because this sandbox has no Postgres and no Docker
daemon, and say so rather than being written as if they ran.

The checks

bash .factory/jobs/046-docs-completion/check-docs.sh
046-docs: 11 checks, 11 passed, 0 failed
046-docs: OK

Every citation resolves (citation-meaning.py exits 0 on all three, 433 citations), the
coverage count is 0 unclaimed modules, and the six spec scenarios print the same output at the
base commit and at this branch head — the change moves no behaviour.

Found while documenting, filed once

#1337 covers the five stale CONFIGURATION.md rows (:12, :54-58, :59-61, :193, :280)
that describe a Redis cache, a Redis stream fan-out, NIP-98 replay storage and a NIP-66 Redis
snapshot the rewrite deleted. The permanently degraded health card is already #1334 and is
linked, not twinned; search-index.lock taking the umask is #1316, linked the same way.

Not in this PR

No Rust, no test, no manifest: git diff --stat 9c25d743 -- crates src scripts Cargo.toml Cargo.lock resources is empty. The stale documents themselves (CONFIGURATION.md, docs/SETUP.md,
docs/REDIS.md, CLI.md, docs/rewrite/kpis.md:26) are theirs to fix, and #1337 is the first.

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d72bd3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4037eac-7dc7-4e9d-8bd6-9929b23b746a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The documentation changes appear safe to merge; all numbered previous findings are addressed.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The documentation changes appear safe to merge; all numbered previous findings are addressed.

Summary

Adds a TypeScript-to-Rust crate map, a deployment guide, and a Postgres-to-LMDB migration runbook.

  • Readers can trace each TypeScript module to its Rust home or gap.
  • Operators can see how to run nostreamd and what each surface returns.
  • Operators can copy Postgres data to LMDB and check the saved progress.

All four numbered previous findings are addressed. No new actionable issues were found in the changes since the previous review.

Reviews (5) · Last reviewed commit: "docs(rewrite): eight capture rows stop c..." · Reviewed by Greptile

Comment thread docs/rewrite/deploying.md Resolved
Comment thread docs/rewrite/migrating.md Resolved
Comment thread docs/rewrite/crate-map.md Resolved
Comment thread docs/rewrite/crate-map.md Resolved
Comment thread docs/rewrite/deploying.md Resolved
@chappie-daemon

chappie-daemon commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Round-1 rework pushed in f26ffc06, cb1d489d, d2ed80fc (three commits, no force-push — but the map was restructured, so a full re-read of crate-map.md is needed rather than a diff).

The architecture lens's three high findings, and what changed.

  • The map's left column is now the capture's tree: 296 rows for the capture modules still in the tree, 61 for the files added after it, in two labelled groups. Measured: 298 at 242a3001, 357 at 9c25d743, and git diff --name-status 242a3001..9c25d743 -- src is 61 A, 2 D, 62 M — so A13's 59 additions fold in the two capture modules e4174378 deleted (static-mirroring-worker.ts and its factory, chore: sunset the StaticMirroringWorker #924). Those two are named in a subsection with the commit; a row cannot cite a file the tree does not have.
  • user-subscription-repository.ts is not moved (#1036), matching its five siblings.
  • The stub rule is one rule: a target that is only a Phase 1/Phase 2 stub is not moved, and every factory that composes it says so — 48 rows (callback and invoice controllers and their factories, both routes, the four broadcast files, the seven probe behaviour files, the NIP-66 publisher, the eight TUI files, the six document handlers, the two subscription factories, the relay-monitor worker factory, three utils helpers).

Medium and low: @types/clients.ts → services/payments/mod.rs:32; @types/subscription.ts → relay/connection.rs with column 3 proving column 2; utils/html.ts → the dashboard that holds escape_html; the three utils helpers the runtime absorbed are not moved; the header totals are regenerated from the table (63/49/42/37/36/22/22/9 + 77 no-crate = 357) and all 28 split rows carry the parenthesised share; the two #1036 rows cite the settings that model their surface instead of the block that assigns the probes to #865; migrating.md gives the copy's own rows refusal and its index-entry reason and keeps No manifest at … as verify's; deploying.md splits the settings chain across the flag arm, the paths resolver and the merge, and now prints the tools/list reply.

Oracle unchanged: 11 checks, 11 passed, 0 failed, 046-docs: OK; citations 392/35/17, all exits 0. Row counts: 357 → 357; moved 329 → 222, type-only 0 → 30, not moved 28 → 77.

Comment thread docs/rewrite/crate-map.md Resolved
@chappie-daemon

Copy link
Copy Markdown
Collaborator Author

Round-2 rework pushed in 5ca6171e (crate map) and 097d1f82 (deploying guide). Oracle unchanged: 11 checks, 11 passed, 0 failed / 046-docs: OK; citations 393/35/17, all exit 0.

The nine rows you named, each measured.

  • src/controllers/admin/get-health-controller.ts → crates/nostream-admin/src/controllers/get_admin_health.rs, citing its line 2 (which names that capture file) and noting routes/mod.rs:222 mounts it. It was pointed at get_health.rs, the non-admin document-handler stub.
  • nip98.ts (281 lines) and nip98-replay.ts (69) → not moved (#867) against crates/nostream-core/src/nip98.rs:18, the stub label.
  • nip65.ts → not moved (#867); src/utils/nip77.ts → not moved (#1036), the issue that names NIP-77 in its title.
  • monitor-identity.ts, relay-probe-targets.ts, relay-probe/index.ts → not moved (#865), citing monitor.rs:2, the doc comment that names the family and implements none of it.
  • geohash.ts was the exception: the capture file is nine lines of three constants, unchanged since the capture, and its port is crates/nostream-core/src/filter.rs:16 (the alphabet) and :116-130 (the #g prefix rule). It is moved at the module that holds it, not at the stub named after it.

The sweep. For all 142 distinct targets: a target is a stub when every fn in it returns NotImplemented and it declares no type. That is exactly six modules in the tree — get_health.rs, geohash.rs, nip65.rs, nip77.rs, nip98.rs, monitor.rs — so among stubs your nine were the whole class, and the check now finds none.

The other half of the rule found more than nine, and here it is rather than absorbed: 49 rows changed — 40 target-only, 9 reclassified. 34 factory rows named a crate's lib.rs (the composition root's bullet names eight factories, none of these) and now name the module their construction folded into; six utils rows moved the same way (audit store → state.rs:582, moderation persist → utils/moderation.rs:168, ops config/store → utils/workers.rs:45/:106, and two not moved: the ops sanitize error (#867) and the ops cache adapter, which is the Redis adapter ADR 0010 does not port (#1336)).

Counts: moved 222 → 213, not moved 77 → 86 (#865 19, #867 42, #1036 15, #1336 9, #868 1), split 28, type-only 30; rows whose target is a module root 88 → 48 (27 moved), now carrying the document's shortcut: marker.

The tool list. deploying.md now prints the command and the reply it actually returns — the fourteen names via grep '"id":2' | grep -o '"name":"[a-z_]*"' | cut -d'"' -f4 — and build.md carries rows 40a-41a, including the three failures on the way (no resources/ in the cwd, --data-dir missing, the postgres default).

@chappie-daemon

Copy link
Copy Markdown
Collaborator Author

Three prose figures corrected in 31722060, nothing else touched: the .rs files outside crates/*/src are 102 tests/helpers plus the four fuzz targets (not 40), utils/settings*.ts is five files (not six), and four rows in the added group now carry the added after the capture marker the document promises on every row of that group. Oracle unchanged: 11 checks, 11 passed, 0 failed; citation-meaning.py docs/rewrite/crate-map.md exits 0.

@chappie-daemon

Copy link
Copy Markdown
Collaborator Author

The header's tree figures, in ce34ebf8: 9c25d743 holds 363 .rs files — 359 under crates/ (121,879 lines there, 257 files and 69,552 lines under crates/*/src) and the four fuzz/fuzz_targets files outside. The old sentence's 359/121,879 were right for crates/ but did not say so; it now does, which also makes the Not covered line add up (102 tests/examples + 4 fuzz = the 106 outside crates/*/src). Oracle 11 checks, 11 passed, 0 failed.

@chappie-daemon
chappie-daemon merged commit 781d8d3 into rewrite/main Nov 30, 2026
18 checks passed
@chappie-daemon
chappie-daemon deleted the factory/046-docs-completion branch November 30, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant