/** * gsd-executor agent — MVP+TDD gate section contract * Verifies the agent definition contains a section instructing the executor * to halt and report when the runtime gate trips. */ const { test, describe } = require('node:test'); const assert = require('node:assert/strict'); const fs = require('fs'); const path = require('path'); const AGENT = path.join(__dirname, '..', 'agents', 'gsd-executor.md'); const REF = path.join(__dirname, '..', 'get-shit-done', 'references', 'execute-mvp-tdd.md'); describe('gsd-executor — MVP+TDD gate section', () => { const content = fs.readFileSync(AGENT, 'utf-8'); test('agent defines an MVP+TDD Gate section', () => { assert.match(content, /MVP\+TDD\s*Gate|MVP[\s-]?TDD[\s-]?gate/i, 'must label the gate'); }); test('agent instructs halt-and-report when gate trips', () => { assert.match(content, /halt|stop[^\n]*gate|gate[^\n]*halt/i, 'must instruct halt'); assert.match(content, /report|surface|emit/i, 'must instruct report'); }); test('agent references execute-mvp-tdd.md', () => { assert.match(content, /execute-mvp-tdd\.md/, 'must reference the gate semantics file'); }); test('referenced file exists on disk', () => { assert.ok(fs.existsSync(REF), `${REF} must exist`); }); });