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
@@ -6,7 +6,15 @@ import stat
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from .diffs import DIFF_SUFFIX, diff_bytes, stored_diff, valid_diff
|
||||
from .diffs import (
|
||||
DIFF_SUFFIX,
|
||||
SEALED_SUFFIX,
|
||||
diff_bytes,
|
||||
sealed_bytes,
|
||||
stored_diff,
|
||||
valid_diff,
|
||||
valid_sealed,
|
||||
)
|
||||
from .errors import Conflict, Missing, ToolError
|
||||
from .fields import WAIT_CAP, bounded, decode, expect, field, seconds
|
||||
from .review_page import review_files
|
||||
@@ -17,7 +25,7 @@ NOTES_LIMIT = limits.NOTES_LIMIT
|
||||
SCORE_LIMIT = 500
|
||||
GATES = ("pass", "fail")
|
||||
REQUEST = ("repo", "worktree", "branch", "tree", "title", "page", "notes", "gate", "score")
|
||||
OPTIONAL = ("agent", "diff")
|
||||
OPTIONAL = ("agent", "diff", "sealed")
|
||||
LISTED = ("id", "created", "worktree", "branch", "tree", "title")
|
||||
STATE = ("id", "status", "tree", "decided")
|
||||
|
||||
@@ -67,9 +75,12 @@ class Reviewing:
|
||||
score = " ".join(bounded(arguments, "score", SCORE_LIMIT).split())
|
||||
agent = field(arguments, "agent").strip() if "agent" in arguments else ""
|
||||
diff = valid_diff(arguments["diff"]) if "diff" in arguments else None
|
||||
sealed = valid_sealed(arguments["sealed"], diff) if "sealed" in arguments else {}
|
||||
page = self.read_page(field(arguments, "page"))
|
||||
extra = {"notes": notes, "gate": arguments["gate"], "score": score, "agent": agent, "diff_files": None if diff is None else len(diff)}
|
||||
attached = {} if diff is None else {DIFF_SUFFIX["review"]: diff_bytes(diff)}
|
||||
if sealed:
|
||||
attached[SEALED_SUFFIX["review"]] = sealed_bytes(sealed)
|
||||
review = self.reviews.submit({**fields, "title": fields["title"].strip(), **extra}, page, review_files(page), attached)
|
||||
self.automate("review", review)
|
||||
return {"id": review["id"], "status": review["status"], "url": self.url()}
|
||||
|
||||
Reference in new issue
Block a user