File size: 6,130 Bytes
a424512
e52b262
 
 
 
a424512
50e7ae1
a424512
 
e52b262
 
c19ce2a
e52b262
 
 
a3d1427
c19ce2a
e52b262
c75710c
7fec228
a424512
 
e52b262
 
 
 
 
 
 
 
d401c5d
 
3eeb6e8
 
5798e95
 
 
 
2441bab
 
 
 
 
 
f191859
 
 
 
 
 
 
 
 
 
 
 
 
 
d87f640
 
f191859
 
3eeb6e8
a3d1427
 
 
 
 
f191859
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516ee53
f191859
 
 
 
 
e52b262
 
 
 
 
 
 
 
 
 
 
 
59446fc
f191859
e52b262
 
f191859
e52b262
c19ce2a
f191859
 
644a42b
e52b262
f191859
c75710c
d401c5d
 
 
 
 
644a42b
 
 
2441bab
7fec228
a3d1427
c75710c
e52b262
 
 
f191859
 
 
e52b262
 
 
 
 
f191859
 
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
title: PacketCourt
emoji: ⚖️
colorFrom: yellow
colorTo: red
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: mit
tags:
  - build-small-hackathon
  - track:backyard
  - sponsor:openbmb
  - sponsor:openai
  - sponsor:nvidia
  - achievement:welltuned
  - achievement:offbrand
  - achievement:sharing
  - achievement:fieldnotes
---

# PacketCourt

**The packet takes the stand.**

PacketCourt audits front-of-pack marketing claims against evidence printed on
the same Indian packaged-food label. It produces traceable, conservative
verdicts instead of an unexplained health score.

**Open PacketCourt:** https://build-small-hackathon-packetcourt.hf.space/

**Read the Community Article:** https://huggingface.co/blog/build-small-hackathon/packetcourtarticle

**Watch the demo:** https://youtu.be/NCc4AZwypeA

**Social post:** https://x.com/godlovesu_n/status/2066615486339744199

PacketCourt also includes a correction-driven Community Review Agent. User
feedback is bundled with the original evidence, investigation path, and
Nemotron review in a public queue. To prevent feedback poisoning, corrections
must be evidence-reviewed before they become eligible for the next router
fine-tune.

## Why PacketCourt

A packet may lead with `HIGH PROTEIN`, `MULTIGRAIN`, or `100% NATURAL` while
the material context sits elsewhere in small print. PacketCourt does not assign
a mysterious health score. It asks a narrower, auditable question:

> Does the evidence printed on this packet support the impression created by
> its front?

Every finding cites supplied label evidence, shows uncertainty, and can be
inspected as structured JSON.

## Live Architecture


![image](https://cdn-uploads.huggingface.co/production/uploads/64ca077e7fe12ecd0aaf33a9/OhEl8j8EBA-x-qgG67yW6.png)

Photo transcription uses the 1.30B-parameter OpenBMB `MiniCPM-V-4.6` through
a public ZeroGPU companion. A fine-tuned 4.4M-parameter evidence router
selects the investigation tools required by each claim. NVIDIA
`Nemotron-Mini-4B-Instruct` independently reviews the completed investigation
for evidence gaps. The main CPU Space performs deterministic evidence auditing,
whole-packet calculations, persuasion-gap analysis, and refusals. ZeroGPU is
requested only while running the vision witness or Nemotron reviewer.

## What It Audits

PacketCourt currently recognizes and audits:

- `High Protein`
- `No Added Sugar`
- `Multigrain`
- `100% Natural`
- `FSSAI Approved`
- `No Preservatives`
- `Baked Not Fried`
- `Zero Trans Fat`
- `Whole Grain`

The engine links those claims to ingredients, nutrition values, licensing
text, package size, and date evidence. It also:

- calculates whole-packet protein, sugar, sodium, and sugar-teaspoon equivalent;
- resolves relative dates such as `best before 6 months from packaging`;
- surfaces after-opening instructions;
- identifies material context omitted from the front through the
  **Persuasion Gap**;
- returns a machine-readable evidence case for every audit.

## Verdict Standard

PacketCourt uses four deliberately conservative verdicts:

| Verdict | Meaning |
|---|---|
| `SUPPORTED BY PROVIDED LABEL` | The supplied back label provides direct evidence. |
| `CONTRADICTED BY PROVIDED LABEL` | The supplied evidence conflicts with the front claim. |
| `TECHNICALLY TRUE, CONTEXT MISSING` | The claim may be true, but material context is quiet. |
| `CANNOT VERIFY` | The packet has not supplied enough evidence. |

## Product Surface

- Phone-friendly front and back photo capture
- Additive multi-angle capture for up to six front/side and six back/side photos
- OpenBMB small-model label transcription with Tesseract fallback
- Paste-text workflow for difficult or damaged labels
- Prepared cases for an immediate product walkthrough
- Fully custom responsive interface backed by a mounted Gradio engine
- Evidence citations, confidence, and transparent structured output

## Run Locally

```bash
python -m pip install -r requirements.txt
python app.py
```

## Test

```bash
pytest
python scripts/evaluate.py
python scripts/export_traces.py
```

Current deterministic evaluation result:

- `21` unit and end-to-end integration tests passing
- `35/35` golden-case checks passing across `10` cases
- `10` transparent traces exported
- `1.000` held-out accuracy on the stratified evidence-router evaluation

## Live Assets

- Public direct app: https://build-small-hackathon-packetcourt.hf.space/
- Main Gradio Space: https://huggingface.co/spaces/build-small-hackathon/packetcourt
- Public OpenBMB ZeroGPU vision companion: https://huggingface.co/spaces/build-small-hackathon/packetcourt-vision
- Public NVIDIA Nemotron reviewer: https://huggingface.co/spaces/build-small-hackathon/packetcourt-nemotron
- Public golden evaluation dataset: https://huggingface.co/datasets/build-small-hackathon/packetcourt-golden-cases
- Public transparent agent traces: https://huggingface.co/datasets/build-small-hackathon/packetcourt-traces
- Fine-tuned evidence router: https://huggingface.co/build-small-hackathon/packetcourt-evidence-router
- Public router training set: https://huggingface.co/datasets/build-small-hackathon/packetcourt-router-training
- Public community feedback queue: https://huggingface.co/datasets/build-small-hackathon/packetcourt-community-feedback
- Public Field Notes report: https://huggingface.co/datasets/build-small-hackathon/packetcourt-field-notes
- Public Codex-attributed GitHub repository: https://github.com/N-45div/PacketCourt

## Safety Boundary

PacketCourt does not declare products healthy, safe, illegal, or fraudulent.
It does not diagnose, replace professional dietary advice, or infer facts that
are absent from the supplied packet. It audits only the provided label evidence
and exposes uncertainty explicitly.

## Codex Attribution

The repository is being built with OpenAI Codex as the primary coding agent.
Codex is responsible for the initial architecture, deterministic audit engine,
tests, custom Gradio application, small-model integration, evaluation pipeline,
and deployment workflow. The git history contains Codex-attributed commits.