-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit-record.html
More file actions
187 lines (177 loc) · 11.1 KB
/
Copy pathsubmit-record.html
File metadata and controls
187 lines (177 loc) · 11.1 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NVYHJ7BJ92"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-NVYHJ7BJ92');</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex,nofollow">
<title>Contribute a Record | JRS Benchmark</title>
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400;500&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
:root{--bg:#050505;--surface:#121212;--surface2:#1A1A1A;--rule:#2A2A2A;--text:#F2F2F2;--muted:#B3B3B3;--muted-soft:#8A8A8A;--accent:#BE9447;--accent-dim:#7A5E28;--ready:#5DBF82;--gap:#E88080}
html,body{background:var(--bg);color:var(--text);font-family:'Inter',sans-serif;line-height:1.65}
a{color:var(--accent)}.wrap{max-width:680px;margin:0 auto;padding:0 20px}
.hd{border-bottom:1px solid var(--rule);padding:16px 20px}.hd-in{max-width:680px;margin:0 auto;display:flex;justify-content:space-between;align-items:center}
.wm{font-family:'Bodoni Moda',serif;font-size:22px;color:var(--accent);text-decoration:none}.meta{font-family:'JetBrains Mono',monospace;font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-soft)}
h1{font-family:'Bodoni Moda',serif;font-weight:400;font-size:26px;margin:24px 0 8px}
.sub{font-size:13.5px;color:var(--muted)}
label.f{display:block;font-family:'JetBrains Mono',monospace;font-size:8px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-soft);margin:14px 0 5px}
input,select,textarea{width:100%;background:var(--surface2);border:1px solid var(--rule);color:var(--text);font-family:'Inter',sans-serif;font-size:13px;padding:10px 12px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.btn{font-family:'JetBrains Mono',monospace;font-size:9px;letter-spacing:.12em;text-transform:uppercase;padding:11px 18px;border:none;background:var(--accent);color:#050505;font-weight:600;cursor:pointer;margin-top:14px}
.note{font-size:12.5px;color:var(--muted-soft);border-left:2px solid var(--accent);padding:12px 15px;background:var(--surface);margin:16px 0}
.status{font-family:'JetBrains Mono',monospace;font-size:10px;letter-spacing:.06em;margin-left:12px}
.ft{border-top:1px solid var(--rule);padding:18px 20px;margin-top:26px;font-family:'JetBrains Mono',monospace;font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted-soft)}
@media(max-width:600px){.row{grid-template-columns:1fr}}
</style>
</head>
<body>
<header class="hd"><div class="hd-in"><a href="/" class="wm">JRS<span style="font-size:9px;vertical-align:super">™</span></a><div class="meta">Contribute a Record</div></div></header>
<main><div class="wrap">
<h1>Contribute a Record for Review</h1>
<p class="sub">To move beyond constructed examples, the benchmark needs real, <b>de-identified</b> records. Paste a record with all identifying details removed. It is held privately for a de-identification check before it can enter the shared review set.</p>
<div class="note"><b>Before you paste:</b> remove names, dates of birth, contact details, employee/case IDs, and anything that could identify a person or organization. The text is screened for common identifiers, but you are responsible for redaction. Do not submit anything privileged or restricted.</div>
<form id="f" onsubmit="return submitRec(event)">
<label class="f">Record text (de-identified)</label>
<textarea id="text" rows="8" required placeholder="Paste the de-identified record"></textarea>
<div class="row">
<div><label class="f">Record type (optional)</label><input id="rtype" placeholder="e.g. investigation summary"></div>
<div><label class="f">AI function involved (optional)</label>
<select id="rfunc"><option value="">-</option><option>summarization</option><option>recommendation</option><option>analysis</option><option>narrative</option><option>none / unknown</option></select></div>
</div>
<button class="btn" type="submit">Submit for review</button><span class="status" id="st"></span>
</form>
</div></main>
<footer class="ft"><div class="wrap" style="padding:0">© 2026 Phillip Wikes · JRS™ · <a href="privacy.html" style="color:inherit">Privacy</a> · confidential · not indexed</div></footer>
<script>
var U='https://pjzxkeviouofdseagvpf.supabase.co', K='sb_publishable_mkdtg6-NgJ44_JVr9vZf6Q_30BVgY4e';
function jrsSanitizeCheck(text){
var patterns=[{re:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,label:'email address'},{re:/\b\d{3}[-.\s]?\d{3}[-.\s]?\d{4}\b/g,label:'phone number'},{re:/\b\d{3}-\d{2}-\d{4}\b/g,label:'SSN'},{re:/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,label:'card number'}];
var found=[]; patterns.forEach(function(p){if(p.re.test(text))found.push(p.label);});
if(found.length){return confirm('Potential sensitive identifier detected ('+found.join(', ')+'). Confirm all personally identifiable information has been redacted before submission.');}
return true;
}
function submitRec(e){
e.preventDefault();
var t=(document.getElementById('text').value||'').trim(), st=document.getElementById('st');
if(t.length<20){st.textContent='Record too short.';st.style.color='var(--gap)';return false;}
if(!jrsSanitizeCheck(t))return false;
st.textContent='Submitting…'; st.style.color='var(--muted-soft)';
fetch(U+'/rest/v1/bench_records',{method:'POST',headers:{'apikey':K,'Authorization':'Bearer '+K,'Content-Type':'application/json','Prefer':'return=minimal'},body:JSON.stringify({text:t,record_type:document.getElementById('rtype').value||null,ai_function:document.getElementById('rfunc').value||null,kind:'real',active:false})})
.then(function(r){ if(!r.ok)throw 0; document.getElementById('f').reset(); st.textContent='Received. Held privately for de-identification review.'; st.style.color='var(--ready)'; })
.catch(function(){
try {
var sessionObj={type:'record-submission',text:t,record_type:document.getElementById('rtype').value||null,ai_function:document.getElementById('rfunc').value||null,source:'submit-record',timestamp:new Date().toISOString()};
var blob=new Blob([JSON.stringify(sessionObj,null,2)],{type:'application/json'});
var dlUrl=URL.createObjectURL(blob); var dlAnchor=document.createElement('a');
dlAnchor.href=dlUrl; dlAnchor.download='jrs-record-'+Date.now()+'.json';
document.body.appendChild(dlAnchor); dlAnchor.click(); document.body.removeChild(dlAnchor); URL.revokeObjectURL(dlUrl);
st.textContent='Server unavailable. Your record was downloaded for manual submission to info@jrsstandard.com.';
} catch(e){ st.textContent='Server unavailable. Contact info@jrsstandard.com to submit your record.'; }
st.style.color='var(--accent)';
});
return false;
}
</script>
<script>
/* JRS LINK-CLICK TELEMETRY. Added 2026-08-13. Token-less, no dependencies.
Posts to /api/telemetry, which is a real endpoint in this repository. */
/**
* Zero-Drift Telemetry Dispatcher
* Guarantees event delivery without delaying navigation or blocking the main thread.
*/
function trackClickAndNavigate(event, targetUrl, eventMetaData) {
eventMetaData = eventMetaData || {};
// 1. Prevent default immediate navigation
if (event && typeof event.preventDefault === 'function') {
event.preventDefault();
}
// 2. Construct immutable telemetry payload
var payload = JSON.stringify({
timestamp: new Date().toISOString(),
origin_url: window.location.href,
target_url: targetUrl,
meta: eventMetaData
});
// 3. Primary Dispatch: Non-blocking navigator.sendBeacon
var isDispatched = false;
if (typeof navigator !== 'undefined' && navigator.sendBeacon) {
var blob = new Blob([payload], { type: 'application/json' });
isDispatched = navigator.sendBeacon('/api/telemetry', blob);
}
// 4. Secondary Dispatch: Fetch API with keepalive flag
if (!isDispatched && typeof fetch === 'function') {
fetch('/api/telemetry', {
method: 'POST',
body: payload,
headers: { 'Content-Type': 'application/json' },
keepalive: true
}).catch(function() {
/* Swallowing non-critical network drops to prioritize UX */
});
}
// 5. Deterministic Fail-safe Navigation Fallback (150ms timeout)
setTimeout(function() {
window.location.href = targetUrl;
}, 150);
}
/* DELEGATION LAYER.
One document-level listener, so links rendered by JavaScript after load are
captured too and no per-link handler is needed anywhere.
It decides WHEN to call the dispatcher. It does not alter it.
Three classes of link are deliberately NOT routed through the dispatcher:
- /api/dl and /api/support already count inside their own 302. A redirect
cannot be blocked or raced, so it is strictly stronger than a beacon and
routing them here would double-count.
- mailto, tel, in-page anchors and downloads are not navigations to count.
- modifier and middle clicks. preventDefault on those would break "open in
new tab", so the beacon is sent WITHOUT preventDefault and the browser is
left to do what the reader asked for. */
(function(){
var COUNTED_SERVER_SIDE = /^\/api\/(dl|support)\b/;
function beacon(target, meta){
try {
var payload = JSON.stringify({
timestamp: new Date().toISOString(),
origin_url: window.location.href,
target_url: target,
meta: meta || {}
});
var sent = false;
if (navigator.sendBeacon) {
sent = navigator.sendBeacon('/api/telemetry', new Blob([payload], { type: 'application/json' }));
}
if (!sent && typeof fetch === 'function') {
fetch('/api/telemetry', { method: 'POST', body: payload,
headers: { 'Content-Type': 'application/json' }, keepalive: true }).catch(function(){});
}
} catch (e) { /* never let telemetry break a click */ }
}
document.addEventListener('click', function(ev){
try {
var a = ev.target && ev.target.closest ? ev.target.closest('a[href]') : null;
if (!a) return;
var href = a.getAttribute('href') || '';
if (!href || href.charAt(0) === '#') return;
if (/^(mailto:|tel:|javascript:)/i.test(href)) return;
if (a.hasAttribute('download')) return;
if (COUNTED_SERVER_SIDE.test(href)) return;
var label = (a.textContent || '').replace(/\s+/g, ' ').trim().slice(0, 80);
var meta = { label: label, src: 'link' };
// Modifier or middle click: the reader wants a new tab. Record it, do not
// hijack it.
if (ev.metaKey || ev.ctrlKey || ev.shiftKey || ev.altKey || ev.button !== 0) {
beacon(a.href, meta);
return;
}
if (a.target && a.target !== '_self') { beacon(a.href, meta); return; }
trackClickAndNavigate(ev, a.href, meta);
} catch (e) { /* a telemetry fault must never block navigation */ }
}, true);
})();
</script>
</body>
</html>