-
Notifications
You must be signed in to change notification settings - Fork 32
Add project pod workspace #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| import mongoose, { Document, Schema, Types } from 'mongoose'; | ||
|
|
||
| export type PodType = 'chat' | 'study' | 'games' | 'agent-ensemble' | 'agent-admin' | 'agent-room' | 'team'; | ||
| export type PodType = 'chat' | 'study' | 'games' | 'project' | 'agent-ensemble' | 'agent-admin' | 'agent-room' | 'team'; | ||
| export type PodJoinPolicy = 'open' | 'invite-only'; | ||
| export type EnsembleParticipantRole = 'starter' | 'responder' | 'synthesizer' | 'observer'; | ||
| export type HumanParticipation = 'none' | 'read-only' | 'participate'; | ||
| export type ProjectStatus = 'planning' | 'on-track' | 'at-risk' | 'blocked' | 'complete'; | ||
|
|
||
| export interface IEnsembleParticipant { | ||
| agentType: string; | ||
|
|
@@ -16,6 +17,18 @@ export interface IPod extends Document { | |
| description?: string; | ||
| type: PodType; | ||
| joinPolicy: PodJoinPolicy; | ||
| projectMeta: { | ||
| goal?: string; | ||
| scope?: string; | ||
| successCriteria: string[]; | ||
| status: ProjectStatus; | ||
| dueDate?: Date | null; | ||
| ownerIds: Types.ObjectId[]; | ||
| keyLinks: Array<{ | ||
| label: string; | ||
| url: string; | ||
| }>; | ||
| }; | ||
| parentPod?: Types.ObjectId | null; | ||
| agentEnsemble: { | ||
| enabled: boolean; | ||
|
|
@@ -48,14 +61,32 @@ const PodSchema = new Schema<IPod>( | |
| description: { type: String, trim: true }, | ||
| type: { | ||
| type: String, | ||
| enum: ['chat', 'study', 'games', 'agent-ensemble', 'agent-admin', 'agent-room', 'team'], | ||
| enum: ['chat', 'study', 'games', 'project', 'agent-ensemble', 'agent-admin', 'agent-room', 'team'], | ||
| default: 'chat', | ||
| }, | ||
| joinPolicy: { | ||
| type: String, | ||
| enum: ['open', 'invite-only'], | ||
| default: 'open', | ||
| }, | ||
| projectMeta: { | ||
| goal: { type: String, trim: true, default: '' }, | ||
| scope: { type: String, trim: true, default: '' }, | ||
| successCriteria: { type: [String], default: [] }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Two small wins: save storage on non-project pods, and make the "is this a project?" check a simple field-presence test. Either mark the subdoc Generated by Claude Code |
||
| status: { | ||
| type: String, | ||
| enum: ['planning', 'on-track', 'at-risk', 'blocked', 'complete'], | ||
| default: 'planning', | ||
| }, | ||
| dueDate: { type: Date, default: null }, | ||
| ownerIds: [{ type: Schema.Types.ObjectId, ref: 'User' }], | ||
| keyLinks: [ | ||
| { | ||
| label: { type: String, trim: true, default: '' }, | ||
| url: { type: String, trim: true, default: '' }, | ||
| }, | ||
| ], | ||
| }, | ||
| parentPod: { type: Schema.Types.ObjectId, ref: 'Pod', default: null }, | ||
| agentEnsemble: { | ||
| enabled: { type: Boolean, default: false }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schema introduces
projectMeta.ownerIds(plural) but the auth check here only honors the originalcreatedBy. A co-owner added viaownerIdsgets 403 when they try to edit project metadata — they paid for the field but can't use it.Either:
or drop
ownerIdsfrom the schema until co-ownership is actually wired.Generated by Claude Code