test(secrets): concierge no-self-secret-ops regression tests (#2605) #2624
Reference in New Issue
Block a user
Delete Branch "fix/concierge-no-self-secret-ops-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes molecule-core#2615.
Adds regression tests for the concierge no-self-secret-ops / safe-approval guard introduced in molecule-core#2605 and enforced by the core#2573 auto-restart skip.
The guard has two layers:
conciergeSystemPromptTmpl(platform_agent.go) — tells the concierge never to run secret ops against its own workspace.autoRestartAllowed(secrets.go) — suppresses auto-restart when a secret write/delete targets the caller's own workspace or the org root (kind='platform').These tests cover the code enforcement layer:
TestSecretsSet_NoAutoRestart_SelfWrite— caller == target workspace → no auto-restart.TestSecretsSet_NoAutoRestart_PlatformRoot— target is the concierge (kind='platform') → no auto-restart.TestSecretsSet_AutoRestartalready covers the safe path: a regular workspace write still triggers auto-restart.Test plan
🤖 Generated with Claude Code
SOP checklist
TestSecretsSet_AutoRestartcovers the safe path. Verified the new tests pass in CI.workspace-server/internal/handlers/secrets_test.go.autoRestartAllowed), readability, scope.feedback_no_such_thing_as_flakes,reference_merge_gate_model_changed_2026_05_18.Approved on head
4feed3161f.5-axis review:
Correctness: the new tests call the real
SecretsHandler.Setpath, including insert,callerWorkspaceID,autoRestartAllowed, and the async restart branch. They cover caller==target self-write suppression and kind=platformtarget suppression, while existingTestSecretsSet_AutoRestartkeeps the regular-workspace restart path covered.Robustness: the tests assert successful writes do not invoke restart by using a buffered restart channel and timeout. The platform-root test verifies the kind lookup is performed and returns
platformbefore suppressing restart.Security: this protects the intended no-self-secret-ops/safe-approval behavior: secret writes to the caller's own workspace or org root do not terminate the active agent/root workspace. No new auth or secret exposure is introduced.
Performance: test-only change; small added runtime from two handler unit tests.
Readability: tests are straightforward. Note: they overlap with existing #2573 tests later in the file, but the duplication is acceptable for explicit #2605 regression coverage and does not change production code.
Caveats: I could not run local Go tests because
gois unavailable in this environment. PR CI was not fully green at review time due governance/advisory contexts, not this code path.