mntr 0.2.0__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.
- mntr-0.2.0/.github/workflows/ci.yml +59 -0
- mntr-0.2.0/.github/workflows/release.yml +158 -0
- mntr-0.2.0/.gitignore +23 -0
- mntr-0.2.0/.python-version +1 -0
- mntr-0.2.0/LICENSE +21 -0
- mntr-0.2.0/PKG-INFO +513 -0
- mntr-0.2.0/README.md +480 -0
- mntr-0.2.0/demos/activations_demo.ipynb +365 -0
- mntr-0.2.0/demos/api_demo.py +130 -0
- mntr-0.2.0/demos/decisions_terminal.py +92 -0
- mntr-0.2.0/demos/future_safety.py +83 -0
- mntr-0.2.0/demos/monitor_streams.ipynb +211 -0
- mntr-0.2.0/demos/prompts/deception.jsonl +5 -0
- mntr-0.2.0/demos/stream_demo.py +218 -0
- mntr-0.2.0/demos/token_safety.py +83 -0
- mntr-0.2.0/demos/utils/__init__.py +0 -0
- mntr-0.2.0/demos/utils/deepseek.py +192 -0
- mntr-0.2.0/demos/utils/heatmap.py +489 -0
- mntr-0.2.0/demos/utils/scenarios.py +50 -0
- mntr-0.2.0/demos/utils/streams.py +137 -0
- mntr-0.2.0/demos/utils/ui.py +308 -0
- mntr-0.2.0/pyproject.toml +96 -0
- mntr-0.2.0/scripts/bench_capture.py +324 -0
- mntr-0.2.0/scripts/bench_stack.py +220 -0
- mntr-0.2.0/scripts/check.sh +20 -0
- mntr-0.2.0/scripts/check_research_split.py +63 -0
- mntr-0.2.0/scripts/download_models.sh +36 -0
- mntr-0.2.0/scripts/hf_crosscheck.py +79 -0
- mntr-0.2.0/scripts/serve.sh +40 -0
- mntr-0.2.0/scripts/serve_gemma.sh +6 -0
- mntr-0.2.0/scripts/serve_qwen.sh +12 -0
- mntr-0.2.0/scripts/serve_qwen14.sh +10 -0
- mntr-0.2.0/scripts/serve_qwen_moe.sh +14 -0
- mntr-0.2.0/scripts/serve_qwen_small.sh +13 -0
- mntr-0.2.0/scripts/stop_server.sh +50 -0
- mntr-0.2.0/scripts/validate_server.py +107 -0
- mntr-0.2.0/scripts/verify.sh +37 -0
- mntr-0.2.0/src/monitors/__init__.py +78 -0
- mntr-0.2.0/src/monitors/__main__.py +5 -0
- mntr-0.2.0/src/monitors/builders.py +119 -0
- mntr-0.2.0/src/monitors/capture/__init__.py +47 -0
- mntr-0.2.0/src/monitors/capture/client.py +576 -0
- mntr-0.2.0/src/monitors/capture/config.py +84 -0
- mntr-0.2.0/src/monitors/capture/follow.py +123 -0
- mntr-0.2.0/src/monitors/capture/notify.py +118 -0
- mntr-0.2.0/src/monitors/capture/policy.py +252 -0
- mntr-0.2.0/src/monitors/capture/server.py +782 -0
- mntr-0.2.0/src/monitors/capture/spool.py +326 -0
- mntr-0.2.0/src/monitors/capture/store.py +724 -0
- mntr-0.2.0/src/monitors/capture/verify.py +136 -0
- mntr-0.2.0/src/monitors/capture/vllm_ext/__init__.py +1 -0
- mntr-0.2.0/src/monitors/capture/vllm_ext/connector.py +833 -0
- mntr-0.2.0/src/monitors/capture/vllm_ext/endpoint.py +499 -0
- mntr-0.2.0/src/monitors/capture/vllm_ext/plugin.py +45 -0
- mntr-0.2.0/src/monitors/cli.py +758 -0
- mntr-0.2.0/src/monitors/client.py +731 -0
- mntr-0.2.0/src/monitors/config.py +603 -0
- mntr-0.2.0/src/monitors/datafile.py +210 -0
- mntr-0.2.0/src/monitors/decisions/__init__.py +22 -0
- mntr-0.2.0/src/monitors/decisions/battery.py +180 -0
- mntr-0.2.0/src/monitors/decisions/monitor.py +394 -0
- mntr-0.2.0/src/monitors/decisions/openrouter.py +346 -0
- mntr-0.2.0/src/monitors/decisions/schema.py +237 -0
- mntr-0.2.0/src/monitors/decisions/source.py +409 -0
- mntr-0.2.0/src/monitors/hub/__init__.py +47 -0
- mntr-0.2.0/src/monitors/hub/app.py +374 -0
- mntr-0.2.0/src/monitors/hub/client.py +228 -0
- mntr-0.2.0/src/monitors/hub/contrib/__init__.py +1 -0
- mntr-0.2.0/src/monitors/hub/contrib/llm_judge.py +627 -0
- mntr-0.2.0/src/monitors/hub/core.py +640 -0
- mntr-0.2.0/src/monitors/hub/events.py +188 -0
- mntr-0.2.0/src/monitors/hub/feeds/__init__.py +86 -0
- mntr-0.2.0/src/monitors/hub/feeds/proxy.py +157 -0
- mntr-0.2.0/src/monitors/hub/feeds/vllm_activations.py +490 -0
- mntr-0.2.0/src/monitors/hub/ids.py +75 -0
- mntr-0.2.0/src/monitors/hub/policy.py +55 -0
- mntr-0.2.0/src/monitors/hub/proxy.py +599 -0
- mntr-0.2.0/src/monitors/hub/publisher.py +118 -0
- mntr-0.2.0/src/monitors/hub/server.py +35 -0
- mntr-0.2.0/src/monitors/hub/service.py +615 -0
- mntr-0.2.0/src/monitors/hub/sources.py +141 -0
- mntr-0.2.0/src/monitors/hub/sse.py +82 -0
- mntr-0.2.0/src/monitors/imports.py +16 -0
- mntr-0.2.0/src/monitors/paths.py +69 -0
- mntr-0.2.0/src/monitors/presets/batteries/current.yaml +60 -0
- mntr-0.2.0/src/monitors/presets/batteries/deception.yaml +47 -0
- mntr-0.2.0/src/monitors/presets/batteries/future.yaml +83 -0
- mntr-0.2.0/src/monitors/presets/batteries/refusal.yaml +52 -0
- mntr-0.2.0/src/monitors/presets/batteries/reward_hacking.yaml +53 -0
- mntr-0.2.0/src/monitors/presets/prompts/deception_judge.txt +14 -0
- mntr-0.2.0/src/monitors/presets/prompts/refusal_judge.txt +14 -0
- mntr-0.2.0/src/monitors/presets/prompts/reward_hacking_judge.txt +14 -0
- mntr-0.2.0/src/monitors/presets/qwen3-14b-deception-harm.yaml +42 -0
- mntr-0.2.0/src/monitors/presets/qwen3-14b-deception.yaml +42 -0
- mntr-0.2.0/src/monitors/presets/text-proxy.yaml +61 -0
- mntr-0.2.0/src/monitors/probes/__init__.py +16 -0
- mntr-0.2.0/src/monitors/probes/artifact.py +195 -0
- mntr-0.2.0/src/monitors/probes/base.py +65 -0
- mntr-0.2.0/src/monitors/probes/fusion.py +288 -0
- mntr-0.2.0/src/monitors/probes/hf.py +89 -0
- mntr-0.2.0/src/monitors/probes/loaders/__init__.py +24 -0
- mntr-0.2.0/src/monitors/probes/loaders/trained.py +26 -0
- mntr-0.2.0/src/monitors/probes/pooling.py +414 -0
- mntr-0.2.0/src/monitors/probes/source.py +286 -0
- mntr-0.2.0/src/monitors/probes/torch_probe.py +22 -0
- mntr-0.2.0/src/monitors/probes/train/__init__.py +72 -0
- mntr-0.2.0/src/monitors/probes/train/__main__.py +170 -0
- mntr-0.2.0/src/monitors/probes/train/artifact.py +21 -0
- mntr-0.2.0/src/monitors/probes/train/attention/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/attention/config.yaml +27 -0
- mntr-0.2.0/src/monitors/probes/train/attention/trainer.py +53 -0
- mntr-0.2.0/src/monitors/probes/train/collect.py +485 -0
- mntr-0.2.0/src/monitors/probes/train/common.py +53 -0
- mntr-0.2.0/src/monitors/probes/train/config.py +261 -0
- mntr-0.2.0/src/monitors/probes/train/data.py +489 -0
- mntr-0.2.0/src/monitors/probes/train/diffmean/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/diffmean/config.yaml +21 -0
- mntr-0.2.0/src/monitors/probes/train/diffmean/trainer.py +55 -0
- mntr-0.2.0/src/monitors/probes/train/evaluate.py +171 -0
- mntr-0.2.0/src/monitors/probes/train/fuse.py +169 -0
- mntr-0.2.0/src/monitors/probes/train/latency.py +58 -0
- mntr-0.2.0/src/monitors/probes/train/linreg/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/linreg/config.yaml +20 -0
- mntr-0.2.0/src/monitors/probes/train/linreg/trainer.py +40 -0
- mntr-0.2.0/src/monitors/probes/train/lr/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/lr/config.yaml +22 -0
- mntr-0.2.0/src/monitors/probes/train/lr/trainer.py +61 -0
- mntr-0.2.0/src/monitors/probes/train/methods.py +68 -0
- mntr-0.2.0/src/monitors/probes/train/metrics.py +143 -0
- mntr-0.2.0/src/monitors/probes/train/mlp/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/mlp/config.yaml +26 -0
- mntr-0.2.0/src/monitors/probes/train/mlp/trainer.py +72 -0
- mntr-0.2.0/src/monitors/probes/train/multimax/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/multimax/config.yaml +27 -0
- mntr-0.2.0/src/monitors/probes/train/multimax/trainer.py +50 -0
- mntr-0.2.0/src/monitors/probes/train/rolling/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/rolling/config.yaml +28 -0
- mntr-0.2.0/src/monitors/probes/train/rolling/trainer.py +54 -0
- mntr-0.2.0/src/monitors/probes/train/run.py +272 -0
- mntr-0.2.0/src/monitors/probes/train/sequence.py +174 -0
- mntr-0.2.0/src/monitors/probes/train/swim/__init__.py +0 -0
- mntr-0.2.0/src/monitors/probes/train/swim/config.yaml +25 -0
- mntr-0.2.0/src/monitors/probes/train/swim/trainer.py +54 -0
- mntr-0.2.0/src/monitors/server.py +714 -0
- mntr-0.2.0/src/monitors/starter.py +118 -0
- mntr-0.2.0/src/monitors/style.py +31 -0
- mntr-0.2.0/src/monitors/templates/probe/README.md.tmpl +37 -0
- mntr-0.2.0/src/monitors/templates/probe/serve.yaml.tmpl +14 -0
- mntr-0.2.0/src/monitors/templates/probe/traces.jsonl +8 -0
- mntr-0.2.0/src/monitors/templates/probe/train.py.tmpl +31 -0
- mntr-0.2.0/tests/__init__.py +0 -0
- mntr-0.2.0/tests/capture_helpers.py +75 -0
- mntr-0.2.0/tests/config_helpers.py +94 -0
- mntr-0.2.0/tests/conftest.py +30 -0
- mntr-0.2.0/tests/decisions_helpers.py +214 -0
- mntr-0.2.0/tests/fakes.py +635 -0
- mntr-0.2.0/tests/layer_source.py +20 -0
- mntr-0.2.0/tests/probe_train_helpers.py +62 -0
- mntr-0.2.0/tests/test_activations_client.py +476 -0
- mntr-0.2.0/tests/test_battery.py +177 -0
- mntr-0.2.0/tests/test_builders.py +81 -0
- mntr-0.2.0/tests/test_capture_config.py +87 -0
- mntr-0.2.0/tests/test_cli.py +983 -0
- mntr-0.2.0/tests/test_client_api.py +808 -0
- mntr-0.2.0/tests/test_config.py +522 -0
- mntr-0.2.0/tests/test_config_flow.py +1006 -0
- mntr-0.2.0/tests/test_connector.py +1550 -0
- mntr-0.2.0/tests/test_datafile.py +174 -0
- mntr-0.2.0/tests/test_decisions_monitor.py +882 -0
- mntr-0.2.0/tests/test_decisions_source.py +669 -0
- mntr-0.2.0/tests/test_demos.py +137 -0
- mntr-0.2.0/tests/test_docs.py +338 -0
- mntr-0.2.0/tests/test_docs_yaml.py +90 -0
- mntr-0.2.0/tests/test_e2e_small.py +453 -0
- mntr-0.2.0/tests/test_e2e_stack.py +309 -0
- mntr-0.2.0/tests/test_endpoint.py +1095 -0
- mntr-0.2.0/tests/test_feed_vllm.py +979 -0
- mntr-0.2.0/tests/test_follow.py +326 -0
- mntr-0.2.0/tests/test_hub_app.py +714 -0
- mntr-0.2.0/tests/test_hub_client.py +382 -0
- mntr-0.2.0/tests/test_hub_core.py +482 -0
- mntr-0.2.0/tests/test_hub_ids.py +94 -0
- mntr-0.2.0/tests/test_hub_policy.py +71 -0
- mntr-0.2.0/tests/test_hub_service.py +810 -0
- mntr-0.2.0/tests/test_launch_sync.py +350 -0
- mntr-0.2.0/tests/test_layers.py +81 -0
- mntr-0.2.0/tests/test_llm_judge.py +848 -0
- mntr-0.2.0/tests/test_notebook_imports.py +235 -0
- mntr-0.2.0/tests/test_notify.py +234 -0
- mntr-0.2.0/tests/test_packaging.py +296 -0
- mntr-0.2.0/tests/test_plan_capture.py +188 -0
- mntr-0.2.0/tests/test_plugin.py +62 -0
- mntr-0.2.0/tests/test_probe_collect.py +493 -0
- mntr-0.2.0/tests/test_probe_evaluate.py +258 -0
- mntr-0.2.0/tests/test_probe_hf.py +217 -0
- mntr-0.2.0/tests/test_probe_source.py +407 -0
- mntr-0.2.0/tests/test_probe_train.py +746 -0
- mntr-0.2.0/tests/test_proxy.py +365 -0
- mntr-0.2.0/tests/test_proxy_broken.py +142 -0
- mntr-0.2.0/tests/test_proxy_disconnect.py +147 -0
- mntr-0.2.0/tests/test_proxy_guards.py +305 -0
- mntr-0.2.0/tests/test_proxy_ids.py +39 -0
- mntr-0.2.0/tests/test_research_split.py +52 -0
- mntr-0.2.0/tests/test_sources_configs.py +51 -0
- mntr-0.2.0/tests/test_spool.py +269 -0
- mntr-0.2.0/tests/test_store.py +1023 -0
- mntr-0.2.0/tests/test_vllm_launch.py +828 -0
- mntr-0.2.0/tests/verify/__init__.py +0 -0
- mntr-0.2.0/tests/verify/conftest.py +433 -0
- mntr-0.2.0/tests/verify/fake_engine.py +339 -0
- mntr-0.2.0/tests/verify/fake_judge.py +80 -0
- mntr-0.2.0/tests/verify/harness.py +276 -0
- mntr-0.2.0/tests/verify/sources.py +158 -0
- mntr-0.2.0/tests/verify/test_cli.py +329 -0
- mntr-0.2.0/tests/verify/test_external.py +88 -0
- mntr-0.2.0/tests/verify/test_gpu.py +546 -0
- mntr-0.2.0/tests/verify/test_gpu14b.py +109 -0
- mntr-0.2.0/tests/verify/test_live.py +381 -0
- mntr-0.2.0/tests/verify/test_security.py +539 -0
- mntr-0.2.0/tests/verify/test_static.py +246 -0
- mntr-0.2.0/uv.lock +6186 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
workflow_call: # release runs it before a manual release
|
|
9
|
+
|
|
10
|
+
# a newer push to a PR replaces its run; runs on main all finish, since release waits for
|
|
11
|
+
# each merge's ci to pass (as a called workflow, github.workflow is the caller's)
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- uses: astral-sh/setup-uv@v6
|
|
22
|
+
- run: uvx ruff@0.16.10 check
|
|
23
|
+
- run: uvx ruff@0.16.10 format --check
|
|
24
|
+
# uv.lock agrees with pyproject.toml (dependencies, and the version a release bumps)
|
|
25
|
+
- run: uv lock --check
|
|
26
|
+
|
|
27
|
+
dist:
|
|
28
|
+
# the wheel and sdist build, and their metadata and README render as PyPI requires
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: astral-sh/setup-uv@v6
|
|
33
|
+
- run: uv build
|
|
34
|
+
- run: uvx twine check --strict dist/*
|
|
35
|
+
|
|
36
|
+
research-split:
|
|
37
|
+
# a research branch (one that changes experiments/) never changes the package
|
|
38
|
+
if: github.event_name == 'pull_request'
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
with:
|
|
43
|
+
fetch-depth: 0 # the merge base with the PR's base branch
|
|
44
|
+
- run: python3 scripts/check_research_split.py "origin/${{ github.base_ref }}"
|
|
45
|
+
|
|
46
|
+
test:
|
|
47
|
+
# the offline suite: no GPU, no model weights (GPU tests: scripts/check.sh --gpu)
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
timeout-minutes: 45
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
- name: Make room for torch and vLLM
|
|
53
|
+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
54
|
+
- uses: astral-sh/setup-uv@v6
|
|
55
|
+
with:
|
|
56
|
+
python-version: "3.13"
|
|
57
|
+
enable-cache: true
|
|
58
|
+
- run: uv sync --frozen
|
|
59
|
+
- run: uv run --frozen --no-sync pytest -q -m "not gpu" --durations=10
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# The version is vMAJOR.MINOR.PATCH:
|
|
4
|
+
# - every PR merged into main bumps PATCH and tags it (a commit pushed straight to main
|
|
5
|
+
# does not), once ci has passed on the merge commit;
|
|
6
|
+
# - Actions tab -> release -> Run workflow (on main) runs ci on main first, then bumps
|
|
7
|
+
# MINOR (or MAJOR), resetting PATCH, and also publishes a GitHub release with notes
|
|
8
|
+
# from the PRs since the last one.
|
|
9
|
+
# - with "publish" ticked, a manual release also builds the wheel and sdist from its tag
|
|
10
|
+
# and uploads them to PyPI (jobs build and publish). Patch bumps are never uploaded.
|
|
11
|
+
#
|
|
12
|
+
# No release is made unless every ci job passed: a failed (or cancelled) ci run on main
|
|
13
|
+
# leaves the version alone, and the next merged PR whose ci passes gets the bump.
|
|
14
|
+
#
|
|
15
|
+
# PyPI upload uses Trusted Publishing (no token in the repo): PyPI trusts this workflow
|
|
16
|
+
# file (release.yml) of idhantgulati/monitors in the GitHub environment `pypi`, set up
|
|
17
|
+
# once on pypi.org as a (pending) publisher for the project name in pyproject.toml. The
|
|
18
|
+
# environment can require a reviewer's approval before each upload. PyPI never takes a
|
|
19
|
+
# version twice, so a failed upload after a successful one needs a new release.
|
|
20
|
+
#
|
|
21
|
+
# The version lives only in pyproject.toml (uv.lock mirrors it); the package reads it back
|
|
22
|
+
# from its installed metadata (`monitors.__version__`, `monitors -V`), so nothing else
|
|
23
|
+
# changes. Locally the same bump is `uv version --bump minor`.
|
|
24
|
+
|
|
25
|
+
on:
|
|
26
|
+
# ci finished on a push to main (a merged PR, or a direct push)
|
|
27
|
+
workflow_run:
|
|
28
|
+
workflows: [ci]
|
|
29
|
+
types: [completed]
|
|
30
|
+
branches: [main]
|
|
31
|
+
workflow_dispatch:
|
|
32
|
+
inputs:
|
|
33
|
+
bump:
|
|
34
|
+
description: Which part of the version to bump
|
|
35
|
+
type: choice
|
|
36
|
+
options: [minor, major]
|
|
37
|
+
default: minor
|
|
38
|
+
publish:
|
|
39
|
+
description: Also upload the release to PyPI
|
|
40
|
+
type: boolean
|
|
41
|
+
default: false
|
|
42
|
+
|
|
43
|
+
permissions:
|
|
44
|
+
contents: write
|
|
45
|
+
pull-requests: read
|
|
46
|
+
|
|
47
|
+
# one bump at a time
|
|
48
|
+
concurrency:
|
|
49
|
+
group: release
|
|
50
|
+
cancel-in-progress: false
|
|
51
|
+
|
|
52
|
+
jobs:
|
|
53
|
+
# a manual release runs the whole of ci on main first
|
|
54
|
+
ci:
|
|
55
|
+
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
|
|
56
|
+
uses: ./.github/workflows/ci.yml
|
|
57
|
+
|
|
58
|
+
release:
|
|
59
|
+
needs: ci
|
|
60
|
+
# ci passed: on a push to main (the job checks it was a merged PR), or in the job above
|
|
61
|
+
if: >-
|
|
62
|
+
always()
|
|
63
|
+
&& ((github.event_name == 'workflow_run'
|
|
64
|
+
&& github.event.workflow_run.event == 'push'
|
|
65
|
+
&& github.event.workflow_run.conclusion == 'success')
|
|
66
|
+
|| (github.event_name == 'workflow_dispatch' && needs.ci.result == 'success'))
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
outputs:
|
|
69
|
+
version: ${{ steps.bump.outputs.version }}
|
|
70
|
+
steps:
|
|
71
|
+
- name: Find the merged PR
|
|
72
|
+
id: pr
|
|
73
|
+
if: github.event_name == 'workflow_run'
|
|
74
|
+
env:
|
|
75
|
+
GH_TOKEN: ${{ github.token }}
|
|
76
|
+
SHA: ${{ github.event.workflow_run.head_sha }}
|
|
77
|
+
run: |
|
|
78
|
+
# the PR whose merge commit ci tested; none for a commit pushed straight to main
|
|
79
|
+
pr=$(gh api "repos/$GITHUB_REPOSITORY/commits/$SHA/pulls" \
|
|
80
|
+
--jq "[.[] | select(.merged_at != null and .merge_commit_sha == \"$SHA\")][0].number // empty")
|
|
81
|
+
echo "number=$pr" >> "$GITHUB_OUTPUT"
|
|
82
|
+
[ -n "$pr" ] || echo "::notice::$SHA is not a merged PR's commit: no release"
|
|
83
|
+
- uses: actions/checkout@v4
|
|
84
|
+
if: github.event_name == 'workflow_dispatch' || steps.pr.outputs.number
|
|
85
|
+
with:
|
|
86
|
+
ref: main # the latest main, which may already hold an earlier bump
|
|
87
|
+
- uses: astral-sh/setup-uv@v6
|
|
88
|
+
if: github.event_name == 'workflow_dispatch' || steps.pr.outputs.number
|
|
89
|
+
- name: Bump pyproject.toml and uv.lock
|
|
90
|
+
id: bump
|
|
91
|
+
if: github.event_name == 'workflow_dispatch' || steps.pr.outputs.number
|
|
92
|
+
env:
|
|
93
|
+
BUMP: ${{ github.event_name == 'workflow_run' && 'patch' || inputs.bump }}
|
|
94
|
+
run: |
|
|
95
|
+
uv version --bump "$BUMP" --no-sync
|
|
96
|
+
echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT"
|
|
97
|
+
- name: Commit, push and tag
|
|
98
|
+
if: steps.bump.outcome == 'success'
|
|
99
|
+
env:
|
|
100
|
+
VERSION: ${{ steps.bump.outputs.version }}
|
|
101
|
+
PR: ${{ steps.pr.outputs.number }}
|
|
102
|
+
run: |
|
|
103
|
+
git config user.name "github-actions[bot]"
|
|
104
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
105
|
+
git commit -am "Release v$VERSION${PR:+ (#$PR)}"
|
|
106
|
+
# main may have moved since the checkout: replay the bump on top of it
|
|
107
|
+
for attempt in 1 2 3; do
|
|
108
|
+
git pull --rebase origin main && git push origin HEAD:main && break
|
|
109
|
+
[ "$attempt" = 3 ] && exit 1
|
|
110
|
+
sleep 5
|
|
111
|
+
done
|
|
112
|
+
git tag -a "v$VERSION" -m "v$VERSION"
|
|
113
|
+
git push origin "v$VERSION"
|
|
114
|
+
- name: GitHub release
|
|
115
|
+
if: github.event_name == 'workflow_dispatch'
|
|
116
|
+
env:
|
|
117
|
+
GH_TOKEN: ${{ github.token }}
|
|
118
|
+
VERSION: ${{ steps.bump.outputs.version }}
|
|
119
|
+
run: gh release create "v$VERSION" --title "v$VERSION" --generate-notes
|
|
120
|
+
|
|
121
|
+
# the distributions of a manual release, built from its tag
|
|
122
|
+
build:
|
|
123
|
+
needs: release
|
|
124
|
+
if: >-
|
|
125
|
+
github.event_name == 'workflow_dispatch' && inputs.publish
|
|
126
|
+
&& needs.release.outputs.version != ''
|
|
127
|
+
runs-on: ubuntu-latest
|
|
128
|
+
permissions:
|
|
129
|
+
contents: read
|
|
130
|
+
steps:
|
|
131
|
+
- uses: actions/checkout@v4
|
|
132
|
+
with:
|
|
133
|
+
ref: v${{ needs.release.outputs.version }}
|
|
134
|
+
- uses: astral-sh/setup-uv@v6
|
|
135
|
+
- run: uv build
|
|
136
|
+
- run: uvx twine check --strict dist/*
|
|
137
|
+
- uses: actions/upload-artifact@v4
|
|
138
|
+
with:
|
|
139
|
+
name: dist
|
|
140
|
+
path: dist/
|
|
141
|
+
if-no-files-found: error
|
|
142
|
+
|
|
143
|
+
# upload to PyPI through Trusted Publishing: the id-token permission lets this job alone
|
|
144
|
+
# ask GitHub for the OIDC token PyPI exchanges for a short-lived upload token
|
|
145
|
+
publish:
|
|
146
|
+
needs: [release, build]
|
|
147
|
+
runs-on: ubuntu-latest
|
|
148
|
+
environment:
|
|
149
|
+
name: pypi
|
|
150
|
+
url: https://pypi.org/p/mntr
|
|
151
|
+
permissions:
|
|
152
|
+
id-token: write
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/download-artifact@v4
|
|
155
|
+
with:
|
|
156
|
+
name: dist
|
|
157
|
+
path: dist/
|
|
158
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
mntr-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.ipynb_checkpoints/
|
|
6
|
+
__marimo__/
|
|
7
|
+
.env
|
|
8
|
+
.env.*
|
|
9
|
+
|
|
10
|
+
# model weights (scripts/download_models.sh), shell-launched server logs
|
|
11
|
+
models/*/
|
|
12
|
+
logs/
|
|
13
|
+
# a MONITORS_HOME on the volume (.sample.env)
|
|
14
|
+
.monitors-home/
|
|
15
|
+
# local design notes, main checkout only
|
|
16
|
+
notes/
|
|
17
|
+
|
|
18
|
+
# legacy checkout-local captures and artifacts
|
|
19
|
+
activations/
|
|
20
|
+
artifacts/
|
|
21
|
+
|
|
22
|
+
# agent state (memory, hooks, skills): kept locally, not in the repo
|
|
23
|
+
.claude/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
mntr-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Idhant Gulati
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|