fix: log workspace create/update/delete to activity trail#392
Open
Ashutoshx7 wants to merge 1 commit into
Open
fix: log workspace create/update/delete to activity trail#392Ashutoshx7 wants to merge 1 commit into
Ashutoshx7 wants to merge 1 commit into
Conversation
Workspace mutations under /subprojects/:id/workspaces were completing without writing to activity_log, unlike every other mutation endpoint. This left a gap in the audit trail for three operations: create, update, and delete. Added logActivity calls after each workspace mutation with proper actor info, project scoping, and entity tracking. Includes four regression tests confirming the audit entries are written. Signed-off-by: Ashutoshx7 <as1142120@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workspace mutations under
/subprojects/:id/workspaceswere completing without writing toactivity_log. Every other mutation endpoint in the codebase properly logs to the audit trail, but these three workspace routes were missed when the subproject workspace feature was added.This is a violation of v1-spec section 15.3: "every mutation writes
activity_log."What changed
Added
logActivity()calls to all three workspace mutation routes insubprojects.ts:POST /subprojects/:id/workspacesworkspace.createdPATCH /subprojects/:id/workspaces/:workspaceIdworkspace.updatedDELETE /subprojects/:id/workspaces/:workspaceIdworkspace.deletedEach entry includes proper actor info (
actorType,actorId,agentId), project scoping, and entity tracking - matching the pattern used by parent subproject routes.Type of Change
How Was This Tested?
Added 4 regression tests in
workspace-audit-trail.test.ts:workspace.createdis logged on POSTworkspace.updatedis logged on PATCHworkspace.deletedis logged on DELETEAll 48 test files pass (205 tests total).
CE & Security Check
Checklist