Repository navigation
ADR-049: safe reindex, read-only hints, redacted output, a cheaper tool surface (B-057, B-045, B-018, B-019, B-021) - #92
Merged
ethanblauw-hub merged 7 commits intoOct 20, 2026
Conversation
…r tool surface Covers B-057, B-045, B-018 (output half), B-019 and B-021 point 3. Co-Authored-By: Claude <noreply@anthropic.com> [ADR-049]
…tool
_tool now derives each tool's MCP annotations: readOnlyHint is reads_index,
so every read tool, including ones added later, declares it without its
author doing anything, and a writer passes its other hints at its decorator
(B-045). Its async wrapper runs the returned text through redact.redact(),
which replaces PEM private keys, "private_key" fields and common token
prefixes with a visible [REDACTED:<kind>] marker; the plain functions the
TUI and tests call stay unredacted, and so does the index (B-018, output
half). The listing also sends each docstring dedented and without the
{"result": string} output schema FastMCP generates for a -> str tool (B-019).
Co-Authored-By: Claude <noreply@anthropic.com>
[ADR-049 src/MCPServer.py src/redact.py]
…ld explicit B-057, the 2026-09-29 incident. _snapshot_index deleted .pre-full-reindex/ as stale, but a backup left by a killed run is the good copy. Now a full rebuild that finds one restores it first and reuses it; a new snapshot is copied into .partial/ and renamed into place only once complete, before the wipe; _restore_index copies instead of moving, so a killed restore can run again; and the backup is removed only after a finished save or a finished restore. reindex's changed_files_only now defaults to True, so a bare call is incremental; the name is kept so saved calls mean what they did. Its annotations say it is destructive and not idempotent, so a client does not auto-retry a timed-out rebuild. The TUI's fallback for an unreadable Mode field is incremental too. CONTRIBUTING section 5 says to verify reindex on a scratch index, never the live one. Co-Authored-By: Claude <noreply@anthropic.com> [ADR-049 src/MCPServer.py src/tui/app.py]
…l descriptions Both branches of the server instructions now say when to prefer semantic_code_search, trace_data_flow, what_writes and analyze_blast_radius over Grep, and that Grep is for exact strings and the files a branch changed (B-021 point 3). what_writes, investigate_architecture and index_status lose narrative and pipeline internals, keeping their when-to-call guidance (B-019). The tool-surface tests read the FastMCP registry, so a tool added later is covered by the readOnlyHint and listing checks without editing them. Co-Authored-By: Claude <noreply@anthropic.com> [ADR-049 src/MCPServer.py]
…tions Co-Authored-By: Claude <noreply@anthropic.com> [ADR-049]
…rds, and secret assignments @EDB answered ADR-049's open questions 1 and 2: keep structured_output=False, and add the prefix-less families, accepting the false positives. The four name-keyed kinds replace only the value and skip a value an earlier pattern already replaced. ADR-049 accepted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> [ADR-049 src/redact.py]
…e-reindex-and-tool-output [ADR-049 src/hybrid_retriever.py src/iterative_retriever.py]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ADR-049 (backlog B-057, B-045, B-018 output half, B-019, B-021 point 3).
What changes
reindex()defaults to incremental (B-057). A full rebuild has to be asked for._toolderives each tool's annotations (B-045). Read-only tools declarereadOnlyHint;reindexis not idempotent.src/redact.py, which marks each match[REDACTED:<kind>]. The index and the plain functions stay unredacted.private_key, and GitHub, Slack, AWS access, Google, Anthropic and OpenAI keys.password/secret/api_key/*_tokennames. These replace only the value and accept some false positives.structured_output=False, which stays as @EDB answered, and from three trimmed descriptions.Tests
Still open (left in the ADR)
🤖 Generated with Claude Code