-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
547 lines (509 loc) · 25.5 KB
/
Copy pathindex.html
File metadata and controls
547 lines (509 loc) · 25.5 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<meta name="theme-color" content="#090d18">
<title>pubskill-lib · The Interdependent Way</title>
<meta name="description" content="Evidence-led repository audit and examination for public Git repositories.">
<link rel="stylesheet" href="https://interdependentway.org/assets/css/site.css">
<style>
.pubskill-shell { max-width: 62rem; margin: 0 auto; }
.pubskill-head { margin-bottom: 2rem; }
.pubskill-head h1 { font-size: clamp(2.8rem, 8vw, 5.8rem); margin-bottom: .8rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.choice-card { display: flex; flex-direction: column; min-height: 15rem; }
.choice-card h2 { margin: .25rem 0 .7rem; }
.choice-card p { color: var(--silver); }
.choice-card .question { color: var(--starlight); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.2rem, 2.4vw, 1.55rem); line-height: 1.35; }
.choice-card .actions { margin-top: auto; }
.choice-card[aria-current="true"] { border-color: var(--violet); box-shadow: var(--shadow); }
.product-panel { margin-top: 1.5rem; }
.product-panel[hidden], .quantity-panel[hidden], .operator-panel[hidden], .recovery-panel[hidden] { display: none; }
.audit-panel { padding: clamp(1.2rem, 4vw, 2rem); background: linear-gradient(145deg, rgba(22,33,58,.9), rgba(16,24,42,.86)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.audit-panel label, .operator-panel label { display: block; margin: .8rem 0 .4rem; color: var(--cyan); font: 700 .76rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .12em; }
.repo-field, .code-field, .count-field { width: 100%; min-height: 3.2rem; padding: .8rem .95rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--night); color: var(--starlight); font: inherit; }
.repo-field::placeholder, .code-field::placeholder { color: #6f7d98; }
.repo-field:focus, .code-field:focus, .count-field:focus { border-color: var(--violet); outline: 3px solid rgba(155,135,245,.18); outline-offset: 2px; }
.count-field { max-width: 9rem; }
.audit-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
button.button { cursor: pointer; font: inherit; }
#status { min-height: 1.6rem; margin: 1rem 0 0; color: var(--silver); }
#out { margin-top: 2rem; }
#out > h2 { overflow-wrap: anywhere; }
.finding { margin: .85rem 0; }
.finding > strong { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; }
.finding p { color: var(--starlight); }
.meta { color: var(--silver); font-size: .88rem; overflow-wrap: anywhere; }
.support-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.examiner-choices { margin-top: 1rem; }
.examiner-choices .card { min-height: 11rem; }
.boundary-note { margin-top: 1rem; }
.quantity-choices .card { min-height: 11rem; }
.quantity-panel { margin-top: 1rem; }
.access-row { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.batch-result { margin: 1rem 0 1.5rem; }
.price-line { color: var(--cyan); font-weight: 700; margin: .8rem 0; }
.promo-line { color: var(--silver); }
.repo-fields { display: grid; gap: .35rem; margin-top: .8rem; }
.site-footer a { color: var(--silver); }
@media (max-width: 780px) {
.pubskill-head h1 { font-size: clamp(2.55rem, 13vw, 4.2rem); }
.choice-grid { grid-template-columns: 1fr; }
.site-header { align-items: center; }
.primary-nav { display: flex; width: auto; }
.primary-nav a { border: 0; padding: .45rem .55rem; }
}
</style>
</head>
<body>
<a class="skip-link" href="#content">Skip to content</a>
<header class="site-header">
<a class="brand" href="https://interdependentway.org/home/" aria-label="The Interdependent Way home">
<span class="brand-mark" aria-hidden="true"><i></i><i></i><i></i></span>
<span><strong>The Interdependent Way</strong><small>public utility</small></span>
</a>
<nav class="primary-nav" aria-label="Primary navigation">
<a href="https://interdependentway.org/projects/">Projects</a>
<a href="https://github.com/The-Interdependency/pubskill-lib">Source</a>
</nav>
</header>
<main id="content" class="site-main">
<div class="pubskill-shell">
<section class="pubskill-head">
<p class="eyebrow">pubskill-lib · repository evidence</p>
<h1>What do you need to know?</h1>
<p class="lede">Choose the question first. pubskill keeps each decision surface to two options.</p>
</section>
<section class="choice-grid" aria-label="pubskill products">
<article class="card choice-card" id="audit-choice" aria-current="true">
<p class="eyebrow">Audit</p>
<h2>Repository Audit</h2>
<p class="question">Which repository claims hold up, and which fail against the evidence?</p>
<p>Three findings are free for one repository. Complete audits start at $5.</p>
<div class="actions"><button class="button" id="choose-audit" type="button">Audit</button></div>
</article>
<article class="card choice-card" id="examiner-choice">
<p class="eyebrow">Examiner</p>
<h2>Repository Examiner</h2>
<p class="question">What is actually in this codebase, how is it structured and documented, what can be measured safely, and where are the unresolved boundaries?</p>
<p>Structural examination does not require AI. Narration is optional.</p>
<div class="actions"><button class="button secondary" id="choose-examiner" type="button">Examiner</button></div>
</article>
</section>
<section class="product-panel" id="audit-panel" aria-labelledby="audit-title">
<div class="page-head">
<p class="eyebrow">Audit</p>
<h2 id="audit-title">Which repository claims hold up, and which fail against the evidence?</h2>
<p class="promo-line">Complete audits start at $5. Choose the number of repositories to see the total.</p>
<div class="support-row" aria-label="Supported Git hosts">
<span class="status status-public">GitHub</span>
<span class="status status-public">GitLab</span>
<span class="status status-public">Bitbucket</span>
<span class="status status-public">Codeberg</span>
<span class="status status-public">SourceHut</span>
</div>
</div>
<div class="choice-grid quantity-choices" aria-label="Audit quantity">
<article class="card choice-card" id="single-choice" aria-current="true">
<p class="eyebrow">One repository</p>
<h3>$5 full audit</h3>
<p>Run the three-finding preview first, then unlock the complete result.</p>
<div class="actions"><button class="button" id="choose-single" type="button">1 repository</button></div>
</article>
<article class="card choice-card" id="multiple-choice">
<p class="eyebrow">Multiple repositories</p>
<h3>Choose any quantity</h3>
<p>Choose the number of repositories. Your total updates automatically.</p>
<div class="actions"><button class="button secondary" id="choose-multiple" type="button">Multiple repositories</button></div>
</article>
</div>
<section class="quantity-panel" id="single-panel">
<div class="audit-panel">
<label for="repo">Public Git repository URL</label>
<input class="repo-field" id="repo" inputmode="url" autocomplete="url" placeholder="https://github.com/owner/repo.git">
<div class="audit-actions">
<button class="button" id="audit" type="button">Run free audit</button>
</div>
<div class="access-row">
<p class="eyebrow">Complete audit</p>
<div class="audit-actions">
<button class="button" id="pay-single" type="button">Pay $5</button>
<button class="button secondary" id="code-single" type="button">Use access code</button>
</div>
</div>
</div>
</section>
<section class="quantity-panel" id="multiple-panel" hidden>
<div class="audit-panel">
<label for="audit-count">Number of repositories</label>
<input class="count-field" id="audit-count" type="number" min="2" step="1" value="5" inputmode="numeric">
<p class="price-line" id="price-summary"></p>
<div class="repo-fields" id="multiple-fields"></div>
<div class="access-row">
<div class="audit-actions">
<button class="button" id="pay-multiple" type="button">Pay</button>
<button class="button secondary" id="code-multiple" type="button">Use access code</button>
</div>
</div>
</div>
</section>
<section class="operator-panel panel" id="operator-panel" hidden>
<p class="eyebrow">Operator access</p>
<label for="operator-code">Access code</label>
<input class="code-field" id="operator-code" type="password" autocomplete="off" placeholder="Enter access code">
<div class="audit-actions">
<button class="button" id="run-operator" type="button">Run full audit</button>
<button class="button secondary" id="cancel-operator" type="button">Cancel</button>
</div>
</section>
<section class="recovery-panel panel" id="recovery-panel" hidden>
<p class="eyebrow">Paid audit recovery</p>
<p id="recovery-copy"></p>
<div class="repo-fields" id="recovery-fields"></div>
<div class="audit-actions"><button class="button" id="recover-paid" type="button">Run purchased audits</button></div>
</section>
<div id="status" role="status" aria-live="polite"></div>
<div id="out"></div>
</section>
<section class="product-panel" id="examiner-panel" hidden aria-labelledby="examiner-title">
<div class="page-head">
<p class="eyebrow">Examiner</p>
<h2 id="examiner-title">What is actually in this codebase, how is it structured and documented, what can be measured safely, and where are the unresolved boundaries?</h2>
<p class="section-intro">The Examiner inventories source, checks safe adapters and placement boundaries, measures supported RATIOS, detects existing NARRATIVE blocks, preserves unresolved conditions as <code>hmmm</code>, and assembles repository documentation.</p>
</div>
<div class="choice-grid examiner-choices" aria-label="Examiner modes">
<article class="card">
<p class="eyebrow">Without AI</p>
<h3>Structural examination</h3>
<p>Inventory, measurable structure, safe write boundaries, RATIOS, existing narratives, documentation assembly, and unresolved boundaries.</p>
</article>
<article class="card">
<p class="eyebrow">Optional AI</p>
<h3>Examination + narration</h3>
<p>Add evidence-bound source narration. The user keeps the choice between their own AI provider and hosted AI.</p>
</article>
</div>
<div class="hmmm boundary-note">
<h3>hmmm</h3>
<p>The Examiner CLI is available now. Hosted Examiner pricing and metering remain unresolved until measured from real repository runs; they are not guessed here.</p>
</div>
</section>
</div>
</main>
<footer class="site-footer">
<div>
<strong>The Interdependent Way</strong>
<p>Evidence first. Claims remain claims until demonstrated.</p>
</div>
<div class="hmmm-boundary"><strong>hmmm</strong><span>Honest incompletion remains visible so the next action has somewhere true to begin.</span></div>
</footer>
<script>
const repo = document.getElementById("repo");
const status = document.getElementById("status");
const out = document.getElementById("out");
const auditPanel = document.getElementById("audit-panel");
const examinerPanel = document.getElementById("examiner-panel");
const auditChoice = document.getElementById("audit-choice");
const examinerChoice = document.getElementById("examiner-choice");
const singleChoice = document.getElementById("single-choice");
const multipleChoice = document.getElementById("multiple-choice");
const singlePanel = document.getElementById("single-panel");
const multiplePanel = document.getElementById("multiple-panel");
const auditCount = document.getElementById("audit-count");
const multipleFields = document.getElementById("multiple-fields");
const priceSummary = document.getElementById("price-summary");
const operatorPanel = document.getElementById("operator-panel");
const operatorCode = document.getElementById("operator-code");
const recoveryPanel = document.getElementById("recovery-panel");
const recoveryFields = document.getElementById("recovery-fields");
const recoveryCopy = document.getElementById("recovery-copy");
let activeQuantityMode = "single";
let paidRecoverySession = "";
function pricingFor(count) {
const free = Math.floor(count / 5);
const paid = count - free;
return {count, free, paid, dollars: paid * 5};
}
function validCount() {
const value = Number(auditCount.value);
if (!Number.isInteger(value) || value < 2) throw new Error("Choose at least 2 repositories.");
return value;
}
function buildRepoFields(container, count, className, existing = []) {
const values = existing.length ? existing : [...container.querySelectorAll("input")].map(input => input.value);
container.replaceChildren();
for (let index = 1; index <= count; index += 1) {
const label = document.createElement("label");
const id = `${className}-${index}`;
label.htmlFor = id;
label.textContent = `Repository ${index}`;
const input = document.createElement("input");
input.className = `repo-field ${className}`;
input.id = id;
input.inputMode = "url";
input.autocomplete = "url";
input.placeholder = `https://github.com/owner/repo-${index}.git`;
input.value = values[index - 1] || "";
container.append(label, input);
}
}
function updateMultipleFields() {
try {
const count = validCount();
buildRepoFields(multipleFields, count, "multiple-repo");
const price = pricingFor(count);
priceSummary.textContent = `${count} complete audits · $${price.dollars} total`;
document.getElementById("pay-multiple").textContent = `Pay $${price.dollars}`;
} catch (error) {
priceSummary.textContent = error.message;
}
}
function selectProduct(product) {
const auditSelected = product === "audit";
auditPanel.hidden = !auditSelected;
examinerPanel.hidden = auditSelected;
auditChoice.setAttribute("aria-current", String(auditSelected));
examinerChoice.setAttribute("aria-current", String(!auditSelected));
(auditSelected ? auditPanel : examinerPanel).scrollIntoView({behavior: "smooth", block: "start"});
}
function selectQuantityMode(mode) {
activeQuantityMode = mode;
const single = mode === "single";
singlePanel.hidden = !single;
multiplePanel.hidden = single;
singleChoice.setAttribute("aria-current", String(single));
multipleChoice.setAttribute("aria-current", String(!single));
operatorPanel.hidden = true;
recoveryPanel.hidden = true;
operatorCode.value = "";
status.textContent = "";
out.replaceChildren();
if (!single) updateMultipleFields();
}
function repoUrlsForMode(mode = activeQuantityMode) {
if (mode === "single") return [repo.value.trim()];
return [...document.querySelectorAll(".multiple-repo")].map(input => input.value.trim());
}
function add(tag, text, parent = out, className = "") {
const node = document.createElement(tag);
node.textContent = text;
if (className) node.className = className;
parent.appendChild(node);
return node;
}
function clearResults() {
status.textContent = "";
out.replaceChildren();
}
function renderFinding(f, parent) {
const card = document.createElement("article");
card.className = "card finding";
add("strong", `${f.id} — ${f.surface}`, card);
add("p", f.claim, card);
add("div", `Evidence: ${f.evidence}`, card, "meta");
add("div", `Class: ${f.class}`, card, "meta");
parent.appendChild(card);
}
function renderFullResult(result, parent) {
add("h3", result.target?.remote || "Repository", parent);
add("p", `Commit: ${result.target?.commit || "unknown"}`, parent, "meta");
add("p", `${result.findings?.length || 0} findings`, parent);
for (const finding of result.findings || []) renderFinding(finding, parent);
if (result.hmmm?.length) {
const boundary = document.createElement("section");
boundary.className = "hmmm";
add("h3", "hmmm", boundary);
const list = document.createElement("ul");
for (const item of result.hmmm) add("li", item, list);
boundary.appendChild(list);
parent.appendChild(boundary);
}
}
function renderBatch(payload) {
clearResults();
add("p", payload.operator ? "operator audit" : "paid audit", out, "eyebrow");
add("h2", `${payload.repository_count} complete audit${payload.repository_count === 1 ? "" : "s"}`);
for (const item of payload.audits || []) {
const section = document.createElement("section");
section.className = "panel batch-result";
if (item.error) {
add("h3", item.repo_url, section);
add("p", item.error, section);
} else {
renderFullResult(item.result, section);
}
out.appendChild(section);
}
}
function renderPreview(r) {
clearResults();
add("p", "free preview", out, "eyebrow");
add("h2", r.target?.remote || "Repository");
add("p", `Commit: ${r.target?.commit || "unknown"}`, out, "meta");
add("h3", `${r.total_findings ?? r.findings?.length ?? 0} findings total`);
for (const finding of r.findings || []) renderFinding(finding, out);
if (r.locked) {
const gate = document.createElement("section");
gate.className = "panel";
add("h3", "Full audit", gate);
add("p", `Preview shows the first ${r.findings.length}. The complete audit also includes remaining findings and ${r.hmmm_count || 0} unresolved constraint(s).`, gate);
const actions = document.createElement("div");
actions.className = "audit-actions";
const pay = document.createElement("button");
pay.className = "button";
pay.type = "button";
pay.textContent = "Pay $5";
pay.addEventListener("click", () => startCheckout([repo.value.trim()]));
const code = document.createElement("button");
code.className = "button secondary";
code.type = "button";
code.textContent = "Use access code";
code.addEventListener("click", () => showOperator("single"));
actions.append(pay, code);
gate.appendChild(actions);
out.appendChild(gate);
}
}
async function runAudit() {
clearResults();
status.textContent = "Running audit…";
try {
const response = await fetch("/audit", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({repo_url: repo.value})
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || "Audit failed");
renderPreview(result);
} catch (error) {
clearResults();
status.textContent = error.message;
}
}
async function startCheckout(repoUrls) {
clearResults();
status.textContent = "Creating checkout…";
try {
const response = await fetch("/checkout", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({repo_urls: repoUrls})
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || "Checkout failed");
sessionStorage.setItem("pubskill_pending_repos", JSON.stringify(repoUrls));
location.assign(result.checkout_url);
} catch (error) {
status.textContent = error.message;
}
}
function showOperator(mode) {
activeQuantityMode = mode;
operatorPanel.hidden = false;
operatorCode.focus();
operatorPanel.scrollIntoView({behavior: "smooth", block: "center"});
}
async function runOperator() {
clearResults();
status.textContent = "Running full audit…";
try {
const response = await fetch("/operator/audit", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({
code: operatorCode.value,
repo_urls: repoUrlsForMode()
})
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || "Operator audit failed");
operatorCode.value = "";
operatorPanel.hidden = true;
renderBatch(result);
} catch (error) {
status.textContent = error.message;
}
}
async function submitPaid(sessionId, repoUrls) {
const response = await fetch("/paid", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({session_id: sessionId, repo_urls: repoUrls})
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || "Paid audit failed");
sessionStorage.removeItem("pubskill_pending_repos");
renderBatch(result);
history.replaceState({}, "", "/");
}
async function loadPaid(sessionId) {
selectProduct("audit");
clearResults();
status.textContent = "Verifying payment…";
let stored = null;
try {
stored = JSON.parse(sessionStorage.getItem("pubskill_pending_repos") || "null");
} catch (_) {
stored = null;
}
if (Array.isArray(stored) && stored.length) {
try {
status.textContent = "Verifying payment and running audits…";
await submitPaid(sessionId, stored);
return;
} catch (error) {
status.textContent = error.message;
return;
}
}
try {
const response = await fetch(`/paid-info?session_id=${encodeURIComponent(sessionId)}`);
const info = await response.json();
if (!response.ok) throw new Error(info.error || "Paid audit could not be recovered");
paidRecoverySession = sessionId;
recoveryPanel.hidden = false;
recoveryCopy.textContent = `Payment covers ${info.repository_count} repository audit${info.repository_count === 1 ? "" : "s"}. Re-enter the same repository URL${info.repository_count === 1 ? "" : "s"} to verify the purchase binding.`;
buildRepoFields(recoveryFields, info.repository_count, "recovery-repo", []);
status.textContent = "Payment verified. Repository list needs to be restored.";
} catch (error) {
status.textContent = error.message;
}
}
async function recoverPaid() {
const repoUrls = [...document.querySelectorAll(".recovery-repo")].map(input => input.value.trim());
try {
status.textContent = "Verifying repository list and running audits…";
await submitPaid(paidRecoverySession, repoUrls);
recoveryPanel.hidden = true;
} catch (error) {
status.textContent = error.message;
}
}
document.getElementById("choose-audit").addEventListener("click", () => selectProduct("audit"));
document.getElementById("choose-examiner").addEventListener("click", () => selectProduct("examiner"));
document.getElementById("choose-single").addEventListener("click", () => selectQuantityMode("single"));
document.getElementById("choose-multiple").addEventListener("click", () => selectQuantityMode("multiple"));
document.getElementById("audit").addEventListener("click", runAudit);
document.getElementById("pay-single").addEventListener("click", () => startCheckout([repo.value.trim()]));
document.getElementById("pay-multiple").addEventListener("click", () => startCheckout(repoUrlsForMode("multiple")));
document.getElementById("code-single").addEventListener("click", () => showOperator("single"));
document.getElementById("code-multiple").addEventListener("click", () => showOperator("multiple"));
document.getElementById("run-operator").addEventListener("click", runOperator);
document.getElementById("cancel-operator").addEventListener("click", () => {
operatorPanel.hidden = true;
operatorCode.value = "";
});
document.getElementById("recover-paid").addEventListener("click", recoverPaid);
auditCount.addEventListener("input", updateMultipleFields);
repo.addEventListener("keydown", event => {
if (event.key === "Enter") runAudit();
});
updateMultipleFields();
const sessionId = new URLSearchParams(location.search).get("session_id");
if (sessionId) loadPaid(sessionId);
</script>
</body>
</html>