dev-2026-03-29 #7

Merged
hzhang merged 60 commits from dev-2026-03-29 into main 2026-04-05 22:11:44 +00:00
Contributor
No description provided.
hzhang added 59 commits 2026-04-01 12:55:47 +00:00
- 明确 Calendar 为独立功能线,Proposal/Essential 为项目结构调整线
- 明确两条线交叉点仅限 event_data / Agent 调度引用层
- 区分必须本波完成 vs 仅设计保留内容
- 新增 docs/wave-2026-03-scope.md
- Document Propose → Proposal naming changes across all layers
- Document Proposal Accept semantic change (single task → Essential-based batch)
- Document story/* restricted expansion and impact analysis
- Document feat_task_id deprecation and backward compatibility strategy
- Document migration execution order and rollback plan
- 后端验收项: 数据模型、Slot ID 策略与物化、验证规则、不可变性、Calendar API、Agent/心跳协作
- 前端验收项: 页面骨架、日程展示、计划展示、操作交互、状态提示、权限
- CLI 验收项: 命令组、日程/计划操作命令、输出格式、用户创建扩展
- 插件联动验收项: 心跳请求、唤醒逻辑、状态管理、ScheduledGatewayRestart
- 跨模块集成验收项
- Backend: new canonical Proposal model + /proposals router
- Backward-compat shims for old Propose imports and /proposes API
- Tests updated to use /proposals, legacy compat tests added
- Impact checklist: docs/BE-PR-001-rename-impact.md
- TASKLIST.md: BE-PR-001 marked complete

All 21 proposal tests pass.
- 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
- 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()
- New router: /projects/{project_id}/proposals/{proposal_id}/essentials
  - GET    (list)   - list all essentials under a proposal
  - POST   (create) - create essential with auto-generated EssentialCode
  - GET    /{id}    - get single essential by id or essential_code
  - PATCH  /{id}    - update essential (title, type, description)
  - DELETE /{id}    - delete essential
- All mutations restricted to open proposals only
- Permission: creator, project owner, or global admin
- Registered essentials router in main.py
- Updated GET /proposals/{id} to return ProposalDetailResponse with
  embedded essentials list
- Activity logging on all CRUD operations
Decision: retain DB column, mark DEPRECATED. Existing rows still return
feat_task_id via API. New accept flow (BE-PR-007) does not write it.
Clients should migrate to generated_tasks / Task.source_proposal_id.

- Backend: model/schema/router deprecation comments updated
- Backend: added docs/BE-PR-010-feat-task-id-deprecation.md
- Tests: updated to work with Essential-based accept flow
- Tests: all 21 proposal tests pass
- TASKLIST: BE-PR-010 marked complete
- Updated HarborForge.Backend submodule (test infra fix + 29 passing tests)
- Marked BE-PR-011 complete in TASKLIST.md
- Virtual slot ID: plan-{plan_id}-{YYYY-MM-DD} format with parse/make helpers
- Plan-date matching: on_month/on_week/on_day hierarchy with week_of_month calc
- Materialization: convert virtual slot to real TimeSlot row, copy plan template
- Detach: clear plan_id after edit/cancel to break plan association
- Bulk materialization: materialize_all_for_date for daily pre-compute
- 23 tests covering all paths (matching, virtual gen, materialize, detach, bulk)
- Add TimeSlotCreate, TimeSlotResponse, TimeSlotCreateResponse schemas
- Add SlotConflictItem, SlotTypeEnum, EventTypeEnum, SlotStatusEnum to schemas
- Add POST /calendar/slots endpoint with:
  - Overlap detection (409 on conflict)
  - Workload warning computation (advisory, returned in response)
  - Support for event_type + event_data (job/system/entertainment)
  - Default date to today if not provided
- Add _slot_to_response helper for ORM -> schema conversion
- Add GET /calendar/day endpoint with optional ?date= query param
- Returns unified CalendarDayResponse merging real slots + virtual plan slots
- New CalendarSlotItem schema supports both real (id) and virtual (virtual_id) slots
- Excludes inactive slots (skipped/aborted) from results
- All slots sorted by scheduled_at ascending
- Add TimeSlotEdit schema (partial update, all fields optional)
- Add TimeSlotEditResponse schema
- Add PATCH /calendar/slots/{slot_id} for editing real slots
- Add PATCH /calendar/slots/virtual/{virtual_id} for editing virtual slots
  - Triggers materialization before applying edits
  - Detaches from plan after edit
- Both endpoints enforce:
  - Past-slot immutability guard
  - Overlap detection (excluding self)
  - Plan detachment on edit
  - Workload warnings in response
- Add POST /calendar/slots/{slot_id}/cancel for real slot cancellation
- Add POST /calendar/slots/virtual/{virtual_id}/cancel for virtual slot cancellation
- Virtual cancel materializes the slot first, then marks as Skipped
- Both endpoints enforce past-slot immutability guard
- Both endpoints detach from plan (set plan_id=NULL)
- Status set to SlotStatus.SKIPPED on cancel
- Add TimeSlotCancelResponse schema
- Import guard_cancel_real_slot and guard_cancel_virtual_slot
- Add SchedulePlanCreate, SchedulePlanResponse, SchedulePlanListResponse schemas
- Add DayOfWeekEnum, MonthOfYearEnum schema enums
- Add POST /calendar/plans endpoint (create plan with hierarchy validation)
- Add GET /calendar/plans endpoint (list plans, optional include_inactive)
- Add GET /calendar/plans/{plan_id} endpoint (get single plan)
- Mark BE-CAL-API-005 complete in TASKLIST.md
- PATCH /calendar/plans/{plan_id}: edit a recurring schedule plan
  - Validates period-parameter hierarchy after merge
  - Rejects edits to inactive (cancelled) plans
  - Detaches future materialized slots so they keep old data
  - Past materialized slots remain untouched

- POST /calendar/plans/{plan_id}/cancel: cancel (soft-delete) a plan
  - Sets is_active=False
  - Detaches future materialized slots (plan_id -> NULL)
  - Preserves past materialized slots, returns their IDs

- Added SchedulePlanEdit and SchedulePlanCancelResponse schemas
- Imported guard_plan_edit/cancel_no_past_retroaction from slot_immutability
- FE-PR-003: Essential create/edit modal with type selector and partial refresh already implemented in ProposalDetailPage
- FE-PR-004: Accept modal with milestone selector and generated tasks display already implemented
- FE-PR-005: Remove 'story' from TASK_TYPES in CreateTaskPage and CreateTaskModal - all story/* must come from Proposal Accept workflow
Update HarborForge.OpenclawPlugin to commit 55d7d11:
- plugin/calendar/types.ts: heartbeat request/response TypeScript types
- plugin/calendar/calendar-bridge.ts: CalendarBridgeClient HTTP client
- plugin/calendar/index.ts: module exports
- docs/PLG-CAL-001-calendar-heartbeat-format.md: full format specification
- plugin/openclaw.plugin.json: calendar config options

Ref: HarborForge.NEXT_WAVE_DEV_DIRECTION.md §6, PLG-CAL-001
- PLG-CAL-001: Calendar heartbeat format — all 3 sub-items completed:
  claw_identifier 传递方式 / agent_id 传递方式 / slot 列表结构
- Spec documented in HarborForge.OpenclawPlugin/docs/PLG-CAL-001-calendar-heartbeat-format.md
- Update TASKLIST.md to mark PLG-CAL-002 as completed
- Plugin submodule updated with scheduler implementation
- Update submodule to include state persistence and restart handling
- Mark PLG-CAL-004 tasks as complete in TASKLIST.md
- Essential 列表与表单 ✓
- Accept milestone 选择 ✓
- story 创建入口限制 ✓
orion added 1 commit 2026-04-03 16:25:50 +00:00
hzhang merged commit afb190003e into main 2026-04-05 22:11:44 +00:00
hzhang deleted branch dev-2026-03-29 2026-04-05 22:11:45 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: zhi/HarborForge#7