@miller-tech/uap 1.175.4 → 1.175.6
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.
- package/package.json +1 -1
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/src/policies/enforcers/enforcement_self_protect.py +13 -0
- package/templates/hooks/__pycache__/deliver_autoroute.cpython-312.pyc +0 -0
- package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
- package/tools/agents/tests/test_enforcement_self_protect.py +23 -0
package/package.json
CHANGED
|
Binary file
|
|
@@ -60,6 +60,19 @@ BYPASS_PATTERNS = (
|
|
|
60
60
|
# review. Refuse it here so the attempt is visible rather than silent.
|
|
61
61
|
re.compile(r"UAP_NO_REVIEW\s*=\s*['\"]?1", re.I),
|
|
62
62
|
re.compile(r"UAP_USER_VALIDATION\s*=\s*['\"]?0", re.I),
|
|
63
|
+
# Single-flight is a DATA-SAFETY control, not a policy preference: deliver
|
|
64
|
+
# runs each candidate in a git worktree, and two runs against one repo are
|
|
65
|
+
# not safe together. Disabling it cost real work — observed live
|
|
66
|
+
# (octopus_invaders_v3, 2026-07-31): the agent ran
|
|
67
|
+
# `UAP_DELIVER_NO_LOCK=1 uap deliver ...`, two runs overlapped for seven
|
|
68
|
+
# minutes, and the untracked space-shooter/ tree they were both building
|
|
69
|
+
# disappeared. It had never been committed, so nothing could recover it.
|
|
70
|
+
#
|
|
71
|
+
# The env var stays a real operator hatch; only the INLINE form is refused,
|
|
72
|
+
# because a switch the constrained party writes into its own command line is
|
|
73
|
+
# not an override — it is an off switch, the same reasoning as every entry
|
|
74
|
+
# above it.
|
|
75
|
+
re.compile(r"UAP_DELIVER_NO_LOCK\s*=\s*['\"]?1", re.I),
|
|
63
76
|
)
|
|
64
77
|
# Destructive ops against the enforcer/policy surface.
|
|
65
78
|
#
|
|
Binary file
|
|
Binary file
|
|
@@ -49,6 +49,29 @@ class SelfProtectTest(unittest.TestCase):
|
|
|
49
49
|
rc, out = run("Bash", {"command": "UAP_ENFORCE_DELIVERY=advisory uap deliver x"})
|
|
50
50
|
self.assertEqual(rc, 2)
|
|
51
51
|
|
|
52
|
+
def test_blocks_inline_single_flight_bypass(self):
|
|
53
|
+
"""Single-flight is a DATA-SAFETY control, not a preference.
|
|
54
|
+
|
|
55
|
+
deliver runs each candidate in a git worktree, and two runs against one
|
|
56
|
+
repo are not safe together. Observed live (octopus_invaders_v3,
|
|
57
|
+
2026-07-31): the agent ran `UAP_DELIVER_NO_LOCK=1 uap deliver ...`, two
|
|
58
|
+
runs overlapped for seven minutes, and the untracked tree they were both
|
|
59
|
+
building disappeared. It had never been committed, so nothing could
|
|
60
|
+
recover it.
|
|
61
|
+
"""
|
|
62
|
+
rc, out = run("Bash", {"command": "UAP_DELIVER_NO_LOCK=1 uap deliver -- build it"})
|
|
63
|
+
self.assertEqual(rc, 2)
|
|
64
|
+
|
|
65
|
+
def test_blocks_exported_single_flight_bypass(self):
|
|
66
|
+
rc, out = run("Bash", {"command": "export UAP_DELIVER_NO_LOCK=1 && uap deliver -- x"})
|
|
67
|
+
self.assertEqual(rc, 2)
|
|
68
|
+
|
|
69
|
+
def test_allows_merely_mentioning_the_override(self):
|
|
70
|
+
# The env var remains a real OPERATOR hatch; only the agent writing it
|
|
71
|
+
# into its own command line is refused. Talking about it is not doing it.
|
|
72
|
+
rc, out = run("Bash", {"command": "echo 'UAP_DELIVER_NO_LOCK is an operator override'"})
|
|
73
|
+
self.assertEqual(rc, 0)
|
|
74
|
+
|
|
52
75
|
def test_blocks_bash_rm_enforcer(self):
|
|
53
76
|
rc, out = run("Bash", {"command": "rm -f .policy-tools/abc_delivery_enforcement.py"})
|
|
54
77
|
self.assertEqual(rc, 2)
|