VibeCoding / examples /hf-localized-cloud-validation.json
dellweb3's picture
Deploy verified conversational workbench and isolated Java application previews
5ca3c16 verified
Raw History Blame Contribute Delete
40.8 kB
{
"deployment": {
"space": "dellweb3/VibeCoding",
"commit": "75835df50e36e60c68f0de8c821460287e3d7519",
"parent_commit": "253a5d441bdd1e9c7fd3647d93b0e8c0e17f6844",
"source_commit": "2971ce3dda5fd36e58778f27148f2a56c94d0a66",
"files": 17,
"package_files": 315,
"unchanged_files_skipped": 298,
"changed_bytes": 269248,
"url": "https://huggingface.co/spaces/dellweb3/VibeCoding"
},
"platform_code_digest": "93df1f49cf2297ffdb8edeff3a27e300025e5d62eb18e0aaf6d2a584950f070e",
"cloud_verified": true,
"human_acceptance": false,
"tested_at_utc": "2026-10-24T06:04:02.776485+00:00",
"generation_checks": [
"HF root retains the original conversation workbench; all three real users sign in and automatic model routing is provider-neutral",
"calculator: wizard-injected full brief completed real routed model calls, protected compilation/tests and durable execution events",
"calculator: exact Java source and documents, real diff, materialized project and public preview link are reviewable in the original workbench",
"calculator: actual isolated Java website operates, errors are business-readable, refresh works, prior apps stay alive, and root remains the workbench",
"affected HF Java application is live; an independent programmer session cannot discover manager leases"
],
"application_smoke": {
"checks": [
"erp: real Java application operates and refreshes on the deployed release",
"pdf: real Java application operates and refreshes on the deployed release",
"Three separate applications coexist after the real calculator development flow"
],
"errors": [],
"external_model_calls": 0,
"deployment": {
"space": "dellweb3/VibeCoding",
"commit": "75835df50e36e60c68f0de8c821460287e3d7519",
"parent_commit": "253a5d441bdd1e9c7fd3647d93b0e8c0e17f6844",
"source_commit": "2971ce3dda5fd36e58778f27148f2a56c94d0a66",
"files": 17,
"package_files": 315,
"unchanged_files_skipped": 298,
"changed_bytes": 269248,
"url": "https://huggingface.co/spaces/dellweb3/VibeCoding"
},
"applications": {
"erp": {
"lease": "4f2b555b0a3145298dae917087e12590",
"receipt": {
"source_digest": "932d0b3ad1811e841d044964f3a1c40e3a4db365fc7c834bcbf058908bc13d51",
"image": "zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"config_digest": "d223365fd05e5fe9d0e74ec5a440e3c878a1dbd0cb9726cf04be2d4575c7f603",
"classes_digest": "52eaa426e3f2e32b741c36e2cf8dcd14bfe92cf13501931e670458eae3f07390",
"tests": 25,
"network": "none",
"host_mounts": []
},
"source": "approved example; freshly generated calculator tested separately"
},
"pdf": {
"lease": "5aeedccaebed401a903097bf1ec72f90",
"receipt": {
"source_digest": "410fa3717502881c9be744f17cd59fda053e9b5f7f028bd0e85e1d364f772225",
"image": "zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"config_digest": "a4a4dc0214cc1380cad3d35772556b07e4965e033ec5b6a7cc078c3ed4edcf90",
"classes_digest": "669d901e2f6d2f5286d723313fe3b7a0891efce30fc7f9b96ade9695e3827bad",
"tests": 23,
"network": "none",
"host_mounts": []
},
"source": "approved example; freshly generated calculator tested separately"
}
},
"passed": 3,
"tested_at_utc": "2026-10-24T06:02:38.496423+00:00"
},
"fresh_hub_browser": {
"checks": [
"fresh HF Hub iframe signs in with a real partitioned session",
"the actual isolated popup receives only the parent-authorized lease scope; final URL contains no handoff capability",
"Java calculation, precision, error and refresh work; Hub retains the original workbench"
],
"errors": [],
"deployment": {
"space": "dellweb3/VibeCoding",
"commit": "75835df50e36e60c68f0de8c821460287e3d7519",
"parent_commit": "253a5d441bdd1e9c7fd3647d93b0e8c0e17f6844",
"source_commit": "2971ce3dda5fd36e58778f27148f2a56c94d0a66",
"files": 17,
"package_files": 315,
"unchanged_files_skipped": 298,
"changed_bytes": 269248,
"url": "https://huggingface.co/spaces/dellweb3/VibeCoding"
},
"fresh_context": true,
"model_calls_started": 0,
"parent_session_keys": [
"actor",
"authenticated"
],
"parent_actor_id": "user-2259cddc9f5f4b689b2015597cf974b1",
"child_scope": "single-preview-only",
"child_session_keys": [
"authenticated",
"csrf",
"actor",
"scope"
],
"receipt": {
"source_digest": "b80e5c95d1153f8e664d4b7bac3701d52fecab2a41de12e5a49ea0fd795cd7a4",
"image": "zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"config_digest": "abbad23d2dfc938dad29c2c0528e7411d0047bfab966e22f0eae41ee2845cdeb",
"classes_digest": "779f483b28864a212c3e199cedc317c3664d207bc8eab14f7d48e47d6be085ad",
"tests": 39,
"network": "none",
"host_mounts": []
},
"passed": 3,
"tested_at_utc": "2026-10-24T06:03:48.433769+00:00",
"cleanup": {
"closed_test_lease": true
}
},
"initial_failure": null,
"model_calls_total": 2,
"calculator": {
"id": "run-91d9242ca6b84e7f9e13177e28422f27",
"status": "verified",
"error": null,
"source": {
"files": {
"src/main/java/demo/App.java": "package demo;\n\nimport com.sun.net.httpserver.HttpServer;\nimport com.sun.net.httpserver.HttpExchange;\nimport java.io.*;\nimport java.math.*;\nimport java.net.InetSocketAddress;\nimport java.nio.ByteBuffer;\nimport java.nio.CharBuffer;\nimport java.nio.charset.*;\nimport java.util.*;\n\npublic class App {\n static final BigDecimal MAX_VAL = new BigDecimal(\"1e24\");\n static final MathContext MC = MathContext.DECIMAL128;\n static int ops, depth, pos;\n static String expr;\n\n public static void main(String[] args) throws Exception {\n HttpServer s = HttpServer.create(new InetSocketAddress(8080), 0);\n s.createContext(\"/\", App::handle);\n s.setExecutor(null);\n s.start();\n }\n\n static void handle(HttpExchange ex) throws IOException {\n try {\n String p = ex.getRequestURI().getPath();\n if (\"/health\".equals(p)) {\n if (!\"GET\".equals(ex.getRequestMethod())) { send(ex,405,\"{\\\"error\\\":\\\"METHOD_NOT_ALLOWED\\\"}\"); return; }\n send(ex,200,\"{\\\"status\\\":\\\"ok\\\"}\");\n } else if (\"/api/calculate\".equals(p)) {\n if (!\"GET\".equals(ex.getRequestMethod())) { send(ex,405,\"{\\\"error\\\":\\\"METHOD_NOT_ALLOWED\\\"}\"); return; }\n String auth = ex.getRequestHeaders().getFirst(\"Authorization\");\n if (!\"Bearer demo-calculator\".equals(auth)) { send(ex,401,\"{\\\"error\\\":\\\"UNAUTHORIZED\\\"}\"); return; }\n doCalc(ex);\n } else { send(ex,404,\"{\\\"error\\\":\\\"NOT_FOUND\\\"}\"); }\n } finally { ex.close(); }\n }\n\n static void doCalc(HttpExchange ex) throws IOException {\n String q = ex.getRequestURI().getRawQuery();\n if (q == null || q.isEmpty()) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n String[] parts = q.split(\"&\");\n String val = null;\n for (String part : parts) {\n int eq = part.indexOf('=');\n String k = eq < 0 ? part : part.substring(0, eq);\n if (!\"expression64\".equals(k) || val != null) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n val = eq < 0 ? \"\" : part.substring(eq + 1);\n }\n if (val == null || val.isEmpty() || val.length() > 256) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n if (!val.matches(\"[A-Za-z0-9_-]+\")) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n byte[] dec;\n try { dec = Base64.getUrlDecoder().decode(val); } catch (Exception e) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n CharsetDecoder cd = StandardCharsets.UTF_8.newDecoder().onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);\n CharBuffer cb;\n try { cb = cd.decode(ByteBuffer.wrap(dec)); } catch (Exception e) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n expr = cb.toString();\n if (expr.length() > 128) { send(ex,422,\"{\\\"error\\\":\\\"LIMIT_EXCEEDED\\\"}\"); return; }\n ops = 0; depth = 0; pos = 0;\n try {\n BigDecimal r = parseSum();\n skipSpaces();\n if (pos < expr.length()) throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (r.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n r = r.setScale(12, RoundingMode.HALF_UP).stripTrailingZeros();\n String rs = r.scale() <= 0 ? r.toPlainString() : r.stripTrailingZeros().toPlainString();\n if (rs.equals(\"-0\")) rs = \"0\";\n String json = \"{\\\"expression\\\":\\\"\" + esc(expr) + \"\\\",\\\"result\\\":\\\"\" + rs + \"\\\"}\";\n send(ex, 200, json);\n } catch (RuntimeException e) { send(ex, errCode(e.getMessage()), \"{\\\"error\\\":\\\"\" + e.getMessage() + \"\\\"}\"); }\n }\n\n static int errCode(String m) { return \"LIMIT_EXCEEDED\".equals(m) ? 422 : 400; }\n static String esc(String s) { return s.replace(\"\\\\\",\"\\\\\\\\\").replace(\"\\\"\",\"\\\\\\\"\"); }\n static void send(HttpExchange ex, int c, String b) throws IOException {\n byte[] bytes = b.getBytes(StandardCharsets.UTF_8);\n ex.getResponseHeaders().set(\"Content-Type\",\"application/json;charset=utf-8\");\n ex.sendResponseHeaders(c, bytes.length);\n ex.getResponseBody().write(bytes);\n }\n static void skipSpaces() { while (pos < expr.length() && expr.charAt(pos) == ' ') pos++; }\n static char peek() { skipSpaces(); return pos < expr.length() ? expr.charAt(pos) : 0; }\n static char take() { return expr.charAt(pos++); }\n\n static BigDecimal parseSum() {\n BigDecimal l = parseProduct();\n while (peek() == '+' || peek() == '-') {\n if (++ops > 64) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n char op = take(); BigDecimal r = parseProduct();\n l = op == '+' ? l.add(r, MC) : l.subtract(r, MC);\n if (l.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n }\n return l;\n }\n\n static BigDecimal parseProduct() {\n BigDecimal l = parseUnary();\n while (peek() == '*' || peek() == '/') {\n if (++ops > 64) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n char op = take(); BigDecimal r = parseUnary();\n if (op == '/') { if (r.signum() == 0) throw new RuntimeException(\"DIVISION_BY_ZERO\"); l = l.divide(r, MC); }\n else l = l.multiply(r, MC);\n if (l.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n }\n return l;\n }\n\n static BigDecimal parseUnary() {\n if (peek() == '+' || peek() == '-') {\n if (++ops > 64) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n char op = take(); BigDecimal v = parseUnary();\n return op == '-' ? v.negate() : v;\n }\n return parseAtom();\n }\n\n static BigDecimal parseAtom() {\n skipSpaces();\n if (pos >= expr.length()) throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (peek() == '(') {\n take(); if (++depth > 16) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n BigDecimal v = parseSum(); depth--;\n if (peek() != ')') throw new RuntimeException(\"INVALID_EXPRESSION\");\n take(); return v;\n }\n return parseNumber();\n }\n\n static BigDecimal parseNumber() {\n skipSpaces(); int start = pos; boolean dot = false; int digits = 0;\n while (pos < expr.length()) {\n char c = expr.charAt(pos);\n if (c >= '0' && c <= '9') { digits++; pos++; }\n else if (c == '.' && !dot) { dot = true; pos++; }\n else break;\n }\n if (digits == 0) throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (dot && pos > 0 && expr.charAt(pos - 1) == '.') throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (digits > 24) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n BigDecimal v = new BigDecimal(expr.substring(start, pos));\n if (v.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n return v;\n }\n}"
},
"source_digest": "e10f16eec0a97808d8fd291b06a5b5b27e30cac39c17f7dd883906ab38a6b7b6"
},
"evidence": {
"digest": "ff55c69a7d053370ef7aeff7dccf6eeda34760739687279ca985b46318e577d9",
"manifest": {
"approvals": [
{
"authorization_ref": "local-web-delegation-v1:user-83d9ef585fe046b4ad03200953e43934",
"digest": "d71ce3ac59e1f650dd6d6529ad481d426a3052708e9f1939bc3c6feba6ef085d",
"increment": true,
"mechanism": "delegated_local_validation",
"node": "design_confirm",
"scope": "design",
"user_id": "user-83d9ef585fe046b4ad03200953e43934"
},
{
"authorization_ref": "local-web-delegation-v1:user-83d9ef585fe046b4ad03200953e43934",
"digest": "9f6c23d7cc0257b73d7053bc709a70c5596a865cb3429c5a7b87938e9c93b98f",
"increment": true,
"mechanism": "delegated_local_validation",
"node": "execution_confirm",
"scope": "execution",
"user_id": "user-83d9ef585fe046b4ad03200953e43934"
}
],
"candidate": {
"classes_digest": "561328a5e340a732b7afea3decb1f1af1ca07928cb946e3bffb1074aac8f9375",
"config_digest": "abbad23d2dfc938dad29c2c0528e7411d0047bfab966e22f0eae41ee2845cdeb",
"container": "zk-run-91d9242ca6b84e7f9e13177e28422f27",
"execution_mode": "qemu",
"image": "zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"isolation": {
"disposable": true,
"host_mounts": [],
"memory_mb": 1024,
"network": "none",
"vcpu": 1
},
"passed": true,
"receipt_digest": "228cd9a57a5d8322293a24bd8857a95baddb777d27ff347f9ff0c64761898f04",
"receipt_ref": "run-91d9242ca6b84e7f9e13177e28422f27-eb80f392dfc04c349711040940d2de5b",
"source_digest": "e10f16eec0a97808d8fd291b06a5b5b27e30cac39c17f7dd883906ab38a6b7b6",
"stage": "build",
"suite_digest": "05e353f239f8919946d419e91e63fedccbf62b02386fa12f39ad8795b6a4de4d",
"tool_receipt": {
"input_digest": "31460dd11bcd0bc9fa06676e5929cfacd6810aac083ac88d82ec2422e46eee74",
"operation": "AO08",
"result_digest": "fc643dde8f4e05367e1747eaed9772e5027512e77b3c25764fefc456e4274a14",
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27"
}
},
"deployment": "not_performed",
"development": {
"design": {
"summary": "Java 17 HttpServer on 8080. GET /health returns 200 {\"status\":\"ok\"}. GET /api/calculate requires Bearer 'demo-calculator'. Validates single expression64 param (base64url, <=256 chars). Decodes strictly to UTF-8 (REPORT mode); if decoded length >128, return 422 LIMIT_EXCEEDED. Recursive-descent parser enforces grammar: sum/product/unary/atom with BigDecimal DECIMAL128. Checks nesting depth <=16 and operator count <=64 during parsing; rejects literals >24 digits or abs value >1e24 with 422. Zero divisor yields 400 DIVISION_BY_ZERO; malformed syntax yields 400 INVALID_EXPRESSION. Invalid encoding/query yields 400 INVALID_INPUT. Wrong method on known paths yields 405; unknown paths yield 404. Success returns {\"expression\": \"original\", \"result\": \"decimal string\"} rounded to scale 12 HALF_UP, stripped trailing zeros."
},
"requirement": "# DEMO-CALC-01:可操作的网页计算器\n\n## 背景与用户\n员工需要在内网快速核算公式,现有简单输入框不能解释优先级或处理错误。本场景交付可直接使用的计算器网站,运算由Java服务执行,页面负责输入和结果展示。\n\n## 页面与交互\n标题“工程计算器”,主卡片包含表达式输入框、结果显示区、数字键盘0–9、小数点、加减乘除、左右括号、退格、清空和等号;旁边显示最近10条成功计算记录,窄屏放到下方。默认示例(12.5+7.5)*3,等于60。历史记录点击后回填输入,不自动重新执行。\n物理键盘可输入公式,Enter计算,Escape清空;每个按钮有明确标签,焦点可见。计算时按钮显示忙碌且防止重复请求;服务返回后再显示结果,不演示虚假延迟。除零或非法表达式在结果区给可理解错误并保留输入。成功结果可作为下次运算起点;结果字符串可复制。\n修改输入、历史回填或清空后,旧结果与复制状态立即失效,重新计算后才能复制。应用只展示输入、结果、历史和业务错误,不显示原始接口JSON、源码摘要、沙箱步骤或代码下载;开发证据保留在工作台。预览准备由平台内部完成,成果页面使用独立端口。\n\n## 编程需求与验收\n- CALC-01:Java17标准库HttpServer,GET /health。GET /api/calculate的唯一参数expression64为UTF-8表达式的无填充base64url;公开凭据demo-calculator,不接受任意脚本、eval或脚本引擎。\n- CALC-02:实现真正的表达式解析,支持+-*/、括号、空格、一元正负。乘除优先于加减,括号优先。2+3*4=14,(2+3)*4=20,-3+5=2。\n- CALC-03:用BigDecimal和DECIMAL128处理中间运算,最终最多12位小数,HALF_UP,去除尾零,不用科学记数法。0.1+0.2=0.3;1/3显示0.333333333333;连续运算可使用上次结果。\n- CALC-04:除零400 DIVISION_BY_ZERO;缺括号、连续非法运算、字母等400 INVALID_EXPRESSION;1+-2、--1属于合法一元符号。缺失、重复、未知参数及非法编码400 INVALID_INPUT。\n- CALC-05:表达式最多128字符、括号16层、64次运算;单个数字字面量最多24位(不含小数点),数值绝对值≤1e24;超限422 LIMIT_EXCEEDED。编码参数最多256字符,超限400 INVALID_INPUT。无身份401、非GET405、未知路径404,线程与输入有界。\n- CALC-06:独立HTTP系统测试覆盖算术、精度、结合顺序、负号、边界和错误;网页测试点击键盘与Enter、历史回填、连续运算、除零展示、窄屏布局。\n\n### 接口与Java实现补充约束\n\n成功和失败都必须返回UTF-8 JSON对象,不能直接返回错误码文本或HttpServer默认HTML。成功包络为`{\"expression\":\"原始表达式(保留空格)\",\"result\":\"结果字符串\"}`,错误包络统一为`{\"error\":\"对应错误码\"}`;未知路径也返回404 `{\"error\":\"NOT_FOUND\"}`。可注册统一根处理器,再精确匹配路径和方法,避免默认路由漏出HTML。\n\n数字语法为`digits ('.' digits+)?`或`'.' digits+`;`.5`合法,`1.`非法。允许标记之间的ASCII空格,保留原输入;` 12 + ( 3 * 2 ) `等于18,`1 2`仍非法,不能简单删除全部空白。严格UTF-8解码须使用CharsetDecoder的REPORT模式,不能用会替换非法字节的默认字符串构造。需要ByteBuffer/CharBuffer时应显式导入`java.nio.ByteBuffer`和`java.nio.CharBuffer`,或使用完整类名,确保Java17实际编译。此处是公开接口和编程约束,不允许修改保护测试。\n\n## 交付与完成条件\n交付Java源码、配套HTML/CSS/JS页面、需求与技术说明、差异、测试对应表、实际沙箱编译和测试证据、可下载ZIP及本地网站。生成源码限定src/main/java/demo/App.java及可选docs,不引入框架或修改保护测试;受控网页模板作为独立交付文件明确来源。失败必须留存诊断并修复复测,不以静态数字冒充Java执行结果。\n\n\nHF验收批次 20261024T055707Z calculator。完整实现上述需求;模型、框架和权限仍由服务端冻结契约决定。"
},
"human_acceptance": false,
"model_calls": [
{
"charged": 5027,
"id": 1,
"metadata": {
"finish_reason": "stop",
"model": "qwen3.8-flash",
"policy_version": "bailian-task-routing-v3",
"request_id": "chatcmpl-570abc1d-1a57-9e4d-af3e-1ba8d7c3c754",
"requested_output_tokens": 2048,
"retry_of": null,
"route_reason": "technical-design",
"stage": "design"
},
"prompt_digest": "69bb51a36a350e9f92fc43a76fd3519ad39a6dd89c8d36149ee68c9d874023db",
"provider": "bailian-qwen3.8-flash",
"reservation": 18848,
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27",
"state": "settled"
},
{
"charged": 4388,
"id": 2,
"metadata": {
"finish_reason": "stop",
"model": "qwen3.8-max",
"policy_version": "bailian-task-routing-v3",
"request_id": "chatcmpl-e3149d2b-2da4-9203-bb0a-1d1b6962f656",
"requested_output_tokens": 8192,
"retry_of": null,
"route_reason": "java-code",
"stage": "code"
},
"prompt_digest": "0c0114f8b2c524b17d6dc371f010e41c001a0c75f100822095b33b78366536e7",
"provider": "bailian-qwen3.8-max",
"reservation": 18099,
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27",
"state": "settled"
}
],
"preview": {
"cases": 1,
"classes_digest": "561328a5e340a732b7afea3decb1f1af1ca07928cb946e3bffb1074aac8f9375",
"config_digest": "abbad23d2dfc938dad29c2c0528e7411d0047bfab966e22f0eae41ee2845cdeb",
"container": "zk-run-91d9242ca6b84e7f9e13177e28422f27",
"execution_mode": "qemu",
"image": "zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"isolation": {
"disposable": true,
"host_mounts": [],
"memory_mb": 1024,
"network": "none",
"vcpu": 1
},
"passed": true,
"passed_cases": 1,
"preview_scope": "disposable-vm-loopback-http",
"receipt_digest": "228cd9a57a5d8322293a24bd8857a95baddb777d27ff347f9ff0c64761898f04",
"receipt_ref": "run-91d9242ca6b84e7f9e13177e28422f27-eb80f392dfc04c349711040940d2de5b",
"source_digest": "e10f16eec0a97808d8fd291b06a5b5b27e30cac39c17f7dd883906ab38a6b7b6",
"stage": "preview",
"suite_digest": "05e353f239f8919946d419e91e63fedccbf62b02386fa12f39ad8795b6a4de4d",
"tool_receipt": {
"input_digest": "1693d3d3d95e7cac510233e71509d30a157f37119849729c6bc9e2df8bfcab2f",
"operation": "AO10",
"result_digest": "c9eb05b829b0efeea47dea55c8b64b8402a1f1fb9d800b0543174bbd0710186b",
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27"
}
},
"repairs": 0,
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27",
"sandbox_cleaned": true,
"snapshot": {
"budget": {
"max_model_calls": 6,
"max_repairs": 2,
"max_seconds": 1800,
"max_tokens": 120000
},
"execution_order": [
"start",
"requirements",
"knowledge",
"context",
"design",
"design_confirm",
"execution_confirm",
"code",
"patch",
"policy",
"build",
"test",
"preview",
"acceptance",
"evidence",
"end"
],
"execution_status": "not_started",
"framework": {
"allowed_paths": [
"src/main/",
"src/test/",
"docs/"
],
"build_tool": "jdk",
"dependencies": {},
"evidence_refs": [
"local-toolchain:zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"user-authorized-local-validation"
],
"frontend": [
"html",
"javascript",
"css"
],
"java_release": 17,
"language": "java",
"profile_id": "java17-standard-web",
"state": "approved",
"version": "0.1.0"
},
"knowledge": [
{
"collection_id": "java-basics",
"digest": "6de6f354ff0e845da78ad210164775f51d9a4c5f01a1e5e355911423bd6a5b5c",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-6de6f354ff0e845da78ad210",
"scope": "reference"
},
{
"collection_id": "java-patterns",
"digest": "803bd1aef5f0764242a56a8c85a3eca81b26cebbe4ec3e6b53d3c4da8864aa2d",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-803bd1aef5f0764242a56a8c",
"scope": "reference"
},
{
"collection_id": "web-development",
"digest": "84c82986259278c89a30d2660f66454f0a5bcb10f871c96c7ec4ea9ebb47e02a",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-84c82986259278c89a30d266",
"scope": "reference"
},
{
"collection_id": "java-frameworks",
"digest": "28b65fe6ced6682555c8b32b676faf14020011ea525eeee57f17562acd17da4c",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-28b65fe6ced6682555c8b32b",
"scope": "reference"
},
{
"collection_id": "java-persistence",
"digest": "972ee7e1f0072e413bec262b67b8af46364ff8aac445a9faeeeb8c041eb07f92",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-972ee7e1f0072e413bec262b",
"scope": "reference"
},
{
"collection_id": "java-testing",
"digest": "8af9017057c130eef9f9a1617a2654859ba80ed4f108b28054aecf14a3d39c45",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-8af9017057c130eef9f9a161",
"scope": "reference"
},
{
"collection_id": "java-integration",
"digest": "befde1177fa13476703d89a8df3902d90ad01cb7d497d0583cfe15620348c7b1",
"enterprise_approved": false,
"quality_status": "imported_unreviewed",
"revision": "corpus-befde1177fa13476703d89a8",
"scope": "reference"
}
],
"operations_lock": {
"AO01@0.1.0": "6f2a89d1624450c6e4afd8f776f23c7df4bf402976a82d0992dfd6cfdc643bf2",
"AO02@0.1.0": "6a4491053f9a3f55d900f3f907f81a0cfc44f09a1e2f1e770248287bc0b8d7f6",
"AO03@0.1.0": "8a1387e065674c2987930ad865a2bdb4ab7346cb589505c350c6bb1907a7eb6d",
"AO04@0.1.0": "3ef3f1be1b0f9240f066fa6d0b3b1430026d55763d15b5fc584a801c64be688b",
"AO05@0.2.0": "eeac70849a9d8bebd00b1d2111545f9376cc6901f6aa611412b1cb73238e47a7",
"AO06@0.1.0": "2b369879ba0cd2847c173cfb7cb583c1dc051553d3d3ea80f954c81c21f1f233",
"AO07@0.1.0": "69e1e824b4c5129f62595ac3df578eec7b083411cd391a72d47303eec3843baa",
"AO08@0.1.0": "1d75566610ac000990fd15b9fd18a6518de8af12a329b3c56d51ff29c0c30623",
"AO09@0.1.0": "2e4bf4b3fcdfce184b8dea9ffebd18ffe91af7320b0ef3ce430edb3b5cc15c52",
"AO10@0.1.0": "d05863bea57e94ad860696bd6ac85e072034f89f6f038f132c65b854dd366e9f",
"AO11@0.1.0": "43b910a51da7a58810d3890eb2305d80663db6a1c187b51466f8e396a94956f0"
},
"project_id": "calculator-demo",
"release_digest": "c90069c4eead2b7a1d5cba845373c90176508bedc1dcc9ed4c58a879a3f2baef",
"release_ref": "calculator-java-development@local-c90069c4eead2b7a",
"snapshot_digest": "c9fe53028fc9bc1aab220f8a5b7f8e82882fb86dff610863daa66a1cd1b57259",
"snapshot_id": "snapshot-d768d6cd537241e5a642b61da78dde17",
"source_digest": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"tenant_id": "demo-tenant",
"user_id": "user-83d9ef585fe046b4ad03200953e43934"
},
"source": {
"files": {
"src/main/java/demo/App.java": "package demo;\n\nimport com.sun.net.httpserver.HttpServer;\nimport com.sun.net.httpserver.HttpExchange;\nimport java.io.*;\nimport java.math.*;\nimport java.net.InetSocketAddress;\nimport java.nio.ByteBuffer;\nimport java.nio.CharBuffer;\nimport java.nio.charset.*;\nimport java.util.*;\n\npublic class App {\n static final BigDecimal MAX_VAL = new BigDecimal(\"1e24\");\n static final MathContext MC = MathContext.DECIMAL128;\n static int ops, depth, pos;\n static String expr;\n\n public static void main(String[] args) throws Exception {\n HttpServer s = HttpServer.create(new InetSocketAddress(8080), 0);\n s.createContext(\"/\", App::handle);\n s.setExecutor(null);\n s.start();\n }\n\n static void handle(HttpExchange ex) throws IOException {\n try {\n String p = ex.getRequestURI().getPath();\n if (\"/health\".equals(p)) {\n if (!\"GET\".equals(ex.getRequestMethod())) { send(ex,405,\"{\\\"error\\\":\\\"METHOD_NOT_ALLOWED\\\"}\"); return; }\n send(ex,200,\"{\\\"status\\\":\\\"ok\\\"}\");\n } else if (\"/api/calculate\".equals(p)) {\n if (!\"GET\".equals(ex.getRequestMethod())) { send(ex,405,\"{\\\"error\\\":\\\"METHOD_NOT_ALLOWED\\\"}\"); return; }\n String auth = ex.getRequestHeaders().getFirst(\"Authorization\");\n if (!\"Bearer demo-calculator\".equals(auth)) { send(ex,401,\"{\\\"error\\\":\\\"UNAUTHORIZED\\\"}\"); return; }\n doCalc(ex);\n } else { send(ex,404,\"{\\\"error\\\":\\\"NOT_FOUND\\\"}\"); }\n } finally { ex.close(); }\n }\n\n static void doCalc(HttpExchange ex) throws IOException {\n String q = ex.getRequestURI().getRawQuery();\n if (q == null || q.isEmpty()) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n String[] parts = q.split(\"&\");\n String val = null;\n for (String part : parts) {\n int eq = part.indexOf('=');\n String k = eq < 0 ? part : part.substring(0, eq);\n if (!\"expression64\".equals(k) || val != null) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n val = eq < 0 ? \"\" : part.substring(eq + 1);\n }\n if (val == null || val.isEmpty() || val.length() > 256) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n if (!val.matches(\"[A-Za-z0-9_-]+\")) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n byte[] dec;\n try { dec = Base64.getUrlDecoder().decode(val); } catch (Exception e) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n CharsetDecoder cd = StandardCharsets.UTF_8.newDecoder().onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);\n CharBuffer cb;\n try { cb = cd.decode(ByteBuffer.wrap(dec)); } catch (Exception e) { send(ex,400,\"{\\\"error\\\":\\\"INVALID_INPUT\\\"}\"); return; }\n expr = cb.toString();\n if (expr.length() > 128) { send(ex,422,\"{\\\"error\\\":\\\"LIMIT_EXCEEDED\\\"}\"); return; }\n ops = 0; depth = 0; pos = 0;\n try {\n BigDecimal r = parseSum();\n skipSpaces();\n if (pos < expr.length()) throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (r.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n r = r.setScale(12, RoundingMode.HALF_UP).stripTrailingZeros();\n String rs = r.scale() <= 0 ? r.toPlainString() : r.stripTrailingZeros().toPlainString();\n if (rs.equals(\"-0\")) rs = \"0\";\n String json = \"{\\\"expression\\\":\\\"\" + esc(expr) + \"\\\",\\\"result\\\":\\\"\" + rs + \"\\\"}\";\n send(ex, 200, json);\n } catch (RuntimeException e) { send(ex, errCode(e.getMessage()), \"{\\\"error\\\":\\\"\" + e.getMessage() + \"\\\"}\"); }\n }\n\n static int errCode(String m) { return \"LIMIT_EXCEEDED\".equals(m) ? 422 : 400; }\n static String esc(String s) { return s.replace(\"\\\\\",\"\\\\\\\\\").replace(\"\\\"\",\"\\\\\\\"\"); }\n static void send(HttpExchange ex, int c, String b) throws IOException {\n byte[] bytes = b.getBytes(StandardCharsets.UTF_8);\n ex.getResponseHeaders().set(\"Content-Type\",\"application/json;charset=utf-8\");\n ex.sendResponseHeaders(c, bytes.length);\n ex.getResponseBody().write(bytes);\n }\n static void skipSpaces() { while (pos < expr.length() && expr.charAt(pos) == ' ') pos++; }\n static char peek() { skipSpaces(); return pos < expr.length() ? expr.charAt(pos) : 0; }\n static char take() { return expr.charAt(pos++); }\n\n static BigDecimal parseSum() {\n BigDecimal l = parseProduct();\n while (peek() == '+' || peek() == '-') {\n if (++ops > 64) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n char op = take(); BigDecimal r = parseProduct();\n l = op == '+' ? l.add(r, MC) : l.subtract(r, MC);\n if (l.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n }\n return l;\n }\n\n static BigDecimal parseProduct() {\n BigDecimal l = parseUnary();\n while (peek() == '*' || peek() == '/') {\n if (++ops > 64) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n char op = take(); BigDecimal r = parseUnary();\n if (op == '/') { if (r.signum() == 0) throw new RuntimeException(\"DIVISION_BY_ZERO\"); l = l.divide(r, MC); }\n else l = l.multiply(r, MC);\n if (l.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n }\n return l;\n }\n\n static BigDecimal parseUnary() {\n if (peek() == '+' || peek() == '-') {\n if (++ops > 64) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n char op = take(); BigDecimal v = parseUnary();\n return op == '-' ? v.negate() : v;\n }\n return parseAtom();\n }\n\n static BigDecimal parseAtom() {\n skipSpaces();\n if (pos >= expr.length()) throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (peek() == '(') {\n take(); if (++depth > 16) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n BigDecimal v = parseSum(); depth--;\n if (peek() != ')') throw new RuntimeException(\"INVALID_EXPRESSION\");\n take(); return v;\n }\n return parseNumber();\n }\n\n static BigDecimal parseNumber() {\n skipSpaces(); int start = pos; boolean dot = false; int digits = 0;\n while (pos < expr.length()) {\n char c = expr.charAt(pos);\n if (c >= '0' && c <= '9') { digits++; pos++; }\n else if (c == '.' && !dot) { dot = true; pos++; }\n else break;\n }\n if (digits == 0) throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (dot && pos > 0 && expr.charAt(pos - 1) == '.') throw new RuntimeException(\"INVALID_EXPRESSION\");\n if (digits > 24) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n BigDecimal v = new BigDecimal(expr.substring(start, pos));\n if (v.abs().compareTo(MAX_VAL) > 0) throw new RuntimeException(\"LIMIT_EXCEEDED\");\n return v;\n }\n}"
},
"source_digest": "e10f16eec0a97808d8fd291b06a5b5b27e30cac39c17f7dd883906ab38a6b7b6"
},
"status": "verified_pending_user_acceptance",
"test": {
"cases": 39,
"classes_digest": "561328a5e340a732b7afea3decb1f1af1ca07928cb946e3bffb1074aac8f9375",
"config_digest": "abbad23d2dfc938dad29c2c0528e7411d0047bfab966e22f0eae41ee2845cdeb",
"container": "zk-run-91d9242ca6b84e7f9e13177e28422f27",
"execution_mode": "qemu",
"image": "zkcoding-qemu@sha256:5c866338b848ec50afbbcb7f0827f562c2aced18638922dd72ae73eaa6bc15ec",
"isolation": {
"disposable": true,
"host_mounts": [],
"memory_mb": 1024,
"network": "none",
"vcpu": 1
},
"passed": true,
"passed_cases": 39,
"preview_scope": "disposable-vm-loopback-http",
"receipt_digest": "228cd9a57a5d8322293a24bd8857a95baddb777d27ff347f9ff0c64761898f04",
"receipt_ref": "run-91d9242ca6b84e7f9e13177e28422f27-eb80f392dfc04c349711040940d2de5b",
"source_digest": "e10f16eec0a97808d8fd291b06a5b5b27e30cac39c17f7dd883906ab38a6b7b6",
"stage": "test",
"suite_digest": "05e353f239f8919946d419e91e63fedccbf62b02386fa12f39ad8795b6a4de4d",
"tool_receipt": {
"input_digest": "1693d3d3d95e7cac510233e71509d30a157f37119849729c6bc9e2df8bfcab2f",
"operation": "AO09",
"result_digest": "aa8dcae36be1fc8eefecf7d02b770592c3df9fe956af7f59e239bb39c01568c8",
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27"
}
}
}
},
"model_calls": [
{
"id": 1,
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27",
"reservation": 18848,
"charged": 5027,
"state": "settled",
"provider": "bailian-qwen3.8-flash",
"prompt_digest": "69bb51a36a350e9f92fc43a76fd3519ad39a6dd89c8d36149ee68c9d874023db",
"metadata": {
"finish_reason": "stop",
"model": "qwen3.8-flash",
"policy_version": "bailian-task-routing-v3",
"request_id": "chatcmpl-570abc1d-1a57-9e4d-af3e-1ba8d7c3c754",
"requested_output_tokens": 2048,
"retry_of": null,
"route_reason": "technical-design",
"stage": "design"
}
},
{
"id": 2,
"run_id": "run-91d9242ca6b84e7f9e13177e28422f27",
"reservation": 18099,
"charged": 4388,
"state": "settled",
"provider": "bailian-qwen3.8-max",
"prompt_digest": "0c0114f8b2c524b17d6dc371f010e41c001a0c75f100822095b33b78366536e7",
"metadata": {
"finish_reason": "stop",
"model": "qwen3.8-max",
"policy_version": "bailian-task-routing-v3",
"request_id": "chatcmpl-e3149d2b-2da4-9203-bb0a-1d1b6962f656",
"requested_output_tokens": 8192,
"retry_of": null,
"route_reason": "java-code",
"stage": "code"
}
}
],
"repairs": 0,
"failure_analysis": null
},
"scope": "Fresh routed calculator development plus all three Java websites; ERP/PDF reuse approved previously generated sources; not arbitrary Maven project support."
}