Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fc1f498
fix: return tool errors without the server's paths or library text
aliasunder Oct 9, 2026
db685a3
test: regenerate the tool-surface snapshots for the description changes
aliasunder Oct 9, 2026
f58f9b5
fix(review): make backtick-quoted paths vault-relative in tool errors
aliasunder Oct 9, 2026
4a78fc9
fix(triage): correct the fenced-block advice and list the read tool's…
aliasunder Oct 9, 2026
d07fb1f
style: clarify the vault-relative error comments and align the docs' …
aliasunder Oct 9, 2026
896affb
fix(triage): one decode-error wording and a plainer fenced-block sent…
aliasunder Oct 9, 2026
0b39e6f
style: readability fixes from the code-quality review
aliasunder Oct 9, 2026
8fa1053
test: pin the path rewrite's boundary checks and the fit error's wording
aliasunder Oct 9, 2026
df483f5
fix: keep sharp's reason in the PDF page failure log and mend a garbl…
aliasunder Oct 9, 2026
3238292
fix(triage): widen the fenced-block warning and reject impossible rev…
aliasunder Oct 9, 2026
bb94476
test: exact assertions in the vault-orientation prompt tests
aliasunder Oct 9, 2026
cb828f8
test: exact assertions in the daily-review prompt tests
aliasunder Oct 9, 2026
e5e7481
test: merge two daily-review test pairs that assert the same value
aliasunder Oct 9, 2026
a180f7f
docs: say client errors name paths vault-relative, never the server's…
aliasunder Oct 9, 2026
c7dfe7f
docs: tell wrappers to pass a Node error as cause, not copy its text
aliasunder Oct 9, 2026
40e6e2b
fix: label a link to a daily note not created yet instead of calling …
aliasunder Oct 9, 2026
116d55e
fix: return the server's own message when the PDF reader fails to start
aliasunder Oct 9, 2026
ce20dcf
docs: say which PDF reader start failures a retry recovers
aliasunder Oct 9, 2026
6cdcc1c
docs: scope the vault-relative rule to Node errors
aliasunder Oct 9, 2026
f909813
refactor: log prompt failures in the catch instead of inside a descri…
aliasunder Oct 9, 2026
a495e4e
fix: one Errors bullet per remedy in vault_read_file and a remedy for…
aliasunder Oct 9, 2026
d9e474a
fix: give too-long paths and impossible daily-note dates their own re…
aliasunder Oct 9, 2026
b09803e
fix: name the full path in vault_read_file's ENAMETOOLONG entry and h…
aliasunder Oct 9, 2026
96bed4e
fix: pin the prompt_error log in daily-review and memory-review
aliasunder Oct 10, 2026
1e69329
test: pin PDF page rendering failed over HTTP with a PDF that has no …
aliasunder Oct 10, 2026
2861893
style: give the modified-notes section its own helper and state the w…
aliasunder Oct 10, 2026
7f81ba4
test: pin daily-note errors exactly and name the too-long-to-save cas…
aliasunder Oct 10, 2026
d383e60
refactor: share the not-a-calendar-date refusal and reword the render…
aliasunder Oct 10, 2026
324ac08
test: raise the per-tool size allowance to 4,217
aliasunder Oct 10, 2026
6ef5910
refactor: name the PDF reads for what they return, not for their erro…
aliasunder Oct 10, 2026
e0e9db4
docs: name the one date that reaches the daily-review catch as client…
aliasunder Oct 10, 2026
c850f26
test: pin the cause in the unreadable-PDF logs of the watcher and the…
aliasunder Oct 10, 2026
958ae93
test: raise the tool-surface allowance to 4,226 after rebasing onto t…
claude Oct 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ A module's folder is decided by **what it depends on**, not just its topic:
(`createSafeHandlers`, `formatNoteMetadata`, `ToolRegistrationContext`
type) live in `tool-helpers.ts`. Group modules take `safeHandler` and
`safeHandlerContent` from the registration context; `createSafeHandlers`
builds them per server from the enabled tools.
builds them per server from the enabled tools and the vault path.
**Tool handlers stay thin**: schema, wire mapping (snake_case ↔ camelCase),
one data-layer call, and content-block/JSON formatting. Multi-step
composition — filtering, counting, pagination, dispatching across parsers
Expand Down Expand Up @@ -390,8 +390,13 @@ log would produce N lines during a vault rebuild (one per note), it's
what went wrong in their own domain and never name API surfaces
(tool names, routes) or prescribe caller-level remediation.
- Log full detail internally, return generic messages externally —
error responses to clients never include paths, stack traces, or
implementation state.
error responses to clients never include the server's own paths,
stack traces, or implementation state. A Node error's paths reach the
client vault-relative, because the tool and prompt boundaries rewrite
them (`describeErrorRelativeTo`), so a wrapper passes the Node error as
`cause` and never copies its message into its own. Errors the server
throws itself keep their text, since they can quote the caller's input
(a refused absolute path comes back as sent).
- `/healthz` needs no sign-in, so never add deployment settings or host
details to its response. The full server returns `{ ok: true }`, and
setup mode adds `mode: "setup"` so the setup page can tell when the full
Expand Down
22 changes: 18 additions & 4 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1288,11 +1288,25 @@ Docker hardening, and durability seatbelts above.
- **`safeHandler()`** (built per server by `createSafeHandlers` in
`tool-helpers.ts`): wraps every MCP tool handler with try/catch. Errors
return a structured `isError` response with the error's name and message,
plus how to fix a properties-block refusal — no stack traces, no absolute
paths. A buggy tool never crashes the server.
plus how to fix a properties-block refusal — no stack traces. A buggy tool
never crashes the server.
- **Library errors**: an image sharp cannot decode, a password-protected
PDF, a damaged PDF, and a PDF reader that fails to start (pdf.js or the
canvas library failing to load, whose error quotes install paths) each
return the server's own message, with the library's error kept as the
cause.
- **Vault-relative error paths**: `describeErrorRelativeTo`
(`src/utils/describe-error.ts`) rewrites the paths in a Node error's
message (a filesystem failure or an invalid path argument) relative to
the vault root, for `safeHandler()` and the prompts' fallback messages.
Errors the server throws itself keep their text, since they can quote the
caller's input. The `tool_error`, `prompt_error` and
`pdf_page_render_failed` logs, and the logs of PDFs the search index or
file watcher cannot read, keep the full message
and the cause of a wrapped error (`describeErrorForLog`).
- **In-lock existence checks**: `deleteNote` and `moveNote` check file
existence inside the lock, returning a vault-relative "not found"
instead of ENOENT (whose message leaks the absolute container path).
existence inside the lock, so a missing note returns the "note not found"
error the tools document instead of Node's ENOENT text.
- **Graceful shutdown** (`server.ts`): SIGTERM handler drains in-flight
requests with a 10-second force-exit fallback, so a write is never
interrupted mid-rename.
Expand Down
11 changes: 9 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,15 @@ mechanism-level detail.
- `safeHandler()` catches all exceptions and returns the error's name and
message, plus how to fix a properties-block refusal — no stack traces
reach the client
- In-lock existence checks return vault-relative "not found" instead of
ENOENT (whose message leaks the container's absolute path)
- An image sharp cannot decode, a password-protected PDF, a damaged PDF,
and a PDF reader that fails to start each return the server's own
message; the library's error, which can quote the server's install paths,
stays in the server log
- A Node error's paths (a filesystem failure or an invalid path argument)
reach the client vault-relative, from tools and from the prompts' fallback
messages alike, so the container's absolute path stays in the server log
- In-lock existence checks return the documented "note not found" error
instead of Node's ENOENT text
- Error middleware returns `"internal server error"` to clients;
request metadata and the error message are logged server-side only

Expand Down
Loading
Loading