manuheart 0.1.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.
Files changed (57) hide show
  1. manuheart-0.1.1/.github/workflows/publish.yml +78 -0
  2. manuheart-0.1.1/.gitignore +13 -0
  3. manuheart-0.1.1/CHANGELOG.md +68 -0
  4. manuheart-0.1.1/PKG-INFO +107 -0
  5. manuheart-0.1.1/README.md +81 -0
  6. manuheart-0.1.1/TODO.md +99 -0
  7. manuheart-0.1.1/docs/ai-agent-operation-boundary.md +26 -0
  8. manuheart-0.1.1/docs/architecture-deployment-notes.md +53 -0
  9. manuheart-0.1.1/docs/baseline-inventory.md +33 -0
  10. manuheart-0.1.1/docs/bash-implementation-understanding.md +255 -0
  11. manuheart-0.1.1/docs/code-analysis-improvement-opportunities.md +111 -0
  12. manuheart-0.1.1/docs/deployment-test-config.md +70 -0
  13. manuheart-0.1.1/docs/fixture-intake-policy.md +50 -0
  14. manuheart-0.1.1/docs/health-state-semantics.md +114 -0
  15. manuheart-0.1.1/docs/implementation-audit-tasks.md +12 -0
  16. manuheart-0.1.1/docs/implementation-checklist.md +33 -0
  17. manuheart-0.1.1/docs/localhost-compatibility-differences.md +54 -0
  18. manuheart-0.1.1/docs/prioritization.md +122 -0
  19. manuheart-0.1.1/docs/product-framing.md +35 -0
  20. manuheart-0.1.1/docs/product-process-classification.md +45 -0
  21. manuheart-0.1.1/docs/python-architecture-proposal.md +545 -0
  22. manuheart-0.1.1/docs/qa-evidence.md +405 -0
  23. manuheart-0.1.1/docs/release/pypi-trusted-publishing.md +112 -0
  24. manuheart-0.1.1/docs/release-posture.md +81 -0
  25. manuheart-0.1.1/docs/requirements.md +58 -0
  26. manuheart-0.1.1/docs/rollback-disable.md +22 -0
  27. manuheart-0.1.1/docs/scope.md +26 -0
  28. manuheart-0.1.1/docs/security-privacy-notes.md +39 -0
  29. manuheart-0.1.1/docs/workflows.md +45 -0
  30. manuheart-0.1.1/examples/deployment-test/public-smoke.json +80 -0
  31. manuheart-0.1.1/examples/localhost/manuheart.json +39 -0
  32. manuheart-0.1.1/examples/localhost/manuheart.yaml +27 -0
  33. manuheart-0.1.1/examples/synthetic-compat/manuheart.json +70 -0
  34. manuheart-0.1.1/examples/synthetic-compat/manuheart.yaml +48 -0
  35. manuheart-0.1.1/pyproject.toml +69 -0
  36. manuheart-0.1.1/scripts/check_clean_install.py +103 -0
  37. manuheart-0.1.1/scripts/check_dependency_security.py +52 -0
  38. manuheart-0.1.1/scripts/check_localhost_compatibility.py +265 -0
  39. manuheart-0.1.1/src/manuheart/__init__.py +8 -0
  40. manuheart-0.1.1/src/manuheart/__main__.py +4 -0
  41. manuheart-0.1.1/src/manuheart/api.py +201 -0
  42. manuheart-0.1.1/src/manuheart/checkers.py +93 -0
  43. manuheart-0.1.1/src/manuheart/cli.py +117 -0
  44. manuheart-0.1.1/src/manuheart/config.py +421 -0
  45. manuheart-0.1.1/src/manuheart/errors.py +13 -0
  46. manuheart-0.1.1/src/manuheart/health.py +208 -0
  47. manuheart-0.1.1/src/manuheart/models.py +204 -0
  48. manuheart-0.1.1/src/manuheart/py.typed +1 -0
  49. manuheart-0.1.1/src/manuheart/reporting.py +90 -0
  50. manuheart-0.1.1/src/manuheart/state.py +241 -0
  51. manuheart-0.1.1/tests/test_api_smoke.py +22 -0
  52. manuheart-0.1.1/tests/test_api_typing.py +42 -0
  53. manuheart-0.1.1/tests/test_checkers.py +189 -0
  54. manuheart-0.1.1/tests/test_config.py +359 -0
  55. manuheart-0.1.1/tests/test_health.py +290 -0
  56. manuheart-0.1.1/tests/test_overrides_cli_state.py +334 -0
  57. manuheart-0.1.1/tests/test_reporting.py +335 -0
@@ -0,0 +1,78 @@
1
+ name: Publish Python package
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types: [published]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution artifacts
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Check out repository
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.11"
23
+
24
+ - name: Install build tooling
25
+ run: python -m pip install --upgrade build twine
26
+
27
+ - name: Build wheel and sdist
28
+ run: python -m build
29
+
30
+ - name: Check distribution metadata
31
+ run: python -m twine check dist/*
32
+
33
+ - name: Upload distribution artifacts
34
+ uses: actions/upload-artifact@v4
35
+ with:
36
+ name: python-package-distributions
37
+ path: dist/*
38
+ if-no-files-found: error
39
+
40
+ publish-testpypi:
41
+ name: Publish to TestPyPI
42
+ needs: build
43
+ if: github.event_name == 'workflow_dispatch'
44
+ runs-on: ubuntu-latest
45
+ environment: testpypi
46
+ permissions:
47
+ id-token: write
48
+ contents: read
49
+ steps:
50
+ - name: Download distribution artifacts
51
+ uses: actions/download-artifact@v4
52
+ with:
53
+ name: python-package-distributions
54
+ path: dist
55
+
56
+ - name: Publish package to TestPyPI
57
+ uses: pypa/gh-action-pypi-publish@release/v1
58
+ with:
59
+ repository-url: https://test.pypi.org/legacy/
60
+
61
+ publish-pypi:
62
+ name: Publish to PyPI
63
+ needs: build
64
+ if: github.event_name == 'release' && github.event.release.prerelease == false
65
+ runs-on: ubuntu-latest
66
+ environment: pypi
67
+ permissions:
68
+ id-token: write
69
+ contents: read
70
+ steps:
71
+ - name: Download distribution artifacts
72
+ uses: actions/download-artifact@v4
73
+ with:
74
+ name: python-package-distributions
75
+ path: dist
76
+
77
+ - name: Publish package to PyPI
78
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,13 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+
9
+ # Example/smoke-test runtime outputs
10
+ examples/deployment-test/tmp/
11
+ examples/deployment-test/var/
12
+ examples/localhost/var/
13
+ examples/synthetic-compat/var/
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ ## v0.1.1 - PyPI trusted publishing release
4
+
5
+ Status: public package publishing release.
6
+
7
+ ### Changed
8
+
9
+ - Added GitHub Actions trusted publishing workflow for TestPyPI and PyPI.
10
+ - Added PyPI/TestPyPI trusted-publisher setup documentation.
11
+ - Changed README documentation links to absolute GitHub URLs so they render correctly on PyPI.
12
+ - Added package project URLs for repository and changelog.
13
+ - Added local release tooling extras for `build` and `twine`.
14
+
15
+ ### Verification
16
+
17
+ - TestPyPI trusted publishing for `manuheart==0.1.0` was verified before this release.
18
+ - `manuheart[yaml]==0.1.0` installed successfully from TestPyPI with real PyPI as dependency fallback.
19
+
20
+ ## v0.1.0 - Internal baseline
21
+
22
+ Status: internal/private baseline; not a public release.
23
+
24
+ ### Added
25
+
26
+ - Python package and CLI for Manuheart health checks.
27
+ - JSON configuration as the primary supported config format.
28
+ - Optional YAML configuration support via the `yaml` extra.
29
+ - Typed domain models for hosts, groups, systems, statuses, checks, reports, and config.
30
+ - ICMP checker backed by `icmplib`.
31
+ - HTTP/S checker backed by `httpx`, with configurable `HEAD`/`GET` behavior and safe `HEAD` to `GET` fallback.
32
+ - Clean typed JSON reports for `hoststatus`, `groupstatus`, and `sysstatus`.
33
+ - Previous-state loading from clean Python reports and legacy-shaped Bash reports.
34
+ - Host/group/system `unknown`, grace, critical-group, and rollup semantics.
35
+ - Per-host checker error isolation and missing-checker warnings.
36
+ - Warning-aware previous-state degradation.
37
+ - Semantic config warnings for valid-but-suspicious health models.
38
+ - API override validation.
39
+ - Minimal check/daemon logging through `runtime.log_file` and `runtime.log_level`.
40
+ - Checker diagnostic details in host reports, with normalization and length bounding.
41
+ - Shared report metadata (`run_id`, `generated_at`) across report files.
42
+ - Public API extension types for injected checkers, clocks, sleepers, daemon event callbacks, config overrides, and previous state.
43
+ - CLI commands: `check`, `daemon`, and `validate-config`.
44
+ - Public deployment smoke config using harmless well-known endpoints.
45
+ - Local QA gates for linting, typing, tests, localhost Bash/Python comparison, dependency audit, and clean install smoke.
46
+
47
+ ### Removed / intentionally not included
48
+
49
+ - Legacy Bash config parsing as a product surface.
50
+ - Drop-in Bash replacement requirement.
51
+ - Public PyPI or public repository release posture.
52
+ - Real infrastructure fixtures or reports.
53
+ - Bounded check concurrency; deferred until real deployment scale justifies it.
54
+
55
+ ### Verification for baseline
56
+
57
+ The baseline is considered releasable internally only after the documented release-readiness gate passes:
58
+
59
+ ```bash
60
+ .venv/bin/python -m ruff check src tests scripts
61
+ .venv/bin/python -m mypy src/manuheart
62
+ .venv/bin/python -m pytest -q
63
+ .venv/bin/python scripts/check_localhost_compatibility.py
64
+ .venv/bin/python scripts/check_dependency_security.py
65
+ .venv/bin/python -m manuheart validate-config --config examples/deployment-test/public-smoke.json
66
+ .venv/bin/python -m manuheart check --config examples/deployment-test/public-smoke.json
67
+ .venv/bin/python scripts/check_clean_install.py
68
+ ```
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: manuheart
3
+ Version: 0.1.1
4
+ Summary: Python rewrite of the Manuheart health checker
5
+ Project-URL: Repository, https://github.com/RusDavies/manuheart-python
6
+ Project-URL: Changelog, https://github.com/RusDavies/manuheart-python/blob/main/CHANGELOG.md
7
+ Author: Russ Davies
8
+ License: MIT
9
+ Requires-Python: >=3.11
10
+ Requires-Dist: httpx>=0.27
11
+ Requires-Dist: icmplib>=3.0
12
+ Provides-Extra: dev
13
+ Requires-Dist: build>=1.2; extra == 'dev'
14
+ Requires-Dist: mypy>=1.10; extra == 'dev'
15
+ Requires-Dist: pip-audit>=2.10; extra == 'dev'
16
+ Requires-Dist: pytest>=8.0; extra == 'dev'
17
+ Requires-Dist: ruff>=0.6; extra == 'dev'
18
+ Requires-Dist: twine>=5.1; extra == 'dev'
19
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
20
+ Provides-Extra: release
21
+ Requires-Dist: build>=1.2; extra == 'release'
22
+ Requires-Dist: twine>=5.1; extra == 'release'
23
+ Provides-Extra: yaml
24
+ Requires-Dist: pyyaml>=6.0; extra == 'yaml'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Manuheart Python
28
+
29
+ ## Quick start
30
+
31
+ Install for local development:
32
+
33
+ ```bash
34
+ python -m venv .venv
35
+ .venv/bin/python -m pip install -e '.[dev,yaml]'
36
+ ```
37
+
38
+ Validate the example config:
39
+
40
+ ```bash
41
+ .venv/bin/python -m manuheart validate-config --config examples/localhost/manuheart.json
42
+ ```
43
+
44
+ Run one check cycle:
45
+
46
+ ```bash
47
+ .venv/bin/python -m manuheart check --config examples/localhost/manuheart.json
48
+ ```
49
+
50
+ Run the public deployment smoke config:
51
+
52
+ ```bash
53
+ .venv/bin/python -m manuheart check --config examples/deployment-test/public-smoke.json
54
+ ```
55
+
56
+ Run daemon mode:
57
+
58
+ ```bash
59
+ .venv/bin/python -m manuheart daemon --config examples/localhost/manuheart.json
60
+ ```
61
+
62
+ Use the library API:
63
+
64
+ ```python
65
+ from manuheart.api import CheckerMap, load_config, run_check, write_reports
66
+
67
+ config = load_config("examples/localhost/manuheart.json")
68
+ result = run_check(config)
69
+ write_reports(result)
70
+ ```
71
+
72
+ Typed extension points such as `CheckerMap`, `ClockSource`, `SleepFunction`, and
73
+ `DaemonEventCallback` are exported from `manuheart.api` for callers that inject custom
74
+ checkers, clocks, daemon sleepers, or daemon event hooks.
75
+
76
+ Library callers can also pass `previous_state=` to `run_check()` for in-memory state
77
+ continuity, or `load_previous=False` when they want a single cycle that deliberately avoids
78
+ reading previous report files.
79
+
80
+ Run the local verification gate:
81
+
82
+ ```bash
83
+ .venv/bin/python -m ruff check src tests scripts
84
+ .venv/bin/python -m mypy src/manuheart
85
+ .venv/bin/python -m pytest -q
86
+ .venv/bin/python scripts/check_localhost_compatibility.py
87
+ .venv/bin/python scripts/check_dependency_security.py
88
+ .venv/bin/python scripts/check_clean_install.py
89
+ ```
90
+
91
+ ## Docs
92
+
93
+ - [Scope](https://github.com/RusDavies/manuheart-python/blob/main/docs/scope.md)
94
+ - [Requirements](https://github.com/RusDavies/manuheart-python/blob/main/docs/requirements.md)
95
+ - [Architecture and deployment notes](https://github.com/RusDavies/manuheart-python/blob/main/docs/architecture-deployment-notes.md)
96
+ - [Health state semantics](https://github.com/RusDavies/manuheart-python/blob/main/docs/health-state-semantics.md)
97
+ - [Deployment test config](https://github.com/RusDavies/manuheart-python/blob/main/docs/deployment-test-config.md)
98
+ - [Release posture](https://github.com/RusDavies/manuheart-python/blob/main/docs/release-posture.md)
99
+ - [PyPI trusted publishing setup](https://github.com/RusDavies/manuheart-python/blob/main/docs/release/pypi-trusted-publishing.md)
100
+ - [Security and privacy notes](https://github.com/RusDavies/manuheart-python/blob/main/docs/security-privacy-notes.md)
101
+ - [Changelog](https://github.com/RusDavies/manuheart-python/blob/main/CHANGELOG.md)
102
+ - [QA evidence](https://github.com/RusDavies/manuheart-python/blob/main/docs/qa-evidence.md)
103
+ - [Implementation checklist](https://github.com/RusDavies/manuheart-python/blob/main/docs/implementation-checklist.md)
104
+ - [Bash implementation understanding](https://github.com/RusDavies/manuheart-python/blob/main/docs/bash-implementation-understanding.md)
105
+ - [Python architecture proposal](https://github.com/RusDavies/manuheart-python/blob/main/docs/python-architecture-proposal.md)
106
+ - [Localhost compatibility differences](https://github.com/RusDavies/manuheart-python/blob/main/docs/localhost-compatibility-differences.md)
107
+ - [Fixture intake policy](https://github.com/RusDavies/manuheart-python/blob/main/docs/fixture-intake-policy.md)
@@ -0,0 +1,81 @@
1
+ # Manuheart Python
2
+
3
+ ## Quick start
4
+
5
+ Install for local development:
6
+
7
+ ```bash
8
+ python -m venv .venv
9
+ .venv/bin/python -m pip install -e '.[dev,yaml]'
10
+ ```
11
+
12
+ Validate the example config:
13
+
14
+ ```bash
15
+ .venv/bin/python -m manuheart validate-config --config examples/localhost/manuheart.json
16
+ ```
17
+
18
+ Run one check cycle:
19
+
20
+ ```bash
21
+ .venv/bin/python -m manuheart check --config examples/localhost/manuheart.json
22
+ ```
23
+
24
+ Run the public deployment smoke config:
25
+
26
+ ```bash
27
+ .venv/bin/python -m manuheart check --config examples/deployment-test/public-smoke.json
28
+ ```
29
+
30
+ Run daemon mode:
31
+
32
+ ```bash
33
+ .venv/bin/python -m manuheart daemon --config examples/localhost/manuheart.json
34
+ ```
35
+
36
+ Use the library API:
37
+
38
+ ```python
39
+ from manuheart.api import CheckerMap, load_config, run_check, write_reports
40
+
41
+ config = load_config("examples/localhost/manuheart.json")
42
+ result = run_check(config)
43
+ write_reports(result)
44
+ ```
45
+
46
+ Typed extension points such as `CheckerMap`, `ClockSource`, `SleepFunction`, and
47
+ `DaemonEventCallback` are exported from `manuheart.api` for callers that inject custom
48
+ checkers, clocks, daemon sleepers, or daemon event hooks.
49
+
50
+ Library callers can also pass `previous_state=` to `run_check()` for in-memory state
51
+ continuity, or `load_previous=False` when they want a single cycle that deliberately avoids
52
+ reading previous report files.
53
+
54
+ Run the local verification gate:
55
+
56
+ ```bash
57
+ .venv/bin/python -m ruff check src tests scripts
58
+ .venv/bin/python -m mypy src/manuheart
59
+ .venv/bin/python -m pytest -q
60
+ .venv/bin/python scripts/check_localhost_compatibility.py
61
+ .venv/bin/python scripts/check_dependency_security.py
62
+ .venv/bin/python scripts/check_clean_install.py
63
+ ```
64
+
65
+ ## Docs
66
+
67
+ - [Scope](https://github.com/RusDavies/manuheart-python/blob/main/docs/scope.md)
68
+ - [Requirements](https://github.com/RusDavies/manuheart-python/blob/main/docs/requirements.md)
69
+ - [Architecture and deployment notes](https://github.com/RusDavies/manuheart-python/blob/main/docs/architecture-deployment-notes.md)
70
+ - [Health state semantics](https://github.com/RusDavies/manuheart-python/blob/main/docs/health-state-semantics.md)
71
+ - [Deployment test config](https://github.com/RusDavies/manuheart-python/blob/main/docs/deployment-test-config.md)
72
+ - [Release posture](https://github.com/RusDavies/manuheart-python/blob/main/docs/release-posture.md)
73
+ - [PyPI trusted publishing setup](https://github.com/RusDavies/manuheart-python/blob/main/docs/release/pypi-trusted-publishing.md)
74
+ - [Security and privacy notes](https://github.com/RusDavies/manuheart-python/blob/main/docs/security-privacy-notes.md)
75
+ - [Changelog](https://github.com/RusDavies/manuheart-python/blob/main/CHANGELOG.md)
76
+ - [QA evidence](https://github.com/RusDavies/manuheart-python/blob/main/docs/qa-evidence.md)
77
+ - [Implementation checklist](https://github.com/RusDavies/manuheart-python/blob/main/docs/implementation-checklist.md)
78
+ - [Bash implementation understanding](https://github.com/RusDavies/manuheart-python/blob/main/docs/bash-implementation-understanding.md)
79
+ - [Python architecture proposal](https://github.com/RusDavies/manuheart-python/blob/main/docs/python-architecture-proposal.md)
80
+ - [Localhost compatibility differences](https://github.com/RusDavies/manuheart-python/blob/main/docs/localhost-compatibility-differences.md)
81
+ - [Fixture intake policy](https://github.com/RusDavies/manuheart-python/blob/main/docs/fixture-intake-policy.md)
@@ -0,0 +1,99 @@
1
+ # TODO
2
+
3
+ ## Product process / Class 2 internal tool setup
4
+
5
+ - [x] Create lightweight product/problem framing.
6
+ - [x] Define requirements and acceptance criteria.
7
+ - [x] Capture UX/workflow notes if a UI exists.
8
+ - [x] Capture security/privacy notes.
9
+ - [x] Capture lightweight architecture/deployment notes.
10
+ - [x] Create implementation checklist.
11
+ - [x] Record basic QA evidence for completed work.
12
+ - [x] Add rollback/disable note.
13
+ - [x] Add AI-agent operation boundary note, unless Russ explicitly exempts it.
14
+
15
+ ## Project discovery
16
+
17
+ - [x] Define scope: what Manuheart Python is responsible for.
18
+ - [x] Capture baseline inventory, current access assumptions, and dependencies.
19
+ - [x] Add README quick start for library API usage and CLI usage.
20
+ - [x] Add Bash-vs-Python output compatibility check for localhost fixtures.
21
+ - [x] Identify initial implementation or audit tasks.
22
+ - [x] Prioritize remediation/build items with Russ.
23
+
24
+
25
+ ## Python rewrite backlog
26
+
27
+ - [x] Understand the original Bash implementation and document its behavior.
28
+ - [x] Propose a clean Python architecture for the rewrite.
29
+ - [x] Create Python project skeleton with `pyproject.toml`, `src/manuheart/`, and `tests/`.
30
+ - [x] Define the initial public library API contract in `src/manuheart/api.py`.
31
+ - [x] Add API smoke tests proving the package and public API import cleanly.
32
+ - [x] Port sample localhost config fixtures from `manuheart-bash`.
33
+ - [x] Implement typed domain models for hosts, groups, systems, statuses, and checks.
34
+ - [x] Remove legacy Bash config, group, and host parser support after product reframe.
35
+ - [x] Implement first-class JSON configuration parser using the same normalized domain model.
36
+ - [x] Implement optional YAML configuration parser, preferably behind a `yaml` package extra.
37
+ - [x] Add equivalence tests proving JSON and YAML config can describe the same health model.
38
+ - [x] Implement pure health rollup logic with fake-checker tests.
39
+ - [x] Implement CLI/API override application for config values and add precedence tests.
40
+ - [x] Implement real ICMP and HTTP(S) checkers.
41
+ - [x] Implement previous-state loading and atomic JSON report writing.
42
+ - [x] Implement CLI commands as thin adapters over the public API.
43
+ - [x] Add tests proving CLI behavior matches API behavior for equivalent inputs.
44
+ - [x] Add smoke test for one-shot localhost run.
45
+ - [x] Add daemon mode only after one-shot mode is solid.
46
+
47
+
48
+ ## Compatibility-first readiness backlog
49
+
50
+ - [x] Preserve report filenames and top-level keys while converting inner fields to cleaner typed JSON.
51
+ - [x] Use Pythonic snake_case field names in clean typed report records.
52
+ - [x] Implement clean typed report output as the default Python report format.
53
+ - [x] Keep report status fields as enum-like strings (`up`, `down`, `unknown`).
54
+ - [x] Keep report timestamp fields as consistently ISO-8601 strings.
55
+ - [x] Add tests proving report fields use typed JSON values where practical.
56
+ - [x] Decide whether safe real-world Bash configs can be used as compatibility fixtures.
57
+ - [x] Add broader synthetic compatibility fixtures after exact localhost output matching is resolved.
58
+ - [x] Add expanded synthetic fixtures for multi-host, HTTP/S, optional group, and failure-grace scenarios.
59
+ - [x] Tighten localhost Bash-vs-Python compatibility check to identify and document migration-relevant output differences.
60
+ - [x] Keep real-world fixture intake blocked unless Russ separately approves sanitized configs.
61
+ - [x] Document accepted compatibility differences between Bash and Python outputs.
62
+ - [x] Decide whether to add an explicit legacy-compatible report mode after clean typed output is established.
63
+ - [x] Add clean-venv install/package smoke test.
64
+ - [x] Decide remote repository and publishing/release posture.
65
+
66
+ ## Code analysis improvement backlog
67
+
68
+ - [x] Implement documented host/group/system `unknown` and grace state semantics.
69
+ - [x] Add stricter structured config validation for unknown keys and numeric bounds.
70
+ - [x] Catch per-host checker crashes in the health engine and convert them to non-`up` check results.
71
+ - [x] Surface previous-state/report read degradation as warnings.
72
+ - [x] Clarify or adjust relative path semantics for status files.
73
+ - [x] Tighten public API typing around checker maps, clocks, sleepers, and daemon callbacks.
74
+ - [x] Add checker detail fields to host reports.
75
+ - [ ] Consider bounded check concurrency after real deployment scale requires it.
76
+ - [x] Harden previous-state loading against malformed report values.
77
+ - [x] Add stricter structured JSON/YAML config validation and clearer `ConfigError` messages.
78
+ - [x] Make HTTP checking less HEAD-only, via configurable method or safe GET fallback.
79
+ - [x] Improve CLI error handling for `check` and `daemon` operational failures.
80
+ - [x] Improve daemon observability and graceful shutdown behaviour.
81
+ - [x] Reuse or inject HTTP clients for efficiency and cleaner checker tests.
82
+ - [x] Add static typing gate and package typing marker (`py.typed`).
83
+ - [x] Add dependency/security review gate before release.
84
+
85
+ ## Follow-up code review polish
86
+
87
+ - [x] Add semantic config warnings for valid-but-suspicious health models.
88
+ - [x] Validate public API override value types and bounds.
89
+ - [x] Implement minimal check/daemon logging using `runtime.log_file` and `runtime.log_level`.
90
+ - [x] Bound and normalize checker detail text before storing it in host reports.
91
+ - [x] Add report-set metadata with matching `run_id` and `generated_at` across host/group/system reports.
92
+ - [x] Add public API support for injected previous state or intentionally skipping disk previous-state loading.
93
+
94
+ ## Release readiness
95
+
96
+ - [x] Add internal `v0.1.0` changelog/release notes.
97
+ - [x] Confirm release-readiness gate includes lint, typecheck, tests, compatibility, dependency audit, public smoke validate/check, and clean install smoke.
98
+ - [x] Add GitHub Actions trusted-publishing workflow for TestPyPI/PyPI.
99
+ - [x] Document PyPI/TestPyPI pending trusted-publisher setup fields.
@@ -0,0 +1,26 @@
1
+ # AI-Agent Operation Boundary
2
+
3
+ Status: Draft.
4
+
5
+ ## Agents may do autonomously
6
+
7
+ - Inspect source, tests, docs, and local fixtures.
8
+ - Create branches and commits for implementation work.
9
+ - Add or update tests.
10
+ - Run local verification gates.
11
+ - Update internal docs and TODO items.
12
+ - Add compatibility checks that do not touch external systems.
13
+
14
+ ## Human approval required
15
+
16
+ - Deploying Manuheart Python to shared infrastructure.
17
+ - Replacing or deleting the Bash implementation.
18
+ - Changing real monitored host lists.
19
+ - Publishing the package externally.
20
+ - Sending alerts/messages externally.
21
+ - Accepting compatibility gaps or known broken health reporting.
22
+ - Handling secrets or sensitive infrastructure credentials.
23
+
24
+ ## Default operating mode
25
+
26
+ Prefer local implementation, tests, and documentation work. Treat deployment and real monitoring changes as human-approved actions only.
@@ -0,0 +1,53 @@
1
+ # Architecture and Deployment Notes
2
+
3
+ Status: Draft.
4
+
5
+ ## Architecture
6
+
7
+ Manuheart Python is a reusable Python library with a CLI adapter.
8
+
9
+ Core layers:
10
+
11
+ - `manuheart.api`: public import surface.
12
+ - `manuheart.config`: JSON/YAML config loading and normalization.
13
+ - `manuheart.models`: typed domain models.
14
+ - `manuheart.health`: health-state update and rollup engine.
15
+ - `manuheart.checkers`: ICMP/HTTP checker adapters backed by Python libraries.
16
+ - `manuheart.state`: previous compatibility-report state loading.
17
+ - `manuheart.reporting`: compatibility JSON report serialization and atomic writes.
18
+ - `manuheart.cli`: command-line adapter over the public API.
19
+
20
+ The health engine should remain independent of config file format and CLI parsing.
21
+
22
+ ## Runtime dependencies
23
+
24
+ - Python 3.11+.
25
+ - `httpx` for HTTP/S checks.
26
+ - `icmplib` for ICMP checks.
27
+ - Optional `PyYAML` for YAML configuration.
28
+
29
+ ## Deployment modes
30
+
31
+ ### Recommended: supervised one-shot
32
+
33
+ Run `manuheart check --config <file>` from cron, systemd timer, CI, or another supervisor. This gives bounded lifecycle, simple logs, and straightforward rollback.
34
+
35
+ ### Optional: daemon
36
+
37
+ Run `manuheart daemon --config <file>` only when built-in scheduling is specifically useful. Prefer an external supervisor for restart policy and lifecycle management.
38
+
39
+ ## Report outputs
40
+
41
+ The tool writes compatibility JSON reports:
42
+
43
+ - `hoststatus`
44
+ - `groupstatus`
45
+ - `sysstatus`
46
+
47
+ Writes are atomic temp-file-and-replace operations.
48
+
49
+ ## Repository and release posture
50
+
51
+ Current posture: internal-only with a private GitHub remote. No public repository, public package publication, or shared-infrastructure deployment should happen without explicit Russ approval. See `docs/release-posture.md`.
52
+
53
+ For deployment smoke testing without real infrastructure, use `examples/deployment-test/public-smoke.json`; see `docs/deployment-test-config.md`.
@@ -0,0 +1,33 @@
1
+ # Baseline Inventory, Access, and Dependencies
2
+
3
+ Status: Draft.
4
+
5
+ ## Repositories / folders
6
+
7
+ - Python rewrite: `projects/manuheart-python`.
8
+ - Bash source reference: `projects/manuheart-bash`.
9
+
10
+ ## Current Python package
11
+
12
+ - Package name: `manuheart`.
13
+ - Source layout: `src/manuheart`.
14
+ - Public API: `manuheart.api`.
15
+ - CLI entry point: `manuheart = manuheart.cli:main`.
16
+
17
+ ## Runtime dependencies
18
+
19
+ - Python 3.11+.
20
+ - `httpx`.
21
+ - `icmplib`.
22
+ - Optional `PyYAML` via `manuheart[yaml]`.
23
+
24
+ ## Development dependencies
25
+
26
+ - `pytest`.
27
+ - `ruff`.
28
+
29
+ ## Access assumptions
30
+
31
+ - Work is local/internal unless Russ approves deployment or publishing.
32
+ - No external messaging, alerting, or infrastructure changes are authorized by default.
33
+ - ICMP checks may require platform/network permissions depending on environment; current implementation uses unprivileged `icmplib` by default.