cloudronin commited on
Commit
a97fe99
Β·
verified Β·
1 Parent(s): ac35d06

CI: sync Credenza Space (local)

Browse files
Files changed (2) hide show
  1. Dockerfile +15 -0
  2. README.md +125 -3
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1
2
+ #
3
+ # Credenza β€” the Space Dockerfile. THIS FILE IS THE ENTIRE SPACE REPO, beside
4
+ # the HF card. It is one line on purpose.
5
+ #
6
+ # HF Docker Spaces show their source to anyone. Credenza's source is private
7
+ # (build spec Β§0), so nothing but this pull may live here β€” the app is baked
8
+ # into the image by deploy/Dockerfile.app. Adding a `COPY credenza/` line to
9
+ # this file would publish the application; deploy/deploy_to_hf.py has a test
10
+ # that fails if app source ever enters the sync payload.
11
+ #
12
+ # The image tag is :latest and CI pushes it immediately before syncing the
13
+ # Space, so a rebuild here always lands on the current app.
14
+
15
+ FROM ghcr.io/cloudronin/credenza:latest
README.md CHANGED
@@ -1,10 +1,132 @@
1
  ---
2
  title: Credenza
3
- emoji: πŸ‘€
4
- colorFrom: gray
5
  colorTo: indigo
6
  sdk: docker
 
7
  pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Credenza
3
+ emoji: πŸ•―οΈ
4
+ colorFrom: blue
5
  colorTo: indigo
6
  sdk: docker
7
+ app_port: 7860
8
  pinned: false
9
+ # Built-in Space sign-in, with NO added scopes.
10
+ #
11
+ # `openid` and `profile` are implicit and are not listed here -- HF rejects them
12
+ # as scope names precisely because it always grants them. Everything HF offers on
13
+ # top (email, read-repos, write-repos, ...) is power Credenza deliberately does
14
+ # not use: it wants an identity to attribute acts to, the ledger's `who`, and
15
+ # nothing else. Storage writes go through the Space's own token rather than the
16
+ # visitor's, which is the boundary the disclosure below describes -- the operator
17
+ # holds the key material.
18
+ #
19
+ # So the honest request is the empty one. Do not add scopes here without a
20
+ # feature that needs them and a disclosure that says so.
21
+ hf_oauth: true
22
+ short_description: Perform a governed credibility review, end to end
23
  ---
24
 
25
+ # Credenza
26
+
27
+ *From the credence table: where things were tested before they were trusted.*
28
+
29
+ Upload a folder of model-credibility evidence and get a fast, honest readout of
30
+ your gaps β€” which credibility factors are missing and which weakeners fire β€”
31
+ against **ASME V&V 40** or **NASA-STD-7009B**.
32
+
33
+ The flow: upload (or try the sample) β†’ the rule router picks a standard β†’ a
34
+ hosted model reads your evidence β†’ you confirm what it understood (status only)
35
+ β†’ a free completeness + weakeners summary β†’ download the assurance package.
36
+
37
+ It reports completeness and weakeners; it does **not** stamp an Accepted /
38
+ Not-Accepted verdict β€” that's a human decision.
39
+
40
+ ## The downloadable package
41
+
42
+ "Download UofA package" gives you a zip built by the same code path as the CLI's
43
+ `uofa import`. The file that carries the assurance is `uofa.jsonld`; the report,
44
+ manifest, public key, and instructions beside it are convenience copies.
45
+
46
+ ```
47
+ unzip uofa-pack-*.zip
48
+ uofa verify uofa.jsonld --pubkey keys/demo.pub
49
+ ```
50
+
51
+ **What a valid signature means here.** Only that the file is unmodified since
52
+ this demo produced it. It is not a review and not an acceptance decision. The
53
+ signing key is a *demonstration issuer key* held by the demo, not a research or
54
+ production key, and not anyone's decision key β€” so a demo package can never be
55
+ mistaken for a formally issued one (it does not verify against the default trust
56
+ anchor; `--pubkey` is required, deliberately).
57
+
58
+ The public key travels inside the zip so verification works offline. A trust
59
+ anchor shipped inside the artifact it validates only proves self-consistency, so
60
+ compare it against this independent copy:
61
+
62
+ ```
63
+ keys/demo.pub sha256:3605a146f4880d9f7a29db6ef5629655091d2ecd0c2b9919cbe49d90d65d83c8
64
+ ```
65
+
66
+ ## Privacy
67
+
68
+ **Your documents leave this Space.** Evidence is read by a hosted model
69
+ (Together AI), so the text of what you upload is sent there to be processed.
70
+ Together's data-handling terms govern what happens to it in transit and at
71
+ rest; check them before uploading anything you would not send to a third-party
72
+ API.
73
+
74
+ What remains true: this Space stores nothing. Each request uses a temporary
75
+ directory that is deleted afterwards, and payloads are not logged by us. That
76
+ is a claim about OUR handling, not about the provider's -- turning off our own
77
+ logging does not stop theirs.
78
+
79
+ **If your evidence is confidential, do not upload it here.** Run the CLI on
80
+ your own machine instead, where a local model reads it and nothing leaves your
81
+ environment:
82
+
83
+ ```bash
84
+ pip install "uofa[extract]"
85
+ uofa extract ./evidence --pack vv40
86
+ ```
87
+
88
+ Pasting a public model card sends only text that is already public.
89
+
90
+ One exception, by design: if you generate a package, that zip is written to a
91
+ separate directory so it survives long enough for you to download it. It is
92
+ deleted when you hit "Start over", when you run another analysis, and in any
93
+ case within 30 minutes. Your uploaded documents are never retained.
94
+
95
+ ## Build & run (local)
96
+
97
+ The image is split so HF's builder stays under its 30-min limit:
98
+ `space/Dockerfile.base` carries the heavy layers (JAR, wheel, JRE, Ollama
99
+ runtime, baked ~3 GB model) and is prebuilt in CI β†’ GHCR; `space/Dockerfile` is
100
+ the thin `FROM <base> + COPY space/` that HF actually builds.
101
+
102
+ For a self-contained **local** build, build the base first (from the **repo
103
+ root** β€” it needs `src/`, `packs/`, `spec/`, and the weakener engine), then the
104
+ thin app image on top of it:
105
+
106
+ ```bash
107
+ # 1. heavy base (JAR + wheel + Ollama + ~3 GB model) β€” tagged so step 2 finds it
108
+ docker build -f space/Dockerfile.base -t ghcr.io/cloudronin/uofa-demo-base:latest .
109
+ # 2. thin app image on top, then run
110
+ docker build -f space/Dockerfile -t uofa-space .
111
+ docker run --rm -p 7860:7860 uofa-space # CPU (extraction is slow)
112
+ docker run --rm --gpus all -p 7860:7860 uofa-space # GPU (Ollama auto-detects)
113
+ ```
114
+
115
+ Then open http://localhost:7860.
116
+
117
+ Set `UOFA_SPACE_MODEL=mock` to drive the UI without running the model (returns
118
+ canned extraction data) β€” useful for development.
119
+
120
+ ## What's inside
121
+
122
+ - `app.py` β€” Gradio Blocks wizard (thin UI).
123
+ - `wizard.py` / `pipeline.py` β€” step logic and the in-process pipeline over `uofa`.
124
+ - `router.py` β€” pre-extract standard router.
125
+ - `summary.py` β€” completeness + weakeners computation.
126
+ - `Dockerfile` / `start.sh` β€” image with Ollama + JRE 17 + qwen3.5:4b baked in.
127
+
128
+ ## Deploying to a HuggingFace Space
129
+
130
+ HuggingFace Docker Spaces expect the `Dockerfile` at the Space repo root. When
131
+ publishing, place this Space's contents at the root (or mirror the `uofa` repo
132
+ and ensure the build context includes `src/`, `packs/`, and `spec/`).