monit-docker 0.0.76__tar.gz → 0.0.78__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 (152) hide show
  1. {monit_docker-0.0.76/monit_docker.egg-info → monit_docker-0.0.78}/PKG-INFO +24 -9
  2. {monit_docker-0.0.76 → monit_docker-0.0.78}/README.md +19 -2
  3. monit_docker-0.0.78/RELEASE +1 -0
  4. monit_docker-0.0.78/VERSION +1 -0
  5. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/architecture.md +10 -6
  6. monit_docker-0.0.78/docs/audit-migration.md +118 -0
  7. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/audit.md +9 -0
  8. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/check-config.md +9 -2
  9. monit_docker-0.0.78/docs/config-cli-contract.md +329 -0
  10. monit_docker-0.0.78/docs/http-api-contract.md +359 -0
  11. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/index.rst +6 -0
  12. monit_docker-0.0.78/docs/journal-compatibility.md +147 -0
  13. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/metrics.md +15 -0
  14. monit_docker-0.0.78/docs/roadmap.md +107 -0
  15. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/scenarios.md +6 -0
  16. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/serve.md +9 -4
  17. monit_docker-0.0.78/docs/supported-environments.md +97 -0
  18. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/__init__.py +1 -1
  19. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/scenarios.py +4 -1
  20. monit_docker-0.0.78/monit_docker/audit_migrate.py +185 -0
  21. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/cli.py +40 -1
  22. {monit_docker-0.0.76 → monit_docker-0.0.78/monit_docker.egg-info}/PKG-INFO +24 -9
  23. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker.egg-info/SOURCES.txt +11 -0
  24. {monit_docker-0.0.76 → monit_docker-0.0.78}/setup.yml +6 -13
  25. monit_docker-0.0.78/tests/test_api_contract.py +381 -0
  26. monit_docker-0.0.78/tests/test_audit_migrate.py +204 -0
  27. monit_docker-0.0.78/tests/test_cli_contract.py +104 -0
  28. monit_docker-0.0.78/tests/test_journal_compatibility.py +139 -0
  29. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_scenarios.py +28 -0
  30. monit_docker-0.0.76/RELEASE +0 -1
  31. monit_docker-0.0.76/VERSION +0 -1
  32. {monit_docker-0.0.76 → monit_docker-0.0.78}/LICENSE +0 -0
  33. {monit_docker-0.0.76 → monit_docker-0.0.78}/MANIFEST.in +0 -0
  34. {monit_docker-0.0.76 → monit_docker-0.0.78}/bin/monit-docker +0 -0
  35. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/access-checks.md +0 -0
  36. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/alerts.md +0 -0
  37. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/compose.md +0 -0
  38. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/cron.md +0 -0
  39. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/dockerhub.md +0 -0
  40. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/dwho-http-notifications.md +0 -0
  41. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/filesystems.md +0 -0
  42. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/grafana.md +0 -0
  43. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/healthchecks.md +0 -0
  44. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/images/grafana-cpu.png +0 -0
  45. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/images/grafana-network.png +0 -0
  46. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/images/grafana-overview.png +0 -0
  47. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/maintenance.md +0 -0
  48. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/notifications.md +0 -0
  49. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/pypi.md +0 -0
  50. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/redis-notifications.md +0 -0
  51. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/restart-limit.md +0 -0
  52. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/runtime-checks.md +0 -0
  53. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/simple.md +0 -0
  54. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/trigger-delay.md +0 -0
  55. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/troubleshooting.md +0 -0
  56. {monit_docker-0.0.76 → monit_docker-0.0.78}/docs/ui.md +0 -0
  57. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/grafana/monit-docker.json +0 -0
  58. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alertmanager.email-slack.yml +0 -0
  59. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alertmanager.email.yml +0 -0
  60. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alertmanager.redis.yml +0 -0
  61. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alertmanager.slack.yml +0 -0
  62. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alerts.runtime.test.yml +0 -0
  63. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alerts.runtime.yml +0 -0
  64. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alerts.test.yml +0 -0
  65. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/alerts.yml +0 -0
  66. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/compose.audit.yaml +0 -0
  67. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/compose.notifications.yaml +0 -0
  68. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/compose.redis.yaml +0 -0
  69. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/compose.yaml +0 -0
  70. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/dwho-http/http.json +0 -0
  71. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/dwho-http/http.yml +0 -0
  72. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/dwho-http/payload.json +0 -0
  73. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/dwho-http/send.py +0 -0
  74. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/grafana/dashboards.yml +0 -0
  75. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/grafana/datasources.yml +0 -0
  76. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/prometheus-notifications.yml +0 -0
  77. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/prometheus.yml +0 -0
  78. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/redis-webhook/Dockerfile +0 -0
  79. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/redis-webhook/bridge.py +0 -0
  80. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/redis-webhook/requirements.txt +0 -0
  81. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/monitoring/start.sh +0 -0
  82. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/scenarios.yml +0 -0
  83. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/ui/compose.actions.yaml +0 -0
  84. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/ui/compose.journal.yaml +0 -0
  85. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/ui/compose.yaml +0 -0
  86. {monit_docker-0.0.76 → monit_docker-0.0.78}/examples/ui/prepare.py +0 -0
  87. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/__main__.py +0 -0
  88. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/__init__.py +0 -0
  89. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/access.py +0 -0
  90. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/configuration.py +0 -0
  91. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/docker.py +0 -0
  92. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/events.py +0 -0
  93. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/filesystems.py +0 -0
  94. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/http.py +0 -0
  95. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/http_routes.py +0 -0
  96. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/rules.py +0 -0
  97. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/selection.py +0 -0
  98. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/state.py +0 -0
  99. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/syntax.py +0 -0
  100. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/adapters/validation.py +0 -0
  101. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/audit.py +0 -0
  102. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/audit_forward.py +0 -0
  103. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/audit_query.py +0 -0
  104. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/core/__init__.py +0 -0
  105. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/core/engine.py +0 -0
  106. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/core/manual.py +0 -0
  107. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/core/metrics.py +0 -0
  108. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/core/policy.py +0 -0
  109. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/core/rules.py +0 -0
  110. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/__init__.py +0 -0
  111. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/errors.py +0 -0
  112. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/filesystems.py +0 -0
  113. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/maintenance.py +0 -0
  114. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/models.py +0 -0
  115. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/rules.py +0 -0
  116. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/domain/runtime.py +0 -0
  117. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/manual_actions.py +0 -0
  118. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/notification_audit.py +0 -0
  119. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/outputs/__init__.py +0 -0
  120. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/outputs/formatting.py +0 -0
  121. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/outputs/prometheus.py +0 -0
  122. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker/service.py +0 -0
  123. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker.egg-info/dependency_links.txt +0 -0
  124. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker.egg-info/requires.txt +0 -0
  125. {monit_docker-0.0.76 → monit_docker-0.0.78}/monit_docker.egg-info/top_level.txt +0 -0
  126. {monit_docker-0.0.76 → monit_docker-0.0.78}/pyproject.toml +0 -0
  127. {monit_docker-0.0.76 → monit_docker-0.0.78}/requirements.txt +0 -0
  128. {monit_docker-0.0.76 → monit_docker-0.0.78}/setup.cfg +0 -0
  129. {monit_docker-0.0.76 → monit_docker-0.0.78}/setup.py +0 -0
  130. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_access.py +0 -0
  131. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_access_docker.py +0 -0
  132. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_adapters.py +0 -0
  133. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_audit.py +0 -0
  134. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_audit_query.py +0 -0
  135. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_check_config.py +0 -0
  136. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_core.py +0 -0
  137. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_cron.py +0 -0
  138. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_docker_integration.py +0 -0
  139. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_engine.py +0 -0
  140. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_filesystem_mode.py +0 -0
  141. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_filesystems.py +0 -0
  142. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_health.py +0 -0
  143. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_httpdis_transport.py +0 -0
  144. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_maintenance.py +0 -0
  145. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_manual_actions.py +0 -0
  146. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_monit_docker.py +0 -0
  147. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_packaging.py +0 -0
  148. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_restart_limit.py +0 -0
  149. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_runtime_checks.py +0 -0
  150. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_runtime_docker.py +0 -0
  151. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_service.py +0 -0
  152. {monit_docker-0.0.76 → monit_docker-0.0.78}/tests/test_trigger_delay.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monit-docker
3
- Version: 0.0.76
3
+ Version: 0.0.78
4
4
  Summary: monit-docker
5
5
  Home-page: https://github.com/decryptus/monit-docker
6
6
  Author: Adrien Delle Cave
@@ -10,16 +10,14 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
10
  Classifier: Natural Language :: English
11
11
  Classifier: Operating System :: Unix
12
12
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 2
14
- Classifier: Programming Language :: Python :: 2.7
15
13
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.5
17
- Classifier: Programming Language :: Python :: 3.6
18
- Classifier: Programming Language :: Python :: 3.7
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.12
19
17
  Classifier: Topic :: System :: Monitoring
20
18
  Classifier: Topic :: Terminals
21
19
  Classifier: Topic :: Utilities
22
- Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
20
+ Requires-Python: >=3.10
23
21
  Description-Content-Type: text/markdown
24
22
  License-File: LICENSE
25
23
  Requires-Dist: cryptography>=3.2.1
@@ -57,7 +55,22 @@ Dynamic: summary
57
55
  [Website](https://www.monit-docker.com/) ·
58
56
  [Documentation (FR)](https://www.monit-docker.com/docs/fr/) ·
59
57
  [Documentation (EN)](https://www.monit-docker.com/docs/en/) ·
60
- [Live demo](https://demo.monit-docker.com/)
58
+ [Live demo](https://demo.monit-docker.com/) ·
59
+ [Roadmap to 1.0](docs/roadmap.md) ·
60
+ [Logos and icons](ui/branding/README.md)
61
+
62
+ The [configuration and CLI compatibility baseline](docs/config-cli-contract.md)
63
+ records current option precedence, selectors, scenario fields and exit codes,
64
+ with the open decisions to resolve before 1.0.
65
+
66
+ The [journal compatibility baseline](docs/journal-compatibility.md) covers retained
67
+ schemas, exports and upgrade/rollback limits without rewriting archives.
68
+ Since **0.0.78**, the optional [audit-migrate command](docs/audit-migration.md)
69
+ provides a dry run and explicit conversion to a new directory with verified backups.
70
+
71
+ The [HTTP API and metrics baseline](docs/http-api-contract.md) documents response
72
+ fields, authentication, errors, freshness, journal pagination and metric
73
+ compatibility, with private-agent `curl` examples and wire-level regression tests.
61
74
 
62
75
  For persistent action and notification history, available since **0.0.65**, see
63
76
  the [audit journal guide](docs/audit.md). Since **0.0.66**, it also includes an optional
@@ -113,7 +126,9 @@ server, Prometheus or Grafana. Its commands are `stats`, `monit`, and optionally
113
126
 
114
127
  ## <a name="installation"></a>Installation
115
128
 
116
- The examples below use Python 3 (CI tests Python 3.10 and 3.12). You need a Docker
129
+ The agent requires Python **3.10+** (CI tests 3.10 and 3.12) on Linux. See the
130
+ [supported environments and check prerequisites](docs/supported-environments.md).
131
+ You need a Docker
117
132
  daemon accessible to the account running monit-docker. For a local installation:
118
133
 
119
134
  ```sh
@@ -12,7 +12,22 @@
12
12
  [Website](https://www.monit-docker.com/) ·
13
13
  [Documentation (FR)](https://www.monit-docker.com/docs/fr/) ·
14
14
  [Documentation (EN)](https://www.monit-docker.com/docs/en/) ·
15
- [Live demo](https://demo.monit-docker.com/)
15
+ [Live demo](https://demo.monit-docker.com/) ·
16
+ [Roadmap to 1.0](docs/roadmap.md) ·
17
+ [Logos and icons](ui/branding/README.md)
18
+
19
+ The [configuration and CLI compatibility baseline](docs/config-cli-contract.md)
20
+ records current option precedence, selectors, scenario fields and exit codes,
21
+ with the open decisions to resolve before 1.0.
22
+
23
+ The [journal compatibility baseline](docs/journal-compatibility.md) covers retained
24
+ schemas, exports and upgrade/rollback limits without rewriting archives.
25
+ Since **0.0.78**, the optional [audit-migrate command](docs/audit-migration.md)
26
+ provides a dry run and explicit conversion to a new directory with verified backups.
27
+
28
+ The [HTTP API and metrics baseline](docs/http-api-contract.md) documents response
29
+ fields, authentication, errors, freshness, journal pagination and metric
30
+ compatibility, with private-agent `curl` examples and wire-level regression tests.
16
31
 
17
32
  For persistent action and notification history, available since **0.0.65**, see
18
33
  the [audit journal guide](docs/audit.md). Since **0.0.66**, it also includes an optional
@@ -68,7 +83,9 @@ server, Prometheus or Grafana. Its commands are `stats`, `monit`, and optionally
68
83
 
69
84
  ## <a name="installation"></a>Installation
70
85
 
71
- The examples below use Python 3 (CI tests Python 3.10 and 3.12). You need a Docker
86
+ The agent requires Python **3.10+** (CI tests 3.10 and 3.12) on Linux. See the
87
+ [supported environments and check prerequisites](docs/supported-environments.md).
88
+ You need a Docker
72
89
  daemon accessible to the account running monit-docker. For a local installation:
73
90
 
74
91
  ```sh
@@ -0,0 +1 @@
1
+ 0.0.78
@@ -0,0 +1 @@
1
+ 0.0.78
@@ -228,7 +228,9 @@ Still pending: a cycle-wide deadline and an embedded UI. A client timeout can be
228
228
  client settings; it is not an overall cycle deadline. Configuration is fixed for
229
229
  each constructed CLI command; automatic reload is not added.
230
230
  Legacy Python versions advertised by the package are not exercised by the CI
231
- matrix, which currently runs Python 3.10 and 3.12.
231
+ matrix, which currently runs Python 3.10 and 3.12. Some advertised interpreters
232
+ cannot run the current code; the supported minimum remains to be reconciled with
233
+ the metadata. See the [configuration and CLI compatibility baseline](config-cli-contract.md).
232
234
 
233
235
 
234
236
  ## Optional UI and manual operations
@@ -243,15 +245,17 @@ network directly. See [UI setup](ui.md).
243
245
  HTTP adapter verifies a proxy secret, exact origin, method, content type and
244
246
  body length before admission. `MonitorService` executes one pending operation
245
247
  between cycles, using the same operation mutex as collection. The engine's
246
- manual method reselects an exact container ID and checks an explicit three-verb
247
- vocabulary. CLI composition supplies the state-backed reservation function;
248
+ manual method reselects an exact container ID and checks the supported action
249
+ vocabulary, including optional maintenance and restart-budget rearm. CLI
250
+ composition supplies the state-backed reservation function;
248
251
  core/domain code has no HTTP, authentication, UI or storage imports.
249
252
 
250
- Manual cooldowns use a distinct per-container key across all three verbs; they
251
- do not replace rule cooldowns or provide durable audit. An operation reserves
253
+ Manual cooldowns use a distinct per-container key across the manual commands;
254
+ they do not replace rule cooldowns. The separate persistent audit journal records
255
+ action attribution and outcomes. An operation reserves
252
256
  before execution and invalidates cached measurements. The subsequent collection
253
257
  refreshes the cache. Autonomous rules remain enabled and can reverse a manual
254
- operation; this first version does not introduce maintenance overrides. The
258
+ operation unless automatic actions are suspended by temporary maintenance. The
255
259
  queue does not promise exactly-once execution across process restarts.
256
260
 
257
261
  The component is Community-only single-host software. A future commercial
@@ -0,0 +1,118 @@
1
+ # Convert a retained journal to schema 2
2
+
3
+ Available since **0.0.78**. `audit-migrate` is an offline administrative command:
4
+ it validates existing journals and can create a **separate conversion bundle**
5
+ with byte-for-byte backups. It does not connect to Docker or execute actions.
6
+ Normal reads already support schemas 1 and 2, so conversion remains optional.
7
+
8
+ ## Preview, then create the bundle
9
+
10
+ Stop **all writers** using this journal before applying a conversion, including
11
+ notification adapters. Use the original retention settings. Global audit options
12
+ go before the subcommand; migration options go after it.
13
+
14
+ ```sh
15
+ # Default: validation and a JSON report, without creating output files.
16
+ monit-docker --audit-file /var/lib/monit-docker/events.jsonl \
17
+ --audit-max-bytes 5242880 --audit-files 5 audit-migrate
18
+
19
+ # Explicit simulation; the planned destination must not already exist.
20
+ monit-docker --audit-file /var/lib/monit-docker/events.jsonl \
21
+ --audit-max-bytes 5242880 --audit-files 5 \
22
+ audit-migrate --dry-run --output-dir /srv/monit-migration-001
23
+
24
+ # Explicit write, after reviewing the simulation.
25
+ monit-docker --audit-file /var/lib/monit-docker/events.jsonl \
26
+ --audit-max-bytes 5242880 --audit-files 5 \
27
+ audit-migrate --apply --output-dir /srv/monit-migration-001
28
+ ```
29
+
30
+ The destination's parent must exist and be writable. No existing file or directory
31
+ is replaced, including an earlier conversion bundle. Files are mode 0600 and
32
+ directories 0700, owned by the user running the command. Reserve disk space for
33
+ both the original-byte backup and converted copy; escaped text can grow.
34
+
35
+ Both modes take the journal lock for a consistent view. A busy lock fails
36
+ immediately; the command does not wait indefinitely. Simulation may create the
37
+ companion `.lock` file but never changes journal data. Holding the lock protects
38
+ against cooperating agent writers; it does not make unrelated administrative file
39
+ edits safe. Keep writers stopped until any operator-controlled switch is complete.
40
+
41
+ ## Bundle and verification
42
+
43
+ | Path in the new directory | Contents |
44
+ | --- | --- |
45
+ | `backup/events.jsonl` and retained suffixes | Original bytes, including original schema versions |
46
+ | `converted/events.jsonl` and retained suffixes | Schema 2 JSONL, preserving file layout and record order |
47
+ | `manifest.json` | Final completion marker, counts, settings and SHA-256 checksums |
48
+
49
+ The command processes only the configured journal and its numbered archives, not
50
+ all files in its parent directory. Higher-numbered archives outside `--audit-files`
51
+ cause an explicit error rather than a silently incomplete conversion. Adjust the
52
+ setting or separately archive those files before proceeding. The maximum supported
53
+ retention count remains 100.
54
+
55
+ The JSON report has `status: "dry_run"` or `"complete"`, `target_schema: 2`, total
56
+ `records`, `legacy_records` and a per-file inventory. Each entry reports original
57
+ and converted sizes/checksums, schema counts and an ordered identity/correlation
58
+ checksum. The manifest has its own `manifest_version: 1`, unrelated to event or
59
+ HTTP schema versions. It contains paths and checksums, not event text; protect it
60
+ along with the private history.
61
+
62
+ Validation runs before destination creation. During conversion the source is
63
+ checked against that inventory, the original-byte backup is reread, and converted
64
+ data is reread to verify schema, count, ordered identities/correlations and the
65
+ expected full-content checksum. Only then is the manifest finalized. Additional
66
+ scalar fields and null/numeric values are retained. Text follows the existing
67
+ [canonical escaping rules](audit.md#text-encoding-shared-by-all-outputs); already
68
+ valid schema 2 values are not escaped again. Converting the output again preserves
69
+ its normalized bytes. Neither deduplication nor sorting is performed.
70
+
71
+ The tool streams records; it does not accumulate the full retained history in
72
+ memory. Each source/converted record must fit the 64 KiB event limit. Both original
73
+ and converted files must fit the configured full-read bound (`--audit-max-bytes`
74
+ plus one maximum-size event). Conversion can require a larger limit than the
75
+ source because visible escapes expand text. Use that same limit when reading the
76
+ converted archive. Published 0.0.65 defaulted to 10 MiB per file, versus 5 MiB since
77
+ 0.0.66; do not accidentally reduce the limit during this operation.
78
+
79
+ ## Errors and interruption
80
+
81
+ Exit status is **0** for a successful simulation or completed bundle, **2** for
82
+ invalid CLI arguments and **119** for a migration failure. An English diagnostic
83
+ is written to stderr on failure; successful reports are JSON on stdout.
84
+
85
+ Unsupported versions, invalid/noncanonical text, nested fields, truncated or
86
+ oversized records, duplicate JSON keys and non-finite numbers are rejected.
87
+ Duplicate-key/number checks are deliberately stricter than ordinary historical
88
+ reads to avoid silently losing information during physical conversion. Symlink
89
+ data/lock files and non-regular files are refused. A nonexistent journal fails;
90
+ an existing empty journal is valid and produces an empty converted file.
91
+
92
+ If a write or verification fails, the original journal remains untouched. The
93
+ partial destination is retained for inspection, without a completed manifest.
94
+ A process interruption may leave `manifest.json.tmp`. **Do not use a bundle that
95
+ has no final `manifest.json` with `status: "complete"`.** Resolve the cause, preserve
96
+ the partial output if needed, and rerun with a new destination. There is no
97
+ automatic resume, deletion or overwrite of previous attempts. Check exit status
98
+ even if files are present; filesystem sync failures are still failures.
99
+
100
+ ## Optional activation and rollback
101
+
102
+ Creating a bundle does not change the agent's configured path. After verifying
103
+ the report and keeping all writers stopped, an operator can point `--audit-file`
104
+ to the converted directory or copy the converted set to a prepared persistent
105
+ directory. Match retention settings and ownership to the service user. Preserve
106
+ the original directory and backup outside the rotation path. Switching paths
107
+ invalidates existing journal browsing cursors; reload the first page.
108
+
109
+ Restart writers only after checking a full export from the chosen path. Do not
110
+ concatenate original and converted copies: they contain the same event IDs.
111
+ For rollback, stop writers, preserve any events appended after activation and
112
+ restore a verified backup with appropriate ownership. Restoring an older backup
113
+ does not include those later events and must not replay their actions. This
114
+ command converts journal files only, not configuration or action state.
115
+
116
+ See [journal compatibility](journal-compatibility.md) for the broader upgrade
117
+ procedure and [supported environments](supported-environments.md) for platform
118
+ and storage requirements.
@@ -68,6 +68,11 @@ escaping required by a destination.
68
68
 
69
69
  ## Storage and recovery
70
70
 
71
+ See [journal schema compatibility](journal-compatibility.md) for mixed historical
72
+ events, export limits, upgrade/rollback steps and rules for future schema changes.
73
+ The optional [audit-migrate command](audit-migration.md), available since 0.0.78,
74
+ creates verified schema 2 copies with original-byte backups and defaults to simulation.
75
+
71
76
  The agent enables its journal when configured with rules, manual actions or the
72
77
  notification webhook. Use a persistent mount and an explicit path:
73
78
 
@@ -273,6 +278,10 @@ An ID groups recorded events; it does not invent missing lifecycle stages.
273
278
 
274
279
  ### Bounded reads and downloads
275
280
 
281
+ See the [HTTP API contract](http-api-contract.md#journal-pages-and-exports) for
282
+ page fields, filter syntax, authentication, cursor error codes and a complete
283
+ `curl` example exporting the displayed page.
284
+
276
285
  `GET /v1/audit` returns up to 100 events, newest first, with a signed continuation
277
286
  cursor. Each request reads at most 1 MiB of journal bytes and retains at most
278
287
  512 KiB of serialized event data, plus bounded parsing/response overhead. At most
@@ -37,7 +37,8 @@ An empty mapping (`{}`) is valid; an empty file, `null` or a list is not.
37
37
  ## What gets checked
38
38
 
39
39
  - Top-level sections and entry shapes: `general`, `vars`, `clients`, `ctn-groups`,
40
- `conditions` and `commands`; missing fields and unknown sections/entry fields.
40
+ `dir-groups`, `conditions`, `commands` and `scenarios`; missing fields and unknown
41
+ sections/entry fields.
41
42
  - Existing import directives, relative file paths and Mako rendering. The same
42
43
  import scope and override behavior as the runtime is used.
43
44
  - Client configuration mappings and basic TLS shape; explicit client names.
@@ -45,6 +46,9 @@ An empty mapping (`{}`) is valid; an empty file, `null` or a list is not.
45
46
  - Every group match and regular expression, CLI selectors and selected group names.
46
47
  - Every command/condition alias, supported Docker action, action argument shape,
47
48
  rule syntax, resource name, unit conversion and condition value conversion.
49
+ - Every named scenario, including its mode-specific options, resources, rules
50
+ and references. Since 0.0.77, access resources also require an explicit directory
51
+ access identity during offline validation, before a runner can start.
48
52
 
49
53
  Validation stops at the first error. Locations identify the source/import file,
50
54
  entry or supplied rule; YAML syntax errors also include line and column numbers.
@@ -53,7 +57,10 @@ Fix the reported error and rerun to reveal any later errors.
53
57
 
54
58
  Checks are deliberately stricter than the legacy loader, which can ignore some
55
59
  unused sections or fields. The behavior and exit codes of the existing commands
56
- are unchanged.
60
+ are unchanged, except for the scenario validation correction noted above.
61
+
62
+ See the [configuration and CLI contract](config-cli-contract.md) for precedence,
63
+ selection semantics and the remaining compatibility decisions before 1.0.
57
64
 
58
65
  ## Output and exit codes
59
66
 
@@ -0,0 +1,329 @@
1
+ # Configuration and CLI compatibility contract
2
+
3
+ **Status: 0.0.x baseline, reviewed for the proposed 0.0.77 release.** This reference
4
+ records the current public behavior and the decisions still needed before 1.0.
5
+ It does not declare the HTTP API, metrics or journal schema stable. Follow the
6
+ [roadmap](roadmap.md) for the complete release criteria.
7
+
8
+ Use full option names and explicit selectors in automation. Global options go
9
+ before the subcommand; that subcommand's options go after it:
10
+
11
+ ```sh
12
+ monit-docker -c config.yml --name 'web-*' stats --rsc status
13
+ monit-docker -c config.yml check-config --output json
14
+ monit-docker -c config.yml run web-guard --dry-run
15
+ ```
16
+
17
+ ## Configuration source and precedence
18
+
19
+ 1. `-c FILE` selects a file; otherwise use `MONIT_DOCKER_CONFFILE`, then
20
+ `/etc/monit-docker/monit-docker.yml`.
21
+ 2. If the selected path exists, load it. A read or parse error does **not** fall
22
+ back to the environment.
23
+ 3. If it does not exist, use nonempty `MONIT_DOCKER_CONFIG` as inline YAML.
24
+ 4. Without either source, historical `stats`, `monit`, `cron` and `serve` use an
25
+ empty configuration. `check-config`, `run` and `scenario` instead return 110.
26
+
27
+ The root must be a YAML mapping. `{}` is valid; an empty document, `null` or a
28
+ list is not. The checked loader requires string keys and mapping-valued sections.
29
+ It rejects unknown sections and entry fields. The historical loader is more
30
+ permissive and can ignore unused fields; `stats` does not load command/condition
31
+ aliases. Validate with `check-config` before deployment.
32
+
33
+ | Section | Entry structure | Meaning |
34
+ | --- | --- | --- |
35
+ | `general` | Mapping | Template context, not a mapping of CLI defaults |
36
+ | `vars` | Mapping | Shared template variables |
37
+ | `clients` | `NAME: {config: MAPPING}` | Docker SDK connection options; `tls` may be a boolean or mapping |
38
+ | `ctn-groups` | `NAME: {match: [STRING, ...]}` | Nonempty list of `name:`, `id:`, `image:` or `label:` patterns |
39
+ | `dir-groups` | `NAME: {paths: [STRING, ...], access: MAPPING}` | Nonempty absolute container paths; `access` is optional unless an access probe is requested |
40
+ | `conditions` | `NAME: {expr: [STRING, ...]}` | Nonempty list of conditions combined with AND |
41
+ | `commands` | `NAME: {exec: [ACTION, ...]}` | Nonempty ordered action sequence |
42
+ | `scenarios` | `NAME: MAPPING` | A named `stats`, `cron` or `serve` job |
43
+
44
+ Command/condition aliases and directory-group names use an ASCII letter followed
45
+ by at most 64 letters, digits, underscores, dots or hyphens. Scenario names match
46
+ `[a-z0-9][a-z0-9-]{0,63}` and are selected exactly. Client and container-group names
47
+ have no equivalent restrictive naming pattern in the checked loader, but must
48
+ be nonempty strings. Prefer simple printable names.
49
+
50
+ Entries may have local `vars` and `@import_vars`. Section imports use
51
+ `@import_client`, `@import_ctn-group`, `@import_dir-group`, `@import_condition`,
52
+ `@import_command` or `@import_scenario`; accept one path or a nonempty list. Imported
53
+ files contain entries directly, without repeating the section wrapper. Relative
54
+ imports resolve against the main file's directory (the working directory for
55
+ inline configuration). Later imports override earlier entries; main-file entries
56
+ override imported entries **as a whole**, without deep merging. Imports are not
57
+ a recursive include mechanism.
58
+
59
+ Mako templates run during rendering and must be trusted. They can access `ENV`,
60
+ the `my` YAML helper and the supplied context. An imported file is rendered before
61
+ its entry-local variables are available. Offline validation does not sandbox
62
+ template execution. State/audit paths resolve against the working directory,
63
+ not the configuration directory; absolute paths are preferable for scheduled jobs.
64
+
65
+ Directory access identities contain exactly `uid`, `gid` and `groups`: integer
66
+ IDs from 0 through 4294967294, and 1..128 distinct supplementary group IDs including
67
+ `gid`. Booleans are not IDs. Paths cannot contain ASCII control characters;
68
+ duplicates are removed in order. Access probes require Python 3 in the target
69
+ Linux container; see [access checks](access-checks.md) for runtime restrictions.
70
+
71
+ ## Docker client selection
72
+
73
+ `--client-from-env` takes precedence over `--client` and configured clients.
74
+ Otherwise, `--client NAME` selects an entry, or the first loaded client is used.
75
+ With no configured clients the historical runtime uses Docker environment
76
+ settings, defaulting `DOCKER_HOST` to `unix:///var/run/docker.sock` when absent.
77
+ An explicit but unknown client is rejected by checked configuration. See the
78
+ legacy discrepancy under [open decisions](#open-decisions-before-10).
79
+
80
+ ## Container selectors
81
+
82
+ | Input | Current behavior |
83
+ | --- | --- |
84
+ | `--name`, `--id`, `--image`, `--label` | Repeatable; each value is also split at commas, with surrounding whitespace removed |
85
+ | Several patterns or kinds | OR: any name, ID, image tag or label value can select the container |
86
+ | `-s STATUS` | Repeatable status alternatives, applied in addition to the pattern selection |
87
+ | `--ctn-group NAME` | Repeatable exact group names; their patterns form a union and replace direct name/ID/image/label patterns |
88
+ | No patterns/groups | All containers allowed by the status filter, including stopped containers |
89
+ | Ordinary pattern | Case-sensitive shell-style glob, matching the whole value |
90
+ | `~EXPRESSION` | Case-sensitive Python regular expression matched from the start; add `$` for an end anchor or `.*` for a leading search |
91
+ | 12-character alphanumeric ID pattern | Automatically gets a trailing `*` for legacy short-ID matching |
92
+ | Label pattern | Matches label **values**, not keys or Docker's `key=value` filter syntax |
93
+ | Image pattern | Matches image tags, not image IDs/digests |
94
+
95
+ Quote patterns to prevent shell expansion. Direct selectors, including scenario
96
+ selectors, split commas even inside regular expressions. For a quantifier such
97
+ as `{1,3}`, use a container group: group `match` expressions do not split commas.
98
+ For example:
99
+
100
+ ```yaml
101
+ ctn-groups:
102
+ workers:
103
+ match: ['name:~worker-[0-9]{1,3}$']
104
+ ```
105
+
106
+ Use `--ctn-group workers`, or scenario `select: {group: workers}`. Group matches
107
+ do not support status expressions; use `-s` or scenario `select.status`.
108
+ An empty result is error 114, not a successful no-op. Container iteration order
109
+ comes from Docker and is not promised to be sorted.
110
+
111
+ ## Global options
112
+
113
+ | Options | Default / constraints |
114
+ | --- | --- |
115
+ | `-c` | Configuration precedence above |
116
+ | `--client`, `--client-from-env` | Client precedence above |
117
+ | `--name`, `--id`, `--image`, `--label`, `--ctn-group`, `-s` | Selection above; status is one of `running`, `created`, `paused`, `restarting`, `removing`, `exited`, `dead` |
118
+ | `-l` | `info`; `critical`, `error`, `warning`, `info`, `debug` |
119
+ | `--logfile` | `MONIT_DOCKER_LOGFILE` or `/var/log/monit-docker/monit-docker.log` |
120
+ | `--runtimedir` | `MONIT_DOCKER_RUNTIMEDIR` or `/run/monit-docker` |
121
+ | `--event-window` | 300 seconds; integer 1..86400 |
122
+ | `--audit-file` | `MONIT_DOCKER_AUDIT_FILE`; otherwise `audit/events.jsonl` beside the state file, or `$XDG_STATE_HOME/monit-docker/audit/events.jsonl` (`~/.local/state` fallback) when a journal is needed |
123
+ | `--audit-max-bytes` | 5242880; integer at least 65536 |
124
+ | `--audit-files` | 5; integer 1..100 |
125
+
126
+ An empty audit path is invalid. Export/forwarding and authenticated journal reads
127
+ require an explicit audit path (the environment variable also counts).
128
+ Environment-derived configuration/log/runtime defaults are read when the CLI
129
+ module is imported; set them before launching the process.
130
+
131
+ ## Rules and action aliases
132
+
133
+ `--cmd` and `--cmd-if` are aliases for the same repeatable option. A rule is an
134
+ unconditional action, `CONDITION ? ACTION`, or `@condition_alias ? @command_alias`;
135
+ inline and aliased sides can be mixed. A command alias expands to its ordered
136
+ action list; a condition alias expands to conditions combined with AND. Alias
137
+ entries do not recursively reference other aliases.
138
+
139
+ Docker actions are `start`, `stop`, `remove`, `reload`, `restart`, `kill`, `pause`,
140
+ `unpause`. Parenthesized text such as `(sh -c "echo ready")` is a Docker exec
141
+ command; use an explicit shell when shell syntax is needed. In a command alias,
142
+ an action can be a string or a single-key mapping whose options are `args` (list)
143
+ and `kwargs` (mapping), passed to the Docker SDK. Offline validation does not
144
+ guarantee that every SDK keyword is supported. Completed exec status is required;
145
+ detached or streaming execs cannot be reported as successful monitored actions.
146
+
147
+ Numeric comparisons use `==`, `!=`, `<`, `<=`, `>`, `>=`, nonnegative numeric
148
+ literals and, where supported, byte units such as `MiB`. State membership uses
149
+ `in (paused,running)` or `not in (paused,running)`, without spaces inside the list.
150
+ Resource-specific bounds/operators are described in the check guides. Conditions
151
+ for one directory group must be satisfied together by at least one path in that
152
+ group. Separate groups and ordinary conditions are combined with AND.
153
+
154
+ Rules requiring only status/PID/health run before metric-dependent rules, even
155
+ when their CLI order is interleaved. Within each phase, input order is preserved.
156
+ Metric rules only run when the container is running or paused. This two-phase
157
+ behavior and the historical chained comparisons need explicit consideration
158
+ when converting long commands into scenarios.
159
+
160
+ ## Subcommands and outputs
161
+
162
+ | Command | Options / behavior |
163
+ | --- | --- |
164
+ | `stats` | Repeatable `--rsc`; `--output json` (default) or `text`; no remediation |
165
+ | `monit` | Repeatable `--rsc` **or** repeatable `--cmd`/`--cmd-if`; `--dry-run` and `--propagate-exit-code` require rules |
166
+ | `cron` | Repeatable `--cmd`/`--cmd-if` and `--state-file` required; policy options below; `--dry-run`, `--propagate-exit-code` |
167
+ | `serve` | Continuous collection; repeatable `--rsc` and optional `--cmd`/`--cmd-if`; state required with rules; policy/listener options below |
168
+ | `check-config` | `--output text` (default) or `json`; optional repeatable `--cmd`/`--cmd-if` checked without running them |
169
+ | `scenario list` | JSON array of `{name, mode, description}`, sorted by name; no positional scenario name |
170
+ | `scenario show NAME` | One rendered scenario object as JSON; can contain command arguments; not a fully expanded default-option dump |
171
+ | `run NAME` | Run one exact scenario; optional `--dry-run` can enable but never disable simulation |
172
+ | `maintenance` | `--state-file`, exact lowercase 64-hex `--container-id`, `--duration` required; 0 resumes, 1..86400 seconds pauses automatic actions; JSON `{container_id, maintenance_until}` |
173
+ | `restart-reset` | `--state-file` and exact lowercase 64-hex `--container-id` required; JSON `{container_id, status: "rearmed"}`; requires recorded attempts |
174
+ | `audit-export` | `--format jsonl` (default) or `csv`; optional `--category action\|notification` and `--since` with timezone |
175
+ | `audit-send` | Export filters plus required `--url` HTTPS receiver and optional `--token-file`; forwards JSON events and reports acknowledgements on stderr |
176
+ | `audit-migrate` (0.0.78+) | Simulation by default or `--dry-run`; `--apply --output-dir NEW_DIRECTORY` creates original-byte backups, converted journals and a verified manifest without connecting to Docker |
177
+
178
+ `stats --output json` emits one JSON object per container, not a single array.
179
+ Each maps the container name to requested resource values. Memory, disk and I/O
180
+ values are human-readable unit strings where applicable. Text uses
181
+ `NAME|RESOURCE:VALUE|...`. `monit` text keeps raw units. Unavailable displayed
182
+ values may be null. Do not parse diagnostic logs as command output.
183
+
184
+ With no `--rsc`, `stats` and `serve` request `mem_usage`, `mem_limit`, `mem_percent`,
185
+ `cpu_percent`, `io_read`, `io_write`, `net_tx`, `net_rx`, `status`, `pid`, `health`.
186
+ Additional resources are `oom_events`, `starts_recent`, `pids_current`,
187
+ `pids_limit`, `pids_percent`, and filesystem resources such as `disk_percent[data]`.
188
+ See [filesystem](filesystems.md), [access](access-checks.md) and
189
+ [runtime](runtime-checks.md) references for all resource meanings and prerequisites.
190
+
191
+ Rules emit JSON action decisions containing `container_id`, `rule`, `command`
192
+ and `status`. Current statuses include `executed`, `dry-run`, `cooldown`,
193
+ `pending`, `restart-limit`, `maintenance`. Nonmatching rules emit no decision.
194
+ Docker exec output is not passed through as a structured stdout result.
195
+ The first action failure aborts the remaining actions and containers.
196
+
197
+ `check-config --output json` returns `{valid, errors, summary}` on stdout.
198
+ Errors contain `location` and `message`; validation stops at the first error.
199
+ Summary counts `clients`, `groups`, `commands`, `conditions`, `rules`, plus
200
+ `scenarios` when present. It validates dormant aliases/groups/scenarios as well
201
+ as supplied rules. `scenario list` validates all scenarios; `show` and `run`
202
+ validate the selected scenario after checking configuration shapes. Their
203
+ configuration errors go to stderr and return 110.
204
+
205
+ These inspection commands do not connect to Docker or create agent state/log
206
+ files. `maintenance` and `restart-reset` also avoid Docker but mutate local state
207
+ and write audit events. A dry run collects live Docker data; cron/serve can create
208
+ a lock and audit simulated decisions while preserving durable policy state.
209
+
210
+ ## Policy and listener options
211
+
212
+ | Option | Modes | Default / constraints |
213
+ | --- | --- | --- |
214
+ | `--state-file` | `cron`, `serve` | Nonempty path; required in cron, or serve with rules/manual actions |
215
+ | `--cooldown` | `cron`, `serve` | 300 seconds; finite and nonnegative |
216
+ | `--max-restarts` | `cron`, `serve` | 3; positive integer, attempts per container until rearm |
217
+ | `--trigger-after` | `cron`, `serve` | 0; finite and nonnegative; positive value requires rules and `--max-gap` |
218
+ | `--max-gap` | `cron`, `serve` | Finite positive seconds; only with positive trigger delay; must exceed interval in serve |
219
+ | `--bind`, `--port` | `serve` | IPv4 `127.0.0.1`, integer 9808 (1..65535) |
220
+ | `--interval` | `serve` | 30 seconds; finite and at least 0.1 |
221
+ | `--stale-after` | `serve` | `max(90, 3 * interval)`; finite and at least interval |
222
+ | `--dry-run` | `monit`, `cron`, `serve`, `run` | Off; requires rules; incompatible with manual HTTP actions |
223
+ | `--allow-actions` | `serve` | Off; requires state, action token and exact HTTPS origin |
224
+ | `--action-origin`, `--action-token-file` | `serve` | Require `--allow-actions`; origin `https://host[:port]` without credentials/path/query/fragment; token file contains 64 lowercase hex characters with optional final newline |
225
+ | `--action-cooldown` | `serve` | 30 seconds; finite and at least 1 |
226
+ | `--allow-maintenance`, `--trust-proxy-user` | `serve` | Off; require `--allow-actions` |
227
+ | `--audit-read-token-file` | `serve` | Off; requires explicit audit path and a distinct read secret |
228
+ | `--notification-token-file` | `serve` | Off; private notification ingestion secret |
229
+
230
+ Keep one persistent state path per Docker host/job. A busy state lock fails
231
+ immediately with 117. See [cron](cron.md), [trigger delay](trigger-delay.md),
232
+ [restart limits](restart-limit.md) and [serve](serve.md) for policy and token details.
233
+
234
+ ## Scenario fields and overrides
235
+
236
+ Scenario mode defaults to `cron`. All modes allow `mode`, `description`,
237
+ `select` or `all: true`, `client`, `client-from-env`, `event-window`, `audit-file`,
238
+ `audit-max-bytes`, `audit-files`. Selection fields are `name`, `id`, `image`,
239
+ `label`, `group`, `status`, each a string or nonempty string list. Choose `select`
240
+ or `all: true`, exclusively. Group selection allows only an additional status.
241
+
242
+ | Mode | Additional fields |
243
+ | --- | --- |
244
+ | `stats` | `resources`, `output` |
245
+ | `cron` | `rules`, `state-file`, `cooldown`, `max-restarts`, `trigger-after`, `max-gap`, `dry-run` |
246
+ | `serve` | All cron fields plus `resources`, `bind`, `port`, `interval`, `stale-after` |
247
+
248
+ `resources` and `rules` accept a string or nonempty string list. Booleans must be
249
+ YAML booleans, not strings. Integer fields accept integers or integer strings;
250
+ other numeric fields accept finite numbers or numeric strings, including template
251
+ results, then apply CLI bounds. Unknown or wrong-mode fields are rejected.
252
+
253
+ `run`/`scenario` reject global selectors and Docker-client overrides. Configuration,
254
+ log and runtime paths are inherited; global audit/event-window settings apply
255
+ unless the scenario defines them. CLI `run --dry-run` only enables simulation.
256
+ The configuration is rendered once and passed to the runner. Scenario names do
257
+ not identify cooldowns: changing the state path starts separate policy history.
258
+ Manual HTTP action options and exec-exit propagation are not scenario fields.
259
+
260
+ Since 0.0.77, access resources in stats/serve scenarios require the directory
261
+ group's `access` identity during offline validation, just as access rules and
262
+ execution do. Disk/inode/mount-mode resources do not require it.
263
+
264
+ ## Exit codes
265
+
266
+ | Code | Meaning |
267
+ | --- | --- |
268
+ | 0 | Successful command; can mean no rule matched or all actions were skipped |
269
+ | 2 | Argument parsing/validation error, before command execution |
270
+ | 110 | Configuration, alias, scenario or value error handled as such |
271
+ | 114 | No container selected |
272
+ | 115 | Required observation unavailable |
273
+ | 116 | Action failure; default for failed in-container exec |
274
+ | 117 | Persistent state lock busy |
275
+ | 118 | State read/write/validation failure |
276
+ | 119 | Audit error, or handled OS/value errors in local administration commands |
277
+ | 140 | Rule syntax error reaching the historical runtime CLI |
278
+ | 150 | Unexpected exception reaching the historical runtime CLI |
279
+ | 170 | Docker SDK connection/client error |
280
+ | 180 | Docker API error during collection; action API failures normally become 116 |
281
+ | 255 | Interrupt/SystemExit handled inside the runtime CLI; not a promise for every signal or every entry point |
282
+
283
+ Some `monit --rsc` invocations intentionally return data as the process status:
284
+
285
+ - `status`: running 0, created 10, paused 20, restarting 30, removing 40, exited 50,
286
+ dead 60.
287
+ - `health`: healthy 0, starting 10, unhealthy 20, none 30, unknown 115.
288
+ - One ordinary `*_percent` resource: integer truncated and bounded to 0..100.
289
+ Raw `stats`/rule measurements are not capped. Filesystem percentages return
290
+ per-path output instead.
291
+
292
+ These early exits describe the **first selected container**, not an aggregate.
293
+ Use an exact container selector for a process-status check. `--propagate-exit-code`
294
+ in `monit`/`cron` returns a failed completed exec's 1..255 status instead of 116;
295
+ it can overlap every other status family. Check command mode and diagnostics.
296
+
297
+ ## Open decisions before 1.0
298
+
299
+ - Unify or explicitly retain strict validation versus permissive runtime loading.
300
+ Normalize configuration failures that currently reach generic status 150.
301
+ - Decide whether an explicitly unknown client must fail even with no configured
302
+ clients; the historical runtime currently falls back to the environment.
303
+ - Decide whether mixed group/direct selection should be rejected in all commands,
304
+ as it already is in scenarios, rather than silently prioritizing groups.
305
+ - Decide how to support commas in direct regular-expression selectors without
306
+ breaking existing comma-separated selection.
307
+ - Review the [historical chained-comparison operand order](architecture.md#compatibility-and-validation):
308
+ `10 < cpu_percent < 90` currently compares the measurement against both bounds
309
+ using `<`. Prefer an AND condition alias with `cpu_percent > 10` and
310
+ `cpu_percent < 90`; do not reinterpret existing expressions without migration.
311
+ - Resolve Python support metadata: CI currently covers Python 3.10/3.12, while
312
+ package metadata still advertises older interpreters that this code cannot run on.
313
+ - Define the supported Docker/platform matrix, deprecation process and migration
314
+ policy; separately review HTTP fields, metrics and journal schema compatibility.
315
+
316
+ No internal Python class, diagnostic wording, implicit argparse abbreviation,
317
+ Docker enumeration order or undocumented YAML behavior is declared a stable API
318
+ by this baseline. Existing DWho, HTTPdis and Sonicprobe foundations remain in use.
319
+
320
+ ## Verification
321
+
322
+ `test_cli_contract.py` covers target selection, label values/image tags, regular
323
+ expression boundaries, group precedence, import replacement, client precedence
324
+ and option placement. `test_scenarios.py` covers scenario overrides, offline
325
+ inspection, single rendering, state continuity and access-resource validation.
326
+ Existing `test_check_config.py`, `test_monit_docker.py`, `test_cron.py`,
327
+ `test_trigger_delay.py` and `test_restart_limit.py` cover diagnostics, exit-code
328
+ propagation and persistent policies. These tests support this inventory; they
329
+ do not complete every milestone in the 1.0 roadmap.