components C8: startup security gates (trust / includes / bypass) - #300
Merged
Conversation
…pass) Three TS-verified boot gates, chained strictly sequentially before the C6 config warnings and C7 MCP approvals: - Folder trust (TrustDialog.tsx, config.ts:771-817): per-project hasTrustDialogAccepted in the USER-owned global config's projects[path] map (git root else cwd) - never a committable file, so a repo cannot pre-trust itself; parent trust covers children; home-dir acceptance is session-only; decline exits 1. Warning enumeration degraded to the two subsystems this port models (bash allow rules + statusLine). config.py grows get/update_project_entry + get_project_path_for_config. - External CLAUDE.md includes (ClaudeMdExternalIncludesDialog.tsx, claudemd.ts:805-815/1427-1437): asked once per project via the boolean pair hasClaudeMdExternalIncludesApproved/WarningShown; get_memory_files now derives include_external from the approval and keys its cache on the effective value; is_external_memory_file excludes the User tier exactly like TS; Esc maps to "no". - Bypass acceptance (BypassPermissionsModeDialog.tsx): decline exits 1, Esc exits 0 (distinct TS codes, now propagated - run_tui returns app.return_code); accept persists skipDangerousModePermissionPrompt to user settings and syncs bootstrap session trust state. - C7 deferred item closed: get_mcpjson_server_status ports the TS auto-approve branches (bypass-accepted flag; non-interactive session, utils.ts:377-403) - headless/SDK runs now match TS instead of the interim skip-with-warning; run_tui defensively pins set_is_interactive(True). Critic loop: REQUEST CHANGES (1 MAJOR: forked session-trust state + stale init.py TODO; 5 MINOR) -> all fixed -> APPROVE. 22 new tests; full suite baseline-identical. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
singlaamitesh
pushed a commit
to singlaamitesh/clawcodex
that referenced
this pull request
Jul 7, 2026
…-startup-gates components C8: startup security gates (trust / includes / bypass)
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.
Summary
hasTrustDialogAcceptedin the user-owned global configprojects[path]map (repo can't pre-trust itself); parent trust covers children; home-dir = session-only; decline → exit 1; accept also syncs the bootstrap session-trust flag consumed by hooks/trust_gate.include_externalfrom the approval, keys its cache on the effective value, and the externals predicate excludes the User tier exactly like TS; Esc = "no".run_tuireturnsapp.return_code); accept persistsskipDangerousModePermissionPrompt: trueto user settings.get_mcpjson_server_statusports TS's auto-approve branches (bypass-accepted flag; non-interactive session, utils.ts:377-403) — headless/SDK behavior now TS parity;run_tuidefensively pins interactive mode so the branch fails safe.init.pytrust placeholder comment rewritten (the TODO it carried pointed at this phase); plan §8 updated with all [FOUND DURING IMPL] decisions.Test plan
🤖 Generated with Claude Code