Expand description
The project a command-line invocation acts for, and the read boundary a command-line read enforces against it.
The root comes from --root/--project-root, then LEAN_CTX_PROJECT_ROOT
(reconciled with the working directory, AP04-G10), then the git root above
the working directory. Shared by the CLI commands, the daemon client and the
shell-hook rewriters, so every entry point names the same project.
Functions§
- cli_
read_ is_ refused - Whether
lean-ctx read <raw>from this process would be refused (#1903). Shell-hook rewriters keep such reads on the native command instead of turning a workingcatinto an access-denied error. - detect_
project_ root - The project this process acts for, from
argsand the working directory. - jail_
cli_ read_ path - #1903:
lean-ctx readenforces the same boundary as MCPctx_read— the PathJail (project root +allow_paths/extra_roots/read_only_roots+ the lean-ctx state dir) and the secret-path policy — with the same error text. A relative path is resolved against the process CWD (a shell user’s intent), never re-anchored at the project root. A broad root (home,/, agent config dir) is refused likelean-ctx calldoes, unless the jail is disabled (path_jail = false), because jailing to~would admit every file the user owns. - promote_
to_ git_ root - require_
project_ root - The project a command that writes project-scoped state acts for;
Errinstead of~,/or an agent directory (AP04-G10).