Skip to content

CTX in CI/CD Pipelines

AgentCTX integrates into CI/CD workflows to automate context-aware operations — running agents on pull requests, verifying trust chains, and maintaining persistent project memory.

name: AgentCTX Verify
on: [pull_request]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install @agentctx/core
- name: Verify translation signatures
run: |
node -e "
const { CryptoManager } = require('@agentctx/core');
const crypto = new CryptoManager('.context');
crypto.verifyAll('.context/translations/').then(r => {
console.log('Verified:', r.valid, '/', r.total);
if (r.invalid.length > 0) { console.error('Invalid:', r.invalid); process.exit(1); }
});
"
name: Agent Code Review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
services:
surrealdb:
image: surrealdb/surrealdb:v3
ports: ['8000:8000']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install @agentctx/core
- name: Initialize and run agent queries
run: |
node -e "
const { Gateway } = require('@agentctx/core');
const gw = new Gateway();
(async () => {
await gw.process('+m:context \"reviewing PR changes\"');
await gw.process('?k \"security patterns\" #code ^5');
await gw.process('+m:check \"OWASP compliance verified\"');
})();
"
name: Knowledge Sync
on:
push:
paths: ['docs/**']
jobs:
ingest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install @agentctx/core
- name: Ingest documentation
run: |
node -e "
const { Gateway } = require('@agentctx/core');
const gw = new Gateway();
// Ingest docs via gateway knowledge plane
gw.process('+k:ingest \"docs/\"');
"

For full-stack testing:

jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker compose up -d --build --wait
- run: |
curl -f http://localhost:3100/health
- run: docker compose down

Store CI/CD context that agents can recall across runs:

// On successful deploy
+m "deploy-v2.1.0" #team #milestone "Deployed to production, all tests green"
// On next PR, agent recalls recent deploys
?m #team #milestone @7d

Add trust verification as a required check:

- name: Verify Agent Actions
run: |
node -e "
const { CryptoManager } = require('@agentctx/core');
const crypto = new CryptoManager('.context');
crypto.verifyAll('.context/translations/').then(r => {
if (r.invalid.length > 0) {
console.error('::error::Agent translation signatures failed verification');
console.error('Invalid files:', r.invalid);
process.exit(1);
}
console.log('All', r.total, 'translations verified');
});
"