Repository navigation
feat(tui): ask for project trust in the TUI instead of exiting (OB7) - #161
Merged
Merged
Conversation
Bare `qq` in a workspace whose project configuration declares sensitive sections no trust record covers used to exit with `TrustRequired`. It now opens the TUI on a trust prompt that lists each pending file and what it declares (model, providers, MCP servers with command or URL, grant counts, packs) with `t trust s this session q quit`. `t` records trust exactly as `qq trust` does; `s` admits the files for this process only. Headless `ask`/`run`/`serve` keep failing fast, and a TUI attached to a server it does not own gets no prompt: trust is a decision about files on the host that runs the server. Design (ADR-0042): a client-side prompt fed by root-computed `PendingTrustNotice`s and resolved by the composition root through a `TrustResolver` hook, so `qq-tui` stays free of `qq-config` and the wire protocol is unchanged. qq-config gains a read-only `ConfigLoader::pending_trust`, `PendingTrust::declarations`, and `LoadRequest::with_process_trust`; the runtime carries process trust on every workspace load and folds it into `PlanKey` so a compile from before the grant is never served after it. Closes ENG-881.
lg2m
added a commit
that referenced
this pull request
Oct 26, 2026
…nreachable trust prompt (#476) * refactor(tui): delete the unreachable project trust prompt Since #446 every startup path ignores untrusted project configuration instead of failing with TrustRequired, so the TUI never received pending trust. Remove Mode::Trust and its resolver, RuntimeFactory::resolve_trust and process-scoped trust, and the ProcessTrust/TrustChanged/TrustDeclaration machinery that only served the prompt. qq trust, qq doctor, qq init and qq config sources keep their behaviour. crates/qq-tui/src/effect.rs returns to its pre-#161 contents because #161 added only the trust effect. QQ-Allow-Revert: crates/qq-tui/src/effect.rs * docs: describe unattended Auto, sandbox requirements and task tools Help text, the /approval picker, README and the user guide still described held Auto calls, the classifier as the gate, y/a/w prompts, and the TUI trust prompt. Rewrite them for the shipped behaviour, document what the shell sandbox needs on each OS and the task-workspace limits, list task_commit, task_push and task_pr, and fix stale design notes (tools.md, architecture.md PR #375 row, ADR-0050 status). Update the verify-qq skill in both copies.
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.
Plan slice OB7 of
docs/plans/onboarding-ux.md. Linear: ENG-881. ADR-0042.User-visible behavior
The last place bare
qqexited instead of asking. Clone a repo with a.qq/config.ronthat setsmodel, providers, MCP servers, or grants, runqq, and instead of an error you get the TUI on a trust prompt:trecords trust exactly asqq trustdoes (samegrant_pending_trust); the next launch doesn't ask.sadmits the files for this process only — nothing written totrust.ron.q/Escquit. Every other key is swallowed until you answer.trusted N file(s)/trusted for this session, the block disappears, the model catalog and capabilities load, and the OB1/OB2 guidance takes over (Alt-Ncreates a session).ask/run/serveare unchanged and still fail fast with theqq trustmessage.--sessionagainst a runningqq serve) gets: "this client is attached to a server it does not own; runqq truston the server host".Design — ADR-0042: client-side prompt, root-resolved, no protocol change
Trust is a decision about files on the host that owns
trust.ron. In the bare-qqcase that host is the process rendering the TUI, so the composition root matchesTrustRequiredon its ownload_for_client, renders plainPendingTrustNotices intoTuiOptions, and supplies aTrustResolverhook (same pattern as the$EDITORhook).qq-tuistays free ofqq-config;PROTOCOL_VERSIONstays 28.ConfigLoader::pending_trust(the scan factored out ofgrant_pending_trust),PendingTrust::declarationsfrom a newDocument::sensitive_declarations,LoadRequest::with_process_trustmerged into the in-memoryTrustStateafter load (no disk write).RuntimeFactoryholds process grants, applies them to every workspace load, and folds a fingerprint intoPlanKeyso a compile from before the grant is never served after it.grant_pending_trustdeliberately loads durable state without process grants, sotaftersstill records the file.trust.ronon behalf of an unauthenticated remote principal. Revisit with ADR-0015 enrollment.Verification
-D warnings,cargo test --workspace— 1862 passed on the stacked tip (the OB10 docs-truth test runs against the new keys and guide text)trecords likeqq trust,sgrants only this process; a session grant is a new cache slot), qq-tui (keys→effects; resolved trust drops the prompt and applies the catalog; render; no-resolver notice; resolver awaited off the loop)HOME: block paints;s→ cleared, notrust.ron;t→trust.ronwritten, next launch doesn't prompt;qq askstill exits withTrustRequired.Docs
ADR-0042 +
adr/README.md;progress/root.md(0042 reserved, next 0043; shared-file row: no PROTOCOL_VERSION change);guide/permissions.md,guide/tui.md(§ Trust + keys),guide/troubleshooting.md,design/tools.md; plan + ledger.Compatibility
No wire, persisted, or config-format change.
qq trustbehaves as before.