feat(augment): Phase 1 - consolidate agent lifecycle backend types and plumbing#3222
Conversation
d14c265 to
d041eb9
Compare
|
This pull request adds a new top-level directory under |
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
d041eb9 to
5e3cebe
Compare
Phase 1 of lifecycle hardening: single PR consolidating all backend type changes and plumbing that were previously split across PRs A/B/E. Backend types (shared.ts): - Add createdBy, createdAt to ChatAgentConfig and ChatAgent - Add rejectionReason, rejectedBy, rejectedAt for rejection tracking Agent routes (agentRoutes.ts): - overlayConfig surfaces all new lifecycle fields - GET /agents scoped for non-admins: published + own + legacy unowned - Promote: ownership checks, phantom draft blocking for non-admins, createdBy set on new config entries, rejection fields cleared on re-promote - Demote: accepts optional reason param, stores rejection fields on review → draft transitions - DELETE /agents/:agentId: ownership-gated draft deletion for non-admins, full deletion for admins, with audit logging Frontend API (AugmentApi.ts): - Add deleteAgentConfig(agentId) method - Add reason param to demoteAgent signature Audit logger: - Add 'agent.delete' audit action API reports updated for both augment-common and augment plugins.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3222 +/- ##
==========================================
+ Coverage 53.55% 53.82% +0.26%
==========================================
Files 2362 2362
Lines 84709 84735 +26
Branches 23464 23475 +11
==========================================
+ Hits 45367 45606 +239
+ Misses 39085 37691 -1394
- Partials 257 1438 +1181
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
5e3cebe to
2593801
Compare
|



Summary
Phase 1 of the Deep-Dive Lifecycle Hardening stack. Builds on and consolidates improvements over already-merged upstream PRs #3205–#3214 (DELETE route,
createdBy/My Agents scoping, GET /agents filtering, orphan wizard removal, lifecycle docs).This PR adds the full backend lifecycle plumbing in one place:
shared.ts:createdBy,createdAt,rejectionReason,rejectedBy,rejectedAtagentRoutes.ts: ownership checks, phantom-draft blocking, non-admin GET scoping, rejection fields on demote, ownership-gated DELETEAugmentApi.ts:deleteAgentConfig,reasonondemoteAgentagentRoutes.test.ts(41 tests)lifecycle-hardening.mdStacked PRs: #3223 (Phase 2 UX) → #3224 (polling) → #3225 (cascading delete) → #3226 (SonataFlow workflow).
Test plan
npx tsc --noEmitinworkspaces/augmentyarn backstage-cli repo test --testPathPattern='agentRoutes.test'yarn prettier:checkin augment workspace