feat(permissions): voie projection CLI (LP0→LP3) + checkpoint Codex/input

Jalon vert regroupant deux chantiers entrelacés dans le working tree,
indissociables au niveau fichier mais tous deux verts (cargo test
--workspace + tests frontend permissions au vert).

Permissions — voie « projection CLI » (advisory), complète :
- LP0 domaine pur : modèle PermissionSet/EffectivePermissions, resolve
  deny-wins + postures Allow<Ask<Deny (crates/domain/src/permission.rs).
- LP1 store : FsPermissionStore (.ideai/permissions.json).
- LP2 use cases : Get/Update project, Update agent override, Resolve.
- LP3 projecteurs Claude/Codex (settings.local.json / config.toml),
  câblage launch-path + PermissionProjectorRegistry, nettoyage des
  fichiers Replace orphelins au swap de profil (LP3-4), composition root
  + commandes Tauri, UI PermissionsPanel (projet + override agent).
- ports.rs : PermissionStore + FileSystem::remove_file (cleanup au swap).

Reste ouvert (hors scope, marqué dans le code) : LP4 enforcement OS
airtight (Landlock fichiers) + résumé de permissions injecté.

Inclut aussi le chantier Codex/input/sessions structurées en cours
(McpConfigStrategy, StructuredAdapter, gestion d'input) partageant les
mêmes fichiers (lifecycle.rs, commands.rs, dto.rs, state.rs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 20:39:18 +02:00
parent 46492506e1
commit 27597eb64e
41 changed files with 6513 additions and 269 deletions

View File

@ -29,7 +29,10 @@ import type {
MemoryIndexEntry,
MemoryLink,
MemoryType,
EffectivePermissions,
PermissionSet,
Project,
ProjectPermissions,
ProfileAvailability,
ResumableAgent,
Skill,
@ -540,6 +543,15 @@ export interface InputGateway {
agentId: string,
ticket: string,
): Promise<void>;
/**
* Reports whether a **frontend terminal cell** is mounted for `agentId` (`true`
* when the cell's write-portal binds its PTY handle, `false` on unmount). The
* backend mediator needs this to deliver a turn to a **headless** agent — one
* delegated in the background with no cell, where nobody would consume
* `delegationReady`: it then writes the task into the PTY itself. An agent with a
* mounted cell keeps the write-portal path. Best-effort; never throws into the UI.
*/
setFrontAttached(agentId: string, attached: boolean): Promise<void>;
}
/**
@ -587,6 +599,28 @@ export interface EmbedderGateway {
describeEmbedderEngines(): Promise<EmbedderEngines>;
}
/** Project and agent permission management (LP1). */
export interface PermissionGateway {
/** Reads the full project permission document. */
getProjectPermissions(projectId: string): Promise<ProjectPermissions>;
/** Replaces or removes project-level default permissions. */
updateProjectPermissions(
projectId: string,
permissions: PermissionSet | null,
): Promise<ProjectPermissions>;
/** Replaces or removes one agent-specific override. */
updateAgentPermissions(
projectId: string,
agentId: string,
permissions: PermissionSet | null,
): Promise<ProjectPermissions>;
/** Resolves effective permissions for one agent. */
resolveAgentPermissions(
projectId: string,
agentId: string,
): Promise<EffectivePermissions | null>;
}
/**
* The full set of gateways the app depends on, injected via the DI provider.
* The composition (real vs mock) is chosen in `app/`.
@ -605,4 +639,5 @@ export interface Gateways {
skill: SkillGateway;
memory: MemoryGateway;
embedder: EmbedderGateway;
permission: PermissionGateway;
}