fix(cli): consolidate provider + KB probe-gates into one strict shared helper#436
Merged
Conversation
…d helper Replaces the duplicate _provider_probe_gate (ai_provider) and _probe_gate (knowledge_base) with a single probe_gate(probe) in commands/_common. The shared helper treats a write-access gate as clean only when the probe is ok and carries no problem. This also closes a latent gap on the knowledge-base write path: its gate previously checked ok alone, so a probe returning ok=true alongside a partial problem (partial data returned with GraphQL errors) read as full access and let a write proceed. KB write-gating now rejects that partial denial, matching the provider gate. Closes #435.
adriannoes
previously approved these changes
Jul 20, 2026
This was referenced Jul 20, 2026
The consolidated probe_gate helper treats a KB write gate as clean only when the probe is ok and carries no problem, so a partial denial (ok:true with a non-null problem) never reads as full access. Mirror the clean-gate wording already in llm-providers.md onto knowledge-bases.md so the doc matches the strict behavior.
Collaborator
Author
|
Thanks @adriannoes. Non-blocking doc mirror done in a44f3f1: |
adriannoes
self-requested a review
July 20, 2026 15:43
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.
Closes #435. Stacked on #434 (rc-dev/feat/llm-provider-writes) — retarget to
devonce #434 merges.Motivation
The CLI had two near-identical write-gating helpers with divergent "clean gate" criteria: the provider helper (added in #434) treated a probe as clean only when it is
okand carries noproblem, while the knowledge-base helper checkedokalone. Both access probes can returnok: truewith a partialproblemwhen the API returns partial data alongside GraphQL errors, so the knowledge-base gate read that partial denial as full access and let a write proceed.Outcome
A single strict
probe_gate(probe)inpipefy_cli.commands._commonbacks both surfaces. Provider write-gating is unchanged; knowledge-base write-gating is now strict, so a partial-denial probe (ok: truewith aproblem) blocks the write instead of passing. The two duplicate helpers are removed.