fix(antigravity): fix agent tools, sandbox permissions, and relocate global msd-core
Some checks failed
Tests / PR mergeability (push) Successful in 30s
Tests / Detect test scope (push) Successful in 21s
Tests / lint-tests (push) Failing after 3m39s
Tests / plugin-validate (push) Successful in 2m22s
Tests / test (inert CI) (push) Has been skipped
Tests / conformance test (macos-latest, 24) (push) Blocked by required conditions
Tests / conformance test (windows-latest, 24, shard 1/3) (push) Blocked by required conditions
Tests / conformance test (windows-latest, 24, shard 2/3) (push) Blocked by required conditions
Tests / Required tests (push) Blocked by required conditions
Tests / conformance test (windows-latest, 24, shard 3/3) (push) Blocked by required conditions
Tests / Base branch health (push) Successful in 12s
Tests / test (ubuntu-latest, 24, shard 1/3) (push) Failing after 20s
Tests / test (ubuntu-latest, 24, shard 2/3) (push) Failing after 19s
Tests / test (ubuntu-latest, 24, shard 3/3) (push) Failing after 19s
Tests / test (ubuntu-latest, 24) (push) Failing after 17s
Tests / QA loop walk (smell ratchet) (push) Failing after 20s
Tests / Coverage gate (merged shards) (push) Has been skipped
Tests / Publish emitted-baseline artifact (push) Has been skipped
Dismiss Unauthorized PR Approvals / dismiss-unauthorized-approval (push) Successful in 21s
Some checks failed
Tests / PR mergeability (push) Successful in 30s
Tests / Detect test scope (push) Successful in 21s
Tests / lint-tests (push) Failing after 3m39s
Tests / plugin-validate (push) Successful in 2m22s
Tests / test (inert CI) (push) Has been skipped
Tests / conformance test (macos-latest, 24) (push) Blocked by required conditions
Tests / conformance test (windows-latest, 24, shard 1/3) (push) Blocked by required conditions
Tests / conformance test (windows-latest, 24, shard 2/3) (push) Blocked by required conditions
Tests / Required tests (push) Blocked by required conditions
Tests / conformance test (windows-latest, 24, shard 3/3) (push) Blocked by required conditions
Tests / Base branch health (push) Successful in 12s
Tests / test (ubuntu-latest, 24, shard 1/3) (push) Failing after 20s
Tests / test (ubuntu-latest, 24, shard 2/3) (push) Failing after 19s
Tests / test (ubuntu-latest, 24, shard 3/3) (push) Failing after 19s
Tests / test (ubuntu-latest, 24) (push) Failing after 17s
Tests / QA loop walk (smell ratchet) (push) Failing after 20s
Tests / Coverage gate (merged shards) (push) Has been skipped
Tests / Publish emitted-baseline artifact (push) Has been skipped
Dismiss Unauthorized PR Approvals / dismiss-unauthorized-approval (push) Successful in 21s
- Map Glob, WebSearch, WebFetch to Antigravity-native tool names (find_by_name, search_web, read_url_content) and drop unmapped tools instead of lowercasing - Emit absolute, glob-free trailing-slash read_file() allow rules in settings.json and strip legacy globbed/tilde rules that crash the Antigravity terminal sandbox - Relocate global Antigravity msd-core/ and sibling scripts/ outside ~/.gemini/ to ~/.msd/antigravity/ (avoiding AGY CLI's hardcoded ~/.gemini/** protection boundary) - Update content rewriters, msd-run-resolver.md, update-context, and update.md to resolve ~/.msd/antigravity/msd-core/ and .agents/msd-core/ - Replace Discord invite link in installer banner with Golem15 Wavepath join URL
This commit is contained in:
@@ -1166,10 +1166,41 @@ process.env.MSD_TEST_MODE = '1';
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const { convertClaudeToAntigravityContent } = require('../bin/install.js');
|
||||
const { convertClaudeToAntigravityContent, setAntigravityGlobalHomePrefix } = require('../bin/install.js');
|
||||
|
||||
describe('convertClaudeToAntigravityContent bare path replacement (#2418)', () => {
|
||||
describe('global install', () => {
|
||||
// The converter writes the configHome the installer resolved. Pin it so
|
||||
// these assertions do not depend on which ~/.gemini/antigravity* dirs the
|
||||
// machine running the tests happens to have.
|
||||
const { beforeEach, afterEach } = require('node:test');
|
||||
beforeEach(() => setAntigravityGlobalHomePrefix('$HOME/.gemini/antigravity/'));
|
||||
afterEach(() => setAntigravityGlobalHomePrefix(null));
|
||||
|
||||
test('routes msd-core outside ~/.gemini/ and keeps non-msd-core configHome refs pinned', () => {
|
||||
setAntigravityGlobalHomePrefix('$HOME/.gemini/antigravity-cli/');
|
||||
const result = convertClaudeToAntigravityContent(
|
||||
'@~/.claude/msd-core/workflows/ui-phase.md\nnode "$HOME/.claude/msd-core/bin/msd-tools.cjs"\ndir = ~/.claude',
|
||||
true,
|
||||
);
|
||||
assert.strictEqual(
|
||||
result,
|
||||
'@~/.msd/antigravity/msd-core/workflows/ui-phase.md\nnode "$HOME/.msd/antigravity/msd-core/bin/msd-tools.cjs"\ndir = ~/.gemini/antigravity-cli',
|
||||
);
|
||||
});
|
||||
|
||||
test('an explicit config dir outside the home directory is written as an absolute path', () => {
|
||||
setAntigravityGlobalHomePrefix('/opt/agy-work/');
|
||||
const result = convertClaudeToAntigravityContent('@~/.claude/msd-core/x.md and $HOME/.claude/msd-core/y.md', true);
|
||||
assert.strictEqual(result, '@/opt/agy-work/msd-core/x.md and /opt/agy-work/msd-core/y.md');
|
||||
});
|
||||
|
||||
test('the pin does not move the skills dir or affect local installs', () => {
|
||||
setAntigravityGlobalHomePrefix('$HOME/.gemini/antigravity-cli/');
|
||||
assert.strictEqual(convertClaudeToAntigravityContent('ls ~/.claude/skills/', true), 'ls ~/.gemini/config/skills/');
|
||||
assert.strictEqual(convertClaudeToAntigravityContent('See ~/.claude/msd-core/', false), 'See .agents/msd-core/');
|
||||
});
|
||||
|
||||
test('replaces ~/.claude (bare, no trailing slash) with ~/.gemini/antigravity', () => {
|
||||
const input = 'configDir = ~/.claude';
|
||||
const result = convertClaudeToAntigravityContent(input, true);
|
||||
@@ -1209,7 +1240,7 @@ describe('convertClaudeToAntigravityContent bare path replacement (#2418)', () =
|
||||
const input = 'See ~/.claude/msd-core/workflows/';
|
||||
const result = convertClaudeToAntigravityContent(input, true);
|
||||
assert.ok(
|
||||
result.includes('~/.gemini/antigravity/msd-core/workflows/'),
|
||||
result.includes('~/.msd/antigravity/msd-core/workflows/'),
|
||||
`Expected path with trailing slash to be replaced, got: ${result}`
|
||||
);
|
||||
assert.ok(!result.includes('~/.claude/'), `Expected ~/ .claude/ to be fully replaced, got: ${result}`);
|
||||
@@ -1219,7 +1250,7 @@ describe('convertClaudeToAntigravityContent bare path replacement (#2418)', () =
|
||||
const input = 'See ~/.claude/msd-core/';
|
||||
const result = convertClaudeToAntigravityContent(input, true);
|
||||
// Result should contain exactly one occurrence of the replacement path
|
||||
const count = (result.match(/~\/.gemini\/antigravity\//g) || []).length;
|
||||
const count = (result.match(/~\/\.msd\/antigravity\/msd-core\//g) || []).length;
|
||||
assert.strictEqual(count, 1, `Expected exactly 1 replacement, got ${count} in: ${result}`);
|
||||
});
|
||||
|
||||
@@ -1262,12 +1293,12 @@ describe('convertClaudeToAntigravityContent bare path replacement (#2418)', () =
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps msd-core references under ~/.gemini/antigravity when a skills ref is present (#3738)', () => {
|
||||
test('routes msd-core references to ~/.msd/antigravity/msd-core when a skills ref is present (#3738)', () => {
|
||||
const input = 'Read ~/.claude/msd-core/workflows/x.md then list ~/.claude/skills/.';
|
||||
const result = convertClaudeToAntigravityContent(input, true);
|
||||
assert.ok(
|
||||
result.includes('~/.gemini/antigravity/msd-core/workflows/x.md'),
|
||||
`msd-core ref must stay under configHome, got: ${result}`
|
||||
result.includes('~/.msd/antigravity/msd-core/workflows/x.md'),
|
||||
`msd-core ref must live outside ~/.gemini/, got: ${result}`
|
||||
);
|
||||
assert.ok(
|
||||
result.includes('~/.gemini/config/skills/'),
|
||||
@@ -5909,6 +5940,49 @@ describe('#3738: antigravity global artifacts install under ~/.gemini/config', (
|
||||
'no agents dir may be created under the CLI configHome — agy never reads it (#3747 silent drop)'
|
||||
);
|
||||
});
|
||||
|
||||
// The engine (msd-core/workflows, references, bin) installs into the resolved
|
||||
// Skill and agent bodies must reference ~/.msd/antigravity/msd-core/ (outside
|
||||
// ~/.gemini/, which Antigravity CLI protects with a hardcoded boundary rule)
|
||||
// and must never point at ~/.gemini/antigravity{,-ide,-cli}/msd-core/.
|
||||
test('CLI-only install: skill and agent bodies reference ~/.msd/antigravity/msd-core/, not ~/.gemini/antigravity*', (t) => {
|
||||
const { resolveAntigravityGlobalDir } = require('../msd-core/bin/lib/runtime-homes.cjs');
|
||||
const home = createTempDir('msd-antigravity-cli-refs-');
|
||||
t.after(() => cleanup(home));
|
||||
sandboxHome(t, home);
|
||||
|
||||
const cliConfigHome = path.join(home, '.gemini', 'antigravity-cli');
|
||||
fs.mkdirSync(cliConfigHome, { recursive: true });
|
||||
const resolved = resolveAntigravityGlobalDir({ home, env: {}, existsSync: fs.existsSync });
|
||||
assert.strictEqual(resolved, cliConfigHome, 'test premise: configHome resolves to the CLI dir');
|
||||
|
||||
installRuntimeArtifacts('antigravity', resolved, 'global', RESOLVED_CORE);
|
||||
|
||||
const discoveryHome = path.join(home, '.gemini', 'config');
|
||||
const bodies = [];
|
||||
for (const dir of fs.readdirSync(path.join(discoveryHome, 'skills'))) {
|
||||
bodies.push(path.join(discoveryHome, 'skills', dir, 'SKILL.md'));
|
||||
}
|
||||
for (const file of fs.readdirSync(path.join(discoveryHome, 'agents'))) {
|
||||
bodies.push(path.join(discoveryHome, 'agents', file));
|
||||
}
|
||||
// allow-test-rule: source-text-is-the-product — installed prompt bodies are the emitted artifact.
|
||||
const validEngineRef = /(?:~|\$HOME)\/\.msd\/antigravity\/msd-core\//g;
|
||||
const blockedGeminiRef = /(?:~|\$HOME)\/\.gemini\/antigravity(?:-ide|-cli)?\/msd-core\//g;
|
||||
const wrong = [];
|
||||
let total = 0;
|
||||
for (const file of bodies.filter((f) => fs.existsSync(f))) {
|
||||
const text = fs.readFileSync(file, 'utf8');
|
||||
for (const _match of text.matchAll(validEngineRef)) {
|
||||
total += 1;
|
||||
}
|
||||
for (const match of text.matchAll(blockedGeminiRef)) {
|
||||
wrong.push(`${path.relative(discoveryHome, file)}: ${match[0]}`);
|
||||
}
|
||||
}
|
||||
assert.ok(total > 0, 'test premise: installed bodies reference the msd-core engine at ~/.msd/antigravity/msd-core/');
|
||||
assert.deepStrictEqual(wrong, [], 'no engine reference may point inside ~/.gemini/antigravity* (blocked by AGY protection boundary)');
|
||||
});
|
||||
});
|
||||
|
||||
// ── #4667 — codex installs must not keep @~/.claude includes ──────────────────
|
||||
|
||||
Reference in New Issue
Block a user