feat(orchestrator): reveal withheld diff content under a passkey signature (019)
staged_diff masks only the secret rule hits and seals each masked file's clear patch apart; reviews and asks store the sealed patches next to their diff, delete them once the item leaves pending, and the hub sweeps orphans. POST /api/diffs/<kind>/<id>/reveal/sign and /reveal hand the clear patches to a signed request; page-diff.js offers Reveal per hidden file and Reveal all, keeps the clear text in the page only and forgets it once the item leaves the inbox. Requirement 019, unit, hub and e2e tests. Accepted MEDUSA false positives (security.py accept after kvb-think-criticize, 2026-11-17): approval.py FTSCAN-231 WEB-SSRF RH005; permission_hook.py MM-SCAN-058 WEB-SSRF RH005; staged_diff.py SAST-ENV-001 AI-BACKDOOR-006 B603; hub.py MEX-SCAN-1167 INF-SCAN-589; page-load.js EXA002; hub_case.py TC001-TC009 INF-SCAN-2057/2206/2440/2457 EXA002 EXA006 PL002 B603 FTSC-SCAN-089. 🎯 Fix: 92 % 💥 Break: 4 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 88 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78d4e4a6aa
commit
af3555e88b
24 files changed
+928
-111
No files matched your search
@@ -18,9 +18,10 @@ Returns:
|
||||
takes or a hub that is down, so Claude Code shows its own dialog.
|
||||
The exit code is 0. An ask for a Bash git commit of exactly the
|
||||
staged index (staged_diff.commit_of) carries the diff staged_diff.py
|
||||
builds of the tree its directory stages, content withheld per the
|
||||
MEDUSA rules of the pipx install; none when it cannot be built or
|
||||
the body would pass DIFF_BODY_LIMIT. An allow of such an ask turns
|
||||
builds of the tree its directory stages, secrets masked per the
|
||||
MEDUSA rules of the pipx install, and the sealed clear patches of
|
||||
its masked files apart; neither when it cannot be built or the body
|
||||
would pass DIFF_BODY_LIMIT. An allow of such an ask turns
|
||||
into a deny with CHANGED when what the commit records
|
||||
(staged_diff.binding) differs right before answering from the
|
||||
preview's, and with UNBOUND when either cannot be read. Any other
|
||||
@@ -88,8 +89,9 @@ def unapprovable(ask: dict) -> bool:
|
||||
def commit_diff(ask: dict, rules: Path | None) -> tuple[str | None, dict]:
|
||||
"""Returns:
|
||||
For a commit ask, what the commit records (staged_diff.binding, None
|
||||
when it cannot be read) and {"diff": the preview of exactly that},
|
||||
{} when it cannot be built; None and {} for any other ask.
|
||||
when it cannot be read) and {"diff": the preview of exactly that,
|
||||
"sealed": the clear patches of its masked files}, {} when it cannot
|
||||
be built; None and {} for any other ask.
|
||||
"""
|
||||
target = commit_target(ask)
|
||||
if target is None:
|
||||
@@ -100,7 +102,8 @@ def commit_diff(ask: dict, rules: Path | None) -> tuple[str | None, dict]:
|
||||
print(f"kvb-orchestrator: the ask goes without its diff and an allow of it turns into a deny: {error}", file=sys.stderr)
|
||||
return None, {}
|
||||
try:
|
||||
return pinned, {"diff": staged_diff.bound_diff(target, pinned, rules)}
|
||||
diff, sealed = staged_diff.bound_diff(target, pinned, rules)
|
||||
return pinned, {"diff": diff, "sealed": sealed}
|
||||
except FAILURES as error:
|
||||
print(f"kvb-orchestrator: the ask goes without its diff: {error}", file=sys.stderr)
|
||||
return pinned, {}
|
||||
|
||||
Reference in new issue
Block a user