Skip to content

Commit 0dc152a

Browse files
author
Oliver Gibbs
committed
refactor(backend): move project collaboration domain to a dedicated stack
Relocates the project, conversation, document, assessment, and design-progress resolver Lambdas — 14 functions, 10 data sources, 23 resolver attachments, 4 event rules, 2 alarms — from the backend stack into a new projects stack that attaches to the same GraphQL API, following the established satellite pattern. The backend stack drops from 500 resources (the CloudFormation ceiling) to 375. Relocated functions carry no pinned names, eliminating recreation collisions; every stateful resource keeps its logical id and policies in place. All seven restructuring gates pass over the populated move manifest: removals-only template diff, 39 stateful logical-id pins, cross-stack resolver parity, IAM privilege equivalence for relocated roles, and byte-level behavioral equivalence of resolver mapping templates. Deploy order is backend first then projects; rollback is the reverse — the choreography is documented in the operator plan.
1 parent a59a1c6 commit 0dc152a

14 files changed

Lines changed: 2738 additions & 1041 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Service (AgentCore Runtime · Gateway · Knowledge Base)
9696
Gateway (per-app API Gateway · authorizer · metrics)
9797
```
9898

99-
Deployed as focused CDK stacks: `backend`, `services`, `governance`, `arbiter`, `frontend`, `gateway`, and `telemetry`.
99+
Deployed as focused CDK stacks: `backend`, `projects`, `services`, `governance`, `arbiter`, `frontend`, `gateway`, and `telemetry`.
100100

101101
## Getting started
102102

backend/bin/app.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { FrontendStack } from "../lib/frontend-stack";
1010
import { GatewayStack } from "../lib/gateway-stack";
1111
import { GovernanceStack } from "../lib/governance-stack";
1212
import { TelemetryStack } from "../lib/telemetry-stack";
13+
import { ProjectsStack } from "../lib/projects-stack";
1314

1415
const app = new cdk.App();
1516

@@ -36,6 +37,33 @@ const backendStack = new BackendStack(app, `citadel-backend-${environment}`, {
3637
description: `Backend infrastructure for Citadel - ${environment}`,
3738
});
3839

40+
// Projects satellite stack — backend-stack-split phase 1 (decision 30e6d067).
41+
// Owns the projects/conversations/documents/assessment/design-progress/
42+
// planning/chatter domain, moved out of BackendStack. Depends on backend
43+
// only, for the shared API/bus/tables/bucket/pool passed in as props;
44+
// resolvers attach to BackendStack's AppSync API via the L1 cross-stack
45+
// pattern (see projects-stack.ts).
46+
const projectsStack = new ProjectsStack(
47+
app,
48+
`citadel-projects-${environment}`,
49+
{
50+
...stackProps,
51+
description: `Projects domain satellite for Citadel - ${environment}`,
52+
appSyncApi: backendStack.appSyncApi,
53+
agentEventBus: backendStack.agentEventBus,
54+
projectsTable: backendStack.projectsTable,
55+
conversationsTable: backendStack.conversationsTable,
56+
agentStatusTable: backendStack.agentStatusTable,
57+
documentBucket: backendStack.documentBucket,
58+
idempotencyTable: backendStack.idempotencyTable,
59+
adrsTable: backendStack.adrsTable,
60+
executionSpecificationsTable: backendStack.executionSpecificationsTable,
61+
agentDesignAssessmentsTable: backendStack.agentDesignAssessmentsTable,
62+
userPool: backendStack.userPool,
63+
},
64+
);
65+
projectsStack.addDependency(backendStack);
66+
3967
// Services stack (depends on backend)
4068
const servicesStack = new ServicesStack(
4169
app,
@@ -332,6 +360,7 @@ if (app.node.tryGetContext("nag") !== "false") {
332360
];
333361
for (const stack of [
334362
backendStack,
363+
projectsStack,
335364
servicesStack,
336365
arbiterStack,
337366
frontendStack,
@@ -439,7 +468,7 @@ if (app.node.tryGetContext("nag") !== "false") {
439468
];
440469
const resourceStarPaths: Array<[cdk.Stack, string]> = [
441470
[
442-
backendStack,
471+
projectsStack,
443472
"DocumentUploadResolverFunction/ServiceRole/DefaultPolicy/Resource",
444473
],
445474
[

0 commit comments

Comments
 (0)