Repository navigation
docs(filter): document the secret-path gate in the architecture and FAQ pages - #1787
Conversation
…AQ pages The built-in secret-path gate is the second gate of the file filter, and `secret_exclude` is one of the reasons `whyExcluded` returns for a file it drops. review-rules.md documents it, but the two other pages that describe the same filter did not: architecture.md still said the filter had five gates and never named the reason, and the FAQ's exclusion-reason table — the table a user reaches for after seeing `(excluded: secret_exclude)` in `--preview` output — had no row for it, in all five locales. Add the gate to the ordered list and the reason to the reason inventory in architecture.md, add the FAQ row, and bump the pipeline diagram's gate count, in all five locales. The mermaid label keeps its wording and only its count and drop list change. internal/model/exclude_reason_docs_test.go is the guard: it reads the reason constants out of preview.go and the reasons whyExcluded returns out of selection.go, then asserts every one of them is documented by the FAQ table and named by the architecture page in every locale, and that the diagram's gate count matches the page's own ordered list.
|
✅ OpenCodeReview: Review skipped: no items were selected. |
NanaseInori
left a comment
There was a problem hiding this comment.
Reviewed the complete eleven-file diff, the pinned whyExcluded implementation and the discussion. The secret-gate search found no competing documentation fix; #1244 concerns the earlier runtime implementation, while #1785 documents the separate rule-mapping table.
The new order matches the code: binary first, then either old or new secret path, before user exclusion/inclusion. The five locale changes consistently add the missing reason and sixth step. The test guard checks missing/stale FAQ reasons and diagram/list consistency without asserting translated prose. It fails visibly when its source/function anchors disappear, and introduces no production behavior change. No blocking defect found.
The scope is selection, not a general data-loss-prevention boundary: these pages should not be read as promising that runtime file-reading tools can never access an excluded path. That existing runtime policy is unchanged by this documentation PR.
Validation was complete patch and supporting-source inspection. I did not independently execute the documentation guards, translation checks, or full race suite, and do not infer a fresh CI pass from the contributor's reported rerun.
This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.
|
NanaseInori approved this diff on 2026-11-10 and its remaining findings are closed; the head has not moved since ( |
Qiyuanqiii
left a comment
There was a problem hiding this comment.
Thanks for your feedback. We have a large PR backlog and need some time for triage. I’ll discuss this PR with others later. If there are any further concerns, we will reply at the bottom of this PR.
Description
The built-in secret-path gate (#1262) is the second gate of the file filter, and
secret_excludeis one of the reasonswhyExcludedreturns for a file it drops. Three pages describe that filter, and only one of them carried the gate:review-rules.md(all 5 locales)architecture.md(all 5 locales)5-gate filter, ordered list of 5 gates, reason inventory of 4 —secret_excludenever namedfaq.md(all 5 locales)secret_excluderowSo the pages contradicted each other: a reader of the review-rules guide saw six gates, and a reader of the architecture page saw five.
The FAQ table is the reference a user reaches for after seeing a reason in output.
ocr review --previewprints lines such as(excluded: user_exclude), and every other reason the filter reports has a row explaining what to do about it — includingbinary,provider_directoryandtoo_large, which also need no action.secret_excludewas the one reason with no row and no fix, in all five locales.The gap, enumerated
Before the change (script comparing
internal/model/preview.go,internal/agent/selection.goand the five locale pages):After:
What changed
architecture.md, all five locales: the heading and the pipeline diagram's gate count move to six gates, the reason inventory gainssecret_exclude, and the ordered gate list gains it as step 2 with the later steps renumbered. The new step states the same two facts the review-rules guide already states about this gate — it runs on either path, and noincluderule can bring the file back.faq.md, all five locales: one row, inserted next tobinaryso the table keeps gate order. It carries a "nothing to do" fix and names the built-in secret paths, like theprovider_directoryrow does.internal/model/exclude_reason_docs_test.go: the guard (new file, test only).No production code changed:
preview.go,selection.go,secret_path.goand every rule document are untouched.The guard
TestFAQDocumentsEveryExcludeReasonandTestArchitectureGateListNamesEveryFilterReasonderive their expectations from the code instead of restating them:ExcludeReasonconstant declarations ininternal/model/preview.go, because Go cannot enumerate constants and a second hand-maintained list would be a second thing to forget;whyExcludedininternal/agent/selection.go;binaryrow to the end of the contiguous table block, so both directions are asserted — every declared reason is listed, and no row lists something that is not a reason — without depending on translated headings;whyExcludedreturns, and its diagram label's gate count must equal the length of its own ordered list, whose steps must number 1..N.Relative wording is not asserted, so a translation stays free.
Type of Change
How Has This Been Tested?
make testpasses locallyThe guard fails on the pre-change pages and passes afterwards. Reverting only the doc edits from the same commit, in the working tree:
Gates on the pushed commit (
efd0419):One test in that sweep is timing-sensitive:
TestBoundaryKeepsTruncationCorrectionWhenRecallIsCancelled(internal/llm/retry_boundary_test.go) failed once under the load of the full suite withattempt 1 = error cancelled/context, want error network/response_decode kept through the cancellation. It is unrelated to this change (I touch no Go production code), it passes on the immediate rerun of the full suite, and it passes three times in a row with-racewhen run alone. Flagging it in case it is a known flake.The docs guardrail for translations was run as well, and all five locales are edited symmetrically:
Checklist
go fmt,go vet)AI/LLM disclosure: the doc edits and the guard test were drafted by an AI coding assistant (Hermes Agent, model deepseek-v4-flash). The account owner read the entire diff line by line, independently re-ran the enumeration, the revert/restore verification and the gates quoted above, and is responsible for the content. Commits are not attributed to the tool.
CLA: the
license/clacheck reports it as signed for this account.Related Issues
No issue: the gap was found by comparing the three pages that describe the filter against
selection.go, not from a report. Happy to file a documentation issue if you would rather have this tracked that way before merge.Relative to the open #1785 (pattern → rule table on
review-rules.md) and #1541 (default exclude list on the same page): both editreview-rules.mdsections this PR does not touch. This PR changesarchitecture.mdandfaq.mdonly.