Skip to content

Commit 29e9c97

Browse files
committed
feat: migrate fatecat to enterprise repository layout
Retire the scripts/project compatibility tree, move runtime assets into canonical enterprise roots, add governance and release gates, and preserve isolated reference snapshots under docs/reference-materials and tools/reference-repos.
1 parent f8cbd05 commit 29e9c97

6,313 files changed

Lines changed: 39499 additions & 3019 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.auto-github.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"schema_version": "auto-github.profile.v1",
3+
"repository": "fatecat",
4+
"github_identity": {
5+
"user": "tradecatlabs",
6+
"commit_name": "tradecatlabs",
7+
"commit_email": "tradecatlabs@users.noreply.github.com"
8+
},
9+
"protected_paths": [
10+
"AGENTS.md",
11+
"README.md",
12+
"SKILL.md",
13+
"CONSTITUTION.md",
14+
"governance/**",
15+
"domains/**/service.yaml",
16+
"domains/**/AGENTS.md",
17+
"domains/**/README.md",
18+
"contracts/**",
19+
"catalog/**",
20+
".github/workflows/**"
21+
],
22+
"dirty_worktree_policy": "preserve-user-changes-and-stage-only-task-scope",
23+
"blocked_operations": [
24+
"git reset --hard",
25+
"git checkout --",
26+
"git clean -fd",
27+
"git push --force"
28+
],
29+
"delivery_gates": [
30+
"git status --short --branch",
31+
"bash scripts/preflight.sh --mode pure --bootstrap --pretty",
32+
"bash scripts/acceptance.sh --with-dev",
33+
"bash scripts/export-runtime.sh --output-parent /tmp/fatecat-export --mode lite",
34+
"bash scripts/check-export-hygiene.sh /tmp/fatecat-export/fatecat",
35+
"git diff --check"
36+
]
37+
}

.dockerignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.git
2+
.github
3+
.history
4+
.venv
5+
venv
6+
__pycache__
7+
*.py[cod]
8+
.pytest_cache
9+
.ruff_cache
10+
.mypy_cache
11+
.coverage
12+
htmlcov
13+
build
14+
dist
15+
*.egg-info
16+
17+
.env
18+
.env.*
19+
!.env.example
20+
!*env.example
21+
*.log
22+
output
23+
24+
scripts/project/.venv
25+
scripts/project/.pytest_cache
26+
scripts/project/.ruff_cache
27+
scripts/project/.mypy_cache
28+
scripts/project/assets/config/.env
29+
scripts/project/assets/data/classics/raw
30+
scripts/project/assets/data/calendar/solar_terms/raw
31+
scripts/project/assets/docs/lifecycle/packs
32+
scripts/project/modules/telegram/output
33+
scripts/project/runtime/**/*.db
34+
scripts/project/runtime/**/*.sqlite
35+
36+
domains/**/output
37+
domains/**/runtime/**/*.db
38+
domains/**/runtime/**/*.sqlite
39+
infra/runtime/local-state/**/*.db
40+
infra/runtime/local-state/**/*.sqlite
41+
tools/reference-repos/**/node_modules
42+
node_modules

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.py]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{md,yml,yaml,toml,json}]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[Makefile]
18+
indent_style = tab

.github/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020

2121
## 依赖方向
2222

23-
- `.github/workflows/* -> scripts/acceptance.sh -> scripts/project/*`
23+
- `.github/workflows/* -> scripts/acceptance.sh -> scripts/common.sh runtime root resolution`
2424
- CI 只调用仓库脚本;具体质量门禁仍以 `scripts/acceptance.sh` 为单一入口。

.github/workflows/acceptance.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
with:
2121
python-version: "3.12"
2222
cache: pip
23-
cache-dependency-path: scripts/project/pyproject.toml
23+
cache-dependency-path: |
24+
pyproject.toml
25+
requirements.lock.txt
2426
2527
- name: Install system tools
2628
run: |

.gitignore

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,47 @@
55
Thumbs.db
66
*.swp
77
*.swo
8+
.idea/
9+
.vscode/
810

911
# Python cache
1012
__pycache__/
1113
*.py[cod]
1214
.pytest_cache/
1315
.ruff_cache/
1416
.mypy_cache/
17+
.coverage
18+
htmlcov/
19+
build/
20+
dist/
21+
*.egg-info/
1522

1623
# Root skill runtime outputs
1724
output/
1825
*.log
1926

27+
# Local env and secrets
28+
.env
29+
.env.*
30+
!.env.example
31+
!*env.example
32+
2033
# Local raw research/source material
21-
scripts/project/assets/data/classics/raw/
22-
scripts/project/assets/data/calendar/solar_terms/raw/
34+
domains/fate-analysis/data-products/classics/raw/
35+
domains/fate-analysis/data-products/calendar/solar_terms/raw/
2336

2437
# Lifecycle working packs
25-
scripts/project/assets/docs/lifecycle/packs/*
26-
!scripts/project/assets/docs/lifecycle/packs/.gitkeep
38+
docs/reference-materials/lifecycle/packs/*
39+
!docs/reference-materials/lifecycle/packs/.gitkeep
2740

2841
# Local virtualenvs
2942
.venv/
3043
venv/
44+
45+
# Enterprise service runtime outputs
46+
domains/*/services/*/output/
47+
domains/*/services/*/runtime/
48+
infra/runtime/local-state/**/*.db
49+
infra/runtime/local-state/**/*.sqlite
50+
infra/runtime/local-state/vendor-build/
51+
tools/reference-repos/**/node_modules/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# No Git submodules are registered.
2+
# Vendor and reference repositories must be managed through tools/reference-repos
3+
# or the existing compatibility asset registry, not implicit submodule state.

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: fatecat-structure
5+
name: FateCat structure gate
6+
entry: bash scripts/check-structure.sh
7+
language: system
8+
pass_filenames: false
9+
- id: fatecat-source-hygiene
10+
name: FateCat source hygiene
11+
entry: bash scripts/check-source-hygiene.sh
12+
language: system
13+
pass_filenames: false
14+
- id: fatecat-privacy-fixtures
15+
name: FateCat privacy fixture gate
16+
entry: bash scripts/check-privacy-fixtures.sh
17+
language: system
18+
pass_filenames: false
19+
- id: fatecat-governance
20+
name: FateCat governance strict validate
21+
entry: python3 governance/tools/validate_governance_package.py --project-root . --strict
22+
language: system
23+
pass_filenames: false
24+
- id: fatecat-diff-check
25+
name: Git whitespace diff check
26+
entry: git diff --check --cached
27+
language: system
28+
pass_filenames: false

AGENTS.md

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
1-
# AGENTS.md - FateCat Skill Repo
1+
# AGENTS.md - FateCat Enterprise Repo
22

33
## 目录用途
44

5-
当前根目录就是单 skill 仓库根:对外暴露标准 skill 入口;真实源码与生命周期资产统一收进 `scripts/project/`,保持根目录卫生。
5+
当前根目录是 FateCat 企业级系统仓库真相源:结构采用 `apps``ai``domains``platform``infra``contracts``catalog``governance``shared``tools``docs``scripts``tests` canonical roots;运行、测试、导出和治理入口全部从企业根解析。
6+
7+
项目主旨:整理综合全部预测流派,首先完善中国传统主流和有效开源仓库,复用先于自写。
68

79
## 目录结构
810

911
```text
1012
fatecat/
1113
├── AGENTS.md
14+
├── DEBUG.md
1215
├── README.md
1316
├── REVIEW.md
1417
├── SKILL.md
18+
├── apps/
19+
├── ai/
20+
├── domains/
21+
│ ├── fate-analysis/
22+
│ │ └── services/fate-core/
23+
│ │ ├── src/
24+
│ │ └── tests/
25+
│ └── experience-delivery/
26+
│ └── services/fatecat-delivery/
27+
│ ├── src/
28+
│ ├── scripts/
29+
│ └── tests/
30+
├── platform/
31+
├── infra/
32+
├── contracts/
33+
├── catalog/
34+
├── governance/
35+
├── shared/
36+
├── tools/
37+
├── docs/
38+
├── tests/
1539
├── .github/
1640
│ ├── AGENTS.md
1741
│ └── workflows/
@@ -20,8 +44,9 @@ fatecat/
2044
│ ├── commands.md
2145
│ ├── execution-playbook.md
2246
│ └── troubleshooting.md
23-
── scripts/
47+
── scripts/
2448
│ ├── acceptance.sh
49+
│ ├── check-structure.sh
2550
│ ├── check-export-hygiene.sh
2651
│ ├── check-source-hygiene.sh
2752
│ ├── clean-runtime.sh
@@ -31,32 +56,35 @@ fatecat/
3156
│ ├── production-readiness.sh
3257
│ ├── preflight.sh
3358
│ └── vendor-health.sh
34-
└── scripts/project/
35-
├── AGENTS.md
36-
├── pyproject.toml
37-
├── assets/
38-
│ └── docs/
39-
│ └── lifecycle/
40-
├── modules/
41-
├── runtime/
42-
├── scripts/
43-
└── tests/
4459
```
4560

4661
## 职责边界
4762

4863
- `SKILL.md`:标准 skill 入口说明。
64+
- `DEBUG.md`:当前调试证据、根因和回归验证记录;只承载已复现问题的诊断闭环。
4965
- `REVIEW.md`:当前仓库审计结果与 release gate 结论;只记录证据、风险与交接,不承载业务源码。
66+
- `apps/`:用户体验入口和渠道壳层。
67+
- `ai/`:Agent、skill、Prompt、评估和 AI 监管相关入口。
68+
- `domains/`:领域服务根;当前承载 `fate-core``fatecat-delivery` 两个生产候选服务源码、契约和测试入口。
69+
- `platform/`:Golden Path、CI/CD、供应链和开发者平台能力。
70+
- `infra/`:环境、容器、数据库、运行准入、安全和观测期望状态。
71+
- `contracts/`:API、数据集、capability、profile、evidence 和策略契约。
72+
- `catalog/`:组件发现、owner、生命周期和依赖关系。
73+
- `governance/`:标准、流程、ADR、风险、门禁、baseline evidence、任务和迁移账本。
74+
- `shared/`:真实复用后的薄共享库,不作为 common 垃圾桶。
75+
- `tools/`:迁移工具、参考仓和供应链快照。
76+
- `docs/`:人类文档入口,不替代机器契约和治理证据。
77+
- `tests/`:仓库级结构、契约、导出和跨服务测试入口。
5078
- `.github/`:GitHub Actions 远端验收配置;只调用仓库脚本,不保存业务代码或 secret。
5179
- `references/`:长文档、阶段门禁、输入输出契约、迁移与排障材料;其中 `execution-playbook.md` 是统一执行顺序真相源。
52-
- `scripts/`:skill 包装脚本、生命周期脚手架与导出脚本;其中 `preflight.sh` 是默认预检入口,`acceptance.sh` 是发布门禁入口,`delivery-smoke.sh` 负责可回收启动验证,`check-source-hygiene.sh` 负责源仓 raw/运行态/个人路径门禁,`check-export-hygiene.sh` 负责导出包卫生门禁,`check-privacy-fixtures.sh` 负责示例数据与 vendor web 隔离门禁,`vendor-health.sh` 负责 vendor 快照健康检查,`live-bot-smoke.sh` 负责真实 Telegram token 验收,`production-readiness.sh` 负责生产配置与 live 验收总门禁。
53-
- `scripts/project/`:FateCat 项目的真实源码根、运行时骨架与项目文档真相源。
54-
- `scripts/project/assets/docs/lifecycle/`:生命周期模板、治理资产与可沉淀的 agent 运维材料。
80+
- `scripts/`:本地可重复执行入口;其中 `preflight.sh` 是默认预检入口,`acceptance.sh` 是发布门禁入口,`check-structure.sh` 是企业结构门禁。
5581

5682
## 依赖方向
5783

58-
- `README.md -> SKILL.md + references/* + scripts/project/assets/docs/lifecycle/*`
84+
- `apps/ai -> domains + contracts`
85+
- `domains/experience-delivery -> domains/fate-analysis + contracts + infra`
86+
- `domains/fate-analysis -> contracts + tools/reference-repos`
87+
- `catalog -> domains + contracts + governance`
5988
- `.github/workflows/* -> scripts/acceptance.sh`
60-
- `scripts/* -> scripts/project/*`
61-
- `SKILL.md -> scripts/preflight.sh + scripts/delivery-smoke.sh + references/execution-playbook.md`
62-
- 禁止在根目录重新散落与 `scripts/project/` 平行的第二套业务源码目录
89+
- `scripts/* -> domains + contracts + infra + governance`
90+
- 禁止新增旧路径 fallback;退役路径只允许出现在迁移账本、历史证据、负例测试和防回潮规则中。

0 commit comments

Comments
 (0)