Repository navigation
Conversation
- Add .github/workflows/ci.yml: format check, vet + golangci-lint, build, test with coverage upload to Codecov, clean - Move root shell scripts into scripts/ and fix ROOT paths - format.sh: add --check mode for CI (no writes) - Add .gitattributes to enforce LF for *.sh / *.yml - Add codecov.yml with 85% project/patch coverage status gates - gofmt all Go files; update README script paths and CI docs
* Add MkDocs documentation site and Docs CI workflow - docs/ becomes a self-contained MkDocs (Material) project: mkdocs.yml, requirements.txt, docs/ content pages (index, architecture, data-model, ops skeletons) - Add .github/workflows/docs.yml: build with mkdocs build --strict on docs/** changes (push/PR), upload site artifact - Ignore docs/site/ build output; update docs/README.md usage guide * Deploy MkDocs site to GitHub Pages on main - Upload Pages artifact from build job on main pushes - Add deploy job (deploy-pages) gated to main, with pages write and id-token write permissions and the github-pages environment
* Design tenant model base fields - Split tenant into a narrow root table (identity, status, quota, audit policy, default references) with related tables holding app/model/tool/channel/backend configs - PostgreSQL DDL with constraints, field-by-field usage table - Lifecycle state machine (active/suspended/disabled) - Mapping to trpc-agent-go runner userID / agent factory / OTel tags - Remaining core tables kept as placeholders * docs: refine tenant model design * docs: enforce tenant identity and lifecycle invariants * docs: restrict tenant status transition execution * docs: guard tenant configuration version updates * docs: reject disabled tenant configuration updates * docs: require tenant lifecycle audit metadata * docs: restrict tenant root-table reads * docs: align tenant id database grammar --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
…iuzengh#6) * feat(tenant): add domain model and inmemory repository * refactor(tenant): isolate InMemory repository package * test(tenant): cover entity validation boundaries * fix(tenant): close PR6 review gaps * test(tenant): cover repository helper branches * test(tenant): make cancellation coverage deterministic * test(tenant): cover cancelled repository operations * docs(tenant): clarify generated tenant IDs * fix(tenant): preserve concurrent repository reads * chore: migrate module path to XnLemon (liuzengh#13) * feat(tenant): add domain model and inmemory repository * refactor(tenant): isolate InMemory repository package * test(tenant): cover entity validation boundaries * fix(tenant): close PR6 review gaps * test(tenant): cover repository helper branches * test(tenant): make cancellation coverage deterministic * test(tenant): cover cancelled repository operations * docs(tenant): clarify generated tenant IDs * fix(tenant): preserve concurrent repository reads * chore: migrate module path to XnLemon --------- Co-authored-by: xnlemon <xianingawa@gmail.com> * fix(tenant): separate module migration and monetary codes * chore: migrate module path to XnLemon --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* feat(tenant): add runtime snapshot boundary * fix(tenant): keep runtime clone helper local * test(tenant): cover runtime boundary failures * fix(tenant): gate runtime snapshots by lifecycle * fix(tenant): seal configuration snapshots --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* feat(tenant): add domain model and inmemory repository * refactor(tenant): isolate InMemory repository package * test(tenant): cover entity validation boundaries * feat(tenant): add runtime snapshot boundary * fix(tenant): keep runtime clone helper local * fix(tenant): validate runtime configuration snapshots * feat(tenant): add runtime snapshot boundary * fix(tenant): keep runtime clone helper local * test(tenant): cover runtime boundary failures * fix(tenant): gate runtime snapshots by lifecycle * test(tenant): cover snapshot validation branches * fix(tenant): seal configuration snapshots --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
…iuzengh#9) * fix(tenant): guard audit metadata and cancelled requests * test(tenant): cover audit reason boundaries --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
* docs: define Agent App publication boundary * agent: add versioned application domain * agent: apply canonical Go formatting * agent: preserve revision publication timeline * agent: validate draft before publication * agent: enforce immutable publication timestamps * agent: canonicalize empty tool allowlists * agent: hash normalized revision configuration * agent: canonicalize signed zero generation values * agent: add tenant-scoped in-memory repository * test: use non-nil repository contexts * test: cover repository failure boundaries * test: exercise cancellable repository lock branches * agent: add sealed execution snapshot boundary * docs: add implementation progress checklist * docs: mark Agent App checklist progress --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
…h#21) * docs: define Backend Profile control plane * docs: close Backend Profile review gaps * backend: add Profile domain and provider catalog * test: cover Backend Profile validation boundaries * backend: harden secret and endpoint normalization * backend: reject endpoints without a hostname * backend: reject ambiguous multi-host endpoints * backend: validate endpoint authorities structurally * backend: enforce canonical validation limits * backend: canonicalize IPv6 and secret boundaries * backend: preserve profile validation idempotence * backend: add Profile repository and in-memory adapter * backend: add immutable execution snapshot * docs: close Backend Profile SQL integrity gaps * backend: reject passphrase option keys * backend: close remaining semantic boundaries * docs: align Backend Profile persistence invariants * docs: preserve optimistic transition conflicts * backend: align terminal and fragment boundaries * docs: keep SQL mutation timestamps monotonic * fix: address backend profile review feedback * fix: align backend profile SQL whitespace semantics
…ner spine (liuzengh#23) * docs: define model profile and runner spine * {model, runtime}: implement tenant-scoped runner spine * test: satisfy runner spine lint checks * fix: preserve agent runtime policy and raise coverage * test: satisfy staticcheck context guidance * test: remove remaining nil context lint warnings * test: complete context lint cleanup * test: remove runner nil context lint warning * fix: close model profile endpoint and secret validation gaps
* docs: complete production architecture design * docs: close architecture review gaps * docs: close final architecture review gaps * docs: close final review gaps * docs: close execution recovery and topology gaps * docs: define scoped secrets and tool recovery * docs: bind replies and runner identity
* docs: define tenant-scoped Channel Binding routing contract * docs: make candidate token explicit * channels: implement tenant-scoped trusted routing * fix: satisfy channel routing lint * test: raise channel binding coverage * test: satisfy static analysis in channel coverage * test: close channel coverage gap * fix: close channel review gaps * fix: bound fake verifier handles * fix: bound in-memory candidate state * fix: preserve replay boundary nonce
…liuzengh#29) * docs: define Gateway execution contract * docs: enumerate Gateway health endpoints * gateway: resolve trusted execution plans * fix: seal trusted channel routes * fix: require authenticator proofs * fix: add opaque API auth results * fix: honor resolver cancellation windows * docs: align architecture acceptance ledger * gateway: add runner registry and dispatch * test: harden gateway stage two coverage * test: colocate gateway lifecycle coverage * test: satisfy gateway lint checks * test: cover gateway and channel verification boundaries * test: satisfy context lint boundaries * docs: define HTTP gateway lifecycle stage * feat: add gateway HTTP lifecycle and protections * fix: satisfy HTTP gateway lint checks * test: cover HTTP lifecycle error paths * fix: preserve HTTP admission boundaries * docs: define graceful shutdown ownership * fix: drain HTTP state before closing * docs: record HTTP stage validation * docs: separate transport disconnect acceptance * docs: map auth and resolver test ownership * docs: align README with delivered gateway stages * test: cover gateway auth and resolver boundaries * docs: preserve README acceptance requirements * docs: mark verified gateway acceptance items
…er (#32) * docs: define Telegram long-polling adapter contract * channels/telegram: implement tenant-scoped long polling adapter * test: handle adapter close error * test: raise Telegram adapter coverage * test: satisfy staticcheck context rule * fix: close Telegram review findings
* docs: define Telegram live E2E example * test: add Telegram live E2E example and workflow * test: keep live bot identity out of fixtures * docs: clarify Telegram E2E CI sender requirement * ci: exclude live Telegram harness from patch coverage * refactor: move Telegram E2E example under examples * fix: expose safe Telegram E2E preflight stages * fix: classify Telegram E2E getMe failures * fix: harden Telegram E2E automation * fix: handle Telegram E2E cancellation cleanly * fix: isolate Telegram E2E marker replies * fix: classify automated Telegram E2E cancellation
…act (#38) * docs: define PostgreSQL control-plane contract * docs: clarify Channel Binding bootstrap ownership * feat(storage): add PostgreSQL control-plane migration * fix(storage): harden PostgreSQL control-plane migration * fix(storage): resolve migration smoke test errors * test(storage): complete migration smoke fixtures * feat(storage): add PostgreSQL repositories and bootstrap * fix(storage): satisfy repository lint * fix(storage): normalize optional backend endpoints * test(storage): cover repository lifecycle paths * fix(storage): use backend lifecycle result * fix: wire production bootstrap and harden publication * test(bootstrap): cover environment dependency edges * test(bootstrap): exercise environment database assembly * test(storage): cover PostgreSQL error paths * ci: scope control-plane coverage statuses * test(bootstrap): cover unavailable runtime boundaries * fix: harden control-plane writer invariants * test(storage): cover controlled writer rollback paths * test(storage): harden controlled writer failure coverage * test(storage): cover terminal control-plane mutations * test(storage): enforce repository boundary ordering * test(storage): cover database and codec boundaries * test: cover bootstrap and storage failure boundaries * test(storage): cover control-plane domain guards * test(storage): harden control-plane reader edges * test(storage): exercise remaining reader guards * test(storage): cover repository domain boundaries * test(storage): assert not-found domain contracts * fix(storage): make controlled creates atomic * fix(storage): remove obsolete model event reader * test(storage): cover controlled create commits * test(storage): cover controlled create transaction failures * refactor(storage): expose domain PostgreSQL adapters * refactor(storage): align PostgreSQL repository boundaries * fix(storage): satisfy PostgreSQL boundary lint * fix(ci): run PostgreSQL integration coverage once * fix(coverage): preserve numeric profile block ordering * chore: remove local coverage artifact * fix(ci): upload native PostgreSQL coverage profiles * fix(coverage): preserve Go profile source order * test(storage): cover PostgreSQL boundaries * test(postgres): exercise control-plane workflows * fix(ci): use native cross-package coverage * test(postgres): cover agent and channel workflows * test(postgres): enforce storage boundary guards * test(agent): cover repository workflows * test(postgres): cover repository readbacks * test(postgres): cover repository failure boundaries
* docs: define PostgreSQL control-plane contract * docs: clarify Channel Binding bootstrap ownership * feat(storage): add PostgreSQL control-plane migration * fix(storage): harden PostgreSQL control-plane migration * fix(storage): resolve migration smoke test errors * test(storage): complete migration smoke fixtures * feat(storage): add PostgreSQL repositories and bootstrap * fix(storage): satisfy repository lint * fix(storage): normalize optional backend endpoints * test(storage): cover repository lifecycle paths * fix(storage): use backend lifecycle result * fix: wire production bootstrap and harden publication * test(bootstrap): cover environment dependency edges * test(bootstrap): exercise environment database assembly * test(storage): cover PostgreSQL error paths * ci: scope control-plane coverage statuses * test(bootstrap): cover unavailable runtime boundaries * fix: harden control-plane writer invariants * test(storage): cover controlled writer rollback paths * test(storage): harden controlled writer failure coverage * test(storage): cover terminal control-plane mutations * test(storage): enforce repository boundary ordering * test(storage): cover database and codec boundaries * test: cover bootstrap and storage failure boundaries * test(storage): cover control-plane domain guards * test(storage): harden control-plane reader edges * test(storage): exercise remaining reader guards * test(storage): cover repository domain boundaries * test(storage): assert not-found domain contracts * fix(storage): make controlled creates atomic * fix(storage): remove obsolete model event reader * test(storage): cover controlled create commits * test(storage): cover controlled create transaction failures * ci: enforce race tests and clarify coverage gate
…s (#45) (#46) * docs: define runtime observability contract (#45) * observability: add provider metrics and gateway telemetry (#45) * observability: preserve cancellation status on gateway spans * observability: use current OpenTelemetry noop provider * observability: enforce redacted telemetry boundaries * test: satisfy context lint in observability coverage * observability: preserve OTLP transport credentials * observability: redact structured log messages * test: cover logger levels and OTLP cancellation * observability: redact span status descriptions
* docs: define Issue 41 bootstrap and admin API contract * docs: close Issue 41 bootstrap and admin API contract * bootstrap: own control-plane migration history and readiness * bootstrap: fix migration execution and add admin boundary * admin: complete scoped metadata updates and error mapping * admin: map duplicate conflicts and expand route coverage * admin: enforce first tenant and hide cross-tenant reads * test: exercise durable migration apply and verify * test: avoid mutating shared migration fixture * test: cover idempotent migration verification * test: cover admin gateway and tenant count boundary * admin: decode model profile keys * test: complete bootstrap coverage and enforce exact admin routes * test: satisfy migration fixture cleanup lint * test: deepen admin and migration execution coverage * fix: avoid deprecated migration driver fallback * test: verify Admin happy paths and migration mismatch handling * test: cover independent bootstrap restart recovery * fix: close bootstrap authorization and restart coverage gaps * test: cover bootstrap authorization edge paths * fix: atomically record migration history * test: cover migration transaction failure paths --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* docs: sync implementation status with main * docs: add repository status badges
* docs: define tenant runtime storage contract * storage: add tenant runtime persistence contract * test: satisfy runtime storage lint * runtime: connect durable store to session capability * runtime: fence reply claims and recover sessions * runtime: read durable session version before CAS * runtime: refresh session reads from durable state * bootstrap: wire runtime store into session capability * runtime: reconcile session adapter failures * runtime: enforce durable state and backend selection * runtime: preserve cold session misses * test: raise runtime storage coverage * test: cover runtime storage error paths * test: satisfy runtime lint checks * fix: preserve runtime session deletion semantics * test: cover runtime cancellation and deletion edges * fix: enforce runtime reply event relationship * feat: persist runtime event history and lifecycle * feat: add fenced runtime outbox worker * fix: preserve durable state during event replay * feat: complete durable runtime acceptance paths * test: cover durable inbound claim recovery * fix: align durable message ID bounds * test: cover durable dispatch failures * test: cover runtime reply candidate reads * fix: prevent unknown outbox redelivery * test: cover postgres transition errors * fix: align runtime storage conformance
* docs: define tenant runtime storage contract * storage: add tenant runtime persistence contract * test: satisfy runtime storage lint * runtime: connect durable store to session capability * runtime: fence reply claims and recover sessions * runtime: read durable session version before CAS * runtime: refresh session reads from durable state * bootstrap: wire runtime store into session capability * runtime: reconcile session adapter failures * runtime: enforce durable state and backend selection * runtime: preserve cold session misses * test: raise runtime storage coverage * test: cover runtime storage error paths * test: satisfy runtime lint checks * fix: preserve runtime session deletion semantics * test: cover runtime cancellation and deletion edges * fix: enforce runtime reply event relationship * feat: persist runtime event history and lifecycle * feat: add fenced runtime outbox worker * fix: preserve durable state during event replay * feat: complete durable runtime acceptance paths * test: cover durable inbound claim recovery * fix: align durable message ID bounds * test: cover durable dispatch failures * test: cover runtime reply candidate reads * fix: prevent unknown outbox redelivery * test: cover postgres transition errors * fix: align runtime storage conformance * docs: define issue 50 reliable delivery contract * feat: add reliable reply delivery loop * ci: validate issue branches * test: verify postgres outbox restart recovery * fix: bound delivery telemetry error classes * test: complete reliable delivery acceptance coverage * test: satisfy telegram context staticcheck * fix: close reliable delivery runtime gaps * test: cover reliable delivery batch and lifecycle errors * Update CI workflow to limit pull request branches * Update pull request trigger branches in docs.yml Remove 'codex/48-tenant-runtime-storage' branch from pull request trigger. * docs: update issue 50 acceptance checklists * docs: record issue 49 runtime storage acceptance
* docs: define tenant audit and usage contract * docs: tighten audit tenant and handoff boundaries * docs: define durable execution audit handoff * audit: add tenant-scoped event and usage contracts * audit: enforce redaction and currency boundaries * test: satisfy audit static analysis * audit: complete credential and ISO validation * audit: reject version overflow * audit: cover validation and nil store paths * audit: honor cancellation before commit * gateway: emit execution audit lifecycle events * audit: add tenant-bound PostgreSQL persistence * gateway: finalize audit before terminal delivery * audit: fix postgres signature and failure handling * audit: harden persistence and gateway failure handling * audit: add control-plane and delivery producers * test: fix audit producer lint * test: cover audit producer boundaries * test: cover telegram audit producer * audit: cover raw admin mutations * audit: preserve raw revision versions * audit: add durable execution handoff boundary * audit: add PostgreSQL execution handoff adapter * audit: complete handoff and producer boundaries * chore: satisfy lint checks * test: cover postgres handoff finalize and get * test: raise handoff and gateway coverage * test: cover telegram audit producer hooks * test: cover postgres handoff validation failures * test: cover repository and admin audit branches * test: cover remaining handoff and producer branches * test: cover telegram audit delivery failure * test: cover gateway terminal audit branches * test: cover telegram idempotency and cancellation branches * test: cover gateway admission and runner audit failures * test: cover forward select cancellation branch * test: cover remaining audit error branches * test: cover gateway route and handoff query branches * test: cover nil runner dispatch branches * test: cover cancellation audit failure branches
* docs: sync implementation status and group navigation * chore: adopt focused golangci lint policy
Co-authored-by: xnlemon <xianingawa@gmail.com>
* fix(audit): allow opaque identifier fragments * test(audit): cover opaque identifier sensitivity rules --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor(cmd): use structured logs for service lifecycle * refactor(healthcheck): log failures with structured levels * refactor(example): log Telegram lifecycle failures * test(example): verify Telegram error logging * refactor(example): name Telegram error reporter * refactor(errors): organize package error definitions * feat(log): add package-prefixed loggers * refactor(log): keep package logger setup local * fix(log): record terminal service failures * test(log): cover structured logging failure paths --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor(runtime): group Runner stream lifecycle state * refactor(gateway): group dispatch execution state * refactor(gateway): group inbound claim state --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* docs: define app, agent, and runtime package boundaries * runtime: make plan assembly boundary explicit * runtime/storage: split runtime store capabilities * runtime/outbox: separate reply and message stores * docs: align runtime storage capability contract * refactor: name resource execution boundaries clearly --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor: move runtime materialization behind boundaries * refactor: tighten app agent and runtime boundaries * test: cover package boundary error paths --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
…141) * refactor: close remaining package boundaries * fix: keep boundary refactor checks green * test: close coverage gaps in boundary refactor --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor: make outbox capabilities explicit * fix: reject incomplete durable dispatch capabilities --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor: make outbox capabilities explicit * refactor: move durable outbox out of runtime * refactor: require explicit gateway storage capabilities --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor: inject bootstrap delivery capabilities * test: cover bootstrap delivery capability wiring --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
* refactor: make outbox capabilities explicit * refactor: move durable outbox out of runtime * refactor: require explicit gateway storage capabilities * refactor: remove runtime store from bootstrap config * refactor: inject bootstrap delivery capabilities * refactor: remove aggregate runtime storage contract --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
{agent, gateway, runtime}: add versioned agent factories and budget controls
…budget controls" (#159)
Co-authored-by: xnlemon <xianingawa@gmail.com>
…et controls (#161) * feat: add chain Agent Factory and budget loop * fix: clean direct-main port * test: cover budget boundary and postgres paths * fix gateway audit recorder construction * chore: format budget postgres tests * test: document intentional budget test complexity * test: cover gateway budget helpers * test: expand budget execution coverage * test: cover remaining PR budget paths * test: cover budget integration boundaries --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
Co-authored-by: xnlemon <xianingawa@gmail.com>
* feat: add multi-tenant channel setup webui Add tenant-scoped runtime materialization and process-owned Telegram and WeCom AI Bot connections, with the React setup UI and acceptance documentation. * chore: prepare 0.1.1 release * fix: satisfy release lint checks * test: expand PR 165 coverage * test: satisfy lint for coverage tests * test --------- Co-authored-by: xnlemon <xianingawa@gmail.com>
Sync XnLemon/trpc-agent-service-platform with the merged upstream main. Source PR: XnLemon/trpc-agent-service#165 Source merge commit: 204faa4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
企业落地 Agent 应用时,通常需要同时服务多个租户、业务线、Agent、IM 入口和数据后端。平台不仅要能运行一次对话,还需要解决配置发布、租户隔离、运行时装配、连接生命周期、故障恢复、测试验证和生产部署等问题。
本 PR 将主仓库已经合并的多租户 WebUI、Telegram/WeCom AI Bot 连接能力和
0.1.1发布内容同步到当前平台仓库,使系统形成一条从配置、发布、连接到真实对话验收的完整链路。来源 PR:
204faa4de9b25787ed22f019ad49ef37399a07f0变更概览
本 PR 主要包含以下内容:
TenantRuntimeRegistry;0.1.1发布配置。核心工程设计
多租户运行时隔离
避免不同租户、不同 Agent 或不同配置版本之间复用错误的 Runner。
tenant_id或app_id,可信路由始终从服务端维护的 Binding 和控制面配置中解析。tenant_id动态路由,避免固定租户的审计 writer 导致跨租户请求失败。WebUI 配置闭环
管理员可以通过 WebUI 完成:
这条路径把原本需要手动调用多个 Admin API 的流程收敛成了可执行、可验收的配置闭环。
Channel Connection 生命周期
新增租户级连接接口:
POST /admin/v1/tenants/{tenant_id}/connectionsGET /admin/v1/tenants/{tenant_id}/connectionsDELETE /admin/v1/tenants/{tenant_id}/connections/{binding_id}连接凭据只在认证后的连接请求中进入进程内 Secret Registry,不写入:
Telegram 连接使用真实 Bot API 身份校验和 long polling。WeCom AI Bot 使用官方 WebSocket 长连接协议,覆盖认证回执、心跳、重连、回复确认和 Outbox 投递。
测试驱动的工程闭环
本次实现过程中针对 Codecov、gocyclo 和 gosec 反馈进行了专项修正:
CI 与质量门禁
主仓库合并后的
main分支 CI 已全部通过:[主仓库 CI Run](https://github.com/XnLemon/trpc-agent-service/actions/runs/34445046749)
通过的主要门禁包括:
CI 使用 PostgreSQL 16、MySQL 8.0 服务容器执行数据库迁移、Repository、初始化和控制面相关测试,并通过独立的 Race Tests 验证并发访问和资源生命周期。
部署验证还会实际完成:
/healthz和/readyz检查;/v1/chat请求。Test Coverage
最终 Codecov 结果:
89.07%23,391 / 26,26085.40773%10285%pass报告入口:
[Codecov PR #165 Report](https://app.codecov.io/gh/XnLemon/trpc-agent-service/pull/165)
覆盖率脚本使用单次原生 Go
-coverpkgprofile,同时统计跨包执行路径,避免不同测试二进制之间重复初始化或产生不一致的覆盖率结果。本次新增和强化的测试重点包括:
真实验收情况
离线部署验收
主仓库 CI 已通过 Docker Compose Golden Path:
该流程从空数据库开始,完成 Tenant、Agent、Model、Backend 和 Revision 的幂等初始化,并实际调用
/v1/chat返回确定性响应。Telegram Live E2E
主仓库包含真实 Telegram Bot API 的长轮询验收:
[Telegram Live E2E Run](https://github.com/XnLemon/trpc-agent-service/actions/runs/34445046627)
该流程使用受保护的 Telegram credentials,验证:
WeCom AI Bot 验收
主仓库 CI 通过了确定性的 WeCom callback/outbox E2E:
[WeCom Deterministic E2E Run](https://github.com/XnLemon/trpc-agent-service/actions/runs/34445046659)
该测试重点验证协议边界、回调处理、数据库状态和 Outbox 投递,不依赖公开的企业微信账号凭据。
同时,仓库中已经沉淀了真实 AI Bot WebSocket 的人工验收路径,包括:
完整验收文档:
[多租户多 Agent Telegram / WeCom 验收链路](https://github.com/XnLemon/trpc-agent-service/blob/main/docs/docs/multitenant-telegram-acceptance.md)
仓库还保留了 Telegram、企业微信自建应用和企业微信 AI Bot 的实际接入截图及 GIF,作为人工验收材料。
工程化亮点
85%覆盖率门禁;已知边界