Spaces:
Build error
Build error
Merge pull request #91 from abinaze/fix/vendor-d3-locally
Browse filesfix(frontend): vendor D3.js locally instead of loading from CDN
- .gitattributes +8 -0
- NOTICE.md +22 -6
- frontend/index.html +10 -3
- frontend/js/vendor/d3.min.js +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Vendored third-party files are committed byte-identical to their upstream
|
| 2 |
+
# source (see NOTICE.md for provenance + SHA-256 of each). Mark them -text
|
| 3 |
+
# so core.autocrlf (commonly on by default on Windows) never rewrites their
|
| 4 |
+
# line endings on checkout -- otherwise a Windows checkout would silently
|
| 5 |
+
# diverge from the documented hash while Linux/macOS/CI checkouts would not,
|
| 6 |
+
# making the file's own provenance record unverifiable on the platform this
|
| 7 |
+
# project's primary users actually develop on.
|
| 8 |
+
frontend/js/vendor/** -text
|
NOTICE.md
CHANGED
|
@@ -52,13 +52,29 @@ assumed from memory.
|
|
| 52 |
|
| 53 |
## Bundled AI models
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
| `paraphrase-multilingual-MiniLM-L12-v2` (sentence-transformers) | `processing/entity_resolver_v2.py` | Apache-2.0, per its model card |
|
| 60 |
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
---
|
| 64 |
|
|
|
|
| 52 |
|
| 53 |
## Bundled AI models
|
| 54 |
|
| 55 |
+
Following the `model_selector` tiering fix (Findings R-2/R-3/R-4), each of
|
| 56 |
+
these tasks can now load any of its three tier variants depending on the
|
| 57 |
+
detected hardware profile, not just one fixed model -- all three variants
|
| 58 |
+
per task are listed below, not just the one previously hardcoded.
|
|
|
|
| 59 |
|
| 60 |
+
| Model | Used by | Tier | License |
|
| 61 |
+
|---|---|---|---|
|
| 62 |
+
| `xx_ent_wiki_sm` | `ai/nlp_extractor.py` (NER) | low | MIT, per its own model card / `spacy-models` release metadata |
|
| 63 |
+
| `en_core_web_sm` | `ai/nlp_extractor.py` (NER) | medium (and the guaranteed fallback on low/high if the tier-specific model isn't installed) | MIT, matching the spaCy models project's stated license |
|
| 64 |
+
| `en_core_web_trf` | `ai/nlp_extractor.py` (NER) | high | MIT, per its own model card / `spacy-models` release metadata |
|
| 65 |
+
| `paraphrase-MiniLM-L3-v2` | `ai/shadow_draft_detector.py`, `processing/entity_resolver_v2.py` (embeddings) | low | Apache-2.0, per its model card |
|
| 66 |
+
| `all-MiniLM-L6-v2` | `ai/shadow_draft_detector.py`, `processing/entity_resolver_v2.py` (embeddings) | medium | Apache-2.0, per its model card |
|
| 67 |
+
| `paraphrase-multilingual-MiniLM-L12-v2` | `ai/shadow_draft_detector.py`, `processing/entity_resolver_v2.py` (embeddings) | high | Apache-2.0, per its model card |
|
| 68 |
+
|
| 69 |
+
None of the six introduces a copyleft obligation.
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## Frontend JavaScript dependencies (vendored files)
|
| 74 |
+
|
| 75 |
+
| File | Package / version | License | Source | Note |
|
| 76 |
+
|---|---|---|---|---|
|
| 77 |
+
| `frontend/js/vendor/d3.min.js` | `d3` 7.9.0 | ISC (Copyright 2010-2023 Mike Bostock) | `https://registry.npmjs.org/d3/-/d3-7.9.0.tgz`, `dist/d3.min.js` | Resolves Finding N-2/F-14: previously loaded from `cdnjs.cloudflare.com` with no working offline fallback (`window._d3Failed` was set on load failure but never read anywhere). Vendored locally instead -- same exact version as the CDN reference it replaces, so no API-compatibility change. SHA-256 of the vendored file: `f2094bbf6141b359722c4fe454eb6c4b0f0e42cc10cc7af921fc158fceb86539`. ISC is a permissive license functionally equivalent to MIT/BSD-2-Clause -- requires only that the copyright/permission notice (above) be preserved; this file's own header comment already carries it (`// https://d3js.org v7.9.0 Copyright 2010-2023 Mike Bostock`). No copyleft obligation. |
|
| 78 |
|
| 79 |
---
|
| 80 |
|
frontend/index.html
CHANGED
|
@@ -28,9 +28,16 @@
|
|
| 28 |
|
| 29 |
<!-- B-25 FIX: wrong SRI hash removed -- browsers refused to load D3 -->
|
| 30 |
<!-- breaking ALL graph visualisation (relationship graph, zoom, nodes) -->
|
| 31 |
-
<
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
</head>
|
| 35 |
<body>
|
| 36 |
|
|
|
|
| 28 |
|
| 29 |
<!-- B-25 FIX: wrong SRI hash removed -- browsers refused to load D3 -->
|
| 30 |
<!-- breaking ALL graph visualisation (relationship graph, zoom, nodes) -->
|
| 31 |
+
<!-- N-2/F-14 FIX: was CDN-loaded (cdnjs.cloudflare.com), which meant the
|
| 32 |
+
Relationship Graph tab threw an unhandled ReferenceError on load with
|
| 33 |
+
no working offline fallback (window._d3Failed was set in onerror but
|
| 34 |
+
never read anywhere -- confirmed by grep). Vendored locally instead
|
| 35 |
+
of wiring a fallback message, since a real offline-first / desktop
|
| 36 |
+
build has no good "recover" story for a missing charting library --
|
| 37 |
+
removing the network dependency entirely is the correct fix, not a
|
| 38 |
+
better error message for it. Exact same version (7.9.0) as the
|
| 39 |
+
previous CDN URL; see NOTICE.md for license + provenance. -->
|
| 40 |
+
<script src="js/vendor/d3.min.js"></script>
|
| 41 |
</head>
|
| 42 |
<body>
|
| 43 |
|
frontend/js/vendor/d3.min.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|