Files
skills/orchestrator/templates/page-reveal.js
T
Kevin Veen-BirkenbachandClaude Opus 5.5 9742884308 feat(orchestrator): firewall view with signed settings changes (001 S6)
Requirement 001 S6: the hub gets a Firewall view of the Claude Code permission and sandbox settings. The operator signs each change with the passkey; a host settings writer (systemd path unit) applies only exact, signed changes to allowlisted settings files through O_NOFOLLOW directory and file descriptors, and a timer refreshes the view. Every signed text and every page sink refuses or marks hidden characters: Cc, Cf, Zl, Zp, every space but U+0020 and the Default_Ignorable set, with U+FE0E/U+FE0F allowed only after one of the 359 non-ASCII emoji bases of Unicode 16 (shared table, validated at import, the same pair rule on the page). Removal of a deny, ask or denyRead entry is exempt only as an exact single remove. The permission hook prints the hub's refusal reason, cleaned of hidden characters. Accepted MEDUSA false positives (independent review, operator pick): 38 this round, mainly the Unicode defence tables read as attack patterns, generic MM-SCAN-058 heuristics, WEB-FLASK-004 at view.py:213 (ints from the validated table via tojson), EXF26-TOOL-004 on the non-secret WebAuthn challenge, PRIV-SCAN-060 on the office-action shape check and PQC007 on a picker key.

🎯 Fix: 95 %
💥 Break: 3 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 92
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:14:17 +00:00

26 lines
1.6 KiB
JavaScript

const UNSEEN = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Zs}\p{Default_Ignorable_Code_Point}]/gu;
const EMOJI_BASES = new Set(JSON.parse(document.getElementById("emoji-bases").textContent));
const PRESENTATION = new Set([0xFE0E, 0xFE0F]);
/**
* @param {string} text the text a match sits in.
* @param {number} offset the UTF-16 index of the match.
* @returns {number} the code point right before offset, NaN at the start.
*/
const codePointBefore = (text, offset) => {
const pair = offset > 1 ? text.codePointAt(offset - 2) : 0;
return pair > 0xFFFF ? pair : text.charCodeAt(offset - 1);
};
/**
* @param {string} text a text a passkey prompt, a signed-item preview or an inbox diff shows.
* @returns {string} the text with every control, format, line or paragraph separator, space separator but the space and default-ignorable character but the tab shown as ⟨U+XXXX⟩, the set signing.unseen() refuses, except a variation selector right after a code point of EMOJI_BASES, the pair signing.presented() accepts, so no text hides, reorders or splits what the passkey signs.
*/
const revealed = (text) => String(text).replace(UNSEEN, (char, offset, whole) => (char === "\t" || char === " " || (PRESENTATION.has(char.codePointAt(0)) && EMOJI_BASES.has(codePointBefore(whole, offset))) ? char : `⟨U+${char.codePointAt(0).toString(16).toUpperCase().padStart(4, "0")}⟩`));
/**
* @param {string} text a text of several lines a signed-item preview shows.
* @returns {string} each line through revealed(), joined by real line breaks.
*/
const revealedLines = (text) => String(text).split("\n").map(revealed).join("\n");