Skip to content

feat(extensions): add a local hierarchical knowledge notebook - #5013

Closed
tang-vu wants to merge 1 commit into
Osmantic:public-betafrom
tang-vu:feat/beta-local-knowledge-notebook-20260914
Closed

tang-vu wants to merge 1 commit into
Osmantic:public-betafrom
tang-vu:feat/beta-local-knowledge-notebook-20260914

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Ready for independent review (2026-09-15). Candidate adda102979e3ed233baf006151c0de8ebd83b084 has a successful GitHub check rollup and no base-branch conflict at this review snapshot. This supersedes earlier draft-status wording only. All validation gaps, migration requirements, live gates and independent human review requirements below remain in force; this is not a merge-ready approval.

Why this matters

Add an optional local knowledge notebook for hierarchical rich notes, research attachments and authenticated workflow access. Trilium's ETAPI provides a concrete path for local agents to store and retrieve organized research, while the existing Extensions lifecycle handles installation and service management.

Contract

  • Pin official triliumnext/trilium:v0.105.0@sha256:cc6a15edd7ac3df9bb98ad39dd40af8ffda6c1c0bfafe37c26137ddcbecdb7e5. Verify its exact configuration map, HTTP setup/password routes, ETAPI and Docker image. ODS prepares UID/GID 1000 ownership; Node starts directly without the image's root chown/usermod wrapper, with read-only root, bounded temporary scratch and dropped capabilities.
  • Bind the notebook to loopback port 7832 by default and retain the existing BIND_ADDRESS operator override. Documentation explicitly requires loopback during the first-run wizard: create the knowledge base and set a strong password before exposing the listener. A fresh empty upstream instance has no owner to authenticate yet; this recipe does not invent unattended password provisioning.
  • Require authentication and explicitly disable backend scripting and the SQL console using the exact supported environment keys. Configuration flags are checked against pinned source; the runtime test below does not claim a general script sandbox or browser isolation guarantee.
  • Persist SQLite, configuration and backups under data/trilium. The handoff is catalog/manifest -> UID preparation -> Compose -> local first-run wizard/password -> authenticated ETAPI token -> note tree and attachments -> persisted database after recreation. Tokens grant knowledge-base access and can be revoked; they are not per-folder permissions.
  • Keep a stopped full-directory backup before upgrading. Database/sync versions may prevent an image-only downgrade, so rollback can require a matching backup. Disabling the extension preserves data. No automatic desktop sync server is configured.
  • Full canonical catalog generation also restores existing disabled pixel-inference metadata without activating it.

Overlap check

Searched open and closed PRs for Trilium and the new production recipe/test paths, including the changed-file inventory; no Trilium implementation exists. #4887 Memos provides lightweight notes, while #4990 HedgeDoc provides collaborative Markdown documents. This scope exposes a single-user hierarchical knowledge base with note relationships, rich content, attachments and ETAPI token lifecycle. Shared library README/catalog additions remain additive and must be preserved in batch integration. Port 7832 has no existing manifest/Compose collision.

Validation

  • Exact-image Linux amd64 under WSL: 2 passed (27-live-setup-status, 187.09 seconds). Actual non-root/read-only startup and health, empty-instance setup, password assignment, anonymous and wrong-password rejection, authenticated token creation, rich Unicode parent/child notes and Unicode attachments.
  • Recreate the container against the same directory, authenticate with the persisted password, retrieve the same hierarchy/content/attachment and revoke each API token; revoked tokens receive 401. Fixtures are cleaned up.
  • Initial live fixture expected 200 for successful database creation; the exact API returns 204. Corrected the expectation after observing successful setup. No pass is claimed for that initial failed fixture.
  • 36 manifests, scoped hooks and git diff --check passed. Full local make gate still reproduces the no-sudo Docker promotion/raw-sudo baseline failure covered by fix(installer): honor unavailable sudo in Docker fallback #3158; no full local gate pass is claimed. Path-filtered CI runs the real image/HTTP/storage test.

Review and limits

Latest candidate adda102979e3ed233baf006151c0de8ebd83b084: 33 successful CI checks, 4 conditionally skipped, including the real notebook contract. Ready for independent review of first-run ownership and persistent storage. No browser rendering, desktop sync, native ARM/macOS/Windows, large import/attachment workload, existing database upgrade or backend-script execution probe was performed. Image metadata advertises amd64/arm64/armv7/armv8; runtime evidence covers Linux amd64. Health proves process availability, not completion of password setup.

Final candidate adda102979e3ed233baf006151c0de8ebd83b084: 33 successful CI checks, 4 conditionally skipped; no pending or failed checks.

Batch integration receipt

This is one of 30 independently branched public-beta PRs. The published synthetic integration head is 61f4c6fccc81bea697f4941683fefb5089ba77f4, built from baseline d49ad4bbc760be319de7f4c9b9a93b1f18fe3922 in this reproducible order:

#4946 → #4948 → #4951 → #4954 → #4972 → #4960 → #4961 → #4957 → #4964 → #4967 → #4968 → #4971 → #4975 → #4976 → #4984 → #4982 → #4990 → #4988 → #4989 → #4997 → #5003 → #5006 → #5007 → #5009 → #5012 → #5011 → #5013 → #5014 → #5020 → #5021

Reconciliation preserved all 146 files owned by a single PR byte-for-byte against their exact candidate heads. The eight shared paths preserve both CLI STT/TTS commands and help, every added Makefile test, both environment schema additions and all Extensions UI behavior. LanguageTool and Kroki both remain headless API entries. Canonical regeneration yields 76 catalog entries and 47 library manifests; all README rows are retained. Shared-file changes need these additive resolutions when merged independently.

Combined validation: 2,852 API tests passed / 1 skipped; 1,082 UI tests passed; 47 manifests passed; all 12 added Makefile commands passed; 12 catalog boundary tests passed / 12 opt-in runtime tests skipped in this combined run. Individual exact-image results remain documented above. UI lint/build, scoped secret hooks, diff checks, four platform smoke tests and installer simulation passed. Compose plans for NVIDIA/AMD/Apple each contain 20 services and no duplicate published bindings across the core plus 12 new recipes; this is static plan evidence, not simultaneous startup or GPU inference.

The first unrestricted UI run timed out in two tests under concurrent load; the complete rerun used --maxWorkers=2 with unchanged assertions and timeouts and passed. ESLint reports zero errors and 603 warnings, including the existing JSX usage-detection pattern. Full local make gate still fails the no-sudo Docker baseline covered by #3158. BATS records 416 passed / 5 failed on this root/WSL host (platform detection, root preflight and a 15 GiB versus 20 GiB free-space expectation). Neither full local gate nor BATS is described as green.

This integration receipt supplements each PR's own regression and does not waive its independent review, live hardware/browser/upgrade gates or rollback requirements. The PRs remain drafts; none was merged upstream.

This was referenced Sep 14, 2026
@tang-vu
tang-vu marked this pull request as ready for review September 15, 2026 01:31
@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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.

2 participants