petfishframework 0.3.3__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- petfishframework-0.4.1/.sisyphus/plans/v0.4.0-plan.md +236 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/AGENTS.md +4 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/CHANGELOG.md +57 -0
- petfishframework-0.4.1/Dockerfile +7 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/PKG-INFO +29 -8
- {petfishframework-0.3.3 → petfishframework-0.4.1}/README.md +23 -7
- {petfishframework-0.3.3 → petfishframework-0.4.1}/SECURITY.md +5 -4
- petfishframework-0.4.1/docker-compose.yml +8 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/api.md +25 -1
- petfishframework-0.4.1/docs/deployment.md +181 -0
- petfishframework-0.4.1/docs/feedbacks/petfishframework_v0_4_0_review.md +830 -0
- petfishframework-0.4.1/docs/release-protocol.md +86 -0
- petfishframework-0.4.1/docs/threat-model.md +189 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/pyproject.toml +3 -1
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/__init__.py +1 -1
- petfishframework-0.4.1/src/petfishframework/__main__.py +28 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/environment.py +12 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/session.py +38 -4
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/credentials/__init__.py +2 -1
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/credentials/broker.py +12 -0
- petfishframework-0.4.1/src/petfishframework/credentials/vault_adapter.py +87 -0
- petfishframework-0.4.1/src/petfishframework/observability/__init__.py +15 -0
- petfishframework-0.4.1/src/petfishframework/observability/otel_sink.py +111 -0
- petfishframework-0.4.1/src/petfishframework/observability/siem_sink.py +157 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/__init__.py +4 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/replay.py +109 -0
- petfishframework-0.4.1/tests/test_main_entry.py +30 -0
- petfishframework-0.4.1/tests/test_otel_sink.py +87 -0
- petfishframework-0.4.1/tests/test_replay_rerun.py +162 -0
- petfishframework-0.4.1/tests/test_replay_resume.py +185 -0
- petfishframework-0.4.1/tests/test_siem_export.py +206 -0
- petfishframework-0.4.1/tests/test_vault_adapter.py +79 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/uv.lock +63 -2
- petfishframework-0.3.3/src/petfishframework/observability/__init__.py +0 -10
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.env.example +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.github/workflows/ci.yml +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.github/workflows/publish.yml +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.gitignore +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.sisyphus/plans/v0.1.6-plan.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.sisyphus/plans/v0.2.0-plan.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/.sisyphus/plans/v0.3.0-plan.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/AGENTS.md.new +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/CONTRIBUTING.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/LICENSE +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/conftest.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/architecture.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/benchmark-results.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/development-plan.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/development.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/enterprise-expense-demo.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_0_1_4_playground_recommendations.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_playground_report.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_production_readiness_roadmap.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_recommendations.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_v0_1_6_playground_review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_v0_1_7_review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_v0_1_8_review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_v0_2_1_review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/feedbacks/archives/petfishframework_v0_2_2_review.md +0 -0
- {petfishframework-0.3.3/docs/feedbacks → petfishframework-0.4.1/docs/feedbacks/archives}/petfishframework_v0_3_0_review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/release-checklist.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/competitor-analysis/README.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/competitor-analysis/competitor-matrix.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/competitor-analysis/market-brief.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/competitor-analysis/positioning-map.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/competitor-analysis/swot-analysis.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/literature-review/inclusion-exclusion-criteria.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/literature-review/literature-matrix.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/literature-review/literature-review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/literature-review/search-strategy.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/research/reference-repos-absorption.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/skeleton-completeness-checklist.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/test-results-report.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/usage-guide.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/docs/validation-roadmap.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/initialization-report.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/mcp/README.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/mcp/connection-checklist.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/mcp/mcp-config.example.json +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/opencode.json +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/qa/code-review-checklist.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/qa/qa-review.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/qa/qc-gate-decision.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/qa/test-plan.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/config.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/agent.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/compiled.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/contracts.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/conversation.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/events.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/structured.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/core/types.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/credentials/token.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/mcp/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/mcp/client.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/mcp/server.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/mcp/stdio_transport.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/mcp/wrapper.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/models/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/models/anthropic.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/models/fake.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/models/openai.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/observability/sinks.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/permissions/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/permissions/model.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/policies/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/policies/conditions.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/policies/engine.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/policies/rule.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/policies/test_runner.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/policies/validator.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reasoning/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reasoning/lats.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reasoning/llm_plus_p.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reasoning/react.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/audit_report.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/cost.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/cost_report.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/pass_at_k.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/retry.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/reliability/timeout.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/retrieval/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/retrieval/adaptive.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/retrieval/crag.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/retrieval/memory_store.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/agent_tool.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/base.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/calculator.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/path_planner.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/registry.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/src/petfishframework/tools/word_sorter.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tasks/backlog.md +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/integration/__init__.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/integration/test_anthropic_integration.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/integration/test_openai_integration.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/policies/enterprise-expense.tests.yaml +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_agent_tool.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_anthropic_adapter.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_api_agent_lifecycle.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_api_edge_cases.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_api_integration.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_api_public_surface.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_api_type_safety.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_async.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_audit_report_v2.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_conversation.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_credential_broker.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_credential_integration.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_degrade.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_degrade_failclosed.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_enterprise_demo.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_m2_m3_m4.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_mcp.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_openai_adapter.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_pass_at_k.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_permission_semantics.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_quickstart_smoke.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_replay.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_retrieval.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_retry.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_skeleton.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_stdio_transport.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_streaming.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_structured.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_tool_registry.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_v016_semantics.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_v018.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_v019.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_v2_interface_compatibility.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_v2_lats.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_v2_llm_plus_p.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_yaml_policy.py +0 -0
- {petfishframework-0.3.3 → petfishframework-0.4.1}/tests/test_yaml_policy_suite.py +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# petfishFramework v0.4.0 开发计划
|
|
2
|
+
|
|
3
|
+
> 基于 v0.3.3 状态 + 8 轮用户反馈 + 全部 deferred 项汇总
|
|
4
|
+
> 目标:observability + deterministic replay + 生产化基础
|
|
5
|
+
> 原则:**TDD 先行,pre_release.py 门禁,文档同步作为完成条件**
|
|
6
|
+
|
|
7
|
+
## v0.4.0 使命
|
|
8
|
+
|
|
9
|
+
> 让 Agent 运行时可观测(OTel)、可回放(确定性 RERUN/RESUME)、可治理(SIEM export)、可部署(Docker + 部署指南)。
|
|
10
|
+
|
|
11
|
+
## Deferred 项汇总(从全部反馈中提取)
|
|
12
|
+
|
|
13
|
+
| 来源 | Deferred 项 | v0.4.0 目标 |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| v0.3.0 §9.2 | deterministic rerun / resume | ✅ 实现 |
|
|
16
|
+
| v0.3.0 §9.2 | MCP server mode | ⏳ v0.5.0(需完整 MCP server 实现) |
|
|
17
|
+
| v0.3.0 §9.2 | deployment guide | ✅ Dockerfile + 部署文档 |
|
|
18
|
+
| v0.3.0 §9.2 | OpenTelemetry | ✅ OTelSink |
|
|
19
|
+
| v0.3.0 §9.2 | SIEM export | ✅ JSON-Lines trace export |
|
|
20
|
+
| v0.3.0 §P2 | Vault adapter | ✅ HashiCorp Vault adapter (可选) |
|
|
21
|
+
| v0.3.0 §P2 | threat model | ✅ 威胁模型文档 |
|
|
22
|
+
| v0.3.0 §P2 | SBOM | ✅ cyclonedx 生成 |
|
|
23
|
+
| v0.3.0 §P2 | signed release | ✅ sigstore cosign |
|
|
24
|
+
| 多轮 | README Current Limitations 中 planned 项 | 清理为 available |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Phase A: Deterministic Replay (RESUME + RERUN)
|
|
29
|
+
|
|
30
|
+
### A1: RESUME — 检查点恢复
|
|
31
|
+
|
|
32
|
+
**目标**:从检查点恢复执行,重注入已记录的模型响应直到检查点,之后继续新鲜调用。
|
|
33
|
+
|
|
34
|
+
#### TDD 测试先行
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
# tests/test_replay_resume.py
|
|
38
|
+
|
|
39
|
+
def test_resume_replays_recorded_prefix():
|
|
40
|
+
"""RESUME: 重注入检查点前的模型响应。"""
|
|
41
|
+
|
|
42
|
+
def test_resume_continues_with_fresh_calls():
|
|
43
|
+
"""RESUME: 检查点后用 live environment 新鲜调用。"""
|
|
44
|
+
|
|
45
|
+
def test_resume_from_mid_session():
|
|
46
|
+
"""RESUME: 从 Session 中间的检查点恢复。"""
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### 实现
|
|
50
|
+
|
|
51
|
+
- `ResumableEnvironment`(已有 v0.1.x 基础)增强:
|
|
52
|
+
- `checkpoint_model_idx` / `checkpoint_tool_idx` 参数
|
|
53
|
+
- 检查点前用 `recording.model_responses[i]` 重注入
|
|
54
|
+
- 检查点后切换到 `live_env`
|
|
55
|
+
- `Session.checkpoint()` 发出 `session.checkpoint` 事件 + 记录当前 model/tool 索引
|
|
56
|
+
- `Session.resume_from(checkpoint_data)` 工厂方法
|
|
57
|
+
|
|
58
|
+
### A2: RERUN — 确定性完整重放 + 偏离检测
|
|
59
|
+
|
|
60
|
+
**目标**:完整重放一个 Session 的所有调用,验证轨迹一致。偏离时报告差异。
|
|
61
|
+
|
|
62
|
+
#### TDD 测试先行
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
# tests/test_replay_rerun.py
|
|
66
|
+
|
|
67
|
+
def test_rerun_reproduces_identical_trajectory():
|
|
68
|
+
"""RERUN: 完整重放,轨迹完全一致。"""
|
|
69
|
+
|
|
70
|
+
def test_rerun_detects_model_call_count_divergence():
|
|
71
|
+
"""RERUN: 模型调用次数不一致 → 报告偏离。"""
|
|
72
|
+
|
|
73
|
+
def test_rerun_detects_tool_result_divergence():
|
|
74
|
+
"""RERUN: 工具结果不一致 → 报告偏离。"""
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### 实现
|
|
78
|
+
|
|
79
|
+
- `RerunEnvironment`:封装 `RecordingEnvironment` + `ReplayEnvironment`
|
|
80
|
+
- `rerun() -> RerunResult`:重放 + 比对
|
|
81
|
+
- `RerunResult.matches: bool` + `divergences: list[str]`
|
|
82
|
+
- 检测:调用次数偏离、工具名偏离、结果值偏离
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Phase B: Observability
|
|
87
|
+
|
|
88
|
+
### B1: OpenTelemetry Sink
|
|
89
|
+
|
|
90
|
+
**目标**:Session 事件 → OTel spans,可接入 Jaeger/Zipkin/DataDog。
|
|
91
|
+
|
|
92
|
+
#### TDD 测试先行
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
# tests/test_otel_sink.py
|
|
96
|
+
|
|
97
|
+
def test_otel_sink_creates_span_per_tool_call():
|
|
98
|
+
"""每个 tool.called 事件创建一个 span。"""
|
|
99
|
+
|
|
100
|
+
def test_otel_sink_creates_span_per_model_call():
|
|
101
|
+
"""每个 model.called 事件创建一个 span。"""
|
|
102
|
+
|
|
103
|
+
def test_otel_sink_nests_tool_spans_under_session():
|
|
104
|
+
"""工具 span 嵌套在 session trace 下。"""
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### 实现
|
|
108
|
+
|
|
109
|
+
- `observability/otel_sink.py` — `OTelSink`:
|
|
110
|
+
- 接收 EventEmitter 事件
|
|
111
|
+
- Session → OTel Trace
|
|
112
|
+
- model.called → span (attributes: model name, tokens, cost)
|
|
113
|
+
- tool.called/blocked/masked → span (attributes: tool name, effect, duration)
|
|
114
|
+
- 使用 `opentelemetry-api`(可选依赖:`pip install petfishframework[otel]`)
|
|
115
|
+
- 无 OTel 安装时降级为 no-op
|
|
116
|
+
|
|
117
|
+
### B2: SIEM Export (JSON-Lines Trace)
|
|
118
|
+
|
|
119
|
+
**目标**:结构化事件导出,可导入 Splunk/Elastic/Datadog。
|
|
120
|
+
|
|
121
|
+
#### TDD 测试先行
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
# tests/test_siem_export.py
|
|
125
|
+
|
|
126
|
+
def test_siem_export_produces_jsonlines():
|
|
127
|
+
"""导出为 JSON-Lines 格式。"""
|
|
128
|
+
|
|
129
|
+
def test_siem_export_redacts_credentials():
|
|
130
|
+
"""导出中不含 secret。"""
|
|
131
|
+
|
|
132
|
+
def test_siem_export_includes_policy_version():
|
|
133
|
+
"""每条记录包含 policy_version。"""
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### 实现
|
|
137
|
+
|
|
138
|
+
- `observability/siem_sink.py` — `SIEMSink`:
|
|
139
|
+
- 接收事件 → 写入 JSON-Lines 文件/流
|
|
140
|
+
- 每行:`{"timestamp", "session_id", "event_type", "tool_name", "effect", "executed", "policy_version", "duration_ms"}`
|
|
141
|
+
- 自动脱敏(复用 event_mask 逻辑)
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Phase C: Production Foundation
|
|
146
|
+
|
|
147
|
+
### C1: Vault Adapter
|
|
148
|
+
|
|
149
|
+
**目标**:CredentialBroker 支持 HashiCorp Vault 作为 secret 后端。
|
|
150
|
+
|
|
151
|
+
#### TDD 测试先行
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
# tests/test_vault_adapter.py
|
|
155
|
+
|
|
156
|
+
def test_vault_adapter_reads_secret():
|
|
157
|
+
"""Vault adapter 从 Vault 读取 secret。"""
|
|
158
|
+
# 使用 mock,不连真实 Vault
|
|
159
|
+
|
|
160
|
+
def test_vault_adapter_caches_locally():
|
|
161
|
+
"""读取后缓存,减少 Vault 调用。"""
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### 实现
|
|
165
|
+
|
|
166
|
+
- `credentials/vault_adapter.py` — `VaultCredentialSource`:
|
|
167
|
+
- `read_secret(path: str) -> str` — 从 Vault 读取
|
|
168
|
+
- 可选依赖:`hvac` library
|
|
169
|
+
- 集成到 `CredentialBroker.register_credential_from_vault(path)`
|
|
170
|
+
|
|
171
|
+
### C2: Dockerfile + 部署指南
|
|
172
|
+
|
|
173
|
+
**文件**:
|
|
174
|
+
- `Dockerfile` — 多阶段构建
|
|
175
|
+
- `docker-compose.yml` — 开发环境
|
|
176
|
+
- `docs/deployment.md` — 部署指南
|
|
177
|
+
|
|
178
|
+
### C3: SBOM + Signed Release
|
|
179
|
+
|
|
180
|
+
- `.github/workflows/publish.yml` 增强:
|
|
181
|
+
- 生成 SBOM (cyclonedx)
|
|
182
|
+
- cosign 签名
|
|
183
|
+
- `docs/threat-model.md` — 威胁模型
|
|
184
|
+
|
|
185
|
+
### C4: 文档 + README 更新
|
|
186
|
+
|
|
187
|
+
- api.md: 新增 OTel + SIEM + Vault + Replay 章节
|
|
188
|
+
- README: Current Limitations 清理(deterministic replay: Available; OTel: Available)
|
|
189
|
+
- CHANGELOG: v0.4.0
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 执行顺序与依赖
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
A1 (RESUME) → A2 (RERUN)
|
|
197
|
+
↓
|
|
198
|
+
B1 (OTel) → B2 (SIEM)
|
|
199
|
+
↓
|
|
200
|
+
C1 (Vault) → C2 (Docker) → C3 (SBOM) → C4 (docs)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## 验收标准
|
|
204
|
+
|
|
205
|
+
| # | 标准 | 验证方法 |
|
|
206
|
+
|---|---|---|
|
|
207
|
+
| V1 | RESUME 从检查点恢复执行 | `test_replay_resume.py` |
|
|
208
|
+
| V2 | RERUN 完整重放 + 偏离检测 | `test_replay_rerun.py` |
|
|
209
|
+
| V3 | OTel sink 生成 spans | `test_otel_sink.py` |
|
|
210
|
+
| V4 | SIEM 导出 JSON-Lines + 脱敏 | `test_siem_export.py` |
|
|
211
|
+
| V5 | Vault adapter 读取 secret(mock) | `test_vault_adapter.py` |
|
|
212
|
+
| V6 | Dockerfile 可构建 | `docker build .` |
|
|
213
|
+
| V7 | SBOM 生成 | CI workflow |
|
|
214
|
+
| V8 | pre_release.py exit 0 | `python scripts/pre_release.py 0.4.0` |
|
|
215
|
+
| V9 | 所有 284+ 现有测试通过 | pytest |
|
|
216
|
+
| V10 | ruff clean | ruff check |
|
|
217
|
+
| V11 | README Current Limitations 清理 | grep "Planned" |
|
|
218
|
+
|
|
219
|
+
## 不做清单(v0.5.0+)
|
|
220
|
+
|
|
221
|
+
- ❌ MCP server mode
|
|
222
|
+
- ❌ MCP governance (allowlist, rate limit)
|
|
223
|
+
- ❌ Tool sandbox (subprocess isolation)
|
|
224
|
+
- ❌ Policy hot-reload
|
|
225
|
+
- ❌ Multi-tenant policy namespace
|
|
226
|
+
|
|
227
|
+
## 新测试预估
|
|
228
|
+
|
|
229
|
+
| Phase | 测试数 |
|
|
230
|
+
|---|---|
|
|
231
|
+
| A1 RESUME | 3 |
|
|
232
|
+
| A2 RERUN | 3 |
|
|
233
|
+
| B1 OTel | 3 |
|
|
234
|
+
| B2 SIEM | 3 |
|
|
235
|
+
| C1 Vault | 2 |
|
|
236
|
+
| **总计** | **~14 新测试** |
|
|
@@ -63,6 +63,10 @@ tasks/ 任务与 backlog
|
|
|
63
63
|
规则:每条必须是"违反会导致 bug,且代码本身无法自解释"的约束;上限 10 条。
|
|
64
64
|
-->
|
|
65
65
|
|
|
66
|
+
1. **Release 版本号 grep checklist** — 每次发布前必须 grep 旧版本号。`SECURITY.md` 的 Supported Versions 表是版本敏感文件,但 `pre_release.py` 不检查它。发布前手动执行 `grep -rn "0\.[0-9]\+\.x" SECURITY.md` 确认当前版本。遗漏会导致外部安全审计认为项目维护停滞。
|
|
67
|
+
2. **新模块必须同步 `__init__.py` 导出** — 新增 `src/petfishframework/<module>/<sub>.py` 时,必须同时在 `<module>/__init__.py` 的 `__all__` 和 import 中添加导出。否则用户无法从包顶层导入,只能走子模块路径,违反 Python 包惯例。OTelSink/SIEMSink 在 v0.4.0 发布时遗漏了此步骤。
|
|
68
|
+
3. **Docker ENTRYPOINT 必须有对应的 `__main__.py`** — Dockerfile 中 `ENTRYPOINT ["python", "-m", "petfishframework"]` 要求 `src/petfishframework/__main__.py` 存在且 `main()` 返回 int 退出码。没有 `__main__.py` 时容器启动直接 crash,且 CI 不构建 Docker 所以不会发现。
|
|
69
|
+
|
|
66
70
|
## Architecture Decisions
|
|
67
71
|
|
|
68
72
|
<!-- 重大技术选型和设计决策的简要记录(一句话结论 + 指向 docs/ 下完整 ADR 的链接)。 -->
|
|
@@ -2,6 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to petfishFramework will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.4.1] — 2026-07-08
|
|
6
|
+
|
|
7
|
+
### Review Fix Patch
|
|
8
|
+
|
|
9
|
+
#### Security & Version Hygiene
|
|
10
|
+
- `SECURITY.md` Supported Versions updated from `0.2.x` to `0.4.x` active + `0.3.x` security fixes only
|
|
11
|
+
- `AGENTS.md` Development Gotchas filled with 3 prevention rules (version grep, `__init__.py` export, Docker entrypoint)
|
|
12
|
+
|
|
13
|
+
#### Observability API
|
|
14
|
+
- `observability/__init__.py` now exports `OTelSink` and `SIEMSink` (previously required submodule import)
|
|
15
|
+
- Updated docstring to reflect actual available sinks
|
|
16
|
+
|
|
17
|
+
#### SIEMSink Enhanced Redaction
|
|
18
|
+
- New `redact_keys` parameter: `SIEMSink(redact_keys=("api_key", "password", ...))`
|
|
19
|
+
- Default redaction: `api_key`, `secret`, `password`, `token`, `authorization`, `cookie`
|
|
20
|
+
- Nested dict key matching (e.g. `connection.password` in `details.redacted_fields`)
|
|
21
|
+
- 3 new TDD tests: default keys, nested keys, custom keys
|
|
22
|
+
|
|
23
|
+
#### Docker Entrypoint Fix
|
|
24
|
+
- Created `src/petfishframework/__main__.py` — `python -m petfishframework` now works
|
|
25
|
+
- Docker container `ENTRYPOINT` no longer crashes on start
|
|
26
|
+
- 2 new TDD tests verifying exit code and output
|
|
27
|
+
|
|
28
|
+
#### README
|
|
29
|
+
- Core Concepts table: "RERUN + RESUME planned" → available
|
|
30
|
+
- Added Observability (OTel + SIEM) section with code example
|
|
31
|
+
- Test count badge updated to 305
|
|
32
|
+
|
|
33
|
+
## [0.4.0] — 2026-07-08
|
|
34
|
+
|
|
35
|
+
### v0.4.0 Production Foundation
|
|
36
|
+
|
|
37
|
+
#### Phase A+B: Deterministic Replay + Observability
|
|
38
|
+
- Deterministic replay infrastructure (`petfishframework.reliability.replay`):
|
|
39
|
+
- `RecordingEnvironment` captures every model response, tool call, and retrieval
|
|
40
|
+
- `ReplayEnvironment` replays recorded calls for deterministic audit
|
|
41
|
+
- `ResumableEnvironment` replays prefix then switches to live execution
|
|
42
|
+
- `ReplayMode.AUDIT`, `RESUME`, `RERUN` semantics
|
|
43
|
+
- OpenTelemetry sink (`OTelSink`) — creates spans for model/tool/session events
|
|
44
|
+
- SIEM export (`SIEMSink`) — structured JSON audit events for downstream SIEMs
|
|
45
|
+
|
|
46
|
+
#### Phase C: Vault Adapter + Deployment + Threat Model
|
|
47
|
+
- `VaultCredentialSource` — reads secrets from HashiCorp Vault with lazy `hvac` import
|
|
48
|
+
- `CredentialBroker.register_credential_from_vault(name, source, path)` — register
|
|
49
|
+
credentials fetched from Vault
|
|
50
|
+
- Optional dependency group `vault = ["hvac>=1.0"]`
|
|
51
|
+
- `Dockerfile` and `docker-compose.yml` for containerized deployment
|
|
52
|
+
- `docs/deployment.md` — Docker deployment guide, environment variables, volume mounts,
|
|
53
|
+
credential-broker integration, and security notes
|
|
54
|
+
- `docs/threat-model.md` — attack surface, trust boundaries, threats, mitigations,
|
|
55
|
+
and fail-closed defaults
|
|
56
|
+
|
|
57
|
+
#### Documentation Sync
|
|
58
|
+
- `docs/api.md` updated to v0.4.0
|
|
59
|
+
- README: deterministic replay and OTel marked available, roadmap bumped to v0.4.x
|
|
60
|
+
- Test count badge updated to 300
|
|
61
|
+
|
|
5
62
|
## [0.3.2] — 2026-07-08
|
|
6
63
|
|
|
7
64
|
### YAML Policy DSL Expansion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: petfishframework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: A lightweight runtime framework for reliable, auditable, budget-aware, and permission-aware AI agents.
|
|
5
5
|
Project-URL: Homepage, https://github.com/kylecui/petfishFramework
|
|
6
6
|
Project-URL: Documentation, https://github.com/kylecui/petfishFramework/tree/master/docs
|
|
@@ -26,6 +26,11 @@ Provides-Extra: mcp
|
|
|
26
26
|
Requires-Dist: mcp>=1.0; extra == 'mcp'
|
|
27
27
|
Provides-Extra: openai
|
|
28
28
|
Requires-Dist: openai>=1.0; extra == 'openai'
|
|
29
|
+
Provides-Extra: otel
|
|
30
|
+
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
|
|
31
|
+
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
|
|
32
|
+
Provides-Extra: vault
|
|
33
|
+
Requires-Dist: hvac>=1.0; extra == 'vault'
|
|
29
34
|
Description-Content-Type: text/markdown
|
|
30
35
|
|
|
31
36
|
# petfishFramework
|
|
@@ -34,7 +39,7 @@ Description-Content-Type: text/markdown
|
|
|
34
39
|
|
|
35
40
|
[](https://www.python.org/downloads/)
|
|
36
41
|
[](https://github.com/kylecui/petfishFramework/blob/master/LICENSE)
|
|
37
|
-
[](https://github.com/kylecui/petfishFramework/tree/master/tests/)
|
|
38
43
|
|
|
39
44
|
**Status: Alpha** — API may change. Core runtime works; see [Roadmap](#roadmap).
|
|
40
45
|
|
|
@@ -187,7 +192,7 @@ print(result.summary())
|
|
|
187
192
|
| **Environment** | Single chokepoint (all calls audited, budget-metered, permission-gated) |
|
|
188
193
|
| **Budget** | Hard execution limits (tokens, cost, steps, tool calls) |
|
|
189
194
|
| **Permission** | SARC access control with 6 DecisionEffects |
|
|
190
|
-
| **Replay** | AUDIT event log
|
|
195
|
+
| **Replay** | AUDIT event log via `session.replay()`; RERUN + RESUME via `reliability.replay` wrappers |
|
|
191
196
|
| **Pass^k** | Reliability metric (k repetitions + perturbation suite) |
|
|
192
197
|
|
|
193
198
|
## Features
|
|
@@ -244,11 +249,27 @@ agent = Agent(model=model, reasoning=ReAct(), tools=tools, credential_broker=bro
|
|
|
244
249
|
# Tools with requires_credentials=True receive a ScopedToken (repr-safe, auto-expiring)
|
|
245
250
|
```
|
|
246
251
|
|
|
252
|
+
## Observability (OTel + SIEM)
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
from petfishframework.observability import OTelSink, SIEMSink
|
|
256
|
+
|
|
257
|
+
# OTel — creates spans for model/tool/session events (requires opentelemetry)
|
|
258
|
+
otel_sink = OTelSink() # no-op if opentelemetry not installed
|
|
259
|
+
|
|
260
|
+
# SIEM — structured JSON-Lines export for downstream SIEM ingestion
|
|
261
|
+
siem_sink = SIEMSink(output_path="audit.jsonl")
|
|
262
|
+
# Credentials auto-redacted; configure additional secret fields:
|
|
263
|
+
# siem_sink = SIEMSink(output_path="audit.jsonl", redact_keys=("api_key", "password"))
|
|
264
|
+
|
|
265
|
+
agent = Agent(model=model, reasoning=ReAct(), tools=tools, event_sinks=(otel_sink, siem_sink))
|
|
266
|
+
```
|
|
267
|
+
|
|
247
268
|
## Roadmap
|
|
248
269
|
|
|
249
270
|
- **v0.2.x**: Core runtime, permission semantics, enterprise PoC, Trusted Publishing ✅
|
|
250
|
-
- **v0.3.x
|
|
251
|
-
- **v0.4.x
|
|
271
|
+
- **v0.3.x**: YAML Policy Engine, CredentialBroker ✅
|
|
272
|
+
- **v0.4.x** (current): Production hardening, deployment guides, Vault adapter, Docker, threat model ✅
|
|
252
273
|
|
|
253
274
|
## Current Limitations
|
|
254
275
|
|
|
@@ -263,8 +284,8 @@ petfishFramework is **Alpha**. API may change before v1.0.
|
|
|
263
284
|
| PARTIAL_ALLOW | ✅ Enforced (pre-execution arg filtering) |
|
|
264
285
|
| MASK | ✅ Enforced (input mask before + output mask after) |
|
|
265
286
|
| DEGRADE | ✅ Enforced (fallback tool switching) |
|
|
266
|
-
| Session replay
|
|
267
|
-
|
|
|
287
|
+
| Session replay / deterministic rerun / resume | ✅ Available |
|
|
288
|
+
| OpenTelemetry + SIEM observability | ✅ Available |
|
|
268
289
|
| MCP client stdio | ✅ Available |
|
|
269
290
|
| MCP server mode | 📋 Planned |
|
|
270
291
|
| Structured output / conversation memory | ✅ Available |
|
|
@@ -279,7 +300,7 @@ petfishFramework is **Alpha**. API may change before v1.0.
|
|
|
279
300
|
git clone https://github.com/kylecui/petfishFramework.git
|
|
280
301
|
cd petfishFramework
|
|
281
302
|
uv sync --all-extras
|
|
282
|
-
uv run pytest #
|
|
303
|
+
uv run pytest # 305 tests
|
|
283
304
|
uv run ruff check src/ tests/
|
|
284
305
|
```
|
|
285
306
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.python.org/downloads/)
|
|
6
6
|
[](https://github.com/kylecui/petfishFramework/blob/master/LICENSE)
|
|
7
|
-
[](https://github.com/kylecui/petfishFramework/tree/master/tests/)
|
|
8
8
|
|
|
9
9
|
**Status: Alpha** — API may change. Core runtime works; see [Roadmap](#roadmap).
|
|
10
10
|
|
|
@@ -157,7 +157,7 @@ print(result.summary())
|
|
|
157
157
|
| **Environment** | Single chokepoint (all calls audited, budget-metered, permission-gated) |
|
|
158
158
|
| **Budget** | Hard execution limits (tokens, cost, steps, tool calls) |
|
|
159
159
|
| **Permission** | SARC access control with 6 DecisionEffects |
|
|
160
|
-
| **Replay** | AUDIT event log
|
|
160
|
+
| **Replay** | AUDIT event log via `session.replay()`; RERUN + RESUME via `reliability.replay` wrappers |
|
|
161
161
|
| **Pass^k** | Reliability metric (k repetitions + perturbation suite) |
|
|
162
162
|
|
|
163
163
|
## Features
|
|
@@ -214,11 +214,27 @@ agent = Agent(model=model, reasoning=ReAct(), tools=tools, credential_broker=bro
|
|
|
214
214
|
# Tools with requires_credentials=True receive a ScopedToken (repr-safe, auto-expiring)
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
+
## Observability (OTel + SIEM)
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
from petfishframework.observability import OTelSink, SIEMSink
|
|
221
|
+
|
|
222
|
+
# OTel — creates spans for model/tool/session events (requires opentelemetry)
|
|
223
|
+
otel_sink = OTelSink() # no-op if opentelemetry not installed
|
|
224
|
+
|
|
225
|
+
# SIEM — structured JSON-Lines export for downstream SIEM ingestion
|
|
226
|
+
siem_sink = SIEMSink(output_path="audit.jsonl")
|
|
227
|
+
# Credentials auto-redacted; configure additional secret fields:
|
|
228
|
+
# siem_sink = SIEMSink(output_path="audit.jsonl", redact_keys=("api_key", "password"))
|
|
229
|
+
|
|
230
|
+
agent = Agent(model=model, reasoning=ReAct(), tools=tools, event_sinks=(otel_sink, siem_sink))
|
|
231
|
+
```
|
|
232
|
+
|
|
217
233
|
## Roadmap
|
|
218
234
|
|
|
219
235
|
- **v0.2.x**: Core runtime, permission semantics, enterprise PoC, Trusted Publishing ✅
|
|
220
|
-
- **v0.3.x
|
|
221
|
-
- **v0.4.x
|
|
236
|
+
- **v0.3.x**: YAML Policy Engine, CredentialBroker ✅
|
|
237
|
+
- **v0.4.x** (current): Production hardening, deployment guides, Vault adapter, Docker, threat model ✅
|
|
222
238
|
|
|
223
239
|
## Current Limitations
|
|
224
240
|
|
|
@@ -233,8 +249,8 @@ petfishFramework is **Alpha**. API may change before v1.0.
|
|
|
233
249
|
| PARTIAL_ALLOW | ✅ Enforced (pre-execution arg filtering) |
|
|
234
250
|
| MASK | ✅ Enforced (input mask before + output mask after) |
|
|
235
251
|
| DEGRADE | ✅ Enforced (fallback tool switching) |
|
|
236
|
-
| Session replay
|
|
237
|
-
|
|
|
252
|
+
| Session replay / deterministic rerun / resume | ✅ Available |
|
|
253
|
+
| OpenTelemetry + SIEM observability | ✅ Available |
|
|
238
254
|
| MCP client stdio | ✅ Available |
|
|
239
255
|
| MCP server mode | 📋 Planned |
|
|
240
256
|
| Structured output / conversation memory | ✅ Available |
|
|
@@ -249,7 +265,7 @@ petfishFramework is **Alpha**. API may change before v1.0.
|
|
|
249
265
|
git clone https://github.com/kylecui/petfishFramework.git
|
|
250
266
|
cd petfishFramework
|
|
251
267
|
uv sync --all-extras
|
|
252
|
-
uv run pytest #
|
|
268
|
+
uv run pytest # 305 tests
|
|
253
269
|
uv run ruff check src/ tests/
|
|
254
270
|
```
|
|
255
271
|
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Supported Versions
|
|
4
4
|
|
|
5
|
-
| Version | Supported
|
|
6
|
-
|
|
7
|
-
| 0.
|
|
8
|
-
|
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
|---------|------------------------|
|
|
7
|
+
| 0.4.x | ✅ Active development |
|
|
8
|
+
| 0.3.x | ⚠️ Security fixes only |
|
|
9
|
+
| < 0.3 | ❌ Not supported |
|
|
9
10
|
|
|
10
11
|
## Reporting a Vulnerability
|
|
11
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# petfishFramework API Reference
|
|
2
2
|
|
|
3
|
-
This document is the authoritative reference for the public API of
|
|
3
|
+
This document is the authoritative reference for the public API of petfishFramework v0.4.1. Every signature, field, and example below is derived from the source code and from the tests that exercise it.
|
|
4
4
|
|
|
5
5
|
## 1. Overview
|
|
6
6
|
|
|
@@ -1445,3 +1445,27 @@ token.get_secret() # raises ValueError("max uses exceeded")
|
|
|
1445
1445
|
if session.credential_broker:
|
|
1446
1446
|
session.credential_broker.cleanup_expired()
|
|
1447
1447
|
```
|
|
1448
|
+
|
|
1449
|
+
### Vault Integration (v0.4.0)
|
|
1450
|
+
|
|
1451
|
+
```python
|
|
1452
|
+
from petfishframework.credentials import CredentialBroker, VaultCredentialSource
|
|
1453
|
+
|
|
1454
|
+
broker = CredentialBroker()
|
|
1455
|
+
source = VaultCredentialSource(
|
|
1456
|
+
vault_url="https://vault.example.com",
|
|
1457
|
+
token="hvs.CAES...",
|
|
1458
|
+
)
|
|
1459
|
+
broker.register_credential_from_vault("openai", source, path="secrets/openai")
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
`VaultCredentialSource` performs a lazy import of `hvac` and raises a clear
|
|
1463
|
+
`ImportError` if the optional dependency is missing. The secret is read once and
|
|
1464
|
+
cached locally for the lifetime of the source; subsequent reads of the same
|
|
1465
|
+
path do not call Vault again.
|
|
1466
|
+
|
|
1467
|
+
Install the optional dependency with:
|
|
1468
|
+
|
|
1469
|
+
```bash
|
|
1470
|
+
pip install petfishframework[vault]
|
|
1471
|
+
```
|