Competition/Round architecture: full platform rewrite (Phases 1-9)
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m45s

Replace Pipeline/Stage system with Competition/Round architecture.
New schema: Competition, Round (7 types), JuryGroup, AssignmentPolicy,
ProjectRoundState, DeliberationSession, ResultLock, SubmissionWindow.
New services: round-engine, round-assignment, deliberation, result-lock,
submission-manager, competition-context, ai-prompt-guard.
Full admin/jury/applicant/mentor UI rewrite. AI prompt hardening with
structured prompts, retry logic, and injection detection. All legacy
pipeline/stage code removed. 4 new migrations + seed aligned.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 23:04:15 +01:00
parent 9ab4717f96
commit 6ca39c976b
349 changed files with 69938 additions and 28767 deletions

View File

@@ -9,7 +9,7 @@ export const gracePeriodRouter = router({
grant: adminProcedure
.input(
z.object({
stageId: z.string(),
roundId: z.string(),
userId: z.string(),
projectId: z.string().optional(),
extendedUntil: z.date(),
@@ -32,7 +32,7 @@ export const gracePeriodRouter = router({
entityType: 'GracePeriod',
entityId: gracePeriod.id,
detailsJson: {
stageId: input.stageId,
roundId: input.roundId,
userId: input.userId,
projectId: input.projectId,
extendedUntil: input.extendedUntil.toISOString(),
@@ -45,13 +45,13 @@ export const gracePeriodRouter = router({
}),
/**
* List grace periods for a stage
* List grace periods for a round
*/
listByStage: adminProcedure
.input(z.object({ stageId: z.string() }))
listByRound: adminProcedure
.input(z.object({ roundId: z.string() }))
.query(async ({ ctx, input }) => {
return ctx.prisma.gracePeriod.findMany({
where: { stageId: input.stageId },
where: { roundId: input.roundId },
include: {
user: { select: { id: true, name: true, email: true } },
grantedBy: { select: { id: true, name: true } },
@@ -61,14 +61,14 @@ export const gracePeriodRouter = router({
}),
/**
* List active grace periods for a stage
* List active grace periods for a round
*/
listActiveByStage: adminProcedure
.input(z.object({ stageId: z.string() }))
listActiveByRound: adminProcedure
.input(z.object({ roundId: z.string() }))
.query(async ({ ctx, input }) => {
return ctx.prisma.gracePeriod.findMany({
where: {
stageId: input.stageId,
roundId: input.roundId,
extendedUntil: { gte: new Date() },
},
include: {
@@ -80,19 +80,19 @@ export const gracePeriodRouter = router({
}),
/**
* Get grace periods for a specific user in a stage
* Get grace periods for a specific user in a round
*/
getByUser: adminProcedure
.input(
z.object({
stageId: z.string(),
roundId: z.string(),
userId: z.string(),
})
)
.query(async ({ ctx, input }) => {
return ctx.prisma.gracePeriod.findMany({
where: {
stageId: input.stageId,
roundId: input.roundId,
userId: input.userId,
},
orderBy: { createdAt: 'desc' },
@@ -152,7 +152,7 @@ export const gracePeriodRouter = router({
entityId: input.id,
detailsJson: {
userId: gracePeriod.userId,
stageId: gracePeriod.stageId,
roundId: gracePeriod.roundId,
},
ipAddress: ctx.ip,
userAgent: ctx.userAgent,
@@ -167,7 +167,7 @@ export const gracePeriodRouter = router({
bulkGrant: adminProcedure
.input(
z.object({
stageId: z.string(),
roundId: z.string(),
userIds: z.array(z.string()),
extendedUntil: z.date(),
reason: z.string().optional(),
@@ -176,7 +176,7 @@ export const gracePeriodRouter = router({
.mutation(async ({ ctx, input }) => {
const created = await ctx.prisma.gracePeriod.createMany({
data: input.userIds.map((userId) => ({
stageId: input.stageId,
roundId: input.roundId,
userId,
extendedUntil: input.extendedUntil,
reason: input.reason,
@@ -192,7 +192,7 @@ export const gracePeriodRouter = router({
action: 'BULK_GRANT_GRACE_PERIOD',
entityType: 'GracePeriod',
detailsJson: {
stageId: input.stageId,
roundId: input.roundId,
userCount: input.userIds.length,
created: created.count,
},