bruno
4dc199d44f
commit to gitea
2026-03-01 07:01:34 +08:00
BrunoGaoSZ
d8237ae76d
commit all
2026-02-28 23:57:35 +01:00
BrunoGaoSZ and Claude Sonnet 4.6
55e65a64ba
fix: escape YAML alias in build-and-notify pr body (use --body-file)
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-28 17:58:25 +01:00
BrunoGaoSZ and Claude Sonnet 4.6
343b188138
feat: deploy via ljwx-deploy GitOps — add deploy-pr job and fix apply-sync-autopr defaults
...
- build-and-notify.yml: add deploy-pr job that clones BrunoGaoSZ/ljwx-deploy,
updates apps/agent-platform/overlays/prod/kustomization.yaml with sha-<7> tag,
and creates a PR (auto-merged by branch protection)
- apply-sync-autopr.sh: fix defaults → DEPLOY_REPO_OWNER=BrunoGaoSZ, DEPLOY_REPO_NAME=ljwx-deploy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-28 17:57:25 +01:00
BrunoGaoSZ and Claude Sonnet 4.6
dec280ad40
fix: unit tests in CI require dummy env vars for Settings import
...
- core/config.py: fix ANTHROPIC_MODEL default (claude-sonnet-4-6-20260217 → claude-sonnet-4-6)
- ci.yml unit-tests job: inject ANTHROPIC_AUTH_TOKEN/DATABASE_URL/REDIS_URL as dummy
values so pydantic Settings() validates at collection time without a .env file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-28 17:42:22 +01:00
BrunoGaoSZ and Claude Sonnet 4.6
87cd4b3975
feat: add CI/CD workflows and ops scripts for GHCR → Harbor → k3s pipeline
...
- Gate validation: all 143 unit tests pass (80.38% coverage), 11 integration tests pass
- Fix ANTHROPIC_MODEL default: claude-sonnet-4-6-20260217 → claude-sonnet-4-6
- Fix docker-compose DATABASE_URL/REDIS_URL: remove nested var expansion
- health_check.sh: auto-source .env for local runs, capture claude inference log
- .github/workflows/ci.yml: lint (ruff), type-check (mypy), unit + integration tests
- .github/workflows/build-and-notify.yml: build Python image → GHCR, notify sync-service
- scripts/ops/apply-sync-autopr.sh: configure sync-service auto-PR to agent-deploy
- scripts/ops/check-sync-autopr.sh: verify sync-service + ArgoCD app status
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-28 17:35:02 +01:00
BrunoGaoSZ and Claude Sonnet 4.6
2360e788d3
feat: implement P10 — SOP profiles, integration tests, smoke gate
...
TASK 1 — Profile Schema (core/profile/schema.py)
已存在:EvidenceThresholds / ModelRouting / WorkflowStep / ApprovalRule /
Permissions / CachePolicy / Profile,全部 frozen=True,含 tool-reference 验证器。
TASK 2 — 三个行业 SOP Profile YAML
- profiles/presales/profile.yaml 企业预售方案生成
- profiles/security_analysis/profile.yaml 安全事件分析(host_isolation 需审批)
- profiles/knowledge_qa/profile.yaml 知识问答(严格模式,阈值全 0.90)
TASK 3 — loader / registry / 测试
- core/profile/loader.py + registry.py(线程安全单例 + 热更新)
- tests/unit/test_profiles.py(19 个用例)
- tests/unit/test_scorer.py(12 个用例,覆盖 EvidenceScorer 全路径)
TASK 4 — 端到端集成测试 + 成本追踪
- tests/integration/test_full_pipeline.py 7 个 mock-based 测试
- tests/integration/test_cost_tracking.py 3 个成本测试
- scripts/smoke_test.sh 更新为与最终门禁一致的 ruff 规则
Bug fixes(使全部测试通过):
- LangGraph: ask_node 显式初始化 error/pending_approval,确保 ainvoke()
结果 dict 中始终包含这两个字段
- GraphInterrupt 不再被 act_node 的 except Exception 吞掉
- Citation.model_dump(mode="json") 修复 Decimal JSON 序列化问题
- act_node 直接调用 audit_logger.write_tool_call(集成测试 mock executor 时仍可审计)
- 修复 mypy 错误:config.py 重复字段、encryptor __init__ 返回值、
registry 属性声明、sanitizer.py 类型注解
- 修复 47 处 ruff lint(F401/F841/E501/I001)
- 添加 pytest-timeout>=2.3.0 依赖
最终门禁全部通过:
ruff E,F,I 0 errors | mypy 0 errors
143 unit tests, 80.38% coverage | 11 integration tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-27 09:21:43 +01:00
bruno and Claude Sonnet 4.6
87443535ff
feat: implement core platform layers (P5-P8)
...
Implement complete agent platform with four major layers:
P5 - Engine Layer (LangGraph):
- AgentState with JSON serialization validation
- 5 async nodes (ask, plan, act, verify, report) with error boundaries
- Template resolution system for {{user_input}} and {{steps.xxx}}
- StateGraph with conditional edges and interrupt_after for approval flow
- 17/17 tests passing, 90% coverage
P6 - LLM Layer:
- ClaudeClient with Decimal-based cost calculation (ROUND_HALF_UP)
- Custom exceptions (ClaudeAPIError, ClaudeTimeoutError, ClaudeRateLimitError)
- PromptBuilder with cache_control support
- ModelRouter with sensitivity-based routing (local vs Claude)
- 18/18 tests passing, 90% coverage
P7 - Audit Layer (Three-tier):
- Sanitizer: mask phone/ID card/API keys, contains_sensitive, mask_dict
- Encryptor: AES-256-GCM with keyring support, 12-byte IV
- AuditLogger: L1 (DB), L2 (OTel), L3 (Encrypted payloads)
- 24/24 tests passing, 86% coverage
P8 - API Layer (FastAPI):
- Lifespan management with 8-step startup sequence
- Middleware: TracingMiddleware, RateLimitMiddleware (Redis), CORS
- Auth: JWT decode with python-jose, RBAC with permission matrix
- Routes: health, chat (SSE), approve, trace
- 13/13 tests passing, 91% coverage
All gate checks passing:
- pytest with 85%+ coverage
- mypy type checking
- ruff style checking
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-26 22:00:23 +08:00
BrunoGaoSZ
34e3924c08
docs(agents): add hardened AGENTS instructions for root and submodules
2026-02-26 07:44:14 +01:00
BrunoGaoSZ
ae78a9bbf2
chore: initialize agent-platform and add claude inference health check
2026-02-26 06:56:12 +01:00