{"owner":"dataelement","repo":"bisheng","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\n---\n\n## 1. Project Identity\n\n**BiSheng (毕昇)** — Enterprise LLM application DevOps platform. Monorepo, three sub-projects:\n\n| Path | Project | Stack |\n|------|---------|-------|\n| `src/backend/` | FastAPI + Celery Workers + Linsight Worker | Python 3.11+, uv, SQLModel, LangGraph |\n| `src/frontend/platform/` | Admin / builder UI | Vite 5 + **Zustand** + react-query v3 + bs-ui |\n| `src/frontend/client/` | End-user chat UI (`/workspace` base path) | Vite 6 + **Recoil** + react-query v4 (@tanstack) + shadcn/ui |\n\n**Runtime topology** (full picture → `docs/architecture/01-architecture-overview.md`):\n- Two SPAs — platform (:3001) and client (:4001, base `/workspace`) — call FastAPI (:7860): `/api/v1` frontend-facing, `/api/v2` open RPC. Commercial edition inserts a Java gateway in front (→ `architecture/11-gateway.md`).\n- Async work: Celery workers (knowledge / workflow / default queues) + Beat; the Linsight agent runs as an independent worker process fed by a Redis queue.\n- Storage ×6: MySQL|DM8 (dual-DB law C2), Redis, Milvus + ES (RAG dual recall), MinIO, OpenFGA (ReBAC).\n- Cross-cutting: tenant isolation auto-injected via ContextVar (C3); every permission check goes through PermissionService → OpenFGA (C4).\n\n---\n\n## 2. Commands\n\nDev / test / build commands live in each sub-project's `AGENTS.md`: `src/backend/AGENTS.md` · `src/frontend/platform/AGENTS.md` · `src/frontend/client/AGENTS.md`.\n\nMiddleware (MySQL / Redis / Milvus / ES / MinIO / OpenFGA): integration tests run in **CI**; per-developer middleware machines are pending.\n\n---\n\n## 3. Backend Rules (P0)\n\n- **Architectural laws** (DDD layering / dual-DB / multi-tenancy / permissions / error codes / security) → [`docs/constitution.md`](docs/constitution.md) (C1–C7); enforced by `scripts/arch-guard.sh` + Constitution Check in `/sdd-review design`.\n- **Backend coding conventions** (module layout, API/response helpers, pagination, error handling) + subsystem quick map → `src/backend/AGENTS.md` (auto-loads when editing backend files).\n\n---\n\n## 4. Frontend Rules (P0)\n\nTwo React apps that **must not be mixed**. Per-app rules auto-load from each sub-project's `AGENTS.md`:\n- `src/frontend/platform/AGENTS.md` — Admin/builder UI (Zustand, react-query v3, bs-ui, `@/`)\n- `src/frontend/client/AGENTS.md` — End-user chat UI (Recoil, react-query v4, shadcn, `~/`)\n\n**Hard rules (both apps — single source of truth here; per-app files add only app-specific detail):**\n- TypeScript only (`.ts` / `.tsx`); functional components only; no class components.\n- Single file ≤ 600 lines. Extract sub-components or hooks when exceeded.\n- `interface` for Props; `type` for internal types. `handleXxx` internal handlers / `onXxx` props. PascalCase components, camelCase utilities/hooks.\n- Named exports for components (`export function`); no default exports. Minimize `any` — if unavoidable, `// eslint-disable-next-line` + a one-line reason.\n- **Never** `import axios` directly — use the wrapped request module. (store must not call HTTP = constitution **C7**)\n- **Never** introduce new UI or state-management libraries.\n- All code comments in English.\n- 403 handled automatically by response interceptors — never add 403 branches in business code.\n\n---\n\n## 5. Architecture Guard (Auto-enforced)\n\n`scripts/arch-guard.sh` runs after every Write/Edit via a PostToolUse hook (through `.claude/hooks/arch-guard-hook.sh`, which feeds violations back to the agent as `additionalContext` for self-correction).\nThe 8 RULEs are the machine-enforcement arm of constitution **C1 / C4 / C6 / C7** — the clause↔RULE anchor table lives in [`docs/constitution.md`](docs/constitution.md). **VIOLATION must be fixed immediately.**\n\n---\n\n## 6. SDD Workflow (non-trivial features)\n\n**Full guide — track selection, ★ pause points, deviation re-confirm rule, document roles, constitution gate, harness → [`docs/SDD-Guide.md`](docs/SDD-Guide.md).**\n\n```\n0. release-contract.md (features/v{X.Y.Z}/release-contract.md;\n   version's first feature creates it) + read constitution.md\n1. Spec Discovery                          → ★ user confirms\n2. spec.md   → /sdd-review <dir> spec       → ★ user confirms\n3. design.md → /sdd-review <dir> design     → ★ user confirms (Constitution Check)\n4. tasks.md  → /sdd-review <dir> tasks\n5. branch feat/<version>/{NNN}-{name}  (create early; docs + code on the branch)\n6. implement wave-by-wave → /task-review <dir> <id> → check off\n7. /e2e-test <dir>  (mandatory)\n8. /code-review --base <main>  (+ CI auto-review)\n9. merge\n```\n\nArtifacts: `features/v{X.Y.Z}/{NNN}-{name}/{spec,design,tasks}.md`. Templates: `features/_templates/` (incl. `release-contract.md`).\n**★ cannot be skipped.** Trivial/hotfix changes use a lighter track — see SDD-Guide §1.\n\nTests: new backend tests under `test/<module>/` (e.g., `test/approval/`), not `test/` root. `asyncio_mode=auto`.\n\n---\n\n## 7. Common Pitfalls\n\nBackend runtime pitfalls (tenant-filter SELECT-only gap, ruff hook import trap, Celery Beat × multi-tenant, DB config Redis TTL) → `src/backend/AGENTS.md` §Known Pitfalls. MinIO `sharepoint` image-proxy pitfall → `src/frontend/platform/AGENTS.md` §Known Pitfalls. Commercial edition (`BISHENG_PRO` env, gateway proxy, SSO) → `docs/architecture/11-gateway.md`.\n\n| Pitfall | Reality |\n|---------|---------|\n| `/api/v1/env` version field | Hardcoded `2.4.0` in source — unreliable. Use route probing instead. |\n| Passwords in config.yaml | Fernet-encrypted. Never write plaintext passwords into the YAML. |\n| First registered user | Becomes `super_admin` automatically. In multi-tenant mode, create the tenant first. |\n\n---\n\n## 8. Reference\n\n- **Docs index** → `docs/README.md` (navigation hub); onboarding & testing → `docs/architecture/09-development-guide.md`\n- **Architecture docs** → `docs/architecture/` (overview, permission, gateway, multi-tenant, data-models, …)\n- **Skills**: `/sdd-review`, `/task-review`, `/code-review`, `/e2e-test`, `/i18n-localizer`, `/react-component-refactor`\n\n**Instruction files (AGENTS.md map).** Root = this file, loaded every session. Auto-loaded on top when editing the matching directory: `src/backend/`, `src/frontend/platform/`, `src/frontend/client/`, plus deep-dir specials `src/backend/bisheng/core/database/alembic/` (migrations) and `src/backend/scripts/` (one-off scripts). Every `CLAUDE.md` is a symlink to its sibling `AGENTS.md` — edit `AGENTS.md` only. Put a new rule in the deepest file covering its scope (cross-app / cross-module → this file; app- or dir-specific → the nearest file); never duplicate a rule across levels — it *will* drift.\n\n"},"files":{"AGENTS.md":"# AGENTS.md\n\n---\n\n## 1. Project Identity\n\n**BiSheng (毕昇)** — Enterprise LLM application DevOps platform. Monorepo, three sub-projects:\n\n| Path | Project | Stack |\n|------|---------|-------|\n| `src/backend/` | FastAPI + Celery Workers + Linsight Worker | Python 3.11+, uv, SQLModel, LangGraph |\n| `src/frontend/platform/` | Admin / builder UI | Vite 5 + **Zustand** + react-query v3 + bs-ui |\n| `src/frontend/client/` | End-user chat UI (`/workspace` base path) | Vite 6 + **Recoil** + react-query v4 (@tanstack) + shadcn/ui |\n\n**Runtime topology** (full picture → `docs/architecture/01-architecture-overview.md`):\n- Two SPAs — platform (:3001) and client (:4001, base `/workspace`) — call FastAPI (:7860): `/api/v1` frontend-facing, `/api/v2` open RPC. Commercial edition inserts a Java gateway in front (→ `architecture/11-gateway.md`).\n- Async work: Celery workers (knowledge / workflow / default queues) + Beat; the Linsight agent runs as an independent worker process fed by a Redis queue.\n- Storage ×6: MySQL|DM8 (dual-DB law C2), Redis, Milvus + ES (RAG dual recall), MinIO, OpenFGA (ReBAC).\n- Cross-cutting: tenant isolation auto-injected via ContextVar (C3); every permission check goes through PermissionService → OpenFGA (C4).\n\n---\n\n## 2. Commands\n\nDev / test / build commands live in each sub-project's `AGENTS.md`: `src/backend/AGENTS.md` · `src/frontend/platform/AGENTS.md` · `src/frontend/client/AGENTS.md`.\n\nMiddleware (MySQL / Redis / Milvus / ES / MinIO / OpenFGA): integration tests run in **CI**; per-developer middleware machines are pending.\n\n---\n\n## 3. Backend Rules (P0)\n\n- **Architectural laws** (DDD layering / dual-DB / multi-tenancy / permissions / error codes / security) → [`docs/constitution.md`](docs/constitution.md) (C1–C7); enforced by `scripts/arch-guard.sh` + Constitution Check in `/sdd-review design`.\n- **Backend coding conventions** (module layout, API/response helpers, pagination, error handling) + subsystem quick map → `src/backend/AGENTS.md` (auto-loads when editing backend files).\n\n---\n\n## 4. Frontend Rules (P0)\n\nTwo React apps that **must not be mixed**. Per-app rules auto-load from each sub-project's `AGENTS.md`:\n- `src/frontend/platform/AGENTS.md` — Admin/builder UI (Zustand, react-query v3, bs-ui, `@/`)\n- `src/frontend/client/AGENTS.md` — End-user chat UI (Recoil, react-query v4, shadcn, `~/`)\n\n**Hard rules (both apps — single source of truth here; per-app files add only app-specific detail):**\n- TypeScript only (`.ts` / `.tsx`); functional components only; no class components.\n- Single file ≤ 600 lines. Extract sub-components or hooks when exceeded.\n- `interface` for Props; `type` for internal types. `handleXxx` internal handlers / `onXxx` props. PascalCase components, camelCase utilities/hooks.\n- Named exports for components (`export function`); no default exports. Minimize `any` — if unavoidable, `// eslint-disable-next-line` + a one-line reason.\n- **Never** `import axios` directly — use the wrapped request module. (store must not call HTTP = constitution **C7**)\n- **Never** introduce new UI or state-management libraries.\n- All code comments in English.\n- 403 handled automatically by response interceptors — never add 403 branches in business code.\n\n---\n\n## 5. Architecture Guard (Auto-enforced)\n\n`scripts/arch-guard.sh` runs after every Write/Edit via a PostToolUse hook (through `.claude/hooks/arch-guard-hook.sh`, which feeds violations back to the agent as `additionalContext` for self-correction).\nThe 8 RULEs are the machine-enforcement arm of constitution **C1 / C4 / C6 / C7** — the clause↔RULE anchor table lives in [`docs/constitution.md`](docs/constitution.md). **VIOLATION must be fixed immediately.**\n\n---\n\n## 6. SDD Workflow (non-trivial features)\n\n**Full guide — track selection, ★ pause points, deviation re-confirm rule, document roles, constitution gate, harness → [`docs/SDD-Guide.md`](docs/SDD-Guide.md).**\n\n```\n0. release-contract.md (features/v{X.Y.Z}/release-contract.md;\n   version's first feature creates it) + read constitution.md\n1. Spec Discovery                          → ★ user confirms\n2. spec.md   → /sdd-review <dir> spec       → ★ user confirms\n3. design.md → /sdd-review <dir> design     → ★ user confirms (Constitution Check)\n4. tasks.md  → /sdd-review <dir> tasks\n5. branch feat/<version>/{NNN}-{name}  (create early; docs + code on the branch)\n6. implement wave-by-wave → /task-review <dir> <id> → check off\n7. /e2e-test <dir>  (mandatory)\n8. /code-review --base <main>  (+ CI auto-review)\n9. merge\n```\n\nArtifacts: `features/v{X.Y.Z}/{NNN}-{name}/{spec,design,tasks}.md`. Templates: `features/_templates/` (incl. `release-contract.md`).\n**★ cannot be skipped.** Trivial/hotfix changes use a lighter track — see SDD-Guide §1.\n\nTests: new backend tests under `test/<module>/` (e.g., `test/approval/`), not `test/` root. `asyncio_mode=auto`.\n\n---\n\n## 7. Common Pitfalls\n\nBackend runtime pitfalls (tenant-filter SELECT-only gap, ruff hook import trap, Celery Beat × multi-tenant, DB config Redis TTL) → `src/backend/AGENTS.md` §Known Pitfalls. MinIO `sharepoint` image-proxy pitfall → `src/frontend/platform/AGENTS.md` §Known Pitfalls. Commercial edition (`BISHENG_PRO` env, gateway proxy, SSO) → `docs/architecture/11-gateway.md`.\n\n| Pitfall | Reality |\n|---------|---------|\n| `/api/v1/env` version field | Hardcoded `2.4.0` in source — unreliable. Use route probing instead. |\n| Passwords in config.yaml | Fernet-encrypted. Never write plaintext passwords into the YAML. |\n| First registered user | Becomes `super_admin` automatically. In multi-tenant mode, create the tenant first. |\n\n---\n\n## 8. Reference\n\n- **Docs index** → `docs/README.md` (navigation hub); onboarding & testing → `docs/architecture/09-development-guide.md`\n- **Architecture docs** → `docs/architecture/` (overview, permission, gateway, multi-tenant, data-models, …)\n- **Skills**: `/sdd-review`, `/task-review`, `/code-review`, `/e2e-test`, `/i18n-localizer`, `/react-component-refactor`\n\n**Instruction files (AGENTS.md map).** Root = this file, loaded every session. Auto-loaded on top when editing the matching directory: `src/backend/`, `src/frontend/platform/`, `src/frontend/client/`, plus deep-dir specials `src/backend/bisheng/core/database/alembic/` (migrations) and `src/backend/scripts/` (one-off scripts). Every `CLAUDE.md` is a symlink to its sibling `AGENTS.md` — edit `AGENTS.md` only. Put a new rule in the deepest file covering its scope (cross-app / cross-module → this file; app- or dir-specific → the nearest file); never duplicate a rule across levels — it *will* drift.\n\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# AGENTS.md\n\n---\n\n## 1. Project Identity\n\n**BiSheng (毕昇)** — Enterprise LLM application DevOps platform. Monorepo, three sub-projects:\n\n| Path | Project | Stack |\n|------|---------|-------|\n| `src/backend/` | FastAPI + Celery Workers + Linsight Worker | Python 3.11+, uv, SQLModel, LangGraph |\n| `src/frontend/platform/` | Admin / builder UI | Vite 5 + **Zustand** + react-query v3 + bs-ui |\n| `src/frontend/client/` | End-user chat UI (`/workspace` base path) | Vite 6 + **Recoil** + react-query v4 (@tanstack) + shadcn/ui |\n\n**Runtime topology** (full picture → `docs/architecture/01-architecture-overview.md`):\n- Two SPAs — platform (:3001) and client (:4001, base `/workspace`) — call FastAPI (:7860): `/api/v1` frontend-facing, `/api/v2` open RPC. Commercial edition inserts a Java gateway in front (→ `architecture/11-gateway.md`).\n- Async work: Celery workers (knowledge / workflow / default queues) + Beat; the Linsight agent runs as an independent worker process fed by a Redis queue.\n- Storage ×6: MySQL|DM8 (dual-DB law C2), Redis, Milvus + ES (RAG dual recall), MinIO, OpenFGA (ReBAC).\n- Cross-cutting: tenant isolation auto-injected via ContextVar (C3); every permission check goes through PermissionService → OpenFGA (C4).\n\n---\n\n## 2. Commands\n\nDev / test / build commands live in each sub-project's `AGENTS.md`: `src/backend/AGENTS.md` · `src/frontend/platform/AGENTS.md` · `src/frontend/client/AGENTS.md`.\n\nMiddleware (MySQL / Redis / Milvus / ES / MinIO / OpenFGA): integration tests run in **CI**; per-developer middleware machines are pending.\n\n---\n\n## 3. Backend Rules (P0)\n\n- **Architectural laws** (DDD layering / dual-DB / multi-tenancy / permissions / error codes / security) → [`docs/constitution.md`](docs/constitution.md) (C1–C7); enforced by `scripts/arch-guard.sh` + Constitution Check in `/sdd-review design`.\n- **Backend coding conventions** (module layout, API/response helpers, pagination, error handling) + subsystem quick map → `src/backend/AGENTS.md` (auto-loads when editing backend files).\n\n---\n\n## 4. Frontend Rules (P0)\n\nTwo React apps that **must not be mixed**. Per-app rules auto-load from each sub-project's `AGENTS.md`:\n- `src/frontend/platform/AGENTS.md` — Admin/builder UI (Zustand, react-query v3, bs-ui, `@/`)\n- `src/frontend/client/AGENTS.md` — End-user chat UI (Recoil, react-query v4, shadcn, `~/`)\n\n**Hard rules (both apps — single source of truth here; per-app files add only app-specific detail):**\n- TypeScript only (`.ts` / `.tsx`); functional components only; no class components.\n- Single file ≤ 600 lines. Extract sub-components or hooks when exceeded.\n- `interface` for Props; `type` for internal types. `handleXxx` internal handlers / `onXxx` props. PascalCase components, camelCase utilities/hooks.\n- Named exports for components (`export function`); no default exports. Minimize `any` — if unavoidable, `// eslint-disable-next-line` + a one-line reason.\n- **Never** `import axios` directly — use the wrapped request module. (store must not call HTTP = constitution **C7**)\n- **Never** introduce new UI or state-management libraries.\n- All code comments in English.\n- 403 handled automatically by response interceptors — never add 403 branches in business code.\n\n---\n\n## 5. Architecture Guard (Auto-enforced)\n\n`scripts/arch-guard.sh` runs after every Write/Edit via a PostToolUse hook (through `.claude/hooks/arch-guard-hook.sh`, which feeds violations back to the agent as `additionalContext` for self-correction).\nThe 8 RULEs are the machine-enforcement arm of constitution **C1 / C4 / C6 / C7** — the clause↔RULE anchor table lives in [`docs/constitution.md`](docs/constitution.md). **VIOLATION must be fixed immediately.**\n\n---\n\n## 6. SDD Workflow (non-trivial features)\n\n**Full guide — track selection, ★ pause points, deviation re-confirm rule, document roles, constitution gate, harness → [`docs/SDD-Guide.md`](docs/SDD-Guide.md).**\n\n```\n0. release-contract.md (features/v{X.Y.Z}/release-contract.md;\n   version's first feature creates it) + read constitution.md\n1. Spec Discovery                          → ★ user confirms\n2. spec.md   → /sdd-review <dir> spec       → ★ user confirms\n3. design.md → /sdd-review <dir> design     → ★ user confirms (Constitution Check)\n4. tasks.md  → /sdd-review <dir> tasks\n5. branch feat/<version>/{NNN}-{name}  (create early; docs + code on the branch)\n6. implement wave-by-wave → /task-review <dir> <id> → check off\n7. /e2e-test <dir>  (mandatory)\n8. /code-review --base <main>  (+ CI auto-review)\n9. merge\n```\n\nArtifacts: `features/v{X.Y.Z}/{NNN}-{name}/{spec,design,tasks}.md`. Templates: `features/_templates/` (incl. `release-contract.md`).\n**★ cannot be skipped.** Trivial/hotfix changes use a lighter track — see SDD-Guide §1.\n\nTests: new backend tests under `test/<module>/` (e.g., `test/approval/`), not `test/` root. `asyncio_mode=auto`.\n\n---\n\n## 7. Common Pitfalls\n\nBackend runtime pitfalls (tenant-filter SELECT-only gap, ruff hook import trap, Celery Beat × multi-tenant, DB config Redis TTL) → `src/backend/AGENTS.md` §Known Pitfalls. MinIO `sharepoint` image-proxy pitfall → `src/frontend/platform/AGENTS.md` §Known Pitfalls. Commercial edition (`BISHENG_PRO` env, gateway proxy, SSO) → `docs/architecture/11-gateway.md`.\n\n| Pitfall | Reality |\n|---------|---------|\n| `/api/v1/env` version field | Hardcoded `2.4.0` in source — unreliable. Use route probing instead. |\n| Passwords in config.yaml | Fernet-encrypted. Never write plaintext passwords into the YAML. |\n| First registered user | Becomes `super_admin` automatically. In multi-tenant mode, create the tenant first. |\n\n---\n\n## 8. Reference\n\n- **Docs index** → `docs/README.md` (navigation hub); onboarding & testing → `docs/architecture/09-development-guide.md`\n- **Architecture docs** → `docs/architecture/` (overview, permission, gateway, multi-tenant, data-models, …)\n- **Skills**: `/sdd-review`, `/task-review`, `/code-review`, `/e2e-test`, `/i18n-localizer`, `/react-component-refactor`\n\n**Instruction files (AGENTS.md map).** Root = this file, loaded every session. Auto-loaded on top when editing the matching directory: `src/backend/`, `src/frontend/platform/`, `src/frontend/client/`, plus deep-dir specials `src/backend/bisheng/core/database/alembic/` (migrations) and `src/backend/scripts/` (one-off scripts). Every `CLAUDE.md` is a symlink to its sibling `AGENTS.md` — edit `AGENTS.md` only. Put a new rule in the deepest file covering its scope (cross-app / cross-module → this file; app- or dir-specific → the nearest file); never duplicate a rule across levels — it *will* drift.\n\n","category":"root","tokens":1645}]}