File size: 2,277 Bytes
6ecbfa8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import gradio as gr


SAMPLE_LEDGER = """| Claim ID | Claim | Source | Gate Status |
|---|---|---|---|
| CL-001 | Example market signal is cited from a registered source entry. | S1 | pass |
| CL-002 | Example risk statement is framed with explicit limitation. | S2 | warning |
| CL-003 | Example unsupported claim is blocked before delivery. | none | block |
"""

SAMPLE_BRIEF = """# Example BriefLoop Output

## Executive Summary

This is a public-safe demo of the BriefLoop workflow shape. It shows how a
brief can carry a claim ledger, quality gates, and audit-oriented records.

## What This Demo Shows

- Claims are recorded before delivery.
- Warnings and blockers are visible.
- Reader-facing output is separate from audit/control artifacts.

## Boundary

This demo does not prove semantic truth and does not run the full multi-agent
workflow inside this Space.
"""

SAMPLE_GATES = """| Gate | Result | Note |
|---|---|---|
| reader-clean | pass | No process residue in reader-facing output. |
| unsupported-material-claim | block | Unsupported material claim must be repaired or removed. |
| source-appendix | warning | Source metadata can be improved. |
"""


def show_demo(selection: str):
    if selection == "Claim Ledger":
        return SAMPLE_LEDGER
    if selection == "Quality Gates":
        return SAMPLE_GATES
    return SAMPLE_BRIEF


with gr.Blocks(title="BriefLoop Demo") as demo:
    gr.Markdown(
        """
        # BriefLoop Demo

        BriefLoop is an open-source workflow for accountable AI-assisted
        business briefings.

        This Space is a bounded product demo. It shows the shape of BriefLoop
        artifacts, not a live proof of semantic truth or output quality.
        """
    )
    view = gr.Radio(
        ["Final Brief", "Claim Ledger", "Quality Gates"],
        value="Final Brief",
        label="Choose a demo artifact",
    )
    output = gr.Markdown()
    view.change(show_demo, inputs=view, outputs=output)
    demo.load(show_demo, inputs=view, outputs=output)
    gr.Markdown(
        """
        Links: [Website](https://briefloop.ai) ·
        [GitHub](https://github.com/Stahl-G/briefloop) ·
        [PyPI](https://pypi.org/project/briefloop/)
        """
    )


if __name__ == "__main__":
    demo.launch()