Add hackathon readiness gates
Browse files- README.md +2 -0
- app.py +25 -7
- docs/HANDOFF_FINAL_HACKATHON.md +4 -0
- docs/SUBMISSION_ASSETS.md +42 -0
- src/nexus_visual_weaver/exporter.py +3 -0
- src/nexus_visual_weaver/render.py +51 -0
- src/nexus_visual_weaver/styles.py +73 -0
- tests/test_app_callbacks.py +34 -0
- tests/test_command_center.py +21 -0
- tests/test_exporter.py +14 -0
README.md
CHANGED
|
@@ -111,6 +111,8 @@ The default preset is **Raven Quality Stack**. `black-forest-labs/FLUX.2-klein-4
|
|
| 111 |
|
| 112 |
Tiny Titan is not the flagship story. It can be claimed only from a successful sidecar export packet where every active sidecar model is <=4B.
|
| 113 |
|
|
|
|
|
|
|
| 114 |
## Local Setup
|
| 115 |
|
| 116 |
```powershell
|
|
|
|
| 111 |
|
| 112 |
Tiny Titan is not the flagship story. It can be claimed only from a successful sidecar export packet where every active sidecar model is <=4B.
|
| 113 |
|
| 114 |
+
See [docs/SUBMISSION_ASSETS.md](docs/SUBMISSION_ASSETS.md) for the demo script, social post draft, thumbnail direction, and final link checklist.
|
| 115 |
+
|
| 116 |
## Local Setup
|
| 117 |
|
| 118 |
```powershell
|
app.py
CHANGED
|
@@ -413,25 +413,36 @@ def export_packet(
|
|
| 413 |
scan: dict[str, Any] | None,
|
| 414 |
active_section: str,
|
| 415 |
operator_state: dict[str, Any] | None,
|
|
|
|
| 416 |
) -> tuple[Any, ...]:
|
| 417 |
state = operator_state or _default_operator_state()
|
| 418 |
scan = _authoritative_generated_scan(state)
|
|
|
|
| 419 |
if run is None:
|
| 420 |
next_state = {**state, "provider_state": "blocked", "export": "blocked", "message": "Export blocked: no active run packet exists."}
|
| 421 |
elif state.get("checkpoint") != "approved":
|
| 422 |
next_state = {**state, "provider_state": "blocked", "export": "blocked", "message": "Export blocked: human checkpoint has not been approved."}
|
| 423 |
elif not _generated_output_path(state):
|
| 424 |
next_state = {**state, "provider_state": "blocked", "export": "blocked", "message": "Export blocked: no generated artifact exists."}
|
| 425 |
-
elif scan.get("export_gate") != "clear":
|
| 426 |
-
next_state = {**state, "provider_state": "blocked", "export": scan.get("export_gate", "blocked"), "message": "Export blocked: ST3GG gate is not clear."}
|
| 427 |
else:
|
| 428 |
-
|
| 429 |
-
|
| 430 |
**state,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 431 |
"provider_state": "exported",
|
| 432 |
-
"export":
|
| 433 |
"export_packet": {"path": export["path"]},
|
| 434 |
-
"message":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 435 |
}
|
| 436 |
return _render_stateful(run, adult_mode, scan, active_section, next_state)
|
| 437 |
|
|
@@ -525,6 +536,13 @@ with gr.Blocks(title="NEXUS Visual Weaver") as demo:
|
|
| 525 |
)
|
| 526 |
run_btn = gr.Button("Run Active Weave", variant="primary", scale=1)
|
| 527 |
stop_btn = gr.Button("Stop Provider Job", variant="stop", interactive=False, scale=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 528 |
with gr.Row(elem_id="nw-operator-actions", elem_classes=["nw-operator-actions"]):
|
| 529 |
scan_btn = gr.Button("Scan Reference", scale=1)
|
| 530 |
checkpoint_btn = gr.Button("Approve Checkpoint", scale=1)
|
|
@@ -627,7 +645,7 @@ with gr.Blocks(title="NEXUS Visual Weaver") as demo:
|
|
| 627 |
)
|
| 628 |
export_btn.click(
|
| 629 |
fn=export_packet,
|
| 630 |
-
inputs=[active_run_state, adult_mode, scan_state, section_nav, operator_state],
|
| 631 |
outputs=operator_outputs,
|
| 632 |
api_name="prepare_export_packet",
|
| 633 |
)
|
|
|
|
| 413 |
scan: dict[str, Any] | None,
|
| 414 |
active_section: str,
|
| 415 |
operator_state: dict[str, Any] | None,
|
| 416 |
+
override_reason: str = "",
|
| 417 |
) -> tuple[Any, ...]:
|
| 418 |
state = operator_state or _default_operator_state()
|
| 419 |
scan = _authoritative_generated_scan(state)
|
| 420 |
+
override_reason = (override_reason or "").strip()
|
| 421 |
if run is None:
|
| 422 |
next_state = {**state, "provider_state": "blocked", "export": "blocked", "message": "Export blocked: no active run packet exists."}
|
| 423 |
elif state.get("checkpoint") != "approved":
|
| 424 |
next_state = {**state, "provider_state": "blocked", "export": "blocked", "message": "Export blocked: human checkpoint has not been approved."}
|
| 425 |
elif not _generated_output_path(state):
|
| 426 |
next_state = {**state, "provider_state": "blocked", "export": "blocked", "message": "Export blocked: no generated artifact exists."}
|
| 427 |
+
elif scan.get("export_gate") != "clear" and not override_reason:
|
| 428 |
+
next_state = {**state, "provider_state": "blocked", "export": scan.get("export_gate", "blocked"), "message": "Export blocked: ST3GG gate is not clear. Add an explicit override reason to prepare a reviewed evidence packet."}
|
| 429 |
else:
|
| 430 |
+
export_state = "clear" if scan.get("export_gate") == "clear" else "override"
|
| 431 |
+
export_input_state = {
|
| 432 |
**state,
|
| 433 |
+
**({"st3gg_override_reason": override_reason} if override_reason and scan.get("export_gate") != "clear" else {}),
|
| 434 |
+
}
|
| 435 |
+
export = write_export_packet(run=run, scan=scan, operator_state=export_input_state, adult_mode=adult_mode)
|
| 436 |
+
next_state = {
|
| 437 |
+
**export_input_state,
|
| 438 |
"provider_state": "exported",
|
| 439 |
+
"export": export_state,
|
| 440 |
"export_packet": {"path": export["path"]},
|
| 441 |
+
"message": (
|
| 442 |
+
f"Governed export packet prepared with ST3GG override recorded: {export['path']}"
|
| 443 |
+
if export_state == "override"
|
| 444 |
+
else f"Governed export packet prepared: {export['path']}"
|
| 445 |
+
),
|
| 446 |
}
|
| 447 |
return _render_stateful(run, adult_mode, scan, active_section, next_state)
|
| 448 |
|
|
|
|
| 536 |
)
|
| 537 |
run_btn = gr.Button("Run Active Weave", variant="primary", scale=1)
|
| 538 |
stop_btn = gr.Button("Stop Provider Job", variant="stop", interactive=False, scale=1)
|
| 539 |
+
override_reason = gr.Textbox(
|
| 540 |
+
value="",
|
| 541 |
+
label="ST3GG Override Reason",
|
| 542 |
+
placeholder="Required only to export a reviewed/blocked artifact. Explain why the evidence packet may be written.",
|
| 543 |
+
lines=2,
|
| 544 |
+
max_lines=3,
|
| 545 |
+
)
|
| 546 |
with gr.Row(elem_id="nw-operator-actions", elem_classes=["nw-operator-actions"]):
|
| 547 |
scan_btn = gr.Button("Scan Reference", scale=1)
|
| 548 |
checkpoint_btn = gr.Button("Approve Checkpoint", scale=1)
|
|
|
|
| 645 |
)
|
| 646 |
export_btn.click(
|
| 647 |
fn=export_packet,
|
| 648 |
+
inputs=[active_run_state, adult_mode, scan_state, section_nav, operator_state, override_reason],
|
| 649 |
outputs=operator_outputs,
|
| 650 |
api_name="prepare_export_packet",
|
| 651 |
)
|
docs/HANDOFF_FINAL_HACKATHON.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
| 18 |
|
| 19 |
Do not paste these into chat, commits, logs, or export packets.
|
| 20 |
|
|
|
|
| 21 |
- `HF_TOKEN`: required for gated FLUX.2 Klein 9B access after license acceptance; the app can honestly fall back to the 4B Tiny Titan sidecar if the 9B lane is unavailable.
|
| 22 |
- `MINICPM_BASE_URL`: OpenBMB OpenAI-compatible endpoint base URL.
|
| 23 |
- `MINICPM_API_KEY`: OpenBMB bearer token.
|
|
@@ -90,6 +91,7 @@ Current evidence from the SSE API:
|
|
| 90 |
- OpenBMB and Nemotron endpoints are optional and must show `missing secret` rather than fake success when not configured.
|
| 91 |
- Demo video and social post links must be added before final submission.
|
| 92 |
- Dev mode served stale `dc6756e` until disabled through the HF API. Keep dev mode off for final judging unless you immediately verify `/config` after re-enabling.
|
|
|
|
| 93 |
|
| 94 |
## Last Verified Checks
|
| 95 |
|
|
@@ -101,6 +103,8 @@ Current evidence from the SSE API:
|
|
| 101 |
- Public Space API: `/gradio_api/info` exposed `run_active_weave`, `scan_reference`, `approve_checkpoint`, `prepare_export_packet`, and `toggle_adult_catalog`.
|
| 102 |
- Public Space config: `Raven Quality Stack` and `FLUX.2 9B PINNED` present; old `Dark Couture v2.4` and `FLUX.2 4B PINNED` absent.
|
| 103 |
- Live weave: real FLUX image generated after switching to `Flux2KleinPipeline`; ST3GG marked the generated PNG `review` and blocked export due high entropy review, proving the export gate is active.
|
|
|
|
|
|
|
| 104 |
|
| 105 |
## Last-Step Checklist
|
| 106 |
|
|
|
|
| 18 |
|
| 19 |
Do not paste these into chat, commits, logs, or export packets.
|
| 20 |
|
| 21 |
+
- Current Space secret inventory checked after the Raven sprint: `HF_TOKEN` is present; OpenBMB, Nemotron/NVIDIA, and Modal secrets are not present.
|
| 22 |
- `HF_TOKEN`: required for gated FLUX.2 Klein 9B access after license acceptance; the app can honestly fall back to the 4B Tiny Titan sidecar if the 9B lane is unavailable.
|
| 23 |
- `MINICPM_BASE_URL`: OpenBMB OpenAI-compatible endpoint base URL.
|
| 24 |
- `MINICPM_API_KEY`: OpenBMB bearer token.
|
|
|
|
| 91 |
- OpenBMB and Nemotron endpoints are optional and must show `missing secret` rather than fake success when not configured.
|
| 92 |
- Demo video and social post links must be added before final submission.
|
| 93 |
- Dev mode served stale `dc6756e` until disabled through the HF API. Keep dev mode off for final judging unless you immediately verify `/config` after re-enabling.
|
| 94 |
+
- The app now supports an explicit ST3GG override reason for evidence-packet export when a generated artifact is review/blocked. This does not mark ST3GG as clear; it records the blocked gate and the human reason.
|
| 95 |
|
| 96 |
## Last Verified Checks
|
| 97 |
|
|
|
|
| 103 |
- Public Space API: `/gradio_api/info` exposed `run_active_weave`, `scan_reference`, `approve_checkpoint`, `prepare_export_packet`, and `toggle_adult_catalog`.
|
| 104 |
- Public Space config: `Raven Quality Stack` and `FLUX.2 9B PINNED` present; old `Dark Couture v2.4` and `FLUX.2 4B PINNED` absent.
|
| 105 |
- Live weave: real FLUX image generated after switching to `Flux2KleinPipeline`; ST3GG marked the generated PNG `review` and blocked export due high entropy review, proving the export gate is active.
|
| 106 |
+
- Readiness: the UI now shows explicit gates for Space/API, Raven Stack, ST3GG, FLUX artifact, checkpoint, export packet, sponsor evidence, and demo/social.
|
| 107 |
+
- Submission assets: see `docs/SUBMISSION_ASSETS.md` for demo script, social draft, thumbnail direction, and final link checklist.
|
| 108 |
|
| 109 |
## Last-Step Checklist
|
| 110 |
|
docs/SUBMISSION_ASSETS.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Submission Assets Plan
|
| 2 |
+
|
| 3 |
+
## Demo Video
|
| 4 |
+
|
| 5 |
+
Target length: 60-90 seconds.
|
| 6 |
+
|
| 7 |
+
1. Open the Space and show the first viewport: Raven Quality Stack, 28.50B budget, ST3GG trust strip, and Hackathon Readiness.
|
| 8 |
+
2. Run the default Raven Chronicle prompt.
|
| 9 |
+
3. Show the real FLUX artifact in the Artifact Preview Lane.
|
| 10 |
+
4. Show ST3GG verdict and explain that generation is not export.
|
| 11 |
+
5. Approve the human checkpoint.
|
| 12 |
+
6. If ST3GG marks the artifact review/blocked, type an explicit override reason and prepare the export packet.
|
| 13 |
+
7. Open the evidence accordion: model stack, ST3GG scan, MiniCPM/Nemotron missing-secret or success states, and export packet path.
|
| 14 |
+
8. Close with the prize map: Off Brand, Best Agent, OpenBMB/NVIDIA when provider evidence succeeds, Modal sidecar when documented.
|
| 15 |
+
|
| 16 |
+
## Social Post Draft
|
| 17 |
+
|
| 18 |
+
NEXUS Visual Weaver is our Build Small hackathon command center for governed visual creation: Raven Quality Stack image generation, gothic couture wardrobe control, LocateAnything grounding, ST3GG export gates, and human checkpoints before release.
|
| 19 |
+
|
| 20 |
+
Built with Gradio on Hugging Face Spaces. Real FLUX artifacts are generated, scanned, checkpointed, and packaged as evidence instead of silently exported.
|
| 21 |
+
|
| 22 |
+
Space: `SPACE_URL`
|
| 23 |
+
Demo: `DEMO_VIDEO_URL`
|
| 24 |
+
|
| 25 |
+
## Thumbnail Direction
|
| 26 |
+
|
| 27 |
+
Create a dark couture command-center cover:
|
| 28 |
+
|
| 29 |
+
- left: Raven Chronicle generated artifact
|
| 30 |
+
- center: workflow graph with ST3GG trust gate
|
| 31 |
+
- right: inspector cards for FLUX.2 9B, LocateAnything, MiniCPM, Nemotron, Modal VOID
|
| 32 |
+
- color: black glass, crimson, cyan, subtle green trust signal
|
| 33 |
+
- text: `NEXUS Visual Weaver`
|
| 34 |
+
|
| 35 |
+
Avoid cluttered model logos, tiny unreadable UI screenshots, or a generic marketing hero.
|
| 36 |
+
|
| 37 |
+
## Final Link Checklist
|
| 38 |
+
|
| 39 |
+
- Replace `DEMO_VIDEO_URL` in README.
|
| 40 |
+
- Replace `SOCIAL_POST_URL` in README.
|
| 41 |
+
- Set `NEXUS_DEMO_VIDEO_URL` and `NEXUS_SOCIAL_POST_URL` as Space variables if we want the readiness meter to mark Demo/Social complete.
|
| 42 |
+
- Re-run `/gradio_api/info` and one `run_active_weave` smoke after link update.
|
src/nexus_visual_weaver/exporter.py
CHANGED
|
@@ -102,6 +102,7 @@ def write_export_packet(
|
|
| 102 |
"repo_id": "black-forest-labs/FLUX.2-klein-4B",
|
| 103 |
}
|
| 104 |
locate_grounding = operator_state.get("locateanything_grounding") or {}
|
|
|
|
| 105 |
packet = {
|
| 106 |
"schema": "nexus_visual_weaver.export_packet.v1",
|
| 107 |
"run_id": run_id,
|
|
@@ -113,6 +114,7 @@ def write_export_packet(
|
|
| 113 |
"artifact": artifact,
|
| 114 |
"generation": generation,
|
| 115 |
"st3gg_scan": scan,
|
|
|
|
| 116 |
"locateanything_grounding": locate_grounding,
|
| 117 |
"offellia_judge": offellia,
|
| 118 |
"minicpm_judge": operator_state.get("minicpm_judge") or {},
|
|
@@ -147,6 +149,7 @@ def write_export_packet(
|
|
| 147 |
"tiny_titan_sidecar": tiny_titan.get("status") in {"success", "available", "sidecar"},
|
| 148 |
"raven_quality_stack": True,
|
| 149 |
"locateanything_grounding": bool(locate_grounding.get("targets") or locate_grounding.get("repo_id")),
|
|
|
|
| 150 |
"st3gg_export_gate": scan.get("export_gate"),
|
| 151 |
},
|
| 152 |
}
|
|
|
|
| 102 |
"repo_id": "black-forest-labs/FLUX.2-klein-4B",
|
| 103 |
}
|
| 104 |
locate_grounding = operator_state.get("locateanything_grounding") or {}
|
| 105 |
+
st3gg_override_reason = str(operator_state.get("st3gg_override_reason", "")).strip()
|
| 106 |
packet = {
|
| 107 |
"schema": "nexus_visual_weaver.export_packet.v1",
|
| 108 |
"run_id": run_id,
|
|
|
|
| 114 |
"artifact": artifact,
|
| 115 |
"generation": generation,
|
| 116 |
"st3gg_scan": scan,
|
| 117 |
+
"st3gg_override_reason": st3gg_override_reason or None,
|
| 118 |
"locateanything_grounding": locate_grounding,
|
| 119 |
"offellia_judge": offellia,
|
| 120 |
"minicpm_judge": operator_state.get("minicpm_judge") or {},
|
|
|
|
| 149 |
"tiny_titan_sidecar": tiny_titan.get("status") in {"success", "available", "sidecar"},
|
| 150 |
"raven_quality_stack": True,
|
| 151 |
"locateanything_grounding": bool(locate_grounding.get("targets") or locate_grounding.get("repo_id")),
|
| 152 |
+
"st3gg_override_recorded": bool(st3gg_override_reason),
|
| 153 |
"st3gg_export_gate": scan.get("export_gate"),
|
| 154 |
},
|
| 155 |
}
|
src/nexus_visual_weaver/render.py
CHANGED
|
@@ -154,6 +154,56 @@ def render_trust_strip(scan: dict | None = None, operator_state: dict | None = N
|
|
| 154 |
"""
|
| 155 |
|
| 156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
def render_topbar(
|
| 158 |
adult_mode: bool = False,
|
| 159 |
relay_status: dict | None = None,
|
|
@@ -197,6 +247,7 @@ def render_topbar(
|
|
| 197 |
<div class="nw-locked"><b>18+</b><span>Locked. Enable in Security with explicit justification.</span></div>
|
| 198 |
</div>
|
| 199 |
{render_trust_strip(scan, operator_state)}
|
|
|
|
| 200 |
"""
|
| 201 |
|
| 202 |
|
|
|
|
| 154 |
"""
|
| 155 |
|
| 156 |
|
| 157 |
+
def _submission_link_ready() -> bool:
|
| 158 |
+
return bool(os.environ.get("NEXUS_DEMO_VIDEO_URL") and os.environ.get("NEXUS_SOCIAL_POST_URL"))
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
def _submission_readiness(scan: dict | None = None, operator_state: dict | None = None) -> tuple[int, int, list[tuple[str, bool, str]]]:
|
| 162 |
+
scan = scan or {"status": "idle", "export_gate": "pending"}
|
| 163 |
+
operator_state = operator_state or {}
|
| 164 |
+
generation = operator_state.get("generation") or {}
|
| 165 |
+
minicpm = operator_state.get("minicpm_judge") or {}
|
| 166 |
+
nemotron = operator_state.get("nemotron_evidence") or {}
|
| 167 |
+
gates = [
|
| 168 |
+
("Space/API", True, "Space is serving the command center and MCP/Gradio API."),
|
| 169 |
+
("Raven Stack", True, "28.50B quality stack is configured under the 32B rule."),
|
| 170 |
+
("ST3GG Visible", True, "Trust strip and export gate are above the fold."),
|
| 171 |
+
("FLUX Artifact", generation.get("status") == "success", "Run Active Weave must generate a real artifact."),
|
| 172 |
+
("Checkpoint", operator_state.get("checkpoint") == "approved", "Human checkpoint must approve the generated artifact."),
|
| 173 |
+
("Export Packet", bool(operator_state.get("export_packet")), "Prepare Export Packet must write evidence JSON."),
|
| 174 |
+
(
|
| 175 |
+
"Sponsor Evidence",
|
| 176 |
+
minicpm.get("status") == "success" and nemotron.get("status") == "success",
|
| 177 |
+
"MiniCPM and Nemotron both need configured secrets and successful calls.",
|
| 178 |
+
),
|
| 179 |
+
("Demo/Social", _submission_link_ready(), "Final demo video and social post URLs are still required."),
|
| 180 |
+
]
|
| 181 |
+
complete = sum(1 for _, ok, _ in gates if ok)
|
| 182 |
+
return complete, len(gates), gates
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
def render_submission_readiness(scan: dict | None = None, operator_state: dict | None = None) -> str:
|
| 186 |
+
complete, total, gates = _submission_readiness(scan, operator_state)
|
| 187 |
+
pct = int((complete / total) * 100)
|
| 188 |
+
chips = "".join(
|
| 189 |
+
f'<span class="nw-ready-chip {"is-done" if ok else "is-waiting"}">{escape(label)}</span>'
|
| 190 |
+
for label, ok, _ in gates
|
| 191 |
+
)
|
| 192 |
+
blockers = [help_text for _, ok, help_text in gates if not ok][:3]
|
| 193 |
+
blockers_html = " ".join(f"<span>{escape(text)}</span>" for text in blockers)
|
| 194 |
+
return f"""
|
| 195 |
+
<section class="nw-readiness">
|
| 196 |
+
<div class="nw-ready-head">
|
| 197 |
+
<strong>Hackathon Readiness</strong>
|
| 198 |
+
<small>{complete}/{total} gates complete</small>
|
| 199 |
+
</div>
|
| 200 |
+
<div class="nw-ready-meter"><i style="width:{pct}%"></i></div>
|
| 201 |
+
<div class="nw-ready-chips">{chips}</div>
|
| 202 |
+
<div class="nw-ready-blockers">{blockers_html}</div>
|
| 203 |
+
</section>
|
| 204 |
+
"""
|
| 205 |
+
|
| 206 |
+
|
| 207 |
def render_topbar(
|
| 208 |
adult_mode: bool = False,
|
| 209 |
relay_status: dict | None = None,
|
|
|
|
| 247 |
<div class="nw-locked"><b>18+</b><span>Locked. Enable in Security with explicit justification.</span></div>
|
| 248 |
</div>
|
| 249 |
{render_trust_strip(scan, operator_state)}
|
| 250 |
+
{render_submission_readiness(scan, operator_state)}
|
| 251 |
"""
|
| 252 |
|
| 253 |
|
src/nexus_visual_weaver/styles.py
CHANGED
|
@@ -165,6 +165,77 @@ footer { display: none !important; }
|
|
| 165 |
.nw-trust-card .nw-badge {
|
| 166 |
margin-bottom: 1px;
|
| 167 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
.nw-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
| 169 |
.nw-shell {
|
| 170 |
display: grid;
|
|
@@ -938,6 +1009,8 @@ footer { display: none !important; }
|
|
| 938 |
@media (max-width: 1100px) {
|
| 939 |
.nw-topbar { grid-template-columns: 1fr; }
|
| 940 |
.nw-trust-strip { grid-template-columns: 1fr; }
|
|
|
|
|
|
|
| 941 |
.nw-shell { grid-template-columns: 1fr; grid-template-rows: auto; }
|
| 942 |
.nw-rail, .nw-inspector, .nw-bottom { grid-column: 1; grid-row: auto; }
|
| 943 |
.nw-rail { flex-direction: row; overflow-x: auto; }
|
|
|
|
| 165 |
.nw-trust-card .nw-badge {
|
| 166 |
margin-bottom: 1px;
|
| 167 |
}
|
| 168 |
+
.nw-readiness {
|
| 169 |
+
display: grid;
|
| 170 |
+
grid-template-columns: 190px minmax(180px, 260px) minmax(420px, 1fr);
|
| 171 |
+
gap: 10px;
|
| 172 |
+
align-items: center;
|
| 173 |
+
padding: 8px;
|
| 174 |
+
border-bottom: 1px solid #171c22;
|
| 175 |
+
background:
|
| 176 |
+
linear-gradient(90deg, rgba(255,54,95,.08), transparent 42%),
|
| 177 |
+
rgba(5, 7, 10, .98);
|
| 178 |
+
}
|
| 179 |
+
.nw-ready-head {
|
| 180 |
+
min-width: 0;
|
| 181 |
+
}
|
| 182 |
+
.nw-ready-head strong {
|
| 183 |
+
display: block;
|
| 184 |
+
font-size: 13px;
|
| 185 |
+
line-height: 1.2;
|
| 186 |
+
}
|
| 187 |
+
.nw-ready-head small {
|
| 188 |
+
color: var(--nw-muted);
|
| 189 |
+
font-size: 11px;
|
| 190 |
+
}
|
| 191 |
+
.nw-ready-meter {
|
| 192 |
+
height: 10px;
|
| 193 |
+
border-radius: 999px;
|
| 194 |
+
overflow: hidden;
|
| 195 |
+
background: #1d242c;
|
| 196 |
+
box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
|
| 197 |
+
}
|
| 198 |
+
.nw-ready-meter i {
|
| 199 |
+
display: block;
|
| 200 |
+
height: 100%;
|
| 201 |
+
background: linear-gradient(90deg, var(--nw-green), var(--nw-cyan));
|
| 202 |
+
box-shadow: 0 0 16px rgba(32,217,232,.32);
|
| 203 |
+
}
|
| 204 |
+
.nw-ready-chips {
|
| 205 |
+
display: flex;
|
| 206 |
+
flex-wrap: wrap;
|
| 207 |
+
gap: 5px;
|
| 208 |
+
}
|
| 209 |
+
.nw-ready-chip {
|
| 210 |
+
border: 1px solid var(--nw-line);
|
| 211 |
+
border-radius: 999px;
|
| 212 |
+
padding: 4px 8px;
|
| 213 |
+
color: var(--nw-muted);
|
| 214 |
+
font-size: 10px;
|
| 215 |
+
font-weight: 750;
|
| 216 |
+
white-space: nowrap;
|
| 217 |
+
}
|
| 218 |
+
.nw-ready-chip.is-done {
|
| 219 |
+
color: #9ff4c6;
|
| 220 |
+
border-color: rgba(38,215,130,.42);
|
| 221 |
+
background: rgba(38,215,130,.08);
|
| 222 |
+
}
|
| 223 |
+
.nw-ready-chip.is-waiting {
|
| 224 |
+
color: #ffb7c4;
|
| 225 |
+
border-color: rgba(255,54,95,.34);
|
| 226 |
+
background: rgba(255,54,95,.06);
|
| 227 |
+
}
|
| 228 |
+
.nw-ready-blockers {
|
| 229 |
+
grid-column: 1 / -1;
|
| 230 |
+
display: flex;
|
| 231 |
+
flex-wrap: wrap;
|
| 232 |
+
gap: 6px;
|
| 233 |
+
}
|
| 234 |
+
.nw-ready-blockers span {
|
| 235 |
+
color: var(--nw-muted);
|
| 236 |
+
font-size: 11px;
|
| 237 |
+
line-height: 1.35;
|
| 238 |
+
}
|
| 239 |
.nw-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
| 240 |
.nw-shell {
|
| 241 |
display: grid;
|
|
|
|
| 1009 |
@media (max-width: 1100px) {
|
| 1010 |
.nw-topbar { grid-template-columns: 1fr; }
|
| 1011 |
.nw-trust-strip { grid-template-columns: 1fr; }
|
| 1012 |
+
.nw-readiness { grid-template-columns: 1fr; }
|
| 1013 |
+
.nw-ready-blockers { grid-column: 1; }
|
| 1014 |
.nw-shell { grid-template-columns: 1fr; grid-template-rows: auto; }
|
| 1015 |
.nw-rail, .nw-inspector, .nw-bottom { grid-column: 1; grid-row: auto; }
|
| 1016 |
.nw-rail { flex-direction: row; overflow-x: auto; }
|
tests/test_app_callbacks.py
CHANGED
|
@@ -146,6 +146,40 @@ def test_export_blocks_without_checkpoint() -> None:
|
|
| 146 |
assert "checkpoint" in blocked[13]["message"].lower()
|
| 147 |
|
| 148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
def test_reference_scan_cannot_clear_blocked_generated_artifact() -> None:
|
| 150 |
base = app.ROOT / "outputs" / "test-app-callbacks"
|
| 151 |
base.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 146 |
assert "checkpoint" in blocked[13]["message"].lower()
|
| 147 |
|
| 148 |
|
| 149 |
+
def test_export_allows_st3gg_review_with_explicit_override() -> None:
|
| 150 |
+
from pathlib import Path
|
| 151 |
+
|
| 152 |
+
result = app.run_weave(
|
| 153 |
+
"gothic patent leather platform boots, crimson hardware",
|
| 154 |
+
"Strict",
|
| 155 |
+
"Wan2.2 I2V",
|
| 156 |
+
False,
|
| 157 |
+
None,
|
| 158 |
+
"Forge",
|
| 159 |
+
)
|
| 160 |
+
run = result[13]
|
| 161 |
+
artifact_path = Path("outputs/test-override-artifact.png")
|
| 162 |
+
artifact_path.parent.mkdir(parents=True, exist_ok=True)
|
| 163 |
+
artifact_path.write_bytes(b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIEND\xaeB`\x82NEXUS_REVIEW")
|
| 164 |
+
state = {
|
| 165 |
+
**result[15],
|
| 166 |
+
"generation": {**result[15]["generation"], "status": "success", "output_path": str(artifact_path)},
|
| 167 |
+
"checkpoint": "approved",
|
| 168 |
+
"provider_state": "checkpointed",
|
| 169 |
+
}
|
| 170 |
+
review_scan = {"status": "review", "export_gate": "blocked", "findings": ["high entropy sample"], "purification_actions": ["manual review"]}
|
| 171 |
+
|
| 172 |
+
blocked = app.export_packet(run, False, review_scan, "Forge", state, "")
|
| 173 |
+
assert blocked[13]["provider_state"] == "blocked"
|
| 174 |
+
assert "override reason" in blocked[13]["message"].lower()
|
| 175 |
+
|
| 176 |
+
exported = app.export_packet(run, False, review_scan, "Forge", state, "Judge-reviewed generated PNG; evidence packet only.")
|
| 177 |
+
assert exported[13]["provider_state"] == "exported"
|
| 178 |
+
assert exported[13]["export"] == "override"
|
| 179 |
+
assert exported[13]["st3gg_override_reason"] == "Judge-reviewed generated PNG; evidence packet only."
|
| 180 |
+
assert "export_packet" in exported[13]
|
| 181 |
+
|
| 182 |
+
|
| 183 |
def test_reference_scan_cannot_clear_blocked_generated_artifact() -> None:
|
| 184 |
base = app.ROOT / "outputs" / "test-app-callbacks"
|
| 185 |
base.mkdir(parents=True, exist_ok=True)
|
tests/test_command_center.py
CHANGED
|
@@ -20,6 +20,7 @@ from nexus_visual_weaver.render import (
|
|
| 20 |
render_inspector,
|
| 21 |
render_operations_panel,
|
| 22 |
render_provider_cards,
|
|
|
|
| 23 |
render_topbar,
|
| 24 |
render_trust_strip,
|
| 25 |
)
|
|
@@ -315,6 +316,8 @@ def test_render_topbar_includes_trust_strip() -> None:
|
|
| 315 |
|
| 316 |
assert "TRUST MODEL" in html
|
| 317 |
assert "nw-trust-strip" in html
|
|
|
|
|
|
|
| 318 |
|
| 319 |
|
| 320 |
def test_render_topbar_with_scan_passes_to_trust_strip() -> None:
|
|
@@ -339,6 +342,24 @@ def test_render_topbar_default_scan_shows_fixture_evidence() -> None:
|
|
| 339 |
assert "PNG trailing bytes -> blocked." in html
|
| 340 |
|
| 341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
# --- render_inspector sponsor evidence tests ---
|
| 343 |
|
| 344 |
def test_render_inspector_shows_sponsor_evidence_section() -> None:
|
|
|
|
| 20 |
render_inspector,
|
| 21 |
render_operations_panel,
|
| 22 |
render_provider_cards,
|
| 23 |
+
render_submission_readiness,
|
| 24 |
render_topbar,
|
| 25 |
render_trust_strip,
|
| 26 |
)
|
|
|
|
| 316 |
|
| 317 |
assert "TRUST MODEL" in html
|
| 318 |
assert "nw-trust-strip" in html
|
| 319 |
+
assert "Hackathon Readiness" in html
|
| 320 |
+
assert "3/8 gates complete" in html
|
| 321 |
|
| 322 |
|
| 323 |
def test_render_topbar_with_scan_passes_to_trust_strip() -> None:
|
|
|
|
| 342 |
assert "PNG trailing bytes -> blocked." in html
|
| 343 |
|
| 344 |
|
| 345 |
+
def test_submission_readiness_tracks_run_and_submission_blockers() -> None:
|
| 346 |
+
html = render_submission_readiness(
|
| 347 |
+
scan={"status": "review", "export_gate": "blocked"},
|
| 348 |
+
operator_state={
|
| 349 |
+
"generation": {"status": "success"},
|
| 350 |
+
"checkpoint": "approved",
|
| 351 |
+
"export_packet": {"path": "outputs/exports/nw.json"},
|
| 352 |
+
"minicpm_judge": {"status": "missing_secret"},
|
| 353 |
+
"nemotron_evidence": {"status": "missing_secret"},
|
| 354 |
+
},
|
| 355 |
+
)
|
| 356 |
+
|
| 357 |
+
assert "Hackathon Readiness" in html
|
| 358 |
+
assert "6/8 gates complete" in html
|
| 359 |
+
assert "MiniCPM and Nemotron" in html
|
| 360 |
+
assert "Final demo video and social post URLs" in html
|
| 361 |
+
|
| 362 |
+
|
| 363 |
# --- render_inspector sponsor evidence tests ---
|
| 364 |
|
| 365 |
def test_render_inspector_shows_sponsor_evidence_section() -> None:
|
tests/test_exporter.py
CHANGED
|
@@ -131,6 +131,20 @@ def test_export_packet_hackathon_claims_st3gg_export_gate(monkeypatch) -> None:
|
|
| 131 |
assert payload_blocked["hackathon_claims"]["st3gg_export_gate"] == "blocked"
|
| 132 |
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
def test_export_packet_includes_model_stack_and_prompts(monkeypatch) -> None:
|
| 135 |
monkeypatch.setenv("NEXUS_EXPORT_DIR", "outputs/test-exports")
|
| 136 |
run = build_command_center_run("raven archivist couture brief")
|
|
|
|
| 131 |
assert payload_blocked["hackathon_claims"]["st3gg_export_gate"] == "blocked"
|
| 132 |
|
| 133 |
|
| 134 |
+
def test_export_packet_records_st3gg_override_reason(monkeypatch) -> None:
|
| 135 |
+
monkeypatch.setenv("NEXUS_EXPORT_DIR", "outputs/test-exports")
|
| 136 |
+
run = build_command_center_run("review override brief")
|
| 137 |
+
scan = {"status": "review", "export_gate": "blocked"}
|
| 138 |
+
state = _make_base_state(st3gg_override_reason="Human reviewed generated artifact for evidence-only export.")
|
| 139 |
+
|
| 140 |
+
result = write_export_packet(run=run, scan=scan, operator_state=state, adult_mode=False)
|
| 141 |
+
payload = json.loads(Path(result["path"]).read_text(encoding="utf-8"))
|
| 142 |
+
|
| 143 |
+
assert payload["st3gg_override_reason"] == "Human reviewed generated artifact for evidence-only export."
|
| 144 |
+
assert payload["hackathon_claims"]["st3gg_override_recorded"] is True
|
| 145 |
+
assert payload["hackathon_claims"]["st3gg_export_gate"] == "blocked"
|
| 146 |
+
|
| 147 |
+
|
| 148 |
def test_export_packet_includes_model_stack_and_prompts(monkeypatch) -> None:
|
| 149 |
monkeypatch.setenv("NEXUS_EXPORT_DIR", "outputs/test-exports")
|
| 150 |
run = build_command_center_run("raven archivist couture brief")
|