From b07b41cd435991cd254957af79055080c85b346e Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sun, 9 Aug 2026 21:08:20 +0900 Subject: feat: AI Agent Sandbox MCP Server v1を実装 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifications、Design、ImplementationPlanの優先順位を整理し、単一Task実行モデル、typed option優先、設定可能なresource上限、local Ollamaを必須とするRelease Gateを文書化。 .NET 10/C# 14の5 production project、3 test project、E2E Clientを構築。typed YAML、en/ja locale、fixed/user prompt、stdioおよびloopback限定Streamable HTTP、agent_run/agent_status、Session、Ollama text/tool/Vision、TaskGraphとtoken accountingを実装。 Windows sandboxとしてfixed AppContainer、canonical/reparse検査、能力別ACL、path+SHA-256 executable approval、child-process restriction、Job Object、task journal、atomic file transaction、crash recoveryを実装。WFPのIPv4/IPv6 default denyとexact allow、dynamic session、temporary loopback exemption、管理者/BFE診断を追加。 Security/Recovery test、MCP/Ollama integration test、stdio/HTTP Operational E2E、Release Bundle生成・checksum・manifest・fresh extraction検査を追加。Requirement TraceabilityとPhase 0〜11の進捗、初回セットアップ可能なREADMEを整備。 Debug/Release/publish/objをrepository rootのbuild/へ集約し、旧project-local bin/objへの依存を除去。artifacts/とbuild/をGit管理外に設定し、clean checkoutでもsolution buildからE2E Clientまで生成可能にした。 --- tests/Agent.Core.Tests/TaskRegistryTests.cs | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/Agent.Core.Tests/TaskRegistryTests.cs (limited to 'tests/Agent.Core.Tests/TaskRegistryTests.cs') diff --git a/tests/Agent.Core.Tests/TaskRegistryTests.cs b/tests/Agent.Core.Tests/TaskRegistryTests.cs new file mode 100644 index 0000000..33e16ab --- /dev/null +++ b/tests/Agent.Core.Tests/TaskRegistryTests.cs @@ -0,0 +1,35 @@ +using Agent.Core.Tasks; + +namespace Agent.Core.Tests; + +public sealed class TaskRegistryTests +{ + [Fact] + public void NewTaskGetsUniqueTaskAndSessionIds() + { + var registry = new TaskRegistry(); + TaskSnapshot first = registry.Enqueue("one", null, null); + TaskSnapshot second = registry.Enqueue("two", null, 0.2); + Assert.NotEqual(first.TaskId, second.TaskId); + Assert.NotEqual(first.SessionId, second.SessionId); + Assert.Equal(AgentTaskState.Queued, first.State); + } + + [Fact] + public void UnknownSessionIsRejected() + { + var registry = new TaskRegistry(); + Assert.Throws(() => registry.Enqueue("request", Guid.NewGuid(), null)); + } + + [Fact] + public void TerminalTaskCannotTransition() + { + var registry = new TaskRegistry(); + TaskSnapshot task = registry.Enqueue("request", null, null); + Assert.True(registry.Transition(task.TaskId, AgentTaskState.Planning)); + Assert.True(registry.Transition(task.TaskId, AgentTaskState.Running)); + Assert.True(registry.Transition(task.TaskId, AgentTaskState.Completed)); + Assert.False(registry.Transition(task.TaskId, AgentTaskState.Running)); + } +} -- cgit v1.2.3