A4: admission policy and the editor lifecycle actions
BrokkrCommandPolicy (Runtime, pure, tested outside Unity) is consulted by BrokkrEditorService before every BrokkrUnityCommandExecutor.Execute; it is the only call path into the executor. The per-project allowed-action list defaults to scene mutation plus lifecycle; createScriptableObject, createPrefabVariant and saveScene are shipped denied (parked Q4 = A), and an action the list does not name is denied. A denial gets a receipt with status denied and a reason. The window's buttons write intents like any other caller, so operator and agent share the gate. Re-landed from the donor as fresh code: refreshAssets, setEditorPlayState, setEditorPaused, captureEditorView, and the play-state fields on the host snapshot (keys 14-17). The donor's captureEditorView wrote to any rooted outputPath; it now resolves the path through one function that accepts only a plain relative .png path under <project>/.brokkr/captures and refuses drive letters, rooted or UNC paths, stream suffixes and any .. segment on every host OS, and dimensions are bounded to 8192. requestedBy joins the intent (key 17) and is echoed on the receipt (key 6). saveScene is new. The window gains an Allowed Actions field bound to a per-project preference. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
bfe1de6305
commit
12f2d426b1
12 changed files with 459 additions and 7 deletions
|
|
@ -36,7 +36,8 @@ internal static class Cli
|
|||
["--view"] = (command, value) => command.viewKind = value,
|
||||
["--output"] = (command, value) => command.outputPath = value,
|
||||
["--width"] = (command, value) => command.width = Integer("--width", value),
|
||||
["--height"] = (command, value) => command.height = Integer("--height", value)
|
||||
["--height"] = (command, value) => command.height = Integer("--height", value),
|
||||
["--requested-by"] = (command, value) => command.requestedBy = value
|
||||
};
|
||||
|
||||
internal static async Task<int> RunAsync(string[] args)
|
||||
|
|
@ -63,6 +64,7 @@ internal static class Cli
|
|||
Console.WriteLine($"observed: {host.observedAt}");
|
||||
Console.WriteLine($"scene: {host.activeScenePath}");
|
||||
Console.WriteLine($"agent-commands: {(host.agentCommandsEnabled ? "on" : "off")}");
|
||||
Console.WriteLine($"state: playing={host.isPlaying} paused={host.isPaused} compiling={host.isCompiling} updating={host.isUpdating}");
|
||||
Console.WriteLine($"objects: {host.sceneObjects.Length}");
|
||||
foreach (var sceneObject in host.sceneObjects.OrderBy(item => item.path, StringComparer.Ordinal))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue