style(kvb-org-organize): drop the hardening bundles' rationale comments
🧪 Test / 🧪 Lock + lint (push) Canceled after 0s
🧪 Test / 🧪 Lock + lint (push) Canceled after 0s
The symlink, FIFO and tokenizer reasons live in the commit messages of the bundles that added them, so the module docstrings of nofollow.py and test_nofollow.py and three rationale lines in watch.py and queue.py go. watch.py gets back the space after ROOT = that the PATH bundle lost. 🎯 Fix: 98 % 💥 Break: 1 % 💸 Cost: 100 % ⏱️ Time: 100 % 🛡️ Security: 100 % 💰 Value: ? 🏆 Score: 97 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa2b03da17
commit
5cb5da81ec
4 files changed
+1
-18
No files matched your search
@@ -1,15 +1,3 @@
|
||||
"""Open, read, lock, append, replace and unlink files below a trusted directory without following a symlink.
|
||||
|
||||
The council root is writable by every sandboxed agent of the same uid, while
|
||||
its hooks run outside the sandbox: a symlink planted at any name or directory
|
||||
below the root would turn a hook's read or write into one outside it, and a
|
||||
FIFO planted at a name would hang every agent's hook. Every function here
|
||||
opens the root and each directory below it with O_NOFOLLOW, relative to the
|
||||
directory before, and the final name with O_NOFOLLOW and O_NONBLOCK; a planted
|
||||
symlink, a `..` part, a path outside the root or anything but a regular file
|
||||
raises OSError.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
|
||||
@@ -76,7 +76,7 @@ def sibling(name: str) -> ModuleType:
|
||||
|
||||
nofollow = sibling("nofollow")
|
||||
hookpath = sibling("hookpath")
|
||||
ROOT =Path(os.environ.get("AGENTS_COUNCIL_ROOT", "/tmp/agents-council"))
|
||||
ROOT = Path(os.environ.get("AGENTS_COUNCIL_ROOT", "/tmp/agents-council"))
|
||||
CONFIG = Path(
|
||||
os.environ.get(
|
||||
"AGENTS_COUNCIL_CONFIG",
|
||||
@@ -190,7 +190,6 @@ def unseen_alerts(session: str) -> list[str]:
|
||||
|
||||
|
||||
def write_text(path: Path, text: str) -> None:
|
||||
# A full disk or a planted symlink refuses the write; the stage must still act, so it is dropped.
|
||||
try:
|
||||
nofollow.replace(ROOT, path, text, 0o600)
|
||||
except OSError:
|
||||
|
||||
Reference in new issue
Block a user