getaero-io/gtm-eng-skills / engineering/warm-intro-scoring
warm-intro-scoring
Verifiedplays/report.ts
View on GitHub/* eslint-disable @typescript-eslint/no-explicit-any -- Ported JSON contract/parity boundary; runtime validators reject malformed values. */
import {requireEvidenceRegistry} from './guardrails';
/** The existing offline report, rendered inside a Play without changing its UI. */
import {validatePayload,compareText} from './core';
import {TEMPLATE} from './generatedtemplate';
function signature(value:any):string {
if(Array.isArray(value))return '['+value.map(signature).join(',')+']';
if(value!==null&&typeof value==='object')return '{'+Object.keys(value).sort(compareText).map(k=>JSON.stringify(k)+':'+signature(value[k])).join(',')+'}';
return JSON.stringify(value);
}
export function reviewPayload(data:any,config:any=null):Record<string,any>{
requireEvidenceRegistry(data);
const payload=validatePayload(data,config);
if(data.coverage!==undefined){if(!data.coverage||!Array.isArray(data.coverage.unresolved))throw Error('Coverage must include unresolved targets');payload.coverage=data.coverage;}
if(payload.paths.length>5000){
const catalog:any[]=[],index=new Map<string,number>();
for(const row of payload.paths)for(const [key,feature] of Object.entries(row.features)){
const id=signature(feature);let position=index.get(id);
if(position===undefined){position=catalog.length;catalog.push(feature);index.set(id,position);}
row.features[key]=position;
}
payload.feature_catalog=catalog;
}
return payload;
}
export function renderReview(data:any,config:any=null):string{
const encoded=JSON.stringify(reviewPayload(data,config)).replaceAll('<','\\u003c').replaceAll('>','\\u003e').replaceAll('&','\\u0026');
let html=TEMPLATE.replace('__TUNING_DATA__',()=>encoded);
if(data.coverage){
const esc=(v:any)=>String(v??'').replaceAll('&','&').replaceAll('<','<').replaceAll('>','>').replaceAll('"','"');
const missing=data.coverage.unresolved||[],orphans=data.coverage.review_states_without_paths||[];
// Optional plain-text notes disclose omitted candidate classes or other coverage limits.
const notes=Array.isArray(data.coverage.notes)?data.coverage.notes:[];
const note=`<section aria-label="Source coverage"><h2>Source coverage</h2><p>${missing.length} unresolved targets. ${orphans.length} prior review states retained without a current path. Export completeness: ${esc(data.coverage.export_completeness||'not verified')}.</p><ul>${missing.map((r:any)=>{const t=r.target||{},name=esc(t.name||t.id||'Unknown target'),url=t.linkedin_url;const identity=typeof url==='string'&&/^https:\/\/(?:www\.)?linkedin\.com\/in\/[^/?#\s]+\/?$/.test(url)?`<a href="${esc(url)}" target="_blank" rel="noopener noreferrer">${name}</a>`:name;return `<li>${identity} — ${esc([t.title||'Job title unknown',t.company].filter(Boolean).join(' · '))}: ${esc(r.reason)}${r.domain_check?`<div>Expected account: ${esc(r.domain_check.expected_domain||'Missing')} · Profile account: ${esc(r.domain_check.profile_domain||'Missing')} · ${esc(r.domain_check.status)}</div>`:''}</li>`;}).join('')}</ul>${notes.length?`<ul>${notes.map((n:any)=>`<li>${esc(n)}</li>`).join('')}</ul>`:''}</section>`;
html=html.replace('</main>',()=>note+'</main>');
}
return html;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |