File size: 4,958 Bytes
7d20a0f
 
3d968d9
 
 
7d20a0f
3d968d9
7d20a0f
3d968d9
7d20a0f
 
3d968d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: SimpleDocReview
emoji: "πŸ“„"
colorFrom: blue
colorTo: gray
sdk: static
app_file: index.html
pinned: false
short_description: Browser-only demo of a local-first document review workflow
---

# SimpleDocReview (demo)

Upload a `.txt`, `.md`, or `.docx` file, run a local quality review, assign
reviewers, collect comments and change requests, and record approvals β€” the full
[SimpleDocReview](https://github.com/eputnam77/SimpleDocReview) workflow, with
nothing to install.

## This is a demo, not a review system

SimpleDocReview is a local-first tool: you run a small Python server on your own
machine and your documents stay on your disk. This Space is a **Static Space**,
which means Hugging Face serves files and runs no code at all β€” so there is no
Python server here, and no server-side storage.

Instead, the server's API is reimplemented in JavaScript and runs in your
browser. That makes the demo complete and private, and it also makes it
disposable:

| | Demo Space | Running it locally |
| --- | --- | --- |
| Where documents go | Your browser's IndexedDB | `uploads/` on your disk |
| Where review records go | Your browser's IndexedDB | `data/reviews.json` |
| Who else can see them | Nobody β€” they never leave the browser | Nobody |
| Survives clearing site data | No | Yes |
| Survives a different browser or device | No | n/a |
| Suitable for real approval rounds | **No** | Yes |

Use it to see what the tool does. Do not use it to hold a review you need to
keep: clear your site data, switch browsers, or open the Space on your phone,
and the workspace is empty again. Nothing is recoverable, because nothing was
ever stored anywhere but locally.

Even locally, SimpleDocReview records approvals as workflow acknowledgements
with a name and a timestamp β€” not digital signatures, and not a tamper-evident
audit trail. For document control with revision history and verifiable audit
records, upstream points at
[DocReview360](https://github.com/eputnam77/DocReview360).

## What works here

Everything in the upstream UI:

- Upload TXT, MD, and DOCX up to 5 MB, with local text extraction
- Deterministic quality review: missing sections, unresolved placeholders, vague
  language, very short documents, overlong sentences
- A reviewer directory, reviewer assignment, and per-reviewer status
- Reviewer comments, change requests, and signed approvals; a document is
  approved only once every assigned reviewer has approved
- The notification queue, with copyable message text
- The activity timeline
- Downloading the original file

Nothing is stubbed or disabled. The demo's only difference from the real thing
is where the data lives.

## About this repository

This is the **deployment repository** for the Space. The application is
developed in [SimpleDocReview](https://github.com/eputnam77/SimpleDocReview) and
vendored into [`app/`](app); `UPSTREAM.json` records exactly which upstream
commit is deployed.

Do not edit files under `app/` β€” it is a mirror, and edits are overwritten on
the next sync. Change upstream, then re-sync. See [DEPLOY.md](DEPLOY.md).

### How the Space runs

Upstream is a Python standard-library HTTP server (`app.py`) serving a vanilla
HTML/CSS/JavaScript front end (`static/`) and storing everything in local files.
A Static Space can serve the front end unchanged, but the server has to go
somewhere. It goes into the browser:

```
app/static/index.html   ->  /index.html       (upstream, with two script tags added)
app/static/app.js       ->  /static/app.js    (upstream, untouched)
app/static/styles.css   ->  /static/styles.css (upstream, untouched)
overlay/sdr-api-core.js ->  /sdr-api-core.js  app.py's API, ported to JavaScript
overlay/sdr-api-shim.js ->  /sdr-api-shim.js  IndexedDB, request interception
```

`sdr-api-shim.js` intercepts every `/api/` request upstream's `app.js` makes and
answers it from `sdr-api-core.js`, which is a port of `app.py` β€” the same routes,
the same rubric, the same status transitions, the same record shapes.

Because that port could silently drift from the Python it mirrors,
[`tests/`](tests) exists to catch it: `tests/parity/` replays a 67-request
workflow through both the real `app.py` and the JavaScript port and diffs every
response and the final record store, and `tests/browser/` drives the built site
in headless Chromium through an upload-review-assign-approve round.

### Local development

Build and preview exactly what the Space serves:

```powershell
.\scripts\build-static.ps1
python -m http.server 8000
```

Verify the port still matches upstream:

```powershell
node tests\parity\run-parity.mjs
node tests\browser\run-browser-check.mjs
```

For real feature work use the upstream repo. Application behavior belongs there;
only the build tooling, the Space card, and the browser-side API belong here.

## License

Inherited from the upstream project. See
[SimpleDocReview](https://github.com/eputnam77/SimpleDocReview).