TRELLIS1 迁移 Trellis 主导开发流程

这个提交包含在:
2026-05-26 09:28:51 +08:00
父节点 7c65d418f3
当前提交 e7baa6c234
共修改 114 个文件,包含 14684 行新增和 178 行删除
+18
查看文件
@@ -0,0 +1,18 @@
# Approval And Workflow
## Source Docs
Read `docs/需求-统一审批中心规约.md` and the latest workflow-related Issue CSV
before modifying approval behavior.
## Rules
- No self-approval.
- Do not use `admin` as a business approver unless the Issue explicitly defines
an administrative fallback.
- Approval precheck, submission, workflow snapshot and task advancement must use
consistent rule semantics.
- Existing workflow snapshots are historical facts; approval advancement should
not drift because rules changed later.
- Reviewer review is required after changes touching workflow, status machine,
approval rules, permissions or migrations.
@@ -0,0 +1,24 @@
# Backend Fastify / Prisma
## Scope
Server work lives under `server/`. Prefer existing route, service, utility and
QA script patterns over new abstractions.
## Rules
- Validate Prisma changes with `cd server && npm run prisma:validate`.
- For route/service edits, run `node --check` on the touched files and the
focused regression listed in the Issue CSV.
- Prisma migrations require rollback notes in Issue `Notes`.
- Do not resolve migration drift, reset databases, or rewrite migration history
without explicit approval.
- Workflow, approval and permission behavior must be verified at process level,
not only syntax level.
## Common Checks
- `cd server && node --check src/routes/reimbursements.js`
- `cd server && node --check src/routes/workflow.js`
- `cd server && ./scripts/regression-workflow-actions.sh`
- `cd server && ./scripts/regression-all.sh`
@@ -0,0 +1,17 @@
# Deployment / Trial Run
## Public OA Boundary
Public OA is quasi-production. Deployments, remote config changes and live data
operations require explicit approval and evidence.
## Rules
- Use `SYNC_ENV=0 bash deploy/trialrun/deploy.sh` only when deployment is
approved; do not overwrite remote `.env`.
- After deployment, report commit hash, `/ready`, public smoke results and
whether the user can test.
- Real business writes are manual unless an Issue explicitly authorizes a
controlled test write.
- Do not execute real payments, import bank statements, connect payment
providers or write ERP without a separate approved Issue.
+17
查看文件
@@ -0,0 +1,17 @@
# Docs And Evidence
## Source Docs
Start from `docs/文档索引.md` and `docs/文档事实源状态矩阵.md`.
## Rules
- Prefer updating existing fact sources, module specs, manuals, evidence docs
or continuous Issue CSVs.
- New documents need a reason and must be registered in both the index and
status matrix.
- Old Issue CSV files are historical audit evidence and should not be rewritten
unless the current Issue explicitly says so.
- For generated evidence, store report paths and conclusions, not raw secrets,
raw payloads, full account identifiers, invoice originals or confidential
business content.
@@ -0,0 +1,23 @@
# Frontend React / Vite / Design
## Source Of Truth
UI work must read `docs/产品设计规则.md` first and align with the Hyinda brand
style. For PC/mobile/WeCom pages, add Playwright or visual verification when
reasonable.
## Rules
- Use existing React/Vite/Tailwind patterns and shared components before adding
page-local UI systems.
- PC pages should keep dense but orderly OA layouts: clear header, filters,
table/list, status, details and predictable actions.
- Mobile pages must use the unified mobile shell, card/list rows, safe-area and
sticky action patterns from the design rules.
- Do not add decorative landing-page styling to operational OA pages.
- Run `cd client && npm run typecheck && npm run build` for frontend changes.
## Frozen / Boundary Items
Frozen modules and Enterprise WeChat-owned HR/attendance entries must be labeled
or hidden according to the active Issue; do not silently re-enable them.
+25
查看文件
@@ -0,0 +1,25 @@
# hyb-oa Project Specs
These specs are the Trellis entry point for hyb-oa. They summarize stable
development rules and point back to the authoritative Issue CSV and `docs/`
fact sources.
## Read Order
1. `project-governance.md`
2. The domain file matching the task.
3. `docs/文档索引.md` and the latest relevant Issue CSV.
## Domain Specs
| Spec | Purpose |
| --- | --- |
| `project-governance.md` | Trellis-first flow, Issue CSV contract, approvals, commit rules |
| `backend-fastify-prisma.md` | Server implementation and migration boundaries |
| `frontend-react-vite-design.md` | React/Vite UI and design-source rules |
| `approval-workflow.md` | OA approval/workflow/self-approval boundaries |
| `reimbursement-invoice-ocr.md` | Reimbursement, invoice, OCR and attachment rules |
| `wecom-boundary.md` | Enterprise WeChat ownership and API/write gates |
| `deployment-trialrun.md` | Public deployment, smoke, live-readiness and rollback gates |
| `docs-and-evidence.md` | Documentation reuse, evidence, Issue CSV and status matrix |
| `security-privacy.md` | Privacy, secret handling and sensitive-data exclusions |
@@ -0,0 +1,31 @@
# Project Governance
## Main Rule
Trellis is the development workflow coordinator. Issue CSV remains the execution
contract and `docs/` remains the business fact source.
## Required Flow
- Start non-trivial work from a Trellis task with a PRD.
- Bind the task to an Issue CSV path and Issue ID before implementation.
- Give a concrete implementation plan before coding and wait for approval.
- Keep edits scoped to the current Issue.
- Update Issue statuses only after the stated Test_Method passes.
- Commit in Chinese and include the Issue ID.
## Stop Conditions
- Production config, deployment, database reset, migration drift, real data
writes, Enterprise WeChat writes, payment actions, or destructive cleanup need
explicit approval.
- Permission model, status machine, workflow engine, migration or approval-rule
changes require read-only reviewer review after implementation.
## Current Local Commands
- `python3 <plan-skill>/scripts/validate_issues_csv.py <csv>`
- `node scripts/qa/check-process-contract.mjs --baseline --json`
- `node scripts/qa/check-trellis-governance.mjs`
- `git diff --check`
- `bash scripts/check-minimal.sh`
@@ -0,0 +1,16 @@
# Reimbursement / Invoice / OCR
## Source Docs
Read `docs/报销发票附件规则.md` before changing reimbursement, invoice, OCR,
duplicate detection or attachment behavior.
## Rules
- PDF invoice OCR is the maintained main path.
- Image OCR remains frozen unless a later Issue explicitly reopens it.
- Do not write raw invoice images, sensitive form values or full OCR payloads to
repo docs, Issue CSV, Trellis task files or chat.
- Reimbursement flow tests should cover upload/OCR, duplicate handling,
submission, approval, payment batch, receipt attachment and AP export when the
Issue scope touches those areas.
+19
查看文件
@@ -0,0 +1,19 @@
# Security And Privacy
## Never Store In Repo / Trellis / Chat
- Passwords, token, Secret, private keys, EncodingAESKey.
- Full personal accounts, full phone numbers, full email addresses where not
required for local config.
- Raw invoice images, contract bodies, bank statement originals, payment
credentials, sensitive quotes, cost details.
- Complete local paths to confidential company directories.
- Enterprise WeChat raw payloads, full `sp_no`, full template IDs, full userid,
form values, attachments or comments.
## Trellis-Specific Rules
- `.trellis/workspace/` is local-only by default.
- `.trellis/tasks/` may contain PRD and acceptance context, but only in
redacted form.
- `scripts/qa/check-trellis-governance.mjs` must pass before commit.
+19
查看文件
@@ -0,0 +1,19 @@
# Enterprise WeChat Boundary
## Ownership
Enterprise WeChat owns mature HR/attendance actions: check-in, leave, missed
punch, outing, overtime and related mobile entry. OA owns reimbursement,
procurement, contracts, projects, payments, invoices, sensitive attachments and
operating audit.
## Rules
- Enterprise WeChat API checks that need trusted IP must run from the deployment
server, not local.
- Do not write Enterprise WeChat, create templates, create approvals, expand
real users, or enable live trials without explicit approval and an Issue CSV.
- Approval-rule configuration cannot be fully read through official APIs; keep
manual backend/real-device gates where specified.
- Messages to Enterprise WeChat must be dehydrated and link back to OA; do not
send sensitive attachments or business documents into native WeCom approvals.