Compare commits

..

66 Commits

Author SHA1 Message Date
086c6d8be6 docs: rewrite top-level README — full component map
List all 7 submodules with stack/role, correct architecture and ports,
replace stale Issues model with tasks/milestones/proposals, add Security
notes (mandatory strong SECRET_KEY) and cross-links to component READMEs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 17:50:52 +01:00
081706f735 quick fix 2026-04-15 07:14:36 +01:00
zhi
3e9f91f54b chore: update HarborForge.Test submodule pointer to main head 2026-04-05 22:18:03 +00:00
zhi
671db14797 chore: update HarborForge submodule pointers 2026-04-05 22:14:41 +00:00
h z
afb190003e Merge pull request 'dev-2026-03-29' (#7) from dev-2026-03-29 into main
Reviewed-on: #7
2026-04-05 22:11:44 +00:00
72d08a3c56 chore: bump HarborForge component pointers for code-first indexing 2026-04-03 16:25:48 +00:00
zhi
1efd77f07a TEST-CLI-CAL-001 TEST-CLI-PR-001 complete CLI test tasks 2026-04-01 12:03:37 +00:00
zhi
9fc0b4934e TEST-FE-PR-001: Mark task as completed
- Essential 列表与表单 ✓
- Accept milestone 选择 ✓
- story 创建入口限制 ✓
2026-04-01 11:41:56 +00:00
zhi
d5d0fa3223 TEST-FE-CAL-001 complete calendar frontend test coverage 2026-04-01 11:06:05 +00:00
zhi
e30a65b8b5 TEST-BE-CAL-001 record calendar backend test completion 2026-04-01 10:35:57 +00:00
zhi
f984a81f86 TEST-BE-PR-001 verify backend proposal tests 2026-04-01 10:04:50 +00:00
zhi
4a51fb10f7 PLG-CAL-004: Mark task as complete - ScheduledGatewayRestart handling
- Update submodule to include state persistence and restart handling
- Mark PLG-CAL-004 tasks as complete in TASKLIST.md
2026-04-01 09:41:24 +00:00
zhi
9aa385db8c PLG-CAL-003 complete plugin deferred replanning 2026-04-01 08:52:16 +00:00
zhi
fea3c05999 PLG-CAL-002: Mark task as complete
- Update TASKLIST.md to mark PLG-CAL-002 as completed
- Plugin submodule updated with scheduler implementation
2026-04-01 08:45:38 +00:00
zhi
f3f85a4b32 chore: mark PLG-CAL-001 complete in TASKLIST.md
- 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
2026-04-01 07:52:39 +00:00
zhi
7ca3bbb668 feat(OpenclawPlugin): PLG-CAL-001: Calendar heartbeat format — submodule update
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
2026-04-01 07:52:07 +00:00
zhi
54c416c01d CLI-CAL-001/002/003/004/005/006/007/008/009/010: Calendar CLI commands 2026-04-01 07:02:47 +00:00
zhi
087e477395 CLI-PR-001/002/003/004: Proposal rename, Essential commands, story restriction 2026-04-01 06:56:30 +00:00
zhi
113b2757ee FE-CAL-004/005: Calendar create/edit/cancel + status warnings 2026-04-01 06:50:11 +00:00
zhi
0418ce7f0b FE-CAL-001/002/003: Calendar page skeleton with slot list and plans view 2026-04-01 06:48:22 +00:00
zhi
88a5d94d12 Update Frontend submodule: FE-PR-005 story restriction 2026-04-01 06:46:27 +00:00
zhi
ce84a5387a FE-PR-003/004/005: Mark existing Essential forms & Accept modal done; remove story from task creation
- 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
2026-04-01 06:46:01 +00:00
zhi
ad0d1675b0 FE-PR-002: Mark task as completed in TASKLIST.md 2026-04-01 06:28:52 +00:00
zhi
0596043b47 FE-PR-002: Update Frontend submodule for Essential list feature 2026-04-01 06:25:54 +00:00
zhi
a8d40134af FE-PR-001: Update Frontend submodule - Propose -> Proposal rename 2026-04-01 04:46:50 +00:00
zhi
c40774199e BE-AGT-004 complete exhausted recovery parsing 2026-04-01 04:18:48 +00:00
zhi
1c87e24ea9 BE-AGT-003: mark task complete, update Backend submodule ref 2026-04-01 02:50:20 +00:00
zhi
e758f977fc BE-AGT-002: mark task complete, update Backend submodule ref 2026-04-01 00:46:23 +00:00
zhi
c4d2b836ca BE-AGT-001: mark task complete, update backend submodule 2026-03-31 23:01:52 +00:00
zhi
6bcea047db BE-CAL-API-007: update submodule ref and mark task complete 2026-03-31 20:46:53 +00:00
zhi
13d13a0f5e BE-CAL-API-006: implement plan-edit and plan-cancel API endpoints
- 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
2026-03-31 16:46:22 +00:00
zhi
3a65c94764 Update Backend submodule: BE-CAL-API-005 2026-03-31 14:47:21 +00:00
zhi
b5163d5e0f BE-CAL-API-005: implement plan-schedule / plan-list API
- 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
2026-03-31 14:46:45 +00:00
zhi
16bcd94027 BE-CAL-API-004: Implement Calendar cancel API for real and virtual slots
- 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
2026-03-31 12:47:56 +00:00
zhi
e561298c97 BE-CAL-API-003: implement Calendar edit API for real and virtual slots
- 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
2026-03-31 10:46:19 +00:00
zhi
7e3acf80ce BE-CAL-API-002: Implement calendar day-view query API
- 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
2026-03-31 07:19:01 +00:00
zhi
77d8f6098f BE-CAL-API-001: Update submodule ref + mark task complete 2026-03-31 05:46:03 +00:00
zhi
18e50156df BE-CAL-API-001: Implement single slot creation API
- 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
2026-03-31 05:45:51 +00:00
zhi
bc1a427f22 BE-CAL-007 + BE-CAL-008: mark completed, update Backend submodule 2026-03-31 04:16:58 +00:00
zhi
5b9d2618ad BE-CAL-006: mark overlap detection task complete in TASKLIST 2026-03-31 01:18:01 +00:00
zhi
eece0773cb Update Backend submodule: BE-CAL-005 plan virtual-slot materialization 2026-03-30 23:47:15 +00:00
zhi
3e1fe5cc79 BE-CAL-005: Implement plan virtual-slot identification and materialization
- 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)
2026-03-30 23:46:51 +00:00
zhi
d12a46b2a3 BE-CAL-004: update submodule pointer + mark task complete in TASKLIST 2026-03-30 22:27:15 +00:00
zhi
c01881ade0 BE-CAL-003: Agent model with status/heartbeat/exhausted fields (backend submodule) 2026-03-30 20:47:56 +00:00
zhi
35045a9490 Mark BE-CAL-002 complete in TASKLIST.md 2026-03-30 19:16:33 +00:00
zhi
ea9f12b9b1 BE-CAL-001: Mark TimeSlot model task complete, update Backend submodule 2026-03-30 17:45:22 +00:00
zhi
2d5e055fc8 BE-PR-011: Mark Proposal/Essential/Story restricted tests complete
- Updated HarborForge.Backend submodule (test infra fix + 29 passing tests)
- Marked BE-PR-011 complete in TASKLIST.md
2026-03-30 16:17:16 +00:00
zhi
52530486d1 BE-PR-010: clean up feat_task_id semantics — deprecate with read-only compat
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
2026-03-30 12:50:14 +00:00
zhi
f61b5ee17f BE-PR-009: restrict all story/* task types + fix test conftest imports 2026-03-30 11:46:28 +00:00
zhi
93fe52750c Mark BE-PR-008 complete in TASKLIST.md 2026-03-30 10:46:38 +00:00
zhi
051183bbe7 Update Backend submodule: BE-PR-008 tracking fields 2026-03-30 10:46:28 +00:00
zhi
988cfcec4d BE-PR-007: mark task complete, update Backend submodule ref 2026-03-30 07:46:28 +00:00
zhi
6493e72d80 Update Backend submodule ref for BE-PR-006 2026-03-30 07:16:34 +00:00
zhi
23052db117 BE-PR-006: Add Essential CRUD API under Proposals
- 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
2026-03-30 07:16:21 +00:00
zhi
5be0f11aac Update Backend submodule ref for BE-PR-005 2026-03-30 06:45:30 +00:00
zhi
5d20df11e9 BE-PR-005: Add Essential schema definitions (create/update/response) and ProposalDetailResponse with nested essentials 2026-03-30 06:45:06 +00:00
zhi
b688ebd35d BE-PR-004: implement EssentialCode encoding rules (submodule update) 2026-03-30 06:16:05 +00:00
zhi
1cdd05d554 BE-PR-003: Update Backend submodule ref + mark task complete 2026-03-29 16:33:10 +00:00
zhi
5ee79e5c5e 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:32:40 +00:00
zhi
598900650d chore: update Backend submodule pointer (BE-PR-002) 2026-03-29 16:02:22 +00:00
zhi
ac585b09b1 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:07 +00:00
zhi
55ac776462 BE-PR-001: Rename Propose -> Proposal across backend
- 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.
2026-03-29 15:35:59 +00:00
zhi
339f9aa126 DOC-003: 整理 Calendar 验收清单
- 后端验收项: 数据模型、Slot ID 策略与物化、验证规则、不可变性、Calendar API、Agent/心跳协作
- 前端验收项: 页面骨架、日程展示、计划展示、操作交互、状态提示、权限
- CLI 验收项: 命令组、日程/计划操作命令、输出格式、用户创建扩展
- 插件联动验收项: 心跳请求、唤醒逻辑、状态管理、ScheduledGatewayRestart
- 跨模块集成验收项
2026-03-29 15:01:35 +00:00
zhi
c2b11248d7 DOC-002: Proposal/Essential/Story restricted migration guide
- 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
2026-03-29 14:32:23 +00:00
zhi
d6ed523731 DOC-001: 整理本波开发范围说明
- 明确 Calendar 为独立功能线,Proposal/Essential 为项目结构调整线
- 明确两条线交叉点仅限 event_data / Agent 调度引用层
- 区分必须本波完成 vs 仅设计保留内容
- 新增 docs/wave-2026-03-scope.md
2026-03-29 14:01:10 +00:00
d7029a1cc7 Merge pull request 'chore/archive-plans-and-next-wave-doc' (#6) from chore/archive-plans-and-next-wave-doc into main
Reviewed-on: #6
2026-03-29 11:45:01 +00:00
10 changed files with 82 additions and 106 deletions

3
.gitmodules vendored
View File

@@ -24,6 +24,3 @@
path = HarborForge.Cli path = HarborForge.Cli
url = https://git.hangman-lab.top/zhi/HarborForge.Cli.git url = https://git.hangman-lab.top/zhi/HarborForge.Cli.git
branch = main branch = main
[submodule "HarborForge.PlexumPlugin"]
path = HarborForge.PlexumPlugin
url = https://git.hangman-lab.top/zhi/HarborForge.PlexumPlugin.git

166
README.md
View File

@@ -1,148 +1,128 @@
# HarborForge # HarborForge
Agent / human collaborative task-management platform — manages the full Agent / 人类协同任务管理平台 —— 用严格的状态机管理 提案 → 里程碑 → 任务 的完整生命周期,配套 CLI、监控与 OpenClaw 集成。
proposal → milestone → task lifecycle with strict state machines, plus a
CLI, monitoring, and OpenClaw integration.
## Repository layout ## 项目结构
This is the umbrella repository; every component is a git submodule: 本仓库是 umbrella 仓库,所有组件以 git 子模块形式组织:
``` ```
HarborForge/ HarborForge/
├── AbstractWizard/ # Go, secure first-time setup service (SSH tunnel, port 8080) ├── AbstractWizard/ # Go安全初始化服务SSH 隧道,端口 8080
├── HarborForge.Backend/ # Python/FastAPI, core REST API + RBAC (port 8000) ├── HarborForge.Backend/ # Python/FastAPI,核心 REST API + RBAC(端口 8000
├── HarborForge.Frontend/ # React + TypeScript + Vite single-page app (port 3000) ├── HarborForge.Frontend/ # React + TypeScript + Vite,单页前端(端口 3000
├── HarborForge.Cli/ # Go command-line client `hf` ├── HarborForge.Cli/ # Go,命令行客户端 `hf`
├── HarborForge.Monitor/ # Go host telemetry client (optional local bridge 9100) ├── HarborForge.Monitor/ # Go,主机遥测客户端(可选本地 bridge 9100
├── HarborForge.OpenclawPlugin/ # Node OpenClaw plugin `harbor-forge` ├── HarborForge.OpenclawPlugin/ # NodeOpenClaw 插件 `harbor-forge`
├── HarborForge.Test/ # Integration tests (backend pytest / frontend Playwright) ├── HarborForge.Test/ # 集成测试(后端 pytest / 前端 Playwright
├── docker-compose.yml # Docker orchestration ├── docker-compose.yml # Docker 编排配置
├── nginx-host.conf.example # Host nginx config example ├── nginx-host.conf.example # 宿主机 nginx 配置示例
└── .env.example # Environment variable template └── .env.example # 环境变量模板
``` ```
## Quick start ## 快速开始
```bash ```bash
# Clone and initialize all submodules # 克隆并初始化所有子模块
git clone --recurse-submodules https://git.hangman-lab.top/zhi/HarborForge.git git clone --recurse-submodules https://git.hangman-lab.top/zhi/HarborForge.git
cd HarborForge cd HarborForge
# If already cloned without submodules: # 若已克隆但未初始化子模块:
git submodule update --init --recursive git submodule update --init --recursive
# Configure environment (do NOT use the defaults — see "Security") # 配置环境变量(不要使用默认值,见“安全”一节)
cp .env.example .env cp .env.example .env
# Edit .env: set at minimum a strong random SECRET_KEY and DB passwords # 编辑 .env,至少设置强随机 SECRET_KEY 与数据库口令
# Start the services # 启动服务
docker compose up -d docker compose up -d
``` ```
## First deployment — setup wizard ## 首次部署 — 初始化向导
HarborForge uses [AbstractWizard](./AbstractWizard) for secure HarborForge 使用 [AbstractWizard](./AbstractWizard) 进行安全初始化。Wizard 仅监听 `127.0.0.1`,必须通过 SSH 隧道访问。
initialization. The wizard listens on `127.0.0.1` only and must be
reached over an SSH tunnel.
```bash ```bash
# 1. SSH tunnel: forward the wizard port to your machine # 1. SSH 隧道映射 wizard 端口到本地
ssh -L 18080:127.0.0.1:18080 user@your-server ssh -L 18080:127.0.0.1:18080 user@your-server
# 2. Open the frontend in a browser (or via the host nginx). # 2. 浏览器访问前端(或通过宿主机 nginx
# If the backend is not initialized, it redirects to the setup wizard. # 前端检测到后端未就绪 → 自动跳转初始化向导
# 3. In the wizard, configure: database connection, admin account, # 3. 在向导中配置:数据库连接、管理员账号、默认项目(可选)
# default project (optional).
# 4. Once saved, the backend detects the config and starts; refresh # 4. 配置保存后,后端自动检测到配置并启动;刷新页面 → 登录界面
# the page → login screen.
``` ```
### Startup flow ### 启动流程
``` ```
docker compose up docker compose up
├── mysql → database starts ├── mysql → 数据库启动
├── wizard → AbstractWizard starts (127.0.0.1, SSH-tunnel access) ├── wizard → AbstractWizard 启动(127.0.0.1SSH 隧道访问)
├── backend → blocks waiting for the config file (polls /config/harborforge.json) ├── backend → 阻塞等待配置文件(轮询 /config/harborforge.json
└── frontend → checks backend state └── frontend → 检测后端状态
├── backend not ready → shows the setup wizard (SSH tunnel to wizard) ├── 后端未就绪 → 显示初始化向导SSH 隧道连 wizard
└── backend ready → normal login screen └── 后端就绪 → 正常登录界面
``` ```
### Security model ### 安全模型
- The wizard port binds to `127.0.0.1` and is never exposed to the - Wizard 端口绑定 `127.0.0.1`,不暴露到外部网络;初始化必须经 SSH 隧道完成。
external network; initialization must be done over an SSH tunnel. - 配置通过 Docker volume 共享给后端(不走网络),后端以只读方式挂载。
- Config is shared with the backend via a Docker volume (never over the
network); the backend mounts it read-only.
## Deployment architecture ## 部署架构
``` ```
Host nginx (80/443) 宿主机 nginx (80/443)
├── / → frontend (Docker, port 3000) ├── / → frontend (Docker, 端口 3000)
└── /api/ → backend (Docker, port 8000) └── /api/ → backend (Docker, 端口 8000)
Internal to Docker (not exposed): Docker 内部(不对外):
wizard (127.0.0.1) → config management, SSH-tunnel access wizard (127.0.0.1) → 配置管理SSH 隧道访问
wizard_config vol → written by wizard, read-only for the backend wizard_config vol → wizard 写入,backend 只读读取
mysql (127.0.0.1) → data persistence mysql (127.0.0.1) → 数据持久化
``` ```
## Submodules ## 子模块
| Submodule | Stack | Role | | 子模块 | 技术栈 | 作用 |
|-----------|-------|------| |--------|--------|------|
| [AbstractWizard](./AbstractWizard) | Go | First-time setup wizard; atomic config writes + backups; init/readonly modes | | [AbstractWizard](./AbstractWizard) | Go | 首次安装向导,安全写配置(原子写 + 备份),init/readonly 模式 |
| [HarborForge.Backend](./HarborForge.Backend) | Python / FastAPI / SQLAlchemy / MySQL | Core API: users, projects, tasks, milestones, proposals, RBAC, webhooks, worklogs, notifications | | [HarborForge.Backend](./HarborForge.Backend) | Python / FastAPI / SQLAlchemy / MySQL | 核心 API用户、项目、任务、里程碑、提案、RBAC、Webhook、工时、通知 |
| [HarborForge.Frontend](./HarborForge.Frontend) | React 18 / TS / Vite | SPA, ~20 pages; auto-detects an uninitialized backend → setup wizard | | [HarborForge.Frontend](./HarborForge.Frontend) | React 18 / TS / Vite | SPA~20 页面;自动检测未初始化 → 引导安装向导 |
| [HarborForge.Cli](./HarborForge.Cli) | Go | Permission-aware command-line client `hf` | | [HarborForge.Cli](./HarborForge.Cli) | Go | 权限感知命令行客户端 `hf` |
| [HarborForge.Monitor](./HarborForge.Monitor) | Go | Standalone host telemetry client, heartbeat reporting | | [HarborForge.Monitor](./HarborForge.Monitor) | Go | 独立主机遥测客户端,心跳上报 |
| [HarborForge.OpenclawPlugin](./HarborForge.OpenclawPlugin) | Node / TS | OpenClaw plugin; bridges telemetry; can install the `hf` skills and calendar scheduling | | [HarborForge.OpenclawPlugin](./HarborForge.OpenclawPlugin) | Node / TS | OpenClaw 插件,桥接遥测,可安装 `hf` 技能与日历调度 |
| [HarborForge.Test](./HarborForge.Test) | pytest / Playwright | Backend and frontend integration tests | | [HarborForge.Test](./HarborForge.Test) | pytest / Playwright | 后端与前端集成测试 |
## Core domain model ## 核心业务模型
- **Milestone**: `open → freeze → undergoing → completed` (freeze - **里程碑**`open → freeze → undergoing → completed`freeze 时须恰好 1 个 release 任务)
requires exactly one release task) - **任务**issue / story / test / maintenance / research / review / resolution`pending → open → undergoing → completed`,完成须带评论
- **Task** (issue / story / test / maintenance / research / review / - **提案**:用户提 propose → 管理者 accept → 自动在里程碑内创建 feature story 任务reject 可重开
resolution): `pending → open → undergoing → completed`; completion - **RBAC**:细粒度权限 + 项目角色层级guest < viewer < member < dev < mgr < admin
requires a comment
- **Proposal**: a user proposes → a manager accepts → a feature-story
task is auto-created in a milestone; rejected proposals can reopen
- **RBAC**: fine-grained permissions + a project role hierarchy
(guest < viewer < member < dev < mgr < admin)
## Ports ## 端口
| Service | Container port | Bind | Env var | | 服务 | 容器端口 | 绑定 | 环境变量 |
|---------|----------------|------|---------| |------|----------|------|----------|
| Frontend | 3000 | see compose | `FRONTEND_PORT` | | Frontend | 3000 | compose | `FRONTEND_PORT` |
| Backend | 8000 | see compose | `BACKEND_PORT` | | Backend | 8000 | compose | `BACKEND_PORT` |
| MySQL | 3306 | 127.0.0.1 | `MYSQL_PORT` | | MySQL | 3306 | 127.0.0.1 | `MYSQL_PORT` |
| Wizard | 8080 | 127.0.0.1 | `WIZARD_PORT` | | Wizard | 8080 | 127.0.0.1 | `WIZARD_PORT` |
> The SSH-tunnel example uses local port `18080` forwarding to the > SSH 隧道示例使用本地端口 `18080` 转发到服务器 wizard。
> server-side wizard.
## Security ## 安全
Before deploying, you must: 部署前务必:
- **Set a strong random `SECRET_KEY`** (e.g. `openssl rand -hex 32`). - **设置强随机 `SECRET_KEY`**(如 `openssl rand -hex 32`)。后端在检测到弱/默认/过短密钥时会拒绝启动。
The backend refuses to start on a weak/default/short key. - 不要使用 `.env.example` 中的占位口令;为 MySQL 设置强口令。
- Not use the placeholder passwords from `.env.example`; set a strong - 不要将含真实密钥的 `.env` 提交进版本库。
MySQL password.
- Never commit a `.env` containing real secrets.
The backend's auth / RBAC / SSRF hardening is documented in the 后端的鉴权/RBAC/SSRF 加固详见 [HarborForge.Backend 的 README](./HarborForge.Backend) “Security” 一节。
"Security" section of the
[HarborForge.Backend README](./HarborForge.Backend).
## Frontend ## 前端
The frontend uses a centralized custom design system (the industrial 前端采用集中式自定义设计系统“Foundry Deck” 工业主题),细节见 [HarborForge.Frontend 的 README](./HarborForge.Frontend)。
"Foundry Deck" theme); see the
[HarborForge.Frontend README](./HarborForge.Frontend) for details.