@miller-tech/uap 1.189.0 → 1.189.2
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 +78 -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/package.json
CHANGED
|
Binary file
|
|
@@ -140,6 +140,43 @@ PROTECTED_TARGETS = (
|
|
|
140
140
|
# shell-writable meant a single append could satisfy a gate — which is
|
|
141
141
|
# exactly how one was satisfied during development.
|
|
142
142
|
".uap/evidence",
|
|
143
|
+
# Delivery COORDINATION state. Same argument as the evidence records, and
|
|
144
|
+
# listed individually for the same reason rather than by widening .uap/:
|
|
145
|
+
# the rest of that directory really is scratch the tooling rewrites
|
|
146
|
+
# constantly, but these two are mechanisms, not logs.
|
|
147
|
+
#
|
|
148
|
+
# `deliver.lock` is the single-flight guard. Removing it puts a second
|
|
149
|
+
# mission on the same tree - not hypothetical: two runs on nested roots
|
|
150
|
+
# overwrote each other's edits to src/cooccurrence.rs on 2026-08-08 until
|
|
151
|
+
# it stopped compiling, each one's gate failing on damage the other had
|
|
152
|
+
# just done. On 2026-08-10 an agent ran
|
|
153
|
+
# rm -f .uap/deliver.lock && uap deliver "<reworded instruction>"
|
|
154
|
+
# to force a relaunch past the guard.
|
|
155
|
+
#
|
|
156
|
+
# `deliver-runs` holds every run's checkpoint - the resumable work itself.
|
|
157
|
+
# Removing that directory was allowed and would discard all of it.
|
|
158
|
+
#
|
|
159
|
+
# Neither ever needs deleting by hand: a lock whose holder is dead or
|
|
160
|
+
# wedged is reclaimed automatically on the next launch, and a run is
|
|
161
|
+
# stopped with the STOP file, which leaves the checkpoint intact.
|
|
162
|
+
".uap/deliver.lock",
|
|
163
|
+
".uap/deliver-runs",
|
|
164
|
+
# The heartbeat is part of the SAME guard, and leaving it out left the
|
|
165
|
+
# bypass open one file over. `isDeliverLockAbandoned` treats a MISSING
|
|
166
|
+
# heartbeat plus a lock older than the wedge timeout as abandoned, so
|
|
167
|
+
# deleting it makes a live holder look dead and the next launch reclaims
|
|
168
|
+
# its lock. Verified: with the heartbeat present a two-hour-old lock held
|
|
169
|
+
# by a live pid is abandoned=False; delete it and the same lock is
|
|
170
|
+
# abandoned=True.
|
|
171
|
+
".uap/deliver.heartbeat",
|
|
172
|
+
# NOT `.uap/pending-deliver.jsonl`, though the delivery-enforcement policy
|
|
173
|
+
# names it alongside these. It is an APPEND-ONLY queue the tooling writes
|
|
174
|
+
# constantly, and the destructive check treats every redirect alike, so
|
|
175
|
+
# protecting it here refuses `echo x >> .uap/pending-deliver.jsonl` — the
|
|
176
|
+
# ordinary way the queue is filled. Caught by the Python enforcer suite
|
|
177
|
+
# (test_gate_evidence), which asserts that exact append stays allowed.
|
|
178
|
+
# Guarding it needs a rule that tells `>>` from `>`; blocking the queue's
|
|
179
|
+
# own writes to protect it is not that rule.
|
|
143
180
|
".uap.json",
|
|
144
181
|
"anthropic-proxy.env",
|
|
145
182
|
)
|
|
@@ -301,6 +338,23 @@ def _destructive_intent(command: str) -> bool:
|
|
|
301
338
|
return bool(toks & set(DESTRUCTIVE_VERBS)) or bool(_REDIRECT.search(command))
|
|
302
339
|
|
|
303
340
|
|
|
341
|
+
_DELIVER_COORD = (
|
|
342
|
+
".uap/deliver.lock",
|
|
343
|
+
".uap/deliver-runs",
|
|
344
|
+
".uap/deliver.heartbeat",
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def _mentions_deliver_coord(command: str) -> bool:
|
|
349
|
+
"""True when the command names the delivery coordination surface.
|
|
350
|
+
|
|
351
|
+
Only chooses the WORDING of a refusal that has already been decided by
|
|
352
|
+
`_bash_destructive`; it never widens or narrows what is refused.
|
|
353
|
+
"""
|
|
354
|
+
text = command.translate(_QUOTES).lower()
|
|
355
|
+
return any(t in text for t in _DELIVER_COORD)
|
|
356
|
+
|
|
357
|
+
|
|
304
358
|
def _direct_destructive(command: str) -> bool:
|
|
305
359
|
"""Destructive op naming a protected path, judged per command segment."""
|
|
306
360
|
cd_into_protected = False
|
|
@@ -465,6 +519,30 @@ def main() -> None:
|
|
|
465
519
|
"(Operator-only override: UAP_SELF_PROTECT_OFF=1.)",
|
|
466
520
|
)
|
|
467
521
|
if _bash_destructive(cmd):
|
|
522
|
+
# Name the SURFACE that was touched. "policy enforcers or proxy env"
|
|
523
|
+
# is simply untrue of a lock file, and a refusal that describes the
|
|
524
|
+
# wrong thing and offers no alternative is how a loop survives a
|
|
525
|
+
# guard: the agent that hit this had been clearing the lock to force
|
|
526
|
+
# a relaunch, seven times, and nothing told it what to do instead.
|
|
527
|
+
if _mentions_deliver_coord(cmd):
|
|
528
|
+
emit(
|
|
529
|
+
False,
|
|
530
|
+
"BLOCKED: this removes delivery COORDINATION state. "
|
|
531
|
+
"`.uap/deliver.lock` is the single-flight guard - deleting it "
|
|
532
|
+
"does not free anything, it puts a SECOND mission on the same "
|
|
533
|
+
"tree, and two of them overwrite each other's edits. "
|
|
534
|
+
"`.uap/deliver-runs/` holds every run's checkpoint, which is "
|
|
535
|
+
"the work itself. `.uap/deliver.heartbeat` is how a live run is "
|
|
536
|
+
"told apart from an abandoned one - remove it and the next launch "
|
|
537
|
+
"reclaims a RUNNING mission's lock. "
|
|
538
|
+
"You never need to remove either: a lock whose holder is dead "
|
|
539
|
+
"or wedged is reclaimed automatically by the next launch. "
|
|
540
|
+
"To STOP a run instead of forcing past it, request the "
|
|
541
|
+
"cooperative stop - `touch .uap/deliver-runs/STOP` - which "
|
|
542
|
+
"ends it at the next turn boundary with its work checkpointed "
|
|
543
|
+
"and the lock released. "
|
|
544
|
+
"(Operator-only override: UAP_SELF_PROTECT_OFF=1.)",
|
|
545
|
+
)
|
|
468
546
|
emit(
|
|
469
547
|
False,
|
|
470
548
|
"BLOCKED: modifying/removing the policy enforcers or proxy env is "
|
|
Binary file
|