import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { lint } from '../lint-default-output.mjs';

const __dirname = dirname(fileURLToPath(import.meta.url));
const REPO = resolve(__dirname, '../..');
const FIXTURE = resolve(REPO, 'tests/fixtures/marketplace-medium');

describe('SC-3 forbidden-words lint (default-output)', () => {
  it('produces no tier1 or tier3 violations across the 6 prose CLIs', async () => {
    const { failures, warnings } = await lint(FIXTURE);
    const failureSummary = failures
      .map((f) => `[${f.cli}] tier${f.tier} "${f.word}" × ${f.count}`)
      .join('\n  ');
    assert.equal(
      failures.length,
      0,
      `SC-3 violations found:\n  ${failureSummary}\n` +
        `(${warnings.length} tier-2 warnings — informational only)`,
    );
  });
});
