From 553d149d477ef103660907f73c02c305ce2710fb Mon Sep 17 00:00:00 2001 From: Virgil Date: Mon, 30 Mar 2026 18:09:32 +0000 Subject: [PATCH] test(ax): add workspace command example coverage Co-Authored-By: Virgil --- .core/reference/docs/RFC.md | 1 + docs/RFC.md | 1 + .../commands_workspace_example_test.go | 35 +++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 pkg/agentic/commands_workspace_example_test.go diff --git a/.core/reference/docs/RFC.md b/.core/reference/docs/RFC.md index f6c7baa..4e0265a 100644 --- a/.core/reference/docs/RFC.md +++ b/.core/reference/docs/RFC.md @@ -423,6 +423,7 @@ Every exported function MUST have a usage-example comment: ## Changelog +- 2026-03-30: `pkg/agentic/commands_workspace.go` now has a matching example companion, closing the last agentic source file without example coverage. - 2026-03-30: plan files and review queue rate-limit state now use `WriteAtomic`, keeping JSON state writes aligned with the AX safe-write convention. - 2026-03-30: transport helpers preserve request and read causes, brain direct API calls surface upstream bodies, and review queue retry parsing no longer uses `MustCompile`. - 2026-03-30: direct Core process calls replaced the `proc.go` wrapper layer; PID helpers now live in `pid.go` and the workspace template documents `c.Process()` directly. diff --git a/docs/RFC.md b/docs/RFC.md index 2344544..7aff798 100644 --- a/docs/RFC.md +++ b/docs/RFC.md @@ -423,6 +423,7 @@ Every exported function MUST have a usage-example comment: ## Changelog +- 2026-03-30: `pkg/agentic/commands_workspace.go` now has a matching example companion, closing the last agentic source file without example coverage. - 2026-03-30: plan files and review queue rate-limit state now use `WriteAtomic`, keeping JSON state writes aligned with the AX safe-write convention. - 2026-03-30: plan create tests now assert the documented `core.ID()` shape and repeated plan creation produces unique IDs, keeping the plan contract aligned with the simplified generator. - 2026-03-30: dispatch completion monitoring now uses a named helper instead of an inline Action closure, keeping the spawned-process finaliser AX-native. diff --git a/pkg/agentic/commands_workspace_example_test.go b/pkg/agentic/commands_workspace_example_test.go new file mode 100644 index 0000000..6ad9f3c --- /dev/null +++ b/pkg/agentic/commands_workspace_example_test.go @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: EUPL-1.2 + +package agentic + +import ( + "os" + + core "dappco.re/go/core" +) + +func ExamplePrepSubsystem_cmdWorkspaceClean() { + fsys := (&core.Fs{}).NewUnrestricted() + root := fsys.TempDir("agentic-workspace-clean-example") + defer fsys.DeleteAll(root) + + previous, hadPrevious := os.LookupEnv("CORE_WORKSPACE") + _ = os.Setenv("CORE_WORKSPACE", root) + defer func() { + if hadPrevious { + _ = os.Setenv("CORE_WORKSPACE", previous) + return + } + _ = os.Unsetenv("CORE_WORKSPACE") + }() + + s := &PrepSubsystem{ + ServiceRuntime: core.NewServiceRuntime(core.New(), AgentOptions{}), + } + + result := s.cmdWorkspaceClean(core.NewOptions()) + core.Println(result.OK) + // Output: + // nothing to clean + // true +}