Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 9 additions & 23 deletions .github/workflows/smoke-enclave-issues-read.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions scripts/ci/smoke-enclave-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { applyGeneralWorkflowPatches } from './apply-general-workflow-patches';
const workflowsDir = path.resolve(__dirname, '../../.github/workflows');
const sourcePath = path.join(workflowsDir, 'smoke-enclave-build-test.md');
const lockPath = path.join(workflowsDir, 'smoke-enclave-build-test.lock.yml');
const issuesSourcePath = path.join(workflowsDir, 'smoke-enclave-issues-read.md');
const issuesLockPath = path.join(workflowsDir, 'smoke-enclave-issues-read.lock.yml');

function countOccurrences(content: string, value: string): number {
return content.split(value).length - 1;
}

describe('smoke enclave build workflow', () => {
const source = fs.readFileSync(sourcePath, 'utf8');
Expand Down Expand Up @@ -83,3 +89,43 @@ describe('smoke enclave build workflow', () => {
expect(source).not.toContain('"additionalProperties": false');
});
});

describe('smoke enclave issues workflow', () => {
const source = fs.readFileSync(issuesSourcePath, 'utf8');
const lock = fs.readFileSync(issuesLockPath, 'utf8');

it('uses one shared multi-agent MCP gateway', () => {
expect(countOccurrences(lock, '- name: Start MCP Gateway')).toBe(1);
expect(lock).not.toContain('Start Enclave GitHub Proxy');
expect(lock).not.toContain('Stop Enclave GitHub Proxy');
expect(lock).not.toContain('AWF_ENCLAVE_GITHUB_PROXY_');
expect(lock).toContain(
'"agentIds": ["${MCP_GATEWAY_AGENT_ID}","${AWF_ENCLAVE_GITHUB_MCP_AGENT_ID}"]'
);
});

it('restricts the enclave identity to the declared GitHub read surface', () => {
expect(lock).toContain(
'"${AWF_ENCLAVE_GITHUB_MCP_AGENT_ID}":{"servers":["github"],' +
'"tools":{"github":["list_issues","issue_read"]},' +
'"allow-only":{"min-integrity":"approved","repos":["github/gh-aw"]}}'
Comment on lines +112 to +116
);
expect(source).toContain('Use only the `github` MCP server');
expect(source).toContain('GitHub CLI, GraphQL, search, writes, or any other GitHub tool');
});

it('keeps the enclave identity out of the primary agent', () => {
expect(lock).toContain(
'AWF_ENCLAVE_GITHUB_MCP_AGENT_ID=$(openssl rand -base64 45'
);
expect(lock).toContain('echo "::add-mask::${AWF_ENCLAVE_GITHUB_MCP_AGENT_ID}"');
expect(lock).toContain('--exclude-env AWF_ENCLAVE_GITHUB_MCP_AGENT_ID');
expect(lock).toContain('--exclude-env MCP_GATEWAY_AGENT_ID');
});

it('tests the local AWF implementation with mcpg v0.4.15', () => {
expect(lock).toContain('ghcr.io/github/gh-aw-mcpg:v0.4.15');
expect(lock).toContain('Install awf binary (local)');
expect(lock).toContain('--build-local');
});
});
Loading