Update: 将子项目从 submodule 转为完整内容

- 移除 GovAI, nomifun-tauri, 算力盒子 的 submodule 引用
- 添加所有子项目的完整源代码
- 保留原始 .git 为 .git.bak 备份
This commit is contained in:
freedak
2026-07-04 19:20:46 +08:00
parent 54d6465fa7
commit f7a720204a
3360 changed files with 802660 additions and 3 deletions
@@ -0,0 +1,63 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>C1 click/type/set_value</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
/* fixed 定位让元素稳定在视口内(C1 走真实 getContentQuads,非硬编码点)。 */
.row { position: relative; margin: 8px; }
#name { display: block; width: 240px; height: 28px; }
#notes { display: block; width: 240px; height: 60px; }
#toggle { display: block; width: 200px; height: 36px; }
/* F2 元素 fixed 钉在视口右上角——永远在视口内(C1 走真实 getContentQuads),
且不挤占文档流,不会把 #submit 顶出视口。 */
#agree-row { position: fixed; top: 8px; right: 120px; }
#noop { position: fixed; top: 8px; right: 8px; width: 100px; height: 28px; }
form#login { margin: 8px; }
#login input { display: block; width: 240px; height: 28px; margin: 4px 0; }
#login button { width: 200px; height: 36px; }
</style>
</head>
<body>
<h1>C1 actions</h1>
<!-- type: 文本输入,type 后读回 value 验证 -->
<div class="row"><label>Name <input id="name" type="text"></label></div>
<!-- set_value: textarea,直接设值后读回 -->
<div class="row"><label>Notes <textarea id="notes"></textarea></label></div>
<!-- click: 按钮点击改自身文案,验证点击真分发到元素 -->
<div class="row"><button id="toggle">Not clicked</button></div>
<!-- 登录表单(验收点):user/pass input + submit buttonsubmit 时打标记(不真导航,preventDefault)。 -->
<form id="login" action="javascript:void(0)">
<label>Username <input id="username" name="username" type="text" autocomplete="username"></label>
<label>Password <input id="password" name="password" type="password" autocomplete="current-password"></label>
<button id="submit" type="submit">Sign in</button>
</form>
<!-- 登录提交后的可见标记(aria 可观测:role=status)。 -->
<div id="login-status" role="status" aria-label="login status">idle</div>
<!-- F2 富锚点(fixed 钉视口右上角,永在视口内、不挤占文档流、不顶出 #submit):
checkbox 点击切换 checkedURL 不变也能经元素态锚点判 changed=true);
#noop 点击不改态不导航(changed 应如实 false)。 -->
<div id="agree-row"><label><input id="agree" type="checkbox"> I agree</label></div>
<button id="noop" type="button">No-op</button>
<script>
document.getElementById('toggle').addEventListener('click', function () {
this.textContent = 'Clicked';
});
document.getElementById('login').addEventListener('submit', function (e) {
e.preventDefault();
var u = document.getElementById('username').value;
// 把提交时捕获的用户名写进可见标记(证明 type 真写入 + click submit 真触发);
// 不回显 password 值(与脱敏精神一致——这里只为证明表单态变)。
document.getElementById('login-status').textContent = 'submitted:' + u;
});
</script>
</body>
</html>
@@ -0,0 +1,9 @@
<!doctype html><html><body>
<h1>Actionability</h1>
<button>Submit order</button>
<button disabled>Disabled action</button>
<label>Email <input type="text"></label>
<label>Locked <input type="text" value="locked" readonly></label>
<div style="display:none"><button>Hidden action</button></div>
<p>Just some static prose, not editable.</p>
</body></html>
@@ -0,0 +1,70 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>C2 hover/select/press_key/scroll/scroll_to_text</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
.row { margin: 8px; }
/* hover 目标:onmouseover 时打标记 + :hover 改色(验证 hover 真投递)。 */
#hovertarget { display: inline-block; width: 200px; height: 40px; line-height: 40px;
text-align: center; background: #ddd; }
#hovertarget:hover { background: #8cf; }
/* select 目标。 */
#picker { display: block; width: 240px; height: 28px; }
/* press_key 目标:表单里的输入框,Enter 触发 submit 打标记。 */
form#search { margin: 8px; }
#q { display: block; width: 240px; height: 28px; }
/* 长页:spacer 撑高,底部有可滚到的文本 + 元素,验证 scroll / scroll_to_text。 */
#spacer { height: 3000px; background: linear-gradient(#fff, #eee); }
#bottom { padding: 24px; background: #cfc; }
#bottomtarget { display: block; width: 200px; height: 40px; background: #fc9; }
</style>
</head>
<body>
<h1>C2 actions</h1>
<!-- hover: onmouseover 打标记(验证 hover 真投递到元素)。用 button 让 aria 给它稳定 name。 -->
<div class="row">
<button id="hovertarget" data-hovered="no">Hover me</button>
</div>
<!-- select_option: 三个选项,act 选 opt2 后读回 select.value。 -->
<div class="row">
<label>Pick <select id="picker" aria-label="Pick">
<option value="opt1">First</option>
<option value="opt2">Second</option>
<option value="opt3">Third</option>
</select></label>
</div>
<!-- press_key: 输入框在 form 内,Enter 触发 submit 打标记(验证 Enter-in-form)。
带一个 submit 按钮让隐式提交在合成键事件下也可靠(单字段无按钮时浏览器启发式不稳)。 -->
<form id="search" action="javascript:void(0)">
<label>Query <input id="q" name="q" type="text"></label>
<button id="search-submit" type="submit" style="position:absolute;left:-9999px">Go</button>
</form>
<div id="search-status" role="status" aria-label="search status">idle</div>
<!-- 长页 spacer:撑高让初始 scrollY=0scroll down 后变大;底部文本/元素验证 scroll_to_text。 -->
<div id="spacer"></div>
<div id="bottom">
<p id="bottommarker">Unique footer sentinel text</p>
<button id="bottomtarget">Bottom target button</button>
</div>
<script>
// hover 标记:onmouseover 置位(hit-target 验证 hover 真命中目标本身)。
document.getElementById('hovertarget').addEventListener('mouseover', function () {
this.setAttribute('data-hovered', 'yes');
this.textContent = 'Hovered';
});
// Enter-in-form 提交标记。
document.getElementById('search').addEventListener('submit', function (e) {
e.preventDefault();
var q = document.getElementById('q').value;
document.getElementById('search-status').textContent = 'searched:' + q;
});
</script>
</body>
</html>
@@ -0,0 +1,63 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>C3 read-only actions (get_page_text/search_page/find_elements/get_dropdown_options/cursor/wait/wait_for)</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
.row { margin: 8px; }
/* find_elements 目标:两个 .primary button + 一个 .secondary。 */
button.primary { display: inline-block; width: 180px; height: 36px; }
button.secondary { display: inline-block; width: 180px; height: 36px; }
#picker { display: block; width: 240px; height: 28px; }
/* cursor: 让若干元素有 cursor:pointer。button 默认非 pointer,显式设。 */
button, a, .clickable { cursor: pointer; }
/* wait_for TextVisible 目标:初始隐藏,1s 后注入文本节点。 */
#late { color: #060; }
</style>
</head>
<body>
<h1>C3 read-only actions</h1>
<!-- get_page_text / search_page:可读正文含唯一 sentinelsearch 命中)+ 明文 secret(验证脱敏)。 -->
<div class="row">
<p id="intro">Welcome to the unique-sentinel-marker order page. Your order is ready.</p>
<!-- 明文 secretget_page_text/search_page 的输出必须脱敏(绝不出现明文 sk-... / Bearer ...)。 -->
<p id="leak">API key sk-ABCDEFGHIJ0123456789xyzQRSTUV must never reach the LLM.</p>
<p id="leak2">Authorization: Bearer abcdef0123456789ABCDEFghij is also a secret.</p>
<!-- password 输入框:DOM 信号 type=password;其 value 经 get_page_text(innerText) 通常不进文本,但保留以对齐 observe 口径。 -->
<label>Password <input id="pw" type="password" value="hunter2plain"></label>
</div>
<!-- find_elementsCSS 选择器 button.primary 命中两个;再用其中一个 ref click 验证可反解。 -->
<div class="row">
<button class="primary" id="p1">Primary One</button>
<button class="primary" id="p2">Primary Two</button>
<button class="secondary" id="s1">Secondary</button>
</div>
<!-- get_dropdown_options:含 selected + disabled option,枚举验证。 -->
<div class="row">
<label>Pick <select id="picker" aria-label="Pick">
<option value="opt1">First</option>
<option value="opt2" selected>Second</option>
<option value="opt3" disabled>Third (disabled)</option>
</select></label>
</div>
<!-- wait_for TextVisible:测试侧用 __eval_page_world_for_test 注入延迟文本(确定性控制时序),
fixture 只提供空容器 #late。 -->
<div class="row"><span id="late"></span></div>
<!-- find_elements click 反解目标:点击 #p1 改自身文案(证明 ref 真能 act)。 -->
<div id="click-status" role="status" aria-label="click status">idle</div>
<script>
// #p1 点击改文案(find_elements 返回的 ref → act(Click) 验证可反解端到端)。
document.getElementById('p1').addEventListener('click', function () {
this.textContent = 'Primary One Clicked';
document.getElementById('click-status').textContent = 'p1-clicked';
});
</script>
</body>
</html>
@@ -0,0 +1,32 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>E4 download sandbox</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
a { display: block; margin: 12px; }
</style>
</head>
<body>
<h1>E4 download</h1>
<!--
E4 集成测试用:触发一次真实下载落进沙箱(per-pet workspace/downloads)。
用 data: URL + download 属性——点击即让 chrome 把内容当文件下载(无需服务器)。
内容是一段可识别的文本(>0 字节,便于断言 size>0);文件名 report.txt(非可执行,
denylist 不命中——本测试验证「良性文件落盘 + MOTW」,红线拒绝走纯逻辑单测)。
注:data: URL 下 download 属性的 suggestedFilename 取 download 属性值(report.txt)。
-->
<a id="dl"
download="report.txt"
href="data:text/plain;charset=utf-8,NomiFun%20E4%20download%20sandbox%20test%20payload%0Aline2%0Aline3%0A">Download report.txt</a>
<script>
// 暴露一个程序化触发(集成测试可直接 click DOM,或经 evaluate 调用——但 E4 测试走真实 click)。
window.__triggerDownload = function () {
document.getElementById('dl').click();
};
</script>
</body>
</html>
@@ -0,0 +1,25 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>F1-sec executable download red-line</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
a { display: block; margin: 12px; }
</style>
</head>
<body>
<h1>F1-sec executable download red-line</h1>
<!--
F1-sec 集成测试用:触发一次「可执行文件」下载(suggestedFilename=setup.exe)。
引擎的下载循环订阅 Browser.downloadWillBegin,命中 reject_executable_download.exe denylist
即 cancelDownloadfail-closed,红线——yolo/companion 也取消,因为该判定不看 session_mode)。
用 data: URL + download="setup.exe":点击即让 chrome 把内容当 setup.exe 下载(无需服务器);
引擎应在落盘前取消它,故沙箱目录里不会出现非空 .exe(也不会出现任何最终落盘文件)。
-->
<a id="dl-exe"
download="setup.exe"
href="data:application/octet-stream;base64,TVqQAAEABLOCKED_FAKE_PE_PAYLOAD_NomiFun_F1sec">Download setup.exe</a>
</body>
</html>
@@ -0,0 +1,83 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>E5 egress firewall</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
pre { margin: 12px; padding: 8px; background: #f0f0f0; }
</style>
</head>
<body>
<h1>E5 egress firewall</h1>
<!--
E5 集成测试用(#[ignore] 真 chrome)。验证 Fetch.enable 拦截链路在真请求路径上生效:
1) IP 封禁(is_blocked_ip enforcement):fetch POST 到云元数据 IP 169.254.169.254。
防火墙在 Fetch.requestPaused 命中 → failRequest{BlockedByClient} → fetch 几乎**瞬间** reject
(而非离线超时挂起)。fixture 记录 reject + 用时,测试据「快速 reject」证明是被防火墙阻断,
而非「无防火墙时的慢超时」。
2) 跨域 POST-body 门控(检测路径):fetch POST 到跨域 host(带 form body)。防火墙在
Fetch.requestPaused 命中 GatePost → 构造预览(host/size/字段名,绝不含值)+ info 留痕 +
E5 范围)continueRequest 放行。离线下该 fetch 仍会因无网络而 reject,但**关键是请求经过了
拦截 handler**(被 continue 而非永久挂起)——证明拦截链路对跨域 POST 也触发了。
全程 file:// fixture,无需服务器:fetch 到外部 host / 元数据 IP 即可触发 requestPaused。
-->
<pre id="log">ready</pre>
<script>
// 把每步结果挂到 window,测试经 a11y observe/evaluate 或直接读 DOM 文本断言。
window.__e5 = { steps: {} };
function logLine(s) {
const el = document.getElementById('log');
el.textContent = el.textContent + "\n" + s;
}
// 1) IP 封禁:fetch POST 到云元数据 IP。被防火墙 failRequest → 快速 reject。
window.__e5BlockedIpFetch = async function () {
const t0 = performance.now();
try {
await fetch("http://169.254.169.254/latest/meta-data/", {
method: "POST",
body: "probe=1",
// no-cors 让请求真正发出(否则 CORS 预检也可能干扰);防火墙在网络层拦,与 CORS 无关。
mode: "no-cors",
});
const dt = performance.now() - t0;
window.__e5.steps.blockedIp = { ok: true, rejected: false, ms: dt };
logLine("blockedIp: NOT rejected (ms=" + dt.toFixed(0) + ")");
} catch (e) {
const dt = performance.now() - t0;
window.__e5.steps.blockedIp = { ok: true, rejected: true, ms: dt, err: String(e) };
logLine("blockedIp: rejected (ms=" + dt.toFixed(0) + ") " + e);
}
return window.__e5.steps.blockedIp;
};
// 2) 跨域 POST-body 门控(检测路径):fetch POST 到跨域 host,带表单 body。
window.__e5CrossOriginPost = async function () {
const t0 = performance.now();
try {
await fetch("https://e5-cross-origin-probe.example.com/collect", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: "username=alice&password=hunter2&csrf=abc123",
mode: "no-cors",
});
const dt = performance.now() - t0;
window.__e5.steps.crossPost = { ok: true, rejected: false, ms: dt };
logLine("crossPost: completed (ms=" + dt.toFixed(0) + ")");
} catch (e) {
const dt = performance.now() - t0;
window.__e5.steps.crossPost = { ok: true, rejected: true, ms: dt, err: String(e) };
logLine("crossPost: rejected (ms=" + dt.toFixed(0) + ") " + e);
}
return window.__e5.steps.crossPost;
};
</script>
</body>
</html>
@@ -0,0 +1,6 @@
<!doctype html><html><body>
<h1>Smoke</h1>
<button>Submit order</button>
<label>Email <input type="text"></label>
<iframe srcdoc="<a href=&quot;#&quot;>Inner</a>"></iframe>
</body></html>
@@ -0,0 +1,25 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Input synthesis (B5)</title>
<style>
html, body { margin: 0; padding: 0; }
/* 定位到确定区域,content quad 中点稳定(虽 B5 走真实 getContentQuads,非硬编码点)。 */
#field { position: fixed; left: 40px; top: 40px; width: 240px; height: 32px; }
#toggle { position: fixed; left: 40px; top: 120px; width: 200px; height: 40px; }
</style>
</head>
<body>
<h1>Input synth</h1>
<!-- 文本输入:dispatch_click 聚焦 → insert_text 写入 → 读回 value 验证。 -->
<label>Name <input id="field" type="text"></label>
<!-- 按钮:点击改自身文案,验证 dispatch_click 真分发到元素。 -->
<button id="toggle">Not clicked</button>
<script>
document.getElementById('toggle').addEventListener('click', function () {
this.textContent = 'Clicked';
});
</script>
</body>
</html>
@@ -0,0 +1,42 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Hit-target / modal overlay</title>
<style>
html, body { margin: 0; padding: 0; }
/* 页面背景里的按钮:被全屏 modal 遮罩盖住,点它会命中 overlay(误点)。 */
#covered {
position: fixed;
left: 40px; top: 200px;
width: 160px; height: 48px;
z-index: 1;
}
/* 全屏半透明遮罩:盖住整个视口(含 #covered)。z-index 高于页面背景按钮。 */
#overlay {
position: fixed;
left: 0; top: 0;
width: 100vw; height: 100vh;
background: rgba(0, 0, 0, 0.4);
z-index: 1000;
}
/* modal 里的「可达」按钮:z-index 高于遮罩,点它真命中它自己(不被遮)。
定位到确定坐标,便于测试硬编码命中点(不依赖 quad 计算,那是 B5)。 */
#reachable {
position: fixed;
left: 40px; top: 40px;
width: 160px; height: 48px;
z-index: 1001;
}
</style>
</head>
<body>
<h1>Hit target</h1>
<button id="covered">Behind overlay</button>
<div id="overlay"></div>
<button id="reachable">Reachable in modal</button>
</body>
</html>
@@ -0,0 +1,31 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>D2 networkidle never-idle (long polling)</title>
</head>
<body>
<h1>Never-idle fixture</h1>
<div id="state" role="status">polling</div>
<script>
// 永不空闲:持续发起请求(每个请求在前一个完成后立即再发),模拟长轮询 / SSE 站。
// inflight 计数永远 >0(或频繁回到 >0),networkidle 永远等不到 500ms 连续空闲 →
// navigate 应在 networkidle 短 cap~4s)到点后降级返 Load(不卡 30s)。
//
// 请求目标用本页自身(file://),每次带不同 query 防缓存命中即返回。即便 file:// 的
// fetch 行为受限,requestWillBeSent 仍会发出 → inflight 计数仍被打破,验证 cap 降级。
let n = 0;
function poll() {
n++;
fetch(location.pathname + '?poll=' + n + '&t=' + Date.now())
.catch(function () {})
.finally(function () {
// 立即再发下一个:让 inflight 在 500ms 静默窗口内总被打破。
setTimeout(poll, 30);
});
}
// 同时并发多条,进一步保证窗口内总有 inflight。
poll(); poll(); poll();
</script>
</body>
</html>
@@ -0,0 +1,4 @@
<!doctype html><html><body>
<h1>PAGE_A_MARKER</h1>
<p>This is page A.</p>
</body></html>
@@ -0,0 +1,4 @@
<!doctype html><html><body>
<h1>PAGE_B_MARKER</h1>
<p>This is page B.</p>
</body></html>
@@ -0,0 +1,7 @@
<!doctype html><html><body>
<h1>Secrets</h1>
<label>Password <input type="password" value="hun]ter2sk"></label>
<p>Your API key is sk-ABCDEFGHIJ0123456789xyzQRSTUV and keep it secret.</p>
<p>Authorization: Bearer abcdef0123456789ABCDEFghij token follows.</p>
<button>Save credentials</button>
</body></html>
@@ -0,0 +1,8 @@
<!doctype html><html><body>
<h1>Shadow</h1>
<div id="o"></div><div id="c"></div>
<script>
o.attachShadow({mode:"open"}).innerHTML = '<button>OpenShadowBtn</button>';
c.attachShadow({mode:"closed"}).innerHTML = '<button>ClosedShadowBtn</button>';
</script>
</body></html>
@@ -0,0 +1,29 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>D2 SPA soft navigation</title>
</head>
<body>
<h1>SPA fixture</h1>
<button id="go">Go to /step2</button>
<div id="state" role="status">at start</div>
<script>
// 点击即 history.pushState 改 URLsame-document soft navigation,无 newDocument)。
// CDP 据此发 Page.navigatedWithinDocument(不发 frameNavigated/loadEventFired)。
document.getElementById('go').addEventListener('click', function () {
history.pushState({}, '', '/step2');
document.getElementById('state').textContent = 'at step2';
});
// 加载即自动软导航一次(让 navigate 到本页后立即触发 navigatedWithinDocument
// 便于集成测试在不依赖点击的情况下观察 SPA 降级路径)。延迟到下一帧,确保 navigate
// 的初始文档 load 与软导航分离。
window.addEventListener('load', function () {
setTimeout(function () {
history.pushState({}, '', '/auto-soft-nav');
document.getElementById('state').textContent = 'auto soft-nav done';
}, 50);
});
</script>
</body>
</html>
@@ -0,0 +1,6 @@
<!doctype html><html><body>
<h1>MAIN_DOC_MARKER parent document</h1>
<p>This text lives in the top/main frame only.</p>
<button>Parent Button</button>
<iframe title="content frame" srcdoc="<!doctype html><html><body><h2>IFRAME_INNER_MARKER child document</h2><p>This text lives inside the iframe only.</p><button>Inner Button</button></body></html>"></iframe>
</body></html>
@@ -0,0 +1,29 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>F-actions upload_file</title>
<style>
html, body { margin: 0; padding: 0; font: 16px sans-serif; }
input { display: block; margin: 12px; }
</style>
</head>
<body>
<h1>F-actions upload</h1>
<!--
F-actions 集成测试用:一个 <input type=file>,验证 act(UploadFile) 经 DOM.setFileInputFiles
把本地文件路径塞进 input.files(绕系统文件对话框)。给它 aria-label 让 observe 暴露稳定 accname。
测试断言:setFileInputFiles 后 input.files.length == 1 且 files[0].name 含被上传的文件名。
-->
<label>Attachment <input id="file" type="file" aria-label="Attachment"></label>
<script>
// 暴露一个只读探针:返回 file input 当前的 {count, first}(测试也可直接经 act 的 verify 锚点拿到)。
window.__fileInputState = function () {
var f = document.getElementById('file').files;
return { count: f ? f.length : 0, first: (f && f.length > 0) ? f[0].name : null };
};
</script>
</body>
</html>