Spaces:
Running
Running
Restore original native instruction comparison for Hard Kinex tasks
Browse files- hard/app.js +3 -3
- hard/index.html +1 -1
- manifest.json +3 -3
hard/app.js
CHANGED
|
@@ -201,7 +201,7 @@ function instructionPair(task, ep) {
|
|
| 201 |
const record = candidate && candidate.initial_goal === ep.instruction && candidate.task_key === task.key ? candidate : null;
|
| 202 |
const recordedNative = record?.observed_native || (ep ? ep.native_instruction : task.native_instruction);
|
| 203 |
const measured = record?.text || (ep ? (ep.instruction || (ep.instruction_policy === 'original_native' ? recordedNative : null)) : null);
|
| 204 |
-
const reference = catalogInstructionAudit.tasks.find(item => item.
|
| 205 |
const nativeReference = !recordedNative && reference?.native ? reference : null;
|
| 206 |
const native = recordedNative || nativeReference?.native;
|
| 207 |
return {record, native, measured, nativeReference};
|
|
@@ -216,7 +216,7 @@ function instructionPanel(task,ep) {
|
|
| 216 |
const choices=[['measured',ep?'Measured':'Planned',measured],['native','Original native',native],['current','Current catalog',null]].filter(([key,,text])=>text&&(key!=='current'||(ep&&text!==measured&&text!==initial)));
|
| 217 |
const currentChanged=native&&task.catalog_instruction&&native!==task.catalog_instruction;
|
| 218 |
const description=!ep?'The current catalog instruction for the planned evaluation.':record?.kind==='scene_bound_goal'?"The measured goal with this episode's objects and targets filled in from the agent's session.":record?.kind==='native_received'?'The native instruction received by the agent during this episode.':'The task instruction supplied for this episode.';
|
| 219 |
-
return `<section class="panel instruction-panel"><div class="section-heading"><div><h2>Task instruction</h2><p>${description}</p></div><div class="segmented" aria-label="Instruction version">${choices.map(([k,label],i)=>`<button data-instruction="${k}" aria-pressed="${i===0}">${label}</button>`).join('')}</div></div>${nativeReference?`<p class="instruction-diff-note" data-native-reference><span>Native comparison uses
|
| 220 |
const comparison=k==='current'?(currentChanged?instructionDiff(native,text):null):diff;
|
| 221 |
const html=comparison?(k==='native'?comparison.original:comparison.revised):esc(text);
|
| 222 |
const note=comparison?(k==='native'?'Struck-through text was removed or replaced in the '+(ep?'measured':'planned')+' instruction.':'Highlighted text was added or replaced relative to the original native instruction.'):(native?'No changes from the original native instruction.':'Original native text is unavailable for comparison.');
|
|
@@ -506,7 +506,7 @@ const sourceConfig=await source.json();evidenceRoot=sourceConfig.evidence_root;r
|
|
| 506 |
document.querySelectorAll('[data-result-file]').forEach(link=>{link.href=resultURL(link.dataset.resultFile);});
|
| 507 |
const r=await fetch(resultURL('data.json'));if(!r.ok)throw Error('HTTP '+r.status);data=resolveEvidence(await r.json());
|
| 508 |
const ir=await fetch(resultURL('measured-instructions.json'));if(!ir.ok)throw Error('Instruction evidence unavailable');measuredInstructions=resolveEvidence(await ir.json());
|
| 509 |
-
const nr=await fetch(
|
| 510 |
try{const c=await fetch(resultURL('cost-data.json'));if(c.ok)UsageMetrics.init(resolveEvidence(await c.json()));}catch{UsageMetrics.init({episodes:{},sources:[]});}
|
| 511 |
for(const task of data.tasks){
|
| 512 |
if(task.family==='task02'){
|
|
|
|
| 201 |
const record = candidate && candidate.initial_goal === ep.instruction && candidate.task_key === task.key ? candidate : null;
|
| 202 |
const recordedNative = record?.observed_native || (ep ? ep.native_instruction : task.native_instruction);
|
| 203 |
const measured = record?.text || (ep ? (ep.instruction || (ep.instruction_policy === 'original_native' ? recordedNative : null)) : null);
|
| 204 |
+
const reference = catalogInstructionAudit.tasks.find(item => item.published_task_key === task.key && item.id === task.native_id);
|
| 205 |
const nativeReference = !recordedNative && reference?.native ? reference : null;
|
| 206 |
const native = recordedNative || nativeReference?.native;
|
| 207 |
return {record, native, measured, nativeReference};
|
|
|
|
| 216 |
const choices=[['measured',ep?'Measured':'Planned',measured],['native','Original native',native],['current','Current catalog',null]].filter(([key,,text])=>text&&(key!=='current'||(ep&&text!==measured&&text!==initial)));
|
| 217 |
const currentChanged=native&&task.catalog_instruction&&native!==task.catalog_instruction;
|
| 218 |
const description=!ep?'The current catalog instruction for the planned evaluation.':record?.kind==='scene_bound_goal'?"The measured goal with this episode's objects and targets filled in from the agent's session.":record?.kind==='native_received'?'The native instruction received by the agent during this episode.':'The task instruction supplied for this episode.';
|
| 219 |
+
return `<section class="panel instruction-panel"><div class="section-heading"><div><h2>Task instruction</h2><p>${description}</p></div><div class="segmented" aria-label="Instruction version">${choices.map(([k,label],i)=>`<button data-instruction="${k}" aria-pressed="${i===0}">${label}</button>`).join('')}</div></div>${nativeReference?`<p class="instruction-diff-note" data-native-reference><span>Native comparison uses the pinned upstream full_description reference${ep?'; native text was not recorded in this episode':''}. ${external(nativeReference.source_url,'Native source')}</span></p>`:''}${choices.map(([k,,text],i)=>{
|
| 220 |
const comparison=k==='current'?(currentChanged?instructionDiff(native,text):null):diff;
|
| 221 |
const html=comparison?(k==='native'?comparison.original:comparison.revised):esc(text);
|
| 222 |
const note=comparison?(k==='native'?'Struck-through text was removed or replaced in the '+(ep?'measured':'planned')+' instruction.':'Highlighted text was added or replaced relative to the original native instruction.'):(native?'No changes from the original native instruction.':'Original native text is unavailable for comparison.');
|
|
|
|
| 506 |
document.querySelectorAll('[data-result-file]').forEach(link=>{link.href=resultURL(link.dataset.resultFile);});
|
| 507 |
const r=await fetch(resultURL('data.json'));if(!r.ok)throw Error('HTTP '+r.status);data=resolveEvidence(await r.json());
|
| 508 |
const ir=await fetch(resultURL('measured-instructions.json'));if(!ir.ok)throw Error('Instruction evidence unavailable');measuredInstructions=resolveEvidence(await ir.json());
|
| 509 |
+
const nr=await fetch('../instruction-audit/hard.json');if(!nr.ok)throw Error('Instruction audit unavailable');catalogInstructionAudit=await nr.json();
|
| 510 |
try{const c=await fetch(resultURL('cost-data.json'));if(c.ok)UsageMetrics.init(resolveEvidence(await c.json()));}catch{UsageMetrics.init({episodes:{},sources:[]});}
|
| 511 |
for(const task of data.tasks){
|
| 512 |
if(task.family==='task02'){
|
hard/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<link rel="stylesheet" href="style.css?v=bd1a59147e1d">
|
| 11 |
<script src="usage-metrics.js?v=330e92f8eb96" defer></script>
|
| 12 |
<script src="../instruction-audit.js?v=7b5e9a418dec" defer></script>
|
| 13 |
-
<script src="app.js?v=
|
| 14 |
<link rel="stylesheet" href="policy.css">
|
| 15 |
<link rel="stylesheet" href="../instruction-audit.css?v=43163fc879ed">
|
| 16 |
</head>
|
|
|
|
| 10 |
<link rel="stylesheet" href="style.css?v=bd1a59147e1d">
|
| 11 |
<script src="usage-metrics.js?v=330e92f8eb96" defer></script>
|
| 12 |
<script src="../instruction-audit.js?v=7b5e9a418dec" defer></script>
|
| 13 |
+
<script src="app.js?v=6fde7288fba9" defer></script>
|
| 14 |
<link rel="stylesheet" href="policy.css">
|
| 15 |
<link rel="stylesheet" href="../instruction-audit.css?v=43163fc879ed">
|
| 16 |
</head>
|
manifest.json
CHANGED
|
@@ -99,8 +99,8 @@
|
|
| 99 |
"sha256": "a53108594a23b740fbb08623f6fffdda1d73608b552988a9ffda9f0944ae66a1"
|
| 100 |
},
|
| 101 |
"hard/app.js": {
|
| 102 |
-
"bytes":
|
| 103 |
-
"sha256": "
|
| 104 |
},
|
| 105 |
"hard/icon.svg": {
|
| 106 |
"bytes": 725,
|
|
@@ -112,7 +112,7 @@
|
|
| 112 |
},
|
| 113 |
"hard/index.html": {
|
| 114 |
"bytes": 3630,
|
| 115 |
-
"sha256": "
|
| 116 |
},
|
| 117 |
"hard/policy.css": {
|
| 118 |
"bytes": 1067,
|
|
|
|
| 99 |
"sha256": "a53108594a23b740fbb08623f6fffdda1d73608b552988a9ffda9f0944ae66a1"
|
| 100 |
},
|
| 101 |
"hard/app.js": {
|
| 102 |
+
"bytes": 97489,
|
| 103 |
+
"sha256": "6fde7288fba9fc3e8b7990f5fbd8c6b63560888b871bbdd6e113940cb918617c"
|
| 104 |
},
|
| 105 |
"hard/icon.svg": {
|
| 106 |
"bytes": 725,
|
|
|
|
| 112 |
},
|
| 113 |
"hard/index.html": {
|
| 114 |
"bytes": 3630,
|
| 115 |
+
"sha256": "1488e9f98a843f37801e91464261aa4a76a02531e928193ad3befe57209e31e9"
|
| 116 |
},
|
| 117 |
"hard/policy.css": {
|
| 118 |
"bytes": 1067,
|