refactor: drop 12 runtimes, keep Claude, Codex, OpenCode, Cursor, ZCode, Antigravity
Removes kilo, kimi, kimi-code, copilot, windsurf, augment, trae, qwen, hermes, cline, codebuddy and pi end to end: capability descriptors, installer branches and converters (bin/install.js 14.9k -> 11.2k lines), TypeScript converters, hook surfaces and runtime homes, review lanes qwen/kimi-code, the two pi migrations, Kimi payload normalization in the hook guards, dead hostBehaviors vocabulary, launcher home probes, fixtures, runtime-specific tests and the prose that presented them as supported. Installer output for the six kept runtimes is byte-identical to before the prune. The Kimi tool-vocabulary tests in workflow-guard, read-guard and read-injection-scanner are left in place pending a decision.
This commit is contained in:
@@ -7,31 +7,27 @@
|
||||
* (such as AGENTS.md) that would become an untracked source of truth running
|
||||
* in parallel with the canonical CONTEXT.md and docs/adr/ records.
|
||||
*
|
||||
* Context: bin/install.js (local Copilot install path, issue #786) writes an
|
||||
* AGENTS.md to process.cwd() when `msd install copilot` is run inside a repo
|
||||
* checkout. If that file is ever committed, editors and AI tools that auto-load
|
||||
* repo-root instruction files will silently pick up MSD's installer-generated
|
||||
* Context: historically bin/install.js (the since-retired local Copilot install
|
||||
* path, issue #786) wrote an AGENTS.md to process.cwd() when run inside a repo
|
||||
* checkout. If such a file is ever committed, editors and AI tools that auto-load
|
||||
* repo-root instruction files will silently pick up an installer-generated
|
||||
* stub rather than the authoritative documentation. This test ensures that
|
||||
* artefact never lands in source control.
|
||||
*/
|
||||
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { runGit, runNode } = require('./helpers/process-seam.cjs');
|
||||
const { GIT_TIMEOUT_MS, INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
const { INSTALL_SCRIPT, installerEnv } = require('./helpers/install-shared.cjs');
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
const { runGit } = require('./helpers/process-seam.cjs');
|
||||
const { GIT_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
|
||||
test('repo-layout: root AGENTS.md is not git-tracked — no ad-hoc AI instruction file committed alongside CONTEXT.md', () => {
|
||||
// The installer legitimately writes AGENTS.md to process.cwd() when
|
||||
// `msd install copilot` runs inside a repo checkout (issue #786). The file
|
||||
// may exist on disk — that's expected after a local install. What must NOT
|
||||
// happen is committing it to git, where editors and AI tools would silently
|
||||
// pick up the installer-generated stub instead of CONTEXT.md.
|
||||
// An installer-generated AGENTS.md may exist on disk after a local install
|
||||
// (historically the Copilot path, issue #786). What must NOT happen is
|
||||
// committing it to git, where editors and AI tools would silently pick up
|
||||
// the installer-generated stub instead of CONTEXT.md.
|
||||
const r = runGit(['ls-files', '--error-unmatch', 'AGENTS.md'], {
|
||||
cwd: ROOT, timeoutMs: GIT_TIMEOUT_MS,
|
||||
});
|
||||
@@ -41,9 +37,9 @@ test('repo-layout: root AGENTS.md is not git-tracked — no ad-hoc AI instructio
|
||||
false,
|
||||
[
|
||||
'root AGENTS.md must not be git-tracked.',
|
||||
'This file is written by `msd install copilot` (bin/install.js, local Copilot path, issue #786)',
|
||||
'when the installer runs inside a repo checkout — its presence on disk is fine,',
|
||||
'but it must never be committed.',
|
||||
'Installer-generated instruction stubs (historically issue #786) may land on disk',
|
||||
'when the installer runs inside a repo checkout — their presence on disk is fine,',
|
||||
'but they must never be committed.',
|
||||
'The repository source of truth for architecture and contributor guidance is',
|
||||
'CONTEXT.md and docs/adr/ — not an installer-generated instruction stub.',
|
||||
'Run `git rm --cached AGENTS.md` to untrack it if accidentally staged.',
|
||||
@@ -51,63 +47,6 @@ test('repo-layout: root AGENTS.md is not git-tracked — no ad-hoc AI instructio
|
||||
);
|
||||
});
|
||||
|
||||
test('repo-layout: installer writes AGENTS.md for a LOCAL Copilot install (cwd), confirming the artifact is scoped', () => {
|
||||
// Behavioral replacement for a source-grep/brace-walk assertion (#3466):
|
||||
// runs the REAL installer (`bin/install.js --copilot --local`) with its cwd
|
||||
// pointed at an isolated temp dir, and asserts AGENTS.md is actually written
|
||||
// there. This directly observes the file-output side effect the guard
|
||||
// controls, rather than parsing install.js's lexical structure.
|
||||
const localRoot = createTempDir('msd-repo-layout-copilot-local-');
|
||||
try {
|
||||
const result = runNode(
|
||||
[INSTALL_SCRIPT, '--copilot', '--local'],
|
||||
{ cwd: localRoot, env: installerEnv({ HOME: localRoot, USERPROFILE: localRoot }), timeoutMs: INSTALL_TIMEOUT_MS },
|
||||
);
|
||||
assert.strictEqual(
|
||||
result.exitCode, 0,
|
||||
`local Copilot install must exit 0\nstdout: ${result.stdout}\nstderr: ${result.stderr}`
|
||||
);
|
||||
assert.ok(
|
||||
fs.existsSync(path.join(localRoot, 'AGENTS.md')),
|
||||
'a LOCAL Copilot install (issue #786) must write AGENTS.md to its cwd — ' +
|
||||
'if this ever stops happening, Copilot CLI loses its primary repo-root instructions file',
|
||||
);
|
||||
} finally {
|
||||
cleanup(localRoot);
|
||||
}
|
||||
});
|
||||
|
||||
test('repo-layout: installer does NOT write AGENTS.md for a GLOBAL Copilot install, confirming the commit risk is scoped', () => {
|
||||
// Companion to the local-install test above (#3466): a GLOBAL Copilot
|
||||
// install is already covered by ~/.copilot/copilot-instructions.md (per
|
||||
// the comment at the `if (!isGlobal)` guard's call site in bin/install.js),
|
||||
// so it must NOT also write a repo-root AGENTS.md. Both the cwd AND the
|
||||
// global --config-dir are isolated temp dirs distinct from this checkout,
|
||||
// so even if the guard under test were broken, this run cannot pollute the
|
||||
// real repository root.
|
||||
const globalCwd = createTempDir('msd-repo-layout-copilot-global-cwd-');
|
||||
const globalConfigDir = createTempDir('msd-repo-layout-copilot-global-config-');
|
||||
try {
|
||||
const result = runNode(
|
||||
[INSTALL_SCRIPT, '--copilot', '--global', '--config-dir', globalConfigDir],
|
||||
{ cwd: globalCwd, env: installerEnv({ HOME: globalCwd, USERPROFILE: globalCwd }), timeoutMs: INSTALL_TIMEOUT_MS },
|
||||
);
|
||||
assert.strictEqual(
|
||||
result.exitCode, 0,
|
||||
`global Copilot install must exit 0\nstdout: ${result.stdout}\nstderr: ${result.stderr}`
|
||||
);
|
||||
assert.equal(
|
||||
fs.existsSync(path.join(globalCwd, 'AGENTS.md')), false,
|
||||
'a GLOBAL Copilot install must NOT write AGENTS.md to the working directory — ' +
|
||||
'that artifact is scoped to local installs only (issue #786); a global install is ' +
|
||||
'already covered by ~/.copilot/copilot-instructions.md',
|
||||
);
|
||||
} finally {
|
||||
cleanup(globalCwd);
|
||||
cleanup(globalConfigDir);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────
|
||||
// Folded from tests/enh-191-retire-sdk-package.test.cjs — consolidation epic #1969 (B5 #1974)
|
||||
|
||||
Reference in New Issue
Block a user