abullard1 commited on
Commit
b2ac46e
·
verified ·
1 Parent(s): 93821c4

Deploy conversion @ 4150fff-space

Browse files
Files changed (4) hide show
  1. README.md +4 -1
  2. app.js +13 -5
  3. config.js +1 -1
  4. index.html +6 -6
README.md CHANGED
@@ -11,7 +11,10 @@ hf_oauth: true
11
  hf_oauth_expiration_minutes: 1440
12
  hf_oauth_scopes:
13
  - read-repos
14
- - contribute-repos
 
 
 
15
  hf_oauth_authorized_org: localgate
16
  ---
17
 
 
11
  hf_oauth_expiration_minutes: 1440
12
  hf_oauth_scopes:
13
  - read-repos
14
+ # write-repos, not contribute-repos — see audit-verdicts/README.md: each
15
+ # Space is its own OAuth app, so app-scoped contribute-repos cannot write
16
+ # the shared results repo created under another Space's app.
17
+ - write-repos
18
  hf_oauth_authorized_org: localgate
19
  ---
20
 
app.js CHANGED
@@ -24,7 +24,7 @@ import { oauthLoginUrl, oauthHandleRedirectIfPresent, uploadFiles, downloadFile,
24
  // the ?v= stamp — an unversioned nested import could load a stale module.
25
  import { keyOf, latestByKey, mergeEvents, orderItems, firstUngraded as
26
  firstUngradedPure, countComplete, stampClass, nextEpoch,
27
- standsDownTo } from "./logic.mjs?v=7d6a390-space";
28
 
29
  // Test seam: Playwright installs window.__testHub (an in-memory hub) before
30
  // any page script runs; production never defines it, so this is one inert
@@ -217,10 +217,18 @@ async function pushGuarded() {
217
  { label: "Download your log", onClick: downloadLog }]);
218
  return;
219
  }
220
- banner(/403|401/.test(String(err))
221
- ? "Your work is saved in this browser, but publishing was refused (permissions). "
222
- + "Nothing is lost use the save button to retry once it's fixed (s on a keyboard)."
223
- : "Your work is saved in this browser, but publishing to the server failed "
 
 
 
 
 
 
 
 
224
  + `(${String(err).slice(0, 80)}). Use the save button to retry (s on a keyboard).`,
225
  true, [{ label: "Download your log (send it to Samuel if this persists)",
226
  onClick: downloadLog }]);
 
24
  // the ?v= stamp — an unversioned nested import could load a stale module.
25
  import { keyOf, latestByKey, mergeEvents, orderItems, firstUngraded as
26
  firstUngradedPure, countComplete, stampClass, nextEpoch,
27
+ standsDownTo } from "./logic.mjs?v=4150fff-space";
28
 
29
  // Test seam: Playwright installs window.__testHub (an in-memory hub) before
30
  // any page script runs; production never defines it, so this is one inert
 
217
  { label: "Download your log", onClick: downloadLog }]);
218
  return;
219
  }
220
+ if (/403|forbidden/i.test(String(err))) {
221
+ // A cached token can carry outdated permissions (e.g. after a scope
222
+ // change). A fresh sign-in reissues it; localStorage keeps every event.
223
+ banner("Your work is saved in this browser, but publishing was refused "
224
+ + "(permissions). Sign in again to refresh your access — you will "
225
+ + "continue exactly where you left off.", true,
226
+ [{ label: "Sign in again", onClick: () => {
227
+ sessionStorage.removeItem("oauth"); signIn(); } },
228
+ { label: "Download your log", onClick: downloadLog }]);
229
+ return;
230
+ }
231
+ banner("Your work is saved in this browser, but publishing to the server failed "
232
  + `(${String(err).slice(0, 80)}). Use the save button to retry (s on a keyboard).`,
233
  true, [{ label: "Download your log (send it to Samuel if this persists)",
234
  onClick: downloadLog }]);
config.js CHANGED
@@ -2,7 +2,7 @@ window.CONFIG = {
2
  task: "conversion",
3
  title: "Pass 2 · rewrite fidelity — 152 items",
4
  itemsPath: "conversion_items.json",
5
- build: "7d6a390-space",
6
  landing: "You will judge whether each rewritten exam question still asks the same "
7
  + "question as the original, and whether it stands on its own without the answer "
8
  + "options. 152 items plus 3 discussable warm-ups; expect roughly 1.5–2 hours, "
 
2
  task: "conversion",
3
  title: "Pass 2 · rewrite fidelity — 152 items",
4
  itemsPath: "conversion_items.json",
5
+ build: "4150fff-space",
6
  landing: "You will judge whether each rewritten exam question still asks the same "
7
  + "question as the original, and whether it stands on its own without the answer "
8
  + "options. 152 items plus 3 discussable warm-ups; expect roughly 1.5–2 hours, "
index.html CHANGED
@@ -5,8 +5,8 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; font-src 'self'; connect-src https://huggingface.co https://*.hf.co; img-src 'self' data:; base-uri 'none'; form-action 'none'">
7
  <title>LocalGate audit</title>
8
- <link rel="stylesheet" href="style.css?v=7d6a390-space">
9
- <link rel="stylesheet" href="katex/katex.min.css?v=7d6a390-space">
10
  </head>
11
  <body>
12
  <header>
@@ -22,9 +22,9 @@
22
  <pre id="rubric-body"></pre></details>
23
  </div>
24
  <div id="controls" hidden></div>
25
- <script src="katex/katex.min.js?v=7d6a390-space"></script>
26
- <script src="katex/auto-render.min.js?v=7d6a390-space"></script>
27
- <script src="config.js?v=7d6a390-space"></script>
28
- <script type="module" src="app.js?v=7d6a390-space"></script>
29
  </body>
30
  </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; font-src 'self'; connect-src https://huggingface.co https://*.hf.co; img-src 'self' data:; base-uri 'none'; form-action 'none'">
7
  <title>LocalGate audit</title>
8
+ <link rel="stylesheet" href="style.css?v=4150fff-space">
9
+ <link rel="stylesheet" href="katex/katex.min.css?v=4150fff-space">
10
  </head>
11
  <body>
12
  <header>
 
22
  <pre id="rubric-body"></pre></details>
23
  </div>
24
  <div id="controls" hidden></div>
25
+ <script src="katex/katex.min.js?v=4150fff-space"></script>
26
+ <script src="katex/auto-render.min.js?v=4150fff-space"></script>
27
+ <script src="config.js?v=4150fff-space"></script>
28
+ <script type="module" src="app.js?v=4150fff-space"></script>
29
  </body>
30
  </html>