flameox 0.2.1__tar.gz → 0.2.2__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.
- {flameox-0.2.1 → flameox-0.2.2}/CHANGELOG.md +30 -0
- {flameox-0.2.1 → flameox-0.2.2}/PKG-INFO +14 -6
- {flameox-0.2.1 → flameox-0.2.2}/README.md +13 -5
- {flameox-0.2.1 → flameox-0.2.2}/docs/adapters.md +20 -4
- {flameox-0.2.1 → flameox-0.2.2}/docs/interfaces.md +29 -11
- {flameox-0.2.1 → flameox-0.2.2}/docs/runtime-safety.md +3 -0
- {flameox-0.2.1 → flameox-0.2.2}/docs/storage-and-evidence.md +11 -4
- {flameox-0.2.1 → flameox-0.2.2}/npm/package-lock.json +2 -2
- {flameox-0.2.1 → flameox-0.2.2}/npm/package.json +1 -1
- {flameox-0.2.1 → flameox-0.2.2}/pyproject.toml +1 -1
- {flameox-0.2.1 → flameox-0.2.2}/server.json +2 -2
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/cli.py +11 -4
- flameox-0.2.2/src/flameox/environment_policy.py +59 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/execution.py +3 -54
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/mcp/server.py +17 -6
- flameox-0.2.2/src/flameox/providers/contracts.py +60 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/cpu.py +22 -6
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/nsight_systems.py +20 -6
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/repository.py +87 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/runtime_contracts.py +13 -1
- flameox-0.2.2/src/flameox/setup.py +141 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/stateless.py +343 -47
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/memray.py +32 -28
- {flameox-0.2.1 → flameox-0.2.2}/tests/adapters/test_memray_aggregation.py +12 -0
- flameox-0.2.2/tests/providers/test_contracts.py +19 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_cpu.py +66 -17
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_nsight_compute.py +67 -1
- flameox-0.2.2/tests/providers/test_nsight_systems.py +138 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/test_cli_stateless.py +53 -3
- flameox-0.2.2/tests/test_runtime_contracts.py +12 -0
- flameox-0.2.2/tests/test_setup_stateless.py +81 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/test_stateless.py +278 -6
- {flameox-0.2.1 → flameox-0.2.2}/uv.lock +1 -1
- flameox-0.2.1/src/flameox/providers/contracts.py +0 -22
- flameox-0.2.1/src/flameox/setup.py +0 -75
- flameox-0.2.1/tests/providers/test_nsight_systems.py +0 -66
- flameox-0.2.1/tests/test_setup_stateless.py +0 -33
- {flameox-0.2.1 → flameox-0.2.2}/.devcontainer/devcontainer.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.env.example +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/CODEOWNERS +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/ISSUE_TEMPLATE/design_discussion.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/labels.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/pull_request_template.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/renovate.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/workflows/ci.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/workflows/labels.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/workflows/release-please.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.github/workflows/release.yml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.gitignore +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.jscpd.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.pre-commit-config.yaml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/.python-version +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/AGENTS.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/CONTRIBUTING.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/LICENSE +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/README.zh-CN.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/SECURITY.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/cliff.toml +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/docs/architecture.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/docs/assets/flameox-mascot-flamegraph.png +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/docs/investigations.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/docs/testing.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/examples/semantic-matrix/README.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/examples/semantic-matrix/semantic_workload.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/mcp-publisher +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/mcp-publisher.tar.gz +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/npm/.oxlintrc.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/npm/README.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/npm/bin/flameox.cjs +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/npm/test/bootstrap.test.cjs +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/__main__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/adapters/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/adapters/sarif.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/adapters/torch_benchmark.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/atomic.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/benchmark_samples.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/canonical.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/command_binding.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/executable_models.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/filesystem.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/mcp/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/models.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/nsight_compute.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/process_models.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/aiperf.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/benchmarks.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/inference_exports.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/kernel_evidence.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/memray.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/nsight_compute.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/nvbench.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/otlp.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/perfetto.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/reliability.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/source_evidence.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/structured_workers.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/providers/xctrace.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/py.typed +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/pytest_capture.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/pytest_runner.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/runtime_errors.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/sdk.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/aiperf.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/aiperf_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/benchmark_samples.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/benchmark_samples_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/compute_sanitizer.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/compute_sanitizer_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/coverage.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/coverage_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/harness.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/memray_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/nsight_compute.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/nsight_compute_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/nsight_systems.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/nsight_systems_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/otlp.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/otlp_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/otlp_parser.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/parquet_schemas.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/perfetto.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/perfetto_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/protocol.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/pyperf.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/pyperf_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/v8_profiles.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/src/flameox/workers/v8_profiles_contract.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/adapters/test_torch_benchmark.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/adapters/test_torch_benchmark_live.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/conftest.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/execution/test_bound_execution.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/execution/test_broker.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/execution/test_command_binding.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/compute_sanitizer/kernel_probe.cu +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/coverage/README.md +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/coverage/coverage-7.13.sqlite +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/coverage/coverage-7.14.sqlite +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/coverage/coverage-7.15.sqlite +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/coverage/workload.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/kernel_validation/pass.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/basic.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/corrupt.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/invalid_uint64.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/multi_range.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/source_files.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/source_markers.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/nsight_compute/uint_boundaries.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/pyspy/chrometrace-0.4.2.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/rocprofv3/project-owned-rocm-shaped-perfetto.json +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/fixtures/triton/vector_add.py.txt +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/performance/test_stateless_scale.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_aiperf.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_compute_sanitizer.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_inference_exports.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_kernel_evidence.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_nvbench.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_rocprof.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/providers/test_xctrace.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/storage/test_bounded_filesystem.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/support/__init__.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/support/execution.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/support/providers.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/test_canonical.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/test_release_metadata.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tests/test_sdk.py +0 -0
- {flameox-0.2.1 → flameox-0.2.2}/tools/__init__.py +0 -0
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to flameox are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.2] - 2026-09-01
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **runtime:** Close canonical evidence edge cases
|
|
10
|
+
- **capture:** Bind providers to owning runtimes
|
|
11
|
+
- **setup:** Retain managed provider extras
|
|
12
|
+
- **capture:** Preserve native evidence across analysis failures
|
|
13
|
+
- **runtime:** Make result continuations truthful
|
|
14
|
+
- **cpu:** Retain resolved py-spy samples
|
|
15
|
+
- **cpu:** Actively probe perf event permissions
|
|
16
|
+
- **memory:** Bound Memray aggregation resources
|
|
17
|
+
- **runtime:** Reject blocked environments at validation
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
- Align runtime ownership and evidence contracts
|
|
22
|
+
- Define provider runtime ownership
|
|
23
|
+
|
|
24
|
+
### Refactoring
|
|
25
|
+
|
|
26
|
+
- **runtime:** Remove unsupported provider fallbacks
|
|
27
|
+
|
|
28
|
+
### Styling
|
|
29
|
+
|
|
30
|
+
- Normalize integrated runtime changes
|
|
31
|
+
|
|
32
|
+
### Testing
|
|
33
|
+
|
|
34
|
+
- **cpu:** Isolate host py-spy fallback
|
|
5
35
|
## [0.2.1] - 2026-09-02
|
|
6
36
|
|
|
7
37
|
### Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: flameox
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Runtime evidence that helps agents trace, profile, and burn down hotspots in application and native code, GPU kernels, and inference stacks.
|
|
5
5
|
Project-URL: Homepage, https://github.com/morluto/flameox
|
|
6
6
|
Project-URL: Repository, https://github.com/morluto/flameox
|
|
@@ -90,9 +90,10 @@ uv run flameox mcp serve --project-root "$PWD"
|
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
`flameox setup` prints the equivalent stdio client configuration. Explicit
|
|
93
|
-
`--provider` selections
|
|
94
|
-
|
|
95
|
-
guidance. Setup never initializes the
|
|
93
|
+
`--provider` selections add the matching Python extras to a persistent uv tool
|
|
94
|
+
environment without removing its existing provider extras. System and vendor
|
|
95
|
+
tools are diagnosed with external install guidance. Setup never initializes the
|
|
96
|
+
project or creates `.flameox`.
|
|
96
97
|
|
|
97
98
|
## Authority model
|
|
98
99
|
|
|
@@ -133,8 +134,10 @@ The server exposes exactly six tools:
|
|
|
133
134
|
- `query_evidence`
|
|
134
135
|
|
|
135
136
|
It exposes one resource template, `flameox://evidence/{evidence_id}`, for the
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
digest-bound, redacted projection of the canonical immutable manifest. Full
|
|
138
|
+
argv, environment values, working directories, and host paths remain available
|
|
139
|
+
only through explicit local manifest inspection. Native artifact bytes are
|
|
140
|
+
deliberately not available as MCP resources.
|
|
138
141
|
|
|
139
142
|
Direct capture accepts an argv array, a project-contained cwd, bounded
|
|
140
143
|
environment overrides, provider and analysis arguments, and limits. Shell
|
|
@@ -142,6 +145,11 @@ strings are never accepted. Work remains owned by the live MCP request, so SDK
|
|
|
142
145
|
progress and cancellation apply directly; there are no detached or
|
|
143
146
|
restart-surviving tasks.
|
|
144
147
|
|
|
148
|
+
Managed external collectors such as py-spy execute from Flameox's uv tool
|
|
149
|
+
environment. In-process collectors such as coverage.py and Memray are verified
|
|
150
|
+
in, and run with, the workload's declared Python interpreter. Flameox does not
|
|
151
|
+
substitute one Python runtime for the other.
|
|
152
|
+
|
|
145
153
|
## Evidence quality
|
|
146
154
|
|
|
147
155
|
An investigation still follows:
|
|
@@ -30,9 +30,10 @@ uv run flameox mcp serve --project-root "$PWD"
|
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
`flameox setup` prints the equivalent stdio client configuration. Explicit
|
|
33
|
-
`--provider` selections
|
|
34
|
-
|
|
35
|
-
guidance. Setup never initializes the
|
|
33
|
+
`--provider` selections add the matching Python extras to a persistent uv tool
|
|
34
|
+
environment without removing its existing provider extras. System and vendor
|
|
35
|
+
tools are diagnosed with external install guidance. Setup never initializes the
|
|
36
|
+
project or creates `.flameox`.
|
|
36
37
|
|
|
37
38
|
## Authority model
|
|
38
39
|
|
|
@@ -73,8 +74,10 @@ The server exposes exactly six tools:
|
|
|
73
74
|
- `query_evidence`
|
|
74
75
|
|
|
75
76
|
It exposes one resource template, `flameox://evidence/{evidence_id}`, for the
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
digest-bound, redacted projection of the canonical immutable manifest. Full
|
|
78
|
+
argv, environment values, working directories, and host paths remain available
|
|
79
|
+
only through explicit local manifest inspection. Native artifact bytes are
|
|
80
|
+
deliberately not available as MCP resources.
|
|
78
81
|
|
|
79
82
|
Direct capture accepts an argv array, a project-contained cwd, bounded
|
|
80
83
|
environment overrides, provider and analysis arguments, and limits. Shell
|
|
@@ -82,6 +85,11 @@ strings are never accepted. Work remains owned by the live MCP request, so SDK
|
|
|
82
85
|
progress and cancellation apply directly; there are no detached or
|
|
83
86
|
restart-surviving tasks.
|
|
84
87
|
|
|
88
|
+
Managed external collectors such as py-spy execute from Flameox's uv tool
|
|
89
|
+
environment. In-process collectors such as coverage.py and Memray are verified
|
|
90
|
+
in, and run with, the workload's declared Python interpreter. Flameox does not
|
|
91
|
+
substitute one Python runtime for the other.
|
|
92
|
+
|
|
85
93
|
## Evidence quality
|
|
86
94
|
|
|
87
95
|
An investigation still follows:
|
|
@@ -56,10 +56,19 @@ provider arguments, and effective limits. They return typed observed/derived
|
|
|
56
56
|
blocks, staged native outputs, coverage, truncation, and limitations. They never
|
|
57
57
|
look up runs or mutable records.
|
|
58
58
|
|
|
59
|
+
The runtime projects provider blocks into the RFC 8785 JSON domain before
|
|
60
|
+
bounding or preservation. Native integers outside JSON's interoperable safe
|
|
61
|
+
integer range are represented as exact decimal strings; they are never rounded
|
|
62
|
+
or allowed to fail later during canonicalization.
|
|
63
|
+
|
|
59
64
|
Native inputs remain byte-for-byte unchanged. Capture outputs stay in bounded
|
|
60
65
|
session scratch until explicit preservation. Large derived tables are immutable
|
|
61
66
|
files inside an evidence bundle, not rows in a durable database.
|
|
62
67
|
|
|
68
|
+
When capture-time preservation is requested, native outputs are published independently of
|
|
69
|
+
downstream normalization success. A decoder failure is retained as a typed analysis failure next
|
|
70
|
+
to authoritative native bytes rather than causing the capture to disappear.
|
|
71
|
+
|
|
63
72
|
## Isolation and conversion
|
|
64
73
|
|
|
65
74
|
Unsafe or heavy decoders use the typed isolated-worker protocol and
|
|
@@ -73,7 +82,14 @@ session-local in-memory DuckDB; it does not create a temporary SQLite database.
|
|
|
73
82
|
|
|
74
83
|
## Provider setup boundary
|
|
75
84
|
|
|
76
|
-
An explicit `flameox setup --provider ...` invocation
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
An explicit `flameox setup --provider ...` invocation adds the selected Python
|
|
86
|
+
extras to the persistent uv tool environment while retaining extras from its
|
|
87
|
+
existing uv receipt. The result reports the complete managed provider set.
|
|
88
|
+
System and vendor packages remain externally installed. Setup creates no
|
|
89
|
+
project state and is not a prerequisite for explicit-path analysis.
|
|
90
|
+
|
|
91
|
+
Provider ownership is explicit during capture. External collectors installed
|
|
92
|
+
with Flameox, such as py-spy, execute from the managed tool environment rather
|
|
93
|
+
than ambient request `PATH`. In-process collectors, including coverage.py and
|
|
94
|
+
Memray, must be installed in the declared workload interpreter; capture probes
|
|
95
|
+
that interpreter before execution and never substitutes Flameox's interpreter.
|
|
@@ -22,8 +22,10 @@ There is one resource template:
|
|
|
22
22
|
flameox://evidence/{evidence_id}
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`resources/list` is empty. `resources/read` returns
|
|
26
|
-
|
|
25
|
+
`resources/list` is empty. `resources/read` returns a redacted, digest-bound projection of the
|
|
26
|
+
canonical manifest with its own versioned media type. It omits argv, environment values, working
|
|
27
|
+
directories, and host paths. The local CLI `evidence show` command is the explicit full-provenance
|
|
28
|
+
view. A missing resource is a protocol error.
|
|
27
29
|
|
|
28
30
|
Tools do not advertise output schemas. Success uses structured content directly,
|
|
29
31
|
without an `ok/result/error` envelope. Tool failures set `isError=true` and carry
|
|
@@ -38,8 +40,18 @@ PathSource {kind: "path", path, format?, producer?, expected_sha256?}
|
|
|
38
40
|
EvidenceSource {kind: "evidence", evidence_id, artifact_role?}
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
Continuations are opaque
|
|
42
|
-
|
|
43
|
+
Continuations are opaque integrity cursors bound to the request and exact input
|
|
44
|
+
digests. They contain no authority, credentials, or artifact data and are not
|
|
45
|
+
an authentication boundary: a caller already authorized to submit the analysis
|
|
46
|
+
can choose which of its rows to request. They can cross process boundaries, so
|
|
47
|
+
a CLI invocation can resume a previous page. A changed input cannot reuse a
|
|
48
|
+
continuation.
|
|
49
|
+
|
|
50
|
+
Projection providers may expose a bounded prefix when their native reader cannot
|
|
51
|
+
resume safely. Such results keep `coverage.complete=false`, identify
|
|
52
|
+
`truncation.reason=provider_limit`, and do not emit a continuation after the last
|
|
53
|
+
retrievable row. A continuation therefore always names a consumable next page;
|
|
54
|
+
it never promises access beyond a provider's declared projection bound.
|
|
43
55
|
|
|
44
56
|
Requests may lower startup row, result-byte, timeout, output-byte, and durable
|
|
45
57
|
provenance-byte limits. Durable provenance bounds the captured argv and execution
|
|
@@ -53,6 +65,11 @@ bounded environment overrides after experiment-case overrides are merged,
|
|
|
53
65
|
provider ID, provider capture arguments, analysis arguments, and request limits.
|
|
54
66
|
Shell command strings are not accepted.
|
|
55
67
|
|
|
68
|
+
Callers may request preservation as part of capture. Once native collection succeeds, requested
|
|
69
|
+
preservation publishes the native artifacts even if immediate analysis fails; the result then
|
|
70
|
+
reports separate capture execution state and a typed `analysis_failure`. An analysis failure is
|
|
71
|
+
never converted into empty successful evidence.
|
|
72
|
+
|
|
56
73
|
Experiment mode adds 2-16 cases, 1-100 blocks, a seed, metric, estimand,
|
|
57
74
|
practical threshold, and optional semantic-oracle argv. Version 0.2 evaluates
|
|
58
75
|
`wall_time_ns` with a paired `median_difference` or `mean_difference`, reports
|
|
@@ -77,14 +94,15 @@ The retained surface is:
|
|
|
77
94
|
flameox setup
|
|
78
95
|
flameox mcp serve|inspect
|
|
79
96
|
flameox capabilities discover|inspect
|
|
80
|
-
flameox analyze [--preserve]
|
|
97
|
+
flameox analyze [--continuation TOKEN] [--preserve]
|
|
81
98
|
flameox capture [--preserve] -- <argv...>
|
|
82
99
|
flameox evidence query|show
|
|
83
100
|
```
|
|
84
101
|
|
|
85
|
-
`setup` prints stdio configuration. Repeated `--provider` options
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
rules used by
|
|
102
|
+
`setup` prints stdio configuration. Repeated `--provider` options add Python
|
|
103
|
+
provider extras to a persistent uv tool environment without removing its
|
|
104
|
+
existing extras, and the result reports the complete managed provider set.
|
|
105
|
+
System and vendor providers receive external installation guidance. Setup does
|
|
106
|
+
not create a project repository, durable operation, or MCP setup endpoint.
|
|
107
|
+
Other CLI commands construct the same runtime and project-root rules used by
|
|
108
|
+
MCP.
|
|
@@ -60,3 +60,6 @@ All work stays local. Manifests preserve explicit paths, provider identity,
|
|
|
60
60
|
effective requests, digests, and execution provenance, so callers must consider
|
|
61
61
|
whether those values are sensitive before preservation. Flameox does not upload
|
|
62
62
|
artifacts, launch native viewers, or expose payload bytes through MCP resources.
|
|
63
|
+
The ordinary MCP evidence resource is a structurally allowlisted projection: full argv,
|
|
64
|
+
environment values, working directories, source paths, and scratch paths remain available only
|
|
65
|
+
through explicit local canonical-manifest inspection.
|
|
@@ -40,13 +40,18 @@ analysis requests, the evidence-episode timestamp, data-file digests, coverage,
|
|
|
40
40
|
and limitations. Process-local handles such as `analysis_id` and continuation
|
|
41
41
|
tokens are excluded from preserved data.
|
|
42
42
|
|
|
43
|
-
The stored envelope adds `format_version` and `evidence_id`. The canonical
|
|
44
|
-
|
|
43
|
+
The stored envelope adds `format_version` and `evidence_id`. The canonical manifest remains the
|
|
44
|
+
local repository and CLI contract. MCP resources expose a separate redacted projection so durable
|
|
45
|
+
provenance is not confused with agent-visible metadata:
|
|
45
46
|
|
|
46
47
|
```text
|
|
47
|
-
application/vnd.flameox.evidence+json;version=1
|
|
48
|
+
application/vnd.flameox.evidence-projection+json;version=1
|
|
48
49
|
```
|
|
49
50
|
|
|
51
|
+
The projection retains immutable identities, digests, capture and analysis status, coverage, and
|
|
52
|
+
provider identity. It replaces capture requests with digests and bounded status fields and never
|
|
53
|
+
returns argv, environment values, working directories, input paths, or scratch paths.
|
|
54
|
+
|
|
50
55
|
## Publication
|
|
51
56
|
|
|
52
57
|
Artifact and evidence directories are assembled beneath the same-filesystem
|
|
@@ -71,7 +76,9 @@ inventory digest before filtering. A continuation is bound to that inventory;
|
|
|
71
76
|
mutation makes it stale rather than silently changing the page. Filters cover
|
|
72
77
|
evidence kind, capability, provider, input digest, and time bounds.
|
|
73
78
|
|
|
74
|
-
`flameox://evidence/{evidence_id}`
|
|
79
|
+
`flameox://evidence/{evidence_id}` validates the canonical manifest and returns its redacted MCP
|
|
80
|
+
projection. `flameox evidence show` remains the explicit local administrative view of the full
|
|
81
|
+
canonical manifest.
|
|
75
82
|
Missing or corrupt resources are MCP resource errors. Native payload bytes are
|
|
76
83
|
not exposed through resources; their digest and role remain visible in the
|
|
77
84
|
manifest.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flameox",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "flameox",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.2",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"bin": {
|
|
12
12
|
"flameox": "bin/flameox.cjs"
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "flameox"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Runtime evidence that helps agents trace, profile, and burn down hotspots in application and native code, GPU kernels, and inference stacks."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"url": "https://github.com/morluto/flameox",
|
|
9
9
|
"source": "github"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.2",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "pypi",
|
|
15
15
|
"registryBaseUrl": "https://pypi.org",
|
|
16
16
|
"identifier": "flameox",
|
|
17
|
-
"version": "0.2.
|
|
17
|
+
"version": "0.2.2",
|
|
18
18
|
"runtimeHint": "uvx",
|
|
19
19
|
"transport": {
|
|
20
20
|
"type": "stdio"
|
|
@@ -82,7 +82,9 @@ def setup(
|
|
|
82
82
|
root = project_root.resolve(strict=True)
|
|
83
83
|
selected = provider or []
|
|
84
84
|
try:
|
|
85
|
-
|
|
85
|
+
installation = install_providers(selected) if selected else None
|
|
86
|
+
command = installation.command if installation is not None else []
|
|
87
|
+
configured_providers = installation.providers if installation is not None else []
|
|
86
88
|
guidance = provider_guidance(selected)
|
|
87
89
|
except SetupFailure as error:
|
|
88
90
|
raise typer.BadParameter(str(error), param_hint="--provider") from error
|
|
@@ -92,7 +94,7 @@ def setup(
|
|
|
92
94
|
"project_root": str(root),
|
|
93
95
|
"durable_repository": str(root / ".flameox"),
|
|
94
96
|
"repository_created": False,
|
|
95
|
-
"providers":
|
|
97
|
+
"providers": configured_providers,
|
|
96
98
|
"install_command": command,
|
|
97
99
|
"external_guidance": guidance,
|
|
98
100
|
}
|
|
@@ -158,6 +160,7 @@ def analyze(
|
|
|
158
160
|
sources: Annotated[list[Path], typer.Argument()],
|
|
159
161
|
arguments: Annotated[str, typer.Option("--arguments")] = "{}",
|
|
160
162
|
format_name: Annotated[str | None, typer.Option("--format")] = None,
|
|
163
|
+
continuation: Annotated[str | None, typer.Option("--continuation")] = None,
|
|
161
164
|
preserve: Annotated[bool, typer.Option("--preserve")] = False,
|
|
162
165
|
project_root: Annotated[Path, typer.Option("--project-root")] = Path("."),
|
|
163
166
|
) -> None:
|
|
@@ -168,6 +171,7 @@ def analyze(
|
|
|
168
171
|
capability_id,
|
|
169
172
|
[PathSource(path=str(path.resolve()), format=format_name) for path in sources],
|
|
170
173
|
_json_object(arguments, option="--arguments"),
|
|
174
|
+
continuation=continuation,
|
|
171
175
|
)
|
|
172
176
|
if preserve:
|
|
173
177
|
result["preserved"] = runtime.preserve_evidence(str(result["analysis_id"]))
|
|
@@ -207,14 +211,17 @@ def capture(
|
|
|
207
211
|
analysis_arguments=_json_object(analysis_arguments, option="--analysis-arguments"),
|
|
208
212
|
),
|
|
209
213
|
capability_id,
|
|
214
|
+
preserve=preserve,
|
|
210
215
|
)
|
|
211
216
|
|
|
212
217
|
try:
|
|
213
218
|
result = anyio.run(execute)
|
|
214
|
-
if preserve:
|
|
219
|
+
if preserve and "preserved" not in result:
|
|
215
220
|
result["preserved"] = runtime.preserve_evidence(str(result["analysis_id"]))
|
|
216
221
|
_write(result)
|
|
217
|
-
if
|
|
222
|
+
if result.get("analysis_failure") is not None or any(
|
|
223
|
+
item["status"] != "succeeded" for item in result["capture"]["executions"]
|
|
224
|
+
):
|
|
218
225
|
raise typer.Exit(code=1)
|
|
219
226
|
except (RuntimeFailure, ValidationError) as error:
|
|
220
227
|
_cli_failure(error)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import re
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
|
|
7
|
+
_DANGEROUS_ENVIRONMENT = {
|
|
8
|
+
"BASH_ENV",
|
|
9
|
+
"CDPATH",
|
|
10
|
+
"ENV",
|
|
11
|
+
"GIT_ASKPASS",
|
|
12
|
+
"LD_LIBRARY_PATH",
|
|
13
|
+
"LD_PRELOAD",
|
|
14
|
+
"PYTHONHOME",
|
|
15
|
+
"PYTHONPATH",
|
|
16
|
+
"SSH_ASKPASS",
|
|
17
|
+
}
|
|
18
|
+
_DANGEROUS_ENVIRONMENT_PREFIXES = ("DYLD_", "GDB_", "GIT_CONFIG_", "LD_", "LLDB_")
|
|
19
|
+
_DANGEROUS_ENVIRONMENT_NAMES = {
|
|
20
|
+
"JAVA_TOOL_OPTIONS",
|
|
21
|
+
"NODE_EXTRA_CA_CERTS",
|
|
22
|
+
"NODE_OPTIONS",
|
|
23
|
+
"PERL5LIB",
|
|
24
|
+
"PERL5OPT",
|
|
25
|
+
"RUBYLIB",
|
|
26
|
+
"RUBYOPT",
|
|
27
|
+
"GDBINIT",
|
|
28
|
+
"GDBHISTFILE",
|
|
29
|
+
"PYTHONSTARTUP",
|
|
30
|
+
}
|
|
31
|
+
_CREDENTIAL_ENVIRONMENT = re.compile(
|
|
32
|
+
r"(?:^|_)(?:TOKEN|PASSWORD|PASSWD|SECRET|KEY|CREDENTIALS?|COOKIES?)(?:_|$)"
|
|
33
|
+
)
|
|
34
|
+
_SAFE_CONTROL_OVERRIDES = {"GIT_CONFIG_GLOBAL": os.devnull, "GIT_CONFIG_NOSYSTEM": "1"}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def is_dangerous_environment_name(name: str) -> bool:
|
|
38
|
+
normalized = name.upper()
|
|
39
|
+
return (
|
|
40
|
+
normalized in _DANGEROUS_ENVIRONMENT
|
|
41
|
+
or normalized in _DANGEROUS_ENVIRONMENT_NAMES
|
|
42
|
+
or normalized.startswith(_DANGEROUS_ENVIRONMENT_PREFIXES)
|
|
43
|
+
or _CREDENTIAL_ENVIRONMENT.search(normalized) is not None
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def is_safe_control_override(name: str, value: str) -> bool:
|
|
48
|
+
return _SAFE_CONTROL_OVERRIDES.get(name.upper()) == value
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def blocked_environment_override(overrides: Mapping[str, str]) -> str | None:
|
|
52
|
+
return next(
|
|
53
|
+
(
|
|
54
|
+
name
|
|
55
|
+
for name, value in overrides.items()
|
|
56
|
+
if is_dangerous_environment_name(name) and not is_safe_control_override(name, value)
|
|
57
|
+
),
|
|
58
|
+
None,
|
|
59
|
+
)
|
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import os
|
|
5
|
-
import re
|
|
6
5
|
import shutil
|
|
7
6
|
import signal
|
|
8
7
|
import stat
|
|
@@ -23,6 +22,7 @@ import psutil
|
|
|
23
22
|
from pydantic import Field, field_validator, model_validator
|
|
24
23
|
|
|
25
24
|
from flameox.command_binding import ExecutableResolver
|
|
25
|
+
from flameox.environment_policy import is_dangerous_environment_name, is_safe_control_override
|
|
26
26
|
from flameox.executable_models import ResolvedExecutable
|
|
27
27
|
from flameox.models import ContractModel
|
|
28
28
|
from flameox.process_models import (
|
|
@@ -34,43 +34,6 @@ from flameox.process_models import (
|
|
|
34
34
|
)
|
|
35
35
|
from flameox.runtime_errors import DomainError, ErrorCode
|
|
36
36
|
|
|
37
|
-
_DANGEROUS_ENVIRONMENT = {
|
|
38
|
-
"BASH_ENV",
|
|
39
|
-
"CDPATH",
|
|
40
|
-
"ENV",
|
|
41
|
-
"GIT_ASKPASS",
|
|
42
|
-
"LD_LIBRARY_PATH",
|
|
43
|
-
"LD_PRELOAD",
|
|
44
|
-
"PYTHONHOME",
|
|
45
|
-
"PYTHONPATH",
|
|
46
|
-
"SSH_ASKPASS",
|
|
47
|
-
}
|
|
48
|
-
_DANGEROUS_ENVIRONMENT_PREFIXES = (
|
|
49
|
-
"DYLD_",
|
|
50
|
-
"GDB_",
|
|
51
|
-
"GIT_CONFIG_",
|
|
52
|
-
"LD_",
|
|
53
|
-
"LLDB_",
|
|
54
|
-
)
|
|
55
|
-
_DANGEROUS_ENVIRONMENT_NAMES = {
|
|
56
|
-
"JAVA_TOOL_OPTIONS",
|
|
57
|
-
"NODE_EXTRA_CA_CERTS",
|
|
58
|
-
"NODE_OPTIONS",
|
|
59
|
-
"PERL5LIB",
|
|
60
|
-
"PERL5OPT",
|
|
61
|
-
"RUBYLIB",
|
|
62
|
-
"RUBYOPT",
|
|
63
|
-
"GDBINIT",
|
|
64
|
-
"GDBHISTFILE",
|
|
65
|
-
"PYTHONSTARTUP",
|
|
66
|
-
}
|
|
67
|
-
_CREDENTIAL_ENVIRONMENT = re.compile(
|
|
68
|
-
r"(?:^|_)(?:TOKEN|PASSWORD|PASSWD|SECRET|KEY|CREDENTIALS?|COOKIES?)(?:_|$)"
|
|
69
|
-
)
|
|
70
|
-
_SAFE_CONTROL_OVERRIDES = {
|
|
71
|
-
"GIT_CONFIG_GLOBAL": os.devnull,
|
|
72
|
-
"GIT_CONFIG_NOSYSTEM": "1",
|
|
73
|
-
}
|
|
74
37
|
INSTALLER_ENVIRONMENT_ALLOWLIST = (
|
|
75
38
|
"PATH",
|
|
76
39
|
"HTTP_PROXY",
|
|
@@ -111,20 +74,6 @@ class ProcessSnapshotPhase(StrEnum):
|
|
|
111
74
|
POST_ROOT_EXIT = "post_root_exit"
|
|
112
75
|
|
|
113
76
|
|
|
114
|
-
def _is_dangerous_environment_name(name: str) -> bool:
|
|
115
|
-
normalized = name.upper()
|
|
116
|
-
return (
|
|
117
|
-
normalized in _DANGEROUS_ENVIRONMENT
|
|
118
|
-
or normalized in _DANGEROUS_ENVIRONMENT_NAMES
|
|
119
|
-
or normalized.startswith(_DANGEROUS_ENVIRONMENT_PREFIXES)
|
|
120
|
-
or _CREDENTIAL_ENVIRONMENT.search(normalized) is not None
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
def _is_safe_control_override(name: str, value: str) -> bool:
|
|
125
|
-
return _SAFE_CONTROL_OVERRIDES.get(name.upper()) == value
|
|
126
|
-
|
|
127
|
-
|
|
128
77
|
class ResourcePolicy(ContractModel):
|
|
129
78
|
filesystem_path: Path
|
|
130
79
|
staging_root: Path | None = None
|
|
@@ -1815,14 +1764,14 @@ class SubprocessBroker:
|
|
|
1815
1764
|
environment = {
|
|
1816
1765
|
name: os.environ[name]
|
|
1817
1766
|
for name in request.environment_allowlist
|
|
1818
|
-
if name in os.environ and not
|
|
1767
|
+
if name in os.environ and not is_dangerous_environment_name(name)
|
|
1819
1768
|
}
|
|
1820
1769
|
if request.systemd_scope_unit is not None:
|
|
1821
1770
|
for name in ("DBUS_SESSION_BUS_ADDRESS", "XDG_RUNTIME_DIR"):
|
|
1822
1771
|
if name in os.environ:
|
|
1823
1772
|
environment[name] = os.environ[name]
|
|
1824
1773
|
for name, value in request.environment_overrides.items():
|
|
1825
|
-
if
|
|
1774
|
+
if is_dangerous_environment_name(name) and not is_safe_control_override(name, value):
|
|
1826
1775
|
raise DomainError(
|
|
1827
1776
|
ErrorCode.INVALID_INPUT,
|
|
1828
1777
|
f"Environment override {name!r} is blocked by policy.",
|
|
@@ -16,7 +16,7 @@ from mcp_types import CallToolResult, ContentBlock, ResourceLink, TextContent, T
|
|
|
16
16
|
from pydantic import ValidationError
|
|
17
17
|
|
|
18
18
|
from flameox import __version__
|
|
19
|
-
from flameox.repository import
|
|
19
|
+
from flameox.repository import AGENT_EVIDENCE_MEDIA_TYPE
|
|
20
20
|
from flameox.runtime_contracts import (
|
|
21
21
|
CaptureTarget,
|
|
22
22
|
ExperimentDesign,
|
|
@@ -158,6 +158,7 @@ def create_server(
|
|
|
158
158
|
mode: Literal["single", "experiment"] = "single",
|
|
159
159
|
experiment: ExperimentDesign | None = None,
|
|
160
160
|
limits: RequestLimits | None = None,
|
|
161
|
+
preserve: bool = False,
|
|
161
162
|
ctx: Context[AnalysisRuntime] | None = None,
|
|
162
163
|
) -> CallToolResult:
|
|
163
164
|
"""Execute a typed target through the broker and immediately analyze its outputs."""
|
|
@@ -174,6 +175,7 @@ def create_server(
|
|
|
174
175
|
experiment=experiment,
|
|
175
176
|
limits=limits,
|
|
176
177
|
progress=progress,
|
|
178
|
+
preserve=preserve,
|
|
177
179
|
)
|
|
178
180
|
failed = [
|
|
179
181
|
item for item in value["capture"]["executions"] if item["status"] != "succeeded"
|
|
@@ -186,7 +188,16 @@ def create_server(
|
|
|
186
188
|
details={"partial_evidence": value, "failed_executions": failed},
|
|
187
189
|
)
|
|
188
190
|
)
|
|
189
|
-
|
|
191
|
+
preserved = value.get("preserved")
|
|
192
|
+
link = None
|
|
193
|
+
if isinstance(preserved, dict):
|
|
194
|
+
link = ResourceLink(
|
|
195
|
+
type="resource_link",
|
|
196
|
+
uri=preserved["uri"],
|
|
197
|
+
name=f"Evidence {preserved['evidence_id']}",
|
|
198
|
+
mime_type=AGENT_EVIDENCE_MEDIA_TYPE,
|
|
199
|
+
)
|
|
200
|
+
return _success(value, resource=link)
|
|
190
201
|
except RuntimeFailure as error:
|
|
191
202
|
return _failure(error)
|
|
192
203
|
except ValidationError as error:
|
|
@@ -205,7 +216,7 @@ def create_server(
|
|
|
205
216
|
type="resource_link",
|
|
206
217
|
uri=value["uri"],
|
|
207
218
|
name=f"Evidence {value['evidence_id']}",
|
|
208
|
-
mime_type=
|
|
219
|
+
mime_type=AGENT_EVIDENCE_MEDIA_TYPE,
|
|
209
220
|
)
|
|
210
221
|
return _success(value, resource=link)
|
|
211
222
|
except RuntimeFailure as error:
|
|
@@ -242,12 +253,12 @@ def create_server(
|
|
|
242
253
|
@server.resource(
|
|
243
254
|
"flameox://evidence/{evidence_id}",
|
|
244
255
|
name="immutable-evidence-manifest",
|
|
245
|
-
description="
|
|
246
|
-
mime_type=
|
|
256
|
+
description="Redacted projection of an immutable Flameox evidence manifest.",
|
|
257
|
+
mime_type=AGENT_EVIDENCE_MEDIA_TYPE,
|
|
247
258
|
)
|
|
248
259
|
async def evidence_manifest(evidence_id: str) -> str:
|
|
249
260
|
try:
|
|
250
|
-
manifest = runtime().
|
|
261
|
+
manifest = runtime().read_evidence_agent_projection(evidence_id)
|
|
251
262
|
except RuntimeFailure as error:
|
|
252
263
|
# Resource handlers raise so missing resources are protocol errors, not content.
|
|
253
264
|
raise FileNotFoundError(f"{error.code}: {error.message}") from error
|