cvpfus Codex commited on
Commit
22a9857
·
1 Parent(s): bf25028

Add PowerShell demo commands

Browse files

Co-authored-by: Codex <codex@openai.com>

Files changed (6) hide show
  1. FIELD_NOTES.md +1 -1
  2. README.md +1 -1
  3. SUBMISSION.md +1 -1
  4. app.py +9 -0
  5. scripts/verify.py +9 -0
  6. static/app.js +1 -0
FIELD_NOTES.md CHANGED
@@ -28,7 +28,7 @@ The app exposes the same budget through `/api/model-budget`, including numeric `
28
 
29
  Runtime setup is also data-backed. `/api/runtime-setup` lists the app command, llama.cpp launch command, model-specific runtime paths, environment values, and fallbacks. The session panel renders a compact version so the demo can distinguish real model wiring from deterministic safety nets.
30
 
31
- The judge runbook lives at `/api/demo-script` and is rendered in the session panel with its API evidence checks. It keeps the live presentation repeatable by pairing visible actions with API checks for health, model budget, runtime setup, runtime status, image descriptions, reader narration, and speech. Each API check includes a curl command for quick reproduction.
32
 
33
  Submission readiness lives at `/api/submission-readiness`. It aggregates the demo-critical checks into one payload: model budget, award evidence, custom frontend assets, runtime setup, accessibility audit, image receipts, and executable demo API checks. POST checks must include sample bodies before readiness passes.
34
 
 
28
 
29
  Runtime setup is also data-backed. `/api/runtime-setup` lists the app command, llama.cpp launch command, model-specific runtime paths, environment values, and fallbacks. The session panel renders a compact version so the demo can distinguish real model wiring from deterministic safety nets.
30
 
31
+ The judge runbook lives at `/api/demo-script` and is rendered in the session panel with its API evidence checks. It keeps the live presentation repeatable by pairing visible actions with API checks for health, model budget, runtime setup, runtime status, image descriptions, reader narration, and speech. Each API check includes curl and PowerShell-friendly `curl.exe` commands for quick reproduction.
32
 
33
  Submission readiness lives at `/api/submission-readiness`. It aggregates the demo-critical checks into one payload: model budget, award evidence, custom frontend assets, runtime setup, accessibility audit, image receipts, and executable demo API checks. POST checks must include sample bodies before readiness passes.
34
 
README.md CHANGED
@@ -75,7 +75,7 @@ The verifier checks syntax, static assets, Space metadata consistency, determini
75
 
76
  `/api/runtime-setup` exposes the commands, environment values, and fallback paths used for the model stack so the demo can be reproduced from the same data the UI displays.
77
 
78
- `/api/demo-script` exposes a compact judge runbook with the visible actions, API checks, sample bodies, and curl commands that prove the submission claims. The session panel renders those actions and API evidence checks as the Judge Runbook.
79
 
80
  `/api/accessibility-audit` exposes structured evidence for semantic reading order, keyboard navigation, reader cursor state, shortcut safety, live narration, image alt text, transcript review, user-controlled playback, and fallback resilience.
81
 
 
75
 
76
  `/api/runtime-setup` exposes the commands, environment values, and fallback paths used for the model stack so the demo can be reproduced from the same data the UI displays.
77
 
78
+ `/api/demo-script` exposes a compact judge runbook with the visible actions, API checks, sample bodies, curl commands, and PowerShell-friendly `curl.exe` commands that prove the submission claims. The session panel renders those actions and API evidence checks as the Judge Runbook.
79
 
80
  `/api/accessibility-audit` exposes structured evidence for semantic reading order, keyboard navigation, reader cursor state, shortcut safety, live narration, image alt text, transcript review, user-controlled playback, and fallback resilience.
81
 
SUBMISSION.md CHANGED
@@ -46,7 +46,7 @@ The prototype is designed for a live hackathon demo: every model-facing path has
46
  - `/api/submission-readiness`: one pass/fail rollup for model budget, award evidence, custom frontend, runtime setup, accessibility, image receipts, and demo API checks.
47
  - `/api/evidence-bundle`: copyable JSON bundle containing the core judge evidence receipts.
48
 
49
- The checks in `/api/demo-script` include curl commands, and the POST checks include sample JSON bodies for `/api/reader-brain` and `/api/speak`.
50
 
51
  The accessibility audit also documents two reader-mode details that matter during judging: the active item is exposed as a reader cursor with focus, visible outline, stable id, and `aria-current`; global shortcuts ignore form controls so voice, speed, and auto-advance settings remain usable while reader mode is active.
52
 
 
46
  - `/api/submission-readiness`: one pass/fail rollup for model budget, award evidence, custom frontend, runtime setup, accessibility, image receipts, and demo API checks.
47
  - `/api/evidence-bundle`: copyable JSON bundle containing the core judge evidence receipts.
48
 
49
+ The checks in `/api/demo-script` include curl and PowerShell-friendly `curl.exe` commands, and the POST checks include sample JSON bodies for `/api/reader-brain` and `/api/speak`.
50
 
51
  The accessibility audit also documents two reader-mode details that matter during judging: the active item is exposed as a reader cursor with focus, visible outline, stable id, and `aria-current`; global shortcuts ignore form controls so voice, speed, and auto-advance settings remain usable while reader mode is active.
52
 
app.py CHANGED
@@ -221,6 +221,14 @@ def demo_curl_command(check: dict[str, Any]) -> str:
221
  return f"curl -X POST {url} -H \"Content-Type: application/json\" -d '{sample_body}'"
222
 
223
 
 
 
 
 
 
 
 
 
224
  def demo_script_core() -> dict[str, Any]:
225
  api_checks = [
226
  {"method": "GET", "path": "/api/health", "expect": "custom Gradio Server app and model manifest"},
@@ -254,6 +262,7 @@ def demo_script_core() -> dict[str, Any]:
254
  ]
255
  for check in api_checks:
256
  check["curl"] = demo_curl_command(check)
 
257
 
258
  return {
259
  "ok": True,
 
221
  return f"curl -X POST {url} -H \"Content-Type: application/json\" -d '{sample_body}'"
222
 
223
 
224
+ def demo_powershell_command(check: dict[str, Any]) -> str:
225
+ url = f"http://localhost:7860{check['path']}"
226
+ if check["method"] == "GET":
227
+ return f"curl.exe {url}"
228
+ sample_body = json.dumps(check["sample_body"], separators=(",", ":")).replace('"', '\\"')
229
+ return f'curl.exe -X POST {url} -H "Content-Type: application/json" -d "{sample_body}"'
230
+
231
+
232
  def demo_script_core() -> dict[str, Any]:
233
  api_checks = [
234
  {"method": "GET", "path": "/api/health", "expect": "custom Gradio Server app and model manifest"},
 
262
  ]
263
  for check in api_checks:
264
  check["curl"] = demo_curl_command(check)
265
+ check["powershell"] = demo_powershell_command(check)
266
 
267
  return {
268
  "ok": True,
scripts/verify.py CHANGED
@@ -46,6 +46,7 @@ def verify_static_assets() -> None:
46
  assert_true("loadDemoScript" in app_js, "Frontend should render the structured demo script")
47
  assert_true("payload.api_checks" in app_js, "Frontend should render structured demo API checks")
48
  assert_true("demo-api-command" in app_js, "Frontend should render copyable demo commands")
 
49
  assert_true("/api/evidence-bundle" in app_js, "Frontend should fetch the evidence bundle for copying")
50
  assert_true("function haltPlayback" in app_js, "Reader controls should expose a shared playback halt helper")
51
  assert_true(
@@ -349,10 +350,18 @@ def verify_routes() -> None:
349
  all(item["curl"].startswith("curl ") for item in demo_payload["api_checks"]),
350
  "Every demo API check should include a curl command",
351
  )
 
 
 
 
352
  assert_true(
353
  "-d '" in reader_check["curl"] and "/api/reader-brain" in reader_check["curl"],
354
  "Reader-brain curl command should include the sample JSON body",
355
  )
 
 
 
 
356
  reader_sample = client.post(reader_check["path"], json=reader_check["sample_body"])
357
  assert_true(reader_sample.status_code == 200, "Reader-brain sample payload should be executable")
358
  reader_sample_payload = reader_sample.json()
 
46
  assert_true("loadDemoScript" in app_js, "Frontend should render the structured demo script")
47
  assert_true("payload.api_checks" in app_js, "Frontend should render structured demo API checks")
48
  assert_true("demo-api-command" in app_js, "Frontend should render copyable demo commands")
49
+ assert_true("item.powershell" in app_js, "Frontend should render PowerShell-friendly demo commands")
50
  assert_true("/api/evidence-bundle" in app_js, "Frontend should fetch the evidence bundle for copying")
51
  assert_true("function haltPlayback" in app_js, "Reader controls should expose a shared playback halt helper")
52
  assert_true(
 
350
  all(item["curl"].startswith("curl ") for item in demo_payload["api_checks"]),
351
  "Every demo API check should include a curl command",
352
  )
353
+ assert_true(
354
+ all(item["powershell"].startswith("curl.exe ") for item in demo_payload["api_checks"]),
355
+ "Every demo API check should include a PowerShell-friendly curl.exe command",
356
+ )
357
  assert_true(
358
  "-d '" in reader_check["curl"] and "/api/reader-brain" in reader_check["curl"],
359
  "Reader-brain curl command should include the sample JSON body",
360
  )
361
+ assert_true(
362
+ '\\"node_type\\"' in reader_check["powershell"] and "/api/reader-brain" in reader_check["powershell"],
363
+ "Reader-brain PowerShell command should include escaped sample JSON",
364
+ )
365
  reader_sample = client.post(reader_check["path"], json=reader_check["sample_body"])
366
  assert_true(reader_sample.status_code == 200, "Reader-brain sample payload should be executable")
367
  reader_sample_payload = reader_sample.json()
static/app.js CHANGED
@@ -253,6 +253,7 @@ async function loadDemoScript() {
253
  <code>${escapeHtml(item.path)}</code>
254
  <p>${escapeHtml(item.expect)}${item.sample_body ? " Sample body included." : ""}</p>
255
  <code class="demo-api-command">${escapeHtml(item.curl)}</code>
 
256
  </li>
257
  `)
258
  .join("");
 
253
  <code>${escapeHtml(item.path)}</code>
254
  <p>${escapeHtml(item.expect)}${item.sample_body ? " Sample body included." : ""}</p>
255
  <code class="demo-api-command">${escapeHtml(item.curl)}</code>
256
+ <code class="demo-api-command">${escapeHtml(item.powershell)}</code>
257
  </li>
258
  `)
259
  .join("");