Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

ci: real ESLint baseline, Windows fixes for vendor-ink and tests

Salman Qureshia3790ae6bd31
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 20abb740..719c560b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,9 +39,6 @@ jobs:
lint:
name: Lint (tsc + ESLint ratchet)
- # Provisional baseline (grep estimate): non-blocking until the first real
- # run refreshes .lint-baseline.json with `npm run lint:ratchet -- --update`.
- continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
diff --git a/.lint-baseline.json b/.lint-baseline.json
index 45642a4d..79e9ff09 100644
--- a/.lint-baseline.json
+++ b/.lint-baseline.json
@@ -1,10 +1,24 @@
{
- "$comment": "PROVISIONAL baseline estimated with grep (scripts/lint-ratchet.cjs --estimate); refresh with `npm run lint:ratchet -- --update` at the first real ESLint run.",
- "provisional": true,
- "generatedAt": "2026-10-09T16:36:45.641Z",
+ "$comment": "ESLint ratchet baseline from the first real CI run (PR #149). Counts may only go down; refresh deliberately with `npm run lint:ratchet -- --update`.",
+ "provisional": false,
+ "generatedAt": "2026-10-09T17:40:48.203Z",
"target": "src",
"rules": {
- "@typescript-eslint/no-explicit-any": 1163,
- "no-console": 134
+ "(unknown)": 1,
+ "@typescript-eslint/no-explicit-any": 1159,
+ "@typescript-eslint/no-require-imports": 6,
+ "@typescript-eslint/no-this-alias": 5,
+ "@typescript-eslint/no-unused-expressions": 100,
+ "@typescript-eslint/no-unused-vars": 281,
+ "no-console": 135,
+ "no-control-regex": 27,
+ "no-func-assign": 5,
+ "no-prototype-builtins": 8,
+ "no-undef": 7,
+ "no-unexpected-multiline": 1,
+ "no-useless-escape": 5,
+ "prefer-const": 4,
+ "react-hooks/exhaustive-deps": 2,
+ "require-yield": 9
}
}
diff --git a/scripts/vendor-ink.cjs b/scripts/vendor-ink.cjs
index c5b36447..a8e8314e 100644
--- a/scripts/vendor-ink.cjs
+++ b/scripts/vendor-ink.cjs
@@ -59,7 +59,7 @@ function obtainTarball(explicit, tmp) {
return explicit;
}
console.log(` fetching ink@${INK_VERSION} with npm pack …`);
- execFileSync('npm', ['pack', `ink@${INK_VERSION}`, '--pack-destination', tmp], { stdio: ['ignore', 'ignore', 'inherit'] });
+ execFileSync('npm', ['pack', `ink@${INK_VERSION}`, '--pack-destination', tmp], { stdio: ['ignore', 'ignore', 'inherit'], shell: process.platform === 'win32' });
const found = fs.readdirSync(tmp).find((f) => f.startsWith('ink-') && f.endsWith('.tgz'));
if (!found) throw new Error('npm pack produced no tarball');
return path.join(tmp, found);
diff --git a/src/capabilities/permissions.test.ts b/src/capabilities/permissions.test.ts
index 8f7c891a..e22b0a91 100644
--- a/src/capabilities/permissions.test.ts
+++ b/src/capabilities/permissions.test.ts
@@ -201,7 +201,9 @@ describe('PermissionManager remote safety', () => {
expect(ask).toHaveBeenCalledTimes(8);
});
- it('does not classify wc --files0-from as a safe read (indirect path deref)', async () => {
+ // POSIX read tools (wc/find/du/head) are not in the pinned Windows dirs, so
+ // there they always prompt (ADR-016); the auto-approve half is POSIX-only.
+ it.skipIf(process.platform === 'win32')('does not classify wc --files0-from as a safe read (indirect path deref)', async () => {
const permissions = new PermissionManager();
const manifest = permissions.getManifest();
manifest.capabilities.shell.enabled = true;
@@ -220,7 +222,9 @@ describe('PermissionManager remote safety', () => {
expect(ask).toHaveBeenCalledTimes(3);
});
- it('find -fprint/-fprintf/-files0-from are side-effectful or indirect — require approval', async () => {
+ // POSIX read tools (wc/find/du/head) are not in the pinned Windows dirs, so
+ // there they always prompt (ADR-016); the auto-approve half is POSIX-only.
+ it.skipIf(process.platform === 'win32')('find -fprint/-fprintf/-files0-from are side-effectful or indirect — require approval', async () => {
const permissions = new PermissionManager();
const manifest = permissions.getManifest();
manifest.capabilities.shell.enabled = true;
@@ -243,7 +247,9 @@ describe('PermissionManager remote safety', () => {
expect(ask).toHaveBeenCalledTimes(4);
});
- it('requires approval for safe-read commands that rely on shell expansion', async () => {
+ // POSIX read tools (wc/find/du/head) are not in the pinned Windows dirs, so
+ // there they always prompt (ADR-016); the auto-approve half is POSIX-only.
+ it.skipIf(process.platform === 'win32')('requires approval for safe-read commands that rely on shell expansion', async () => {
const permissions = new PermissionManager();
const manifest = permissions.getManifest();
manifest.capabilities.shell.enabled = true;
diff --git a/src/channels/cli-mercury-code-exit.test.ts b/src/channels/cli-mercury-code-exit.test.ts
index ab54d179..932d6ff8 100644
--- a/src/channels/cli-mercury-code-exit.test.ts
+++ b/src/channels/cli-mercury-code-exit.test.ts
@@ -1,7 +1,5 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { readFileSync } from 'node:fs';
-import { mkdtempSync, rmSync } from 'node:fs';
-import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
@@ -16,8 +14,10 @@ describe('Mercury Code exit paths', () => {
it('exitMercuryCode tears down Mercury Code state and returns to chat', async () => {
const channel = new CLIChannel();
- const dir = mkdtempSync(join(tmpdir(), 'mercury-code-exit-'));
- try {
+ // Enter on the repo cwd: entering spawns async git reads with the dir as
+ // cwd, and Windows keeps a temp dir locked while they run.
+ const dir = process.cwd();
+ {
const entered = channel.enterMercuryCode(dir, 'test');
expect(entered.ok).toBe(true);
expect(channel.getTuiState().mode).toBe('mercury-code');
@@ -32,11 +32,8 @@ describe('Mercury Code exit paths', () => {
expect(state.mercuryCode).toBeNull();
expect(state.programmingMode).toBe('off');
expect(state.exitEscArmed).toBe(false);
- } finally {
- // Wait for the async git header read started by enterMercuryCode;
- // Windows keeps the directory locked while that child runs.
+ // Let the async git header read finish before the test ends.
await channel.refreshMercuryCodeGit();
- rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });
}
});