refactor(backend): 按业务拆分 API、数据库与契约并统一网关鉴权 by Jasonxia007 · Pull Request #4160 · ModelEngine-Group/nexent · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2da5445
refactor(backend): organize service APIs and persistence modules
Jasonxia007 Oct 21, 2026
f1b9e89
refactor(backend): centralize incoming authentication in gateway
Jasonxia007 Oct 21, 2026
450415b
merge: sync develop and resolve backend ownership conflicts
Jasonxia007 Oct 21, 2026
0633a86
test: remove stale database package imports from migrated fixtures
Jasonxia007 Oct 21, 2026
f3bcc50
test: align relocation guards and memory retrieval mocks with canonic…
Jasonxia007 Oct 22, 2026
5a3e59c
refactor(backend): group business contracts, errors and constants
Jasonxia007 Oct 22, 2026
838ffbd
refactor(gateway): consolidate northbound routes and authentication
Jasonxia007 Oct 22, 2026
9f93ac0
merge: sync develop and preserve batched document tag projection
Jasonxia007 Oct 22, 2026
f10aa39
refactor(runtime): separate agent preparation and local execution
Jasonxia007 Oct 22, 2026
3640bab
refactor(backend): consolidate environment and pure constants
Jasonxia007 Oct 22, 2026
8b17f2a
merge: sync develop lifecycle recovery regressions
Jasonxia007 Oct 22, 2026
652a7fe
docs(contracts): clean stale constant comments
Jasonxia007 Oct 22, 2026
ee8a81a
fix(gateway): constrain file proxy and repair migrated test imports
Jasonxia007 Oct 23, 2026
8f99357
merge: sync develop and retain migrated regression lookups
Jasonxia007 Oct 23, 2026
73b7797
merge: sync latest develop prompt and A2A changes
Jasonxia007 Oct 23, 2026
f07102b
refactor(runtime): remove legacy agents import compatibility
Jasonxia007 Oct 23, 2026
c5de405
merge: integrate agent runtime responsibility refactor
Jasonxia007 Oct 23, 2026
03c9561
merge: sync develop conversation and runtime test repairs
Jasonxia007 Oct 23, 2026
42e4da3
fix(tests): repair CI isolation and benchmark root discovery
Jasonxia007 Oct 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .agents/skills/nexent-backend/references/configuration.md
2 changes: 1 addition & 1 deletion .agents/skills/nexent-backend/references/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ The new design standard requires all five audit fields on every new table, inclu
## SQL

- Every file named `init.sql` or with `merged_migrations` in its name is already merged into the target branch, which is immutable. Never modify, rename, or delete one.
- Add a versioned migration under `deploy/sql/migrations/`, following current naming/version conventions. Application version is `APP_VERSION` in `backend/consts/const.py`.
- Add a versioned migration under `deploy/sql/migrations/`, following current naming/version conventions. Application version is `APP_VERSION` in `backend/contracts/constants/environment.py`.
- Verify naming/comments, type limits, JSONB validation, audit maintenance, reference/uniqueness behavior, soft deletion/versioning, query indexes, transaction ownership, and migration compatibility as applicable. External database execution requires authorization for that action.
2 changes: 1 addition & 1 deletion .agents/skills/nexent-backend/references/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Applies to `backend/apps/**/*.py`.
## Boundary and compatibility

- Parse/validate inputs, invoke services, translate domain errors to HTTP, and return responses. Keep business logic out of apps.
- Read configuration from `consts.const` or pass explicit parameters. Preserve existing routes, payloads, and response structures.
- Read configuration from `contracts.constants.environment` or pass explicit parameters. Preserve existing routes, payloads, and response structures.
- New collections use plural nouns and snake_case path segments; parameters use singular semantic names such as `{agent_id}`. Keep legacy prefixes such as `/agent`.
- Prefer resource-oriented CRUD routes; use action routes for non-CRUD behavior or compatibility.
- GET reads/lists; preserve legacy GET actions but introduce no new side-effecting GETs. POST creates, searches, or triggers actions. DELETE is idempotent. Prefer PUT for full updates and PATCH for partial updates while retaining legacy POST update routes.
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/nexent-backend/references/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Applies to `backend/services/**/*.py`.
- Return plain domain values; do not return web framework responses, raise `HTTPException`, or translate failures into HTTP status codes.
- Reuse domain exceptions in `backend/consts/exceptions.py`; declare new domain classes there when needed. Wrap lower-level failures at the appropriate boundary with `raise DomainError(...) from exc`.
- Existing exceptions include `AgentRunException`, `LimitExceededError`, `UnauthorizedError`, `SignatureValidationError`, and `MemoryPreparationException`. Inspect current definitions before use.
- Import configuration from `consts.const` or accept parameters, then pass configuration into SDK calls. Do not read environment variables here.
- Import configuration from `contracts.constants.environment` or accept parameters, then pass configuration into SDK calls. Do not read environment variables here.
- A service explicitly allowed to continue after database failure may catch an appropriate shared exception. Inspect what the database client actually raises; do not assume it wraps failures in a named custom exception.

Verify orchestration, return values, and domain failure propagation independently of HTTP mapping.
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

- Write code comments, docstrings, TODOs, and configuration comments in English. User-facing strings may use supported languages; this does not prescribe conversation language.
- Every new or modified source file (`.py`, `.sh`, `.sql`, `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`) must start with the copyright header `Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. All rights reserved.` (the end year tracks the current year, e.g. `2025-2027` in 2027) in the file's comment style (`#` for Python/Shell, `--` for SQL, `//` for TypeScript/JavaScript), placed after shebang/encoding lines. The `Copyright Header Check` CI job rejects changed files missing it; verify or fix locally with `python scripts/check_copyright.py [--fix] <files...>`.
- In backend/SDK Python code, centralize environment reads in `backend/consts/const.py`. Backend callers import from `consts.const`; SDK code accepts parameters and must not read environment variables or introduce `from_env()` methods.
- Every SQL file under `deploy/sql/` already merged into the target branch is immutable, including initialization and Supabase SQL. Do not edit, rename, or delete it. Add versioned migrations under `deploy/sql/migrations/`; application version is `APP_VERSION` in `backend/consts/const.py`.
- In backend/SDK Python code, centralize environment reads in `backend/contracts/constants/environment.py`. Backend callers import from `contracts.constants.environment`; SDK code accepts parameters and must not read environment variables or introduce `from_env()` methods.
- Every SQL file under `deploy/sql/` already merged into the target branch is immutable, including initialization and Supabase SQL. Do not edit, rename, or delete it. Add versioned migrations under `deploy/sql/migrations/`; application version is `APP_VERSION` in `backend/contracts/constants/environment.py`.
- Preserve existing HTTP routes, payloads, and response contracts when applying conventions to new code.

## Load rules for the task
Expand Down
9 changes: 7 additions & 2 deletions backend/adapters/jiuwen_sdk_adapter.py
Loading
Loading