Skip to content

components C8: startup security gates (trust / includes / bypass) - #300

Merged
ericleepi314 merged 1 commit into
mainfrom
components/c8-startup-gates
Jun 11, 2026
Merged

components C8: startup security gates (trust / includes / bypass)#300
ericleepi314 merged 1 commit into
mainfrom
components/c8-startup-gates

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Summary

  • Ports the three TS startup gates as a strictly sequential boot chain (trust → external CLAUDE.md includes → bypass acceptance → C6 warnings → C7 MCP approvals), so no later dialog can stack above an unanswered trust prompt.
  • Trust (TrustDialog.tsx + config.ts:771-817): per-project hasTrustDialogAccepted in the user-owned global config projects[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.
  • External includes (ClaudeMdExternalIncludesDialog.tsx + claudemd.ts:805-815/1427-1437): asked once per project (boolean pair); the loader derives include_external from the approval, keys its cache on the effective value, and the externals predicate excludes the User tier exactly like TS; Esc = "no".
  • Bypass acceptance (BypassPermissionsModeDialog.tsx): decline → exit 1, Esc → exit 0 (distinct TS codes, now propagated — run_tui returns app.return_code); accept persists skipDangerousModePermissionPrompt: true to user settings.
  • Closes the C7 deferred item: get_mcpjson_server_status ports TS's auto-approve branches (bypass-accepted flag; non-interactive session, utils.ts:377-403) — headless/SDK behavior now TS parity; run_tui defensively pins interactive mode so the branch fails safe.
  • init.py trust placeholder comment rewritten (the TODO it carried pointed at this phase); plan §8 updated with all [FOUND DURING IMPL] decisions.

Test plan

  • 22 new tests: trust round-trip/parent-walk/home-session-only/warnings, includes state + end-to-end through the REAL loader (excluded → approved → included), User-tier predicate guard, bypass round-trips, 9-case screen pilot matrix, app-chain tests via import-time-captured real methods (decline codes, write-failure honesty, worker branches)
  • TUI + services + context + MCP + init suites: 983 passed (2 known PATH-dependent pre-existing failures)
  • Full suite BASELINE-IDENTICAL vs the 12 known pre-existing failures
  • Critic loop: REQUEST CHANGES (1 MAJOR / 5 MINOR / 4 NIT) → all fixed incl. the TS User-tier verification → APPROVE ("ready to ship")

🤖 Generated with Claude Code

…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>
@ericleepi314
ericleepi314 merged commit 4d44cbc into main Jun 11, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant