harbor run -t openthoughts/tasktrove-exp-rpt-issue-issue-4495harbor download openthoughts/tasktrove-exp-rpt-issue-issue-4495This task asks you to add a tiny Node.js project that mirrors an offline subset of a VoiceFocusDeviceTransformer API. The solution must run entirely offline, be runnable from the terminal, and be toggleable between two scenarios by editing a small capability file vf-capability.txt.
What you’ll implement
How to run (offline, on a Linux machine)
Notes on behavior to reproduce (offline mock)
Deliverables to create/modify in /app/
Important: The patch you implement should be self-contained and not rely on network access. It should be straightforward to switch capabilities by editing vf-capability.txt.
Before you start (showing the existing, pre-fix state) The following code blocks illustrate the expected shape of the files before you apply the patch. They are intentionally minimal placeholders to indicate the starting point. Do not reveal the fix here; you will implement the behavior described above.
# vf-capability.txt (before)
# (empty file or placeholder content; to be set to 'supported' or 'unsupported' by the user)
# src/Device.js (before)
class Device {
constructor(id) {
this.id = id;
}
}
module.exports = Device;
# src/VoiceFocusTransformDevice.js (before)
class VoiceFocusTransformDevice {
constructor(device) {
this.device = device;
}
}
module.exports = VoiceFocusTransformDevice;
# src/VoiceFocusDeviceTransformer.js (before)
class VoiceFocusDeviceTransformer {
constructor(supported) {
this._supported = !!supported;
}
isSupported() {
return this._supported;
}
createTransformDevice(device, nodeOptions) {
// In the pre-fix state, this might simply return undefined
return undefined;
}
static isSupported(spec, options) {
// Not implemented in the placeholder
return false;
}
static create(spec, options) {
// Placeholder: always return a transformer with unsupported capability
return new VoiceFocusDeviceTransformer(false);
}
}
module.exports = VoiceFocusDeviceTransformer;
# benchmark/run.js (before)
const fs = require('fs');
const Device = require('../src/Device');
const Transformer = require('../src/VoiceFocusDeviceTransformer');
const TransformDevice = require('../src/VoiceFocusTransformDevice');
const device = new Device('dummy-device');
const transformer = Transformer.create(null, {});
const transformDevice = null; // no real transform device in the placeholder
const logLine = `[${new Date().toISOString()}] Benchmark run placeholder\n`;
fs.writeFileSync('./benchmark/benchmark.log', logLine);
console.log(logLine.trim());
# benchmark/verify.sh (before)
#!/bin/sh
LOG="benchmark/benchmark.log"
if [ -f "$LOG" ]; then
echo "Log exists."
else
echo "Log not found."
fi
What to implement (the actual desired behavior)
What you should deliver
If you need clarification or examples during implementation, you can ask for guidance, but the final deliverable must be a self-contained offline harness and wrapper consistent with the described behavior.