From 0435d0029c79a843b6945bf54462fce4919952fb Mon Sep 17 00:00:00 2001 From: Koutian Wu Date: Mon, 20 Apr 2026 13:10:40 -0500 Subject: [PATCH] fix: replace report.html GitHub issue builder with researchskills.ai redirect Remove ~100 lines of buildIssueUrl() JS that constructed GitHub issue URLs with inline markdown YAML. Replace with simple redirect to researchskills.ai/submit. Consent gating preserved. Co-Authored-By: Claude Opus 4.6 (1M context) --- extract-knowhow/templates/report.html | 108 ++------------------------ 1 file changed, 7 insertions(+), 101 deletions(-) diff --git a/extract-knowhow/templates/report.html b/extract-knowhow/templates/report.html index 63c383e..5a1a84e 100644 --- a/extract-knowhow/templates/report.html +++ b/extract-knowhow/templates/report.html @@ -113,7 +113,7 @@

🏛️ OpenScientist

After agreeing above, click "Submit" on individual skills or submit all accepted skills at once.
- +

@@ -186,7 +186,7 @@

🏛️ OpenScientist

${mkEditable(sk.description, 'ed-desc')}
- +

Domain Knowledge

${mkEditable(sk.domain_knowledge, 'ed-dk')} @@ -208,101 +208,9 @@

Common Pitfalls

${mkEditableList(sk.pitfalls, 'ed-pit')} b.textContent=open?'▼ Hide details':'▶ Show details'; } -function readEditable(parent, cls){ - const el=parent.querySelector('.'+cls); - return el?el.textContent.trim():''; -} -function readEditableList(parent, cls){ - return Array.from(parent.querySelectorAll('.'+cls)).map(e=>e.textContent.trim()).filter(Boolean); -} - -function buildIssueUrl(pi, si){ - const proj = projects[pi]; - const sk = proj.skills[si]; - const id = `sk-${pi}-${si}`; - const wrap = document.getElementById(id+'-w'); - const detail = document.getElementById(id+'-d'); - - const authorName = document.getElementById('author-name').value.trim() || 'Anonymous'; - const authorInst = document.getElementById('author-inst').value.trim(); - const authorRole = document.getElementById('author-role').value; - const author = authorName + (authorInst ? ' (' + authorInst + ')' : ''); - - // Read current (possibly edited) values from DOM - const title = readEditable(wrap, 'ed-title') || sk.title; - const desc = readEditable(wrap, 'ed-desc') || sk.description; - const dk = readEditable(detail, 'ed-dk') || sk.domain_knowledge || ''; - const rs = readEditableList(detail, 'ed-rs'); - const tools = readEditableList(detail, 'ed-tools'); - const pit = readEditableList(detail, 'ed-pit'); - - const slug = title.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,''); - const subLabel = [proj.domain, proj.subdomain].map(s=>s.split('-').map(w=>w.charAt(0).toUpperCase()+w.slice(1)).join(' ')).join(' / '); - const catLabel = CAT[sk.category] || sk.category; - const date = DATA.date || new Date().toISOString().slice(0,10); - - const skillMd = `--- -name: ${slug} -description: > - ${desc} -domain: ${proj.domain} -subdomain: ${proj.subdomain} -category: ${sk.category} -author: "${author}" -expertise_level: intermediate -tags: [] -dependencies: [] -version: 1.0.0 -status: draft -reviewed_by: [] ---- - -## Purpose - -${desc} - -## Tools - -${tools.length ? tools.map(t=>'- **'+t.split(' — ')[0]+'**'+(t.includes(' — ')?': '+t.split(' — ').slice(1).join(' — '):'')).join('\n') : '- N/A'} - -## Domain Knowledge - -### Key Concepts - -${dk || 'N/A'} - -## Reasoning Protocol - -${rs.length ? rs.map((s,i)=>'Step '+(i+1)+': '+s).join('\n') : 'N/A'} - -## Common Pitfalls - -${pit.length ? pit.map(p=>'- '+p).join('\n') : '- N/A'} - -## References - -- Extracted by /extract-knowhow on ${date} -- Source project: ${proj.name}`; - - const params = new URLSearchParams({ - template: '01-submit-skill.yml', - title: 'Skill Submission: ' + slug, - english_name: authorName, - role: authorRole || '', - affiliation: authorInst || '', - subdomain: subLabel, - category: sk.category + ' — ' + catLabel, - skill_content: skillMd, - generation_method: 'Generated by /extract-knowhow, then reviewed by me', - notes: 'Confidence: ' + sk.confidence - }); - - return 'https://github.com/OpenScientists/OpenScientist/issues/new?' + params.toString(); -} - -function openIssue(pi, si){ +function openIssue(){ if(!consentGiven){ alert('Please agree to the submission terms first.'); return; } - window.open(buildIssueUrl(pi, si), '_blank'); + window.open('https://researchskills.ai/submit', '_blank'); } function submitAll(){ @@ -310,14 +218,12 @@

Common Pitfalls

${mkEditableList(sk.pitfalls, 'ed-pit')} let count = 0; projects.forEach((proj, pi) => { proj.skills.forEach((sk, si) => { - const id = `sk-${pi}-${si}`; - if(!document.getElementById(id).checked) return; - window.open(buildIssueUrl(pi, si), '_blank'); - count++; + if(document.getElementById(`sk-${pi}-${si}`).checked) count++; }); }); if(count===0){alert('No skills selected.');return} - document.getElementById('submit-msg').textContent = '✓ Opened ' + count + ' GitHub issue tab(s). Review and submit each one.'; + window.open('https://researchskills.ai/submit', '_blank'); + document.getElementById('submit-msg').textContent = '✓ ' + count + ' skill(s) selected. Submit them at researchskills.ai.'; document.getElementById('output').style.display = 'block'; }