Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(runners): read GUI markers only from header comments [C7,V4]

Corey Olson8fac8635b4ae
diff --git a/src/gui-admission.js b/src/gui-admission.js
index d9b3d2bc..5c1a44a2 100644
--- a/src/gui-admission.js
+++ b/src/gui-admission.js
@@ -7,11 +7,25 @@ import { explicitCheckFiles } from './browser-admission.js';
/** Only an explicit file annotation requests a GUI; --headless does not establish this capability. */
export function testsNeedGui(root, files) {
return files.some(file => {
- try { return /^\s*(?:\/\*\*?[^]*?@pullboard-test-gui\b[^]*?\*\/)/u.test(readFileSync(resolve(root, file), 'utf8')); }
+ try { return headerNeedsGui(readFileSync(resolve(root, file), 'utf8')); }
catch { return false; } // Missing files retain their normal execution failure; they cannot add an inferred capability.
});
}
+/** Read annotation lines only from leading comments, stopping before any executable source or code literal. */
+function headerNeedsGui(source) {
+ let remaining = source.replace(/^#![^\n]*(?:\n|$)/u, '').trimStart();
+ while (remaining.startsWith('/*') || remaining.startsWith('//')) {
+ const block = remaining.startsWith('/*');
+ const end = block ? remaining.indexOf('*/', 2) : remaining.indexOf('\n');
+ if (block && end < 0) return false;
+ const comment = remaining.slice(2, end < 0 ? remaining.length : end);
+ if (/^[ \t]*\*?[ \t]*@pullboard-test-gui[ \t]*\r?$/mu.test(comment)) return true;
+ remaining = end < 0 ? '' : remaining.slice(end + (block ? 2 : 1)).trimStart();
+ }
+ return false;
+}
+
/** Read the project's tracked Node test files when an opaque full gate supplies no explicit selection. */
export function projectNeedsGui(root) {
const result = spawnSync('git', ['ls-files', '-z', '--', 'test', 'tests'], { cwd: root, encoding: 'utf8', maxBuffer: 8 * 1024 ** 2 });