conduct-cli 0.6.5__tar.gz → 0.6.6__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.
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/PKG-INFO +1 -1
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/pyproject.toml +1 -1
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/hook_template.py +22 -1
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/README.md +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/setup.cfg +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/setup.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/guard.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.5 → conduct_cli-0.6.6}/tests/test_switch.py +0 -0
|
@@ -179,8 +179,29 @@ def _maybe_sync_policy():
|
|
|
179
179
|
|
|
180
180
|
remote_version = remote.get("version", "")
|
|
181
181
|
local_version = ""
|
|
182
|
+
local_policy: dict = {}
|
|
182
183
|
if POLICY_PATH.exists():
|
|
183
|
-
|
|
184
|
+
local_policy = json.loads(POLICY_PATH.read_text())
|
|
185
|
+
local_version = local_policy.get("version", "")
|
|
186
|
+
|
|
187
|
+
# Meta-rule: block silent fail_closed → fail_open downgrade.
|
|
188
|
+
# An attacker who compromises the policy server cannot silently disable governance.
|
|
189
|
+
# Legitimate downgrade requires fail_mode_downgrade_token in the new policy,
|
|
190
|
+
# matching the token stored when fail_closed was originally set.
|
|
191
|
+
old_mode = local_policy.get("fail_mode", "fail_open")
|
|
192
|
+
new_mode = remote.get("fail_mode", "fail_open")
|
|
193
|
+
if old_mode == "fail_closed" and new_mode != "fail_closed":
|
|
194
|
+
expected = local_policy.get("fail_mode_downgrade_token")
|
|
195
|
+
provided = remote.get("fail_mode_downgrade_token")
|
|
196
|
+
if not expected or expected != provided:
|
|
197
|
+
_post_signature_invalid_event(
|
|
198
|
+
expected_sig=f"fail_mode_downgrade_token:{expected}",
|
|
199
|
+
computed_sig=f"fail_mode_downgrade_token:{provided}",
|
|
200
|
+
policy_version=remote_version,
|
|
201
|
+
hostname=__import__("platform").node(),
|
|
202
|
+
)
|
|
203
|
+
return # reject downgrade — keep existing fail_closed policy
|
|
204
|
+
|
|
184
205
|
if remote_version != local_version:
|
|
185
206
|
POLICY_PATH.write_text(json.dumps(remote, indent=2))
|
|
186
207
|
VERSION_CACHE_PATH.write_text(json.dumps({"ts": time.time(), "version": remote_version}))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|