Commit Graph

45 Commits

Author SHA1 Message Date
755c418391 feat: auto-trigger Discord wakeup when slot becomes ONGOING 2026-04-05 09:37:14 +00:00
79c6c32a78 feat: store discord user ids on accounts 2026-04-04 20:16:22 +00:00
zhi
eb57197020 BE-CAL-004: implement MinimumWorkload storage
- New model: minimum_workloads table with JSON config column (per-user)
- Schemas: MinimumWorkloadConfig, MinimumWorkloadUpdate, MinimumWorkloadResponse
- Service: CRUD operations + check_workload_warnings() entry point for BE-CAL-007
- API: GET/PUT/PATCH /calendar/workload-config (self + admin routes)
- Migration: auto-create minimum_workloads table on startup
- Registered calendar router in main.py
2026-03-30 22:27:05 +00:00
zhi
1c062ff4f1 BE-CAL-003: Add Agent model with status/heartbeat/exhausted fields
- New app/models/agent.py with Agent model, AgentStatus & ExhaustReason enums
- Agent has 1-to-1 FK to User, unique agent_id (OpenClaw $AGENT_ID),
  claw_identifier (OpenClaw instance, convention-matches MonitoredServer.identifier)
- Status fields: status (idle/on_call/busy/exhausted/offline), last_heartbeat
- Exhausted tracking: exhausted_at, recovery_at, exhaust_reason (rate_limit/billing)
- User model: added 'agent' back-reference (uselist=False)
- Schemas: AgentResponse, AgentStatusUpdate, UserCreate now accepts agent_id+claw_identifier
- UserResponse: includes agent_id when agent is bound
- Users router: create_user creates Agent record when agent_id+claw_identifier provided
- Auto-migration: CREATE TABLE agents in _migrate_schema()
- Startup imports: agent and calendar models registered
2026-03-30 20:47:44 +00:00
zhi
a9b4fa14b4 BE-CAL-002: Add SchedulePlan model with period hierarchy constraints
- Add DayOfWeek and MonthOfYear enums for plan period parameters
- Add SchedulePlan model with at_time/on_day/on_week/on_month fields
- Add DB-level check constraints enforcing hierarchy:
  on_month requires on_week, on_week requires on_day
- Add application-level @validates for on_week range (1-4),
  on_month hierarchy, and estimated_duration (1-50)
- Add is_active flag for soft-delete (plan-cancel)
- Add bidirectional relationship between SchedulePlan and TimeSlot
- All existing tests pass (29/29)
2026-03-30 19:16:16 +00:00
zhi
3dcd07bdf3 BE-CAL-001: Add TimeSlot model with SlotType/SlotStatus/EventType enums
- New calendar.py model file with TimeSlot table definition
- SlotType enum: work, on_call, entertainment, system
- SlotStatus enum: not_started, ongoing, deferred, skipped, paused, finished, aborted
- EventType enum: job, entertainment, system_event
- All fields per design doc: user_id, date, slot_type, estimated_duration,
  scheduled_at, started_at, attended, actual_duration, event_type, event_data (JSON),
  priority, status, plan_id (FK to schedule_plans)
2026-03-30 17:45:18 +00:00
zhi
90d1f22267 BE-PR-010: deprecate feat_task_id — retain column, read-only compat
- Updated model docstring with full deprecation strategy
- Updated column comment to mark as deprecated (BE-PR-010)
- Updated schema/router comments for deprecation clarity
- Added deprecation doc: docs/BE-PR-010-feat-task-id-deprecation.md
- feat_task_id superseded by Task.source_proposal_id (BE-PR-008)
2026-03-30 12:49:52 +00:00
zhi
c84884fe64 BE-PR-008: add Proposal Accept tracking fields (source_proposal_id, source_essential_id)
- Add source_proposal_id and source_essential_id FK columns to Task model
- Populate tracking fields during Proposal Accept task generation
- Add generated_tasks relationship on Proposal model for reverse lookup
- Expose source_proposal_id/source_essential_id in TaskResponse schema
- Add GeneratedTaskBrief schema and include generated_tasks in ProposalDetailResponse
- Proposal detail endpoint now returns generated story tasks with status
2026-03-30 10:46:20 +00:00
zhi
089d75f953 BE-PR-003: Add Essential SQLAlchemy model
- New app/models/essential.py with Essential model and EssentialType enum
  (feature, improvement, refactor)
- Fields: id, essential_code (unique), proposal_id (FK to proposes),
  type, title, description, created_by_id (FK to users), created_at, updated_at
- Added essentials relationship to Proposal model (cascade delete-orphan)
- Added essentials table auto-migration in main.py _migrate_schema()
- Registered essential module import in startup()
2026-03-29 16:33:00 +00:00
zhi
119a679e7f BE-PR-002: Proposal model naming & field adjustments
- Add comprehensive docstring to Proposal model documenting all relationships
- Add column comments for all fields (title, description, status, project_id, etc.)
- Mark feat_task_id as DEPRECATED (will be replaced by Essential->task mapping in BE-PR-008)
- Add proposal_code hybrid property as preferred alias for DB column propose_code
- Update ProposalResponse schema to include proposal_code alongside propose_code
- Update serializer to emit both proposal_code and propose_code for backward compat
- No DB migration needed -- only Python-level changes
2026-03-29 16:02:18 +00:00
zhi
cfacd432f5 BE-PR-001: Rename Propose -> Proposal across backend
- New canonical model: Proposal, ProposalStatus (app/models/proposal.py)
- New canonical router: /projects/{id}/proposals (app/api/routers/proposals.py)
- Schemas renamed: ProposalCreate, ProposalUpdate, ProposalResponse, etc.
- Old propose.py and proposes.py kept as backward-compat shims
- Legacy /proposes API still works (delegates to /proposals handlers)
- DB table name (proposes), column (propose_code), and permission names
  (propose.*) kept unchanged for zero-migration compat
- Updated init_wizard.py comments
2026-03-29 15:35:23 +00:00
zhi
86911286c0 feat: add code-based meetings router with participant/attend support
- New dedicated meetings.py router with full CRUD (list/get/create/update/delete)
- All endpoints accept meeting_code or numeric id
- MeetingParticipant model for tracking meeting attendance
- POST /meetings/{id}/attend adds current user to participant list
- Serialization includes participants list, project_code, milestone_code
- Creator auto-added as participant on meeting creation
- Registered in main.py alongside existing routers
2026-03-21 19:18:20 +00:00
zhi
271d5140e6 feat(users): switch account management to single-role model
- add users.role_id for one global role per account
- seed protected account-manager role with account.create permission
- default new accounts to guest role
- block admin role assignment through user management
- allow account-manager permission to create accounts
2026-03-21 08:44:19 +00:00
zhi
14dcda3cdc feat(monitor): store nginx telemetry for generic clients
- accept nginx installation status and sites-enabled list
- persist nginx fields in server state
- expose nginx data in monitor overview/admin views
- auto-migrate new server_states columns on startup
2026-03-20 10:03:56 +00:00
zhi
8e0f158266 refactor(monitor): remove deprecated challenge flow
- Remove challenge issuance endpoint
- Remove monitor websocket challenge handshake flow
- Remove challenge/nonce runtime models
- Keep API key as the only server auth path
2026-03-20 07:42:43 +00:00
zhi
97f12cac7a feat(monitor): store plugin version separately from openclaw version
- Add server_states.plugin_version column
- Keep openclaw_version for remote OpenClaw runtime version
- Expose plugin_version in monitor server view
- Accept and persist plugin_version in heartbeat payloads
2026-03-20 07:23:18 +00:00
zhi
c70f90cb52 feat(monitor): add API Key authentication for server heartbeat
- Add api_key field to MonitoredServer model with unique index
- Add migration to create api_key column
- Add POST /admin/servers/{id}/api-key for key generation
- Add DELETE /admin/servers/{id}/api-key for key revocation
- Add POST /server/heartbeat-v2 with X-API-Key header auth
- TelemetryPayload includes load_avg and uptime_seconds
2026-03-19 18:17:50 +00:00
zhi
43742f69da fix: add values_callable to all SQLAlchemy Enum columns
SQLAlchemy 2.0 defaults to mapping Python enum *names* (OPEN, CLOSED)
to DB values, but MySQL stores lowercase *values* (open, closed).
This mismatch causes LookupError on read.

Adding values_callable=lambda x: [e.value for e in x] tells SQLAlchemy
to use the enum values for DB mapping.

Affected models: milestone, task, meeting, propose, support
2026-03-19 09:38:37 +00:00
zhi
ec91a15f65 fix(P7.1): remove TaskType.TASK from models.py + fix milestone task defaults (issue/pending) 2026-03-17 23:01:02 +00:00
zhi
89e3bcdd0f feat(P7.1): remove task_type='task' — migrate to issue/defect, update defaults and DB migration 2026-03-17 16:05:32 +00:00
zhi
2bea75e843 feat: add Propose model/schema + DB enum migration scripts
- New Propose model (app/models/propose.py) with status enum (open/accepted/rejected)
- New Propose schemas (ProposeCreate/Update/Response) in schemas.py
- MySQL enum migration in main.py for milestone/task status columns
  - milestone: pending→open, deferred→closed, progressing→undergoing
  - task: progressing→undergoing
- Import propose model in startup for create_all
- Add started_at column migration for milestones
2026-03-17 02:04:42 +00:00
zhi
9e22c97ae8 refactor: update milestone/task status enums to new state machine values
Milestone: open/freeze/undergoing/completed/closed (was open/pending/deferred/progressing/closed)
Task: open/pending/undergoing/completed/closed (was open/pending/progressing/closed)

- Add MilestoneStatusEnum to schemas with typed validation
- Add started_at field to Milestone model
- Update all router/CLI references from progressing->undergoing
- Add completed status handling in task transition logic
2026-03-17 00:04:29 +00:00
zhi
9e14df921e feat: add modal-edit permissions for projects milestones and tasks 2026-03-16 18:13:54 +00:00
zhi
214a9b109d refactor: replace issues backend with milestone tasks 2026-03-16 13:22:14 +00:00
Zhi
a1a99bb838 feat: add code fields - milestoneCode, taskCode, supportCode, meetingCode 2026-03-12 22:48:04 +00:00
Zhi
5297711c77 refactor: split tasks/supports/meetings into separate tables 2026-03-12 22:26:24 +00:00
Zhi
5a76f61692 fix: remove leftover code in get_issue 2026-03-12 22:01:55 +00:00
Zhi
6fe5e5ddb3 feat: add task fields - task_code, estimated_effort, etc 2026-03-12 21:54:16 +00:00
Zhi
d76328923c feat: milestone enhancements - new fields, task/support/meeting endpoints, progress 2026-03-12 14:25:51 +00:00
Zhi
c695ef903f fix: rbac ProjectMember reference, add repo field to Project 2026-03-12 12:04:51 +00:00
Zhi
74177915df feat: add configurable role/permission system 2026-03-12 11:41:55 +00:00
Zhi
1eb90cd61c fix: project create schema - owner_name auto-fill from owner_id, sub/related projects as list 2026-03-12 10:52:46 +00:00
zhi
d5bf47f4fc fix: quote enum values and csv export subtype 2026-03-12 09:37:19 +00:00
zhi
e5775bb9c8 feat: add project code generation + remove issues/milestones from nav 2026-03-12 09:25:26 +00:00
zhi
6b3e42195d feat: add task type hierarchy with subtypes (issue/meeting/support/maintenance/research/review/story/test) 2026-03-11 23:55:52 +00:00
zhi
464bccafd8 feat: add 10m server challenge flow and websocket telemetry channel 2026-03-11 12:41:32 +00:00
zhi
d299428d35 feat: add public monitor API + admin provider/server management scaffold 2026-03-11 11:59:53 +00:00
Zhi
703103af91 feat: time tracking / work logs (create, list, summary, project summary, CLI commands) 2026-02-23 05:11:52 +00:00
Zhi
0a8b18729b feat: notifications system, webhook retry, issue assign endpoint, CLI milestones/notifications/overdue commands 2026-02-23 00:11:26 +00:00
Zhi
7485f29ada feat: milestones, due dates, overdue filter, CSV export 2026-02-22 19:12:35 +00:00
Zhi
a63afa073d feat: activity log model + API (audit trail) 2026-02-22 09:06:37 +00:00
Zhi
1e9c6fd2f8 feat: API key auth for agents (create/list/revoke) + dual auth (JWT or API key) 2026-02-22 09:05:05 +00:00
Zhi
149f2d868f feat: add webhook + webhook_log models 2026-02-22 02:40:57 +00:00
Zhi
81e1a2fc58 feat: add JWT auth (login/me), fix bcrypt version, add .gitignore 2026-02-21 12:11:06 +00:00
root
fd980c0344 refactor: move all files to root (no nested backend/) 2026-02-21 08:25:37 +00:00