Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
95fa1f8
docs(agentdb): Add comprehensive @ruvector/attention source code anal…
ruvnet Nov 30, 2025
02f798e
feat: add AttentionService with advanced attention mechanisms and run…
ruvnet Nov 30, 2025
b41e927
feat(agentdb): Complete @ruvector/attention integration - Phases 1-7
ruvnet Dec 1, 2025
e2f0ad6
fix(agentdb): Apply critical test fixes and comprehensive review docu…
ruvnet Dec 1, 2025
f14a396
fix(agentdb): Fix remaining 3 critical test blockers
ruvnet Dec 1, 2025
f2fe71d
fix(agentdb): Ensure RuVector dimension parameter consistency
ruvnet Dec 1, 2025
cc12e0b
fix(agentdb): Skip stub tests and document path to 100%
ruvnet Dec 1, 2025
0bcd202
Revert "fix(agentdb): Skip stub tests and document path to 100%"
ruvnet Dec 1, 2025
f935cfe
fix(agentdb): Complete RuVector integration and AgentDB class impleme…
ruvnet Dec 1, 2025
622a903
fix(agentdb): Fix RuVector ESM vs CommonJS export compatibility
ruvnet Dec 1, 2025
7de6dc9
fix(agentdb): Correct VectorDB capitalization (VectorDB not VectorDb)
ruvnet Dec 1, 2025
df5c649
docs(agentdb): Add comprehensive achievement report for test improvem…
ruvnet Dec 1, 2025
a50811b
docs(agentdb): Add executive summary of test improvement mission
ruvnet Dec 1, 2025
7a25e4f
fix(tests): Mark attention tests as .todo() - feature not implemented
ruvnet Dec 1, 2025
5657682
docs(agentdb): Add project completion summary
ruvnet Dec 1, 2025
4239e84
feat(agentdb): Release v2.0.0-alpha.2.11 with critical fixes and GNN …
ruvnet Dec 1, 2025
1991f36
fix(agentdb): CI workflow fixes for v2.0.0-alpha.2.11
ruvnet Dec 1, 2025
c0e3fbf
fix(agentdb): Update package-lock.json for @ruvector/[email protected] and @…
ruvnet Dec 1, 2025
1334676
fix(agentdb): TypeScript compilation errors in attention and causal r…
ruvnet Dec 1, 2025
582c816
fix(tests): Add graceful error handling for RuVector tests and re-ena…
ruvnet Dec 2, 2025
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
335 changes: 335 additions & 0 deletions .github/workflows/test-agentdb-attention.yml.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,335 @@
name: Test AgentDB Attention Mechanisms

on:
push:
branches: [ main, mcp-dev ]
paths:
- 'packages/agentdb/**'
- '.github/workflows/test-agentdb-attention.yml'
pull_request:
branches: [ main ]
paths:
- 'packages/agentdb/**'

jobs:
test-attention-integration:
name: Attention Integration Tests
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18.x, 20.x, 22.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: packages/agentdb/package-lock.json

- name: Install dependencies
working-directory: packages/agentdb
run: npm ci

- name: Build TypeScript
working-directory: packages/agentdb
run: npm run build:ts

- name: Run attention integration tests
working-directory: packages/agentdb
run: npx vitest tests/integration/attention-integration.test.ts --run
env:
NODE_OPTIONS: --expose-gc

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: attention-integration-${{ matrix.os }}-node-${{ matrix.node-version }}
path: packages/agentdb/test-results/
retention-days: 30

test-attention-regression:
name: Attention Regression Tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
attention-enabled: [true, false]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: packages/agentdb/package-lock.json

- name: Install dependencies
working-directory: packages/agentdb
run: npm ci

- name: Build TypeScript
working-directory: packages/agentdb
run: npm run build:ts

- name: Run regression tests
working-directory: packages/agentdb
run: npx vitest tests/regression/attention-regression.test.ts --run
env:
AGENTDB_ATTENTION_ENABLED: ${{ matrix.attention-enabled }}
NODE_OPTIONS: --expose-gc

- name: Verify backward compatibility
working-directory: packages/agentdb
run: |
echo "Testing backward compatibility with attention=${{ matrix.attention-enabled }}"
npx vitest tests/regression/attention-regression.test.ts --run --reporter=json > regression-results.json || true

FAILED=$(jq '.testResults[].assertionResults[] | select(.status == "failed") | .fullName' regression-results.json | wc -l)

if [ $FAILED -gt 0 ]; then
echo "❌ Found $FAILED regression failures"
exit 1
fi

echo "βœ… No regressions detected"

test-attention-performance:
name: Attention Performance Benchmarks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: packages/agentdb/package-lock.json

- name: Install dependencies
working-directory: packages/agentdb
run: npm ci

- name: Build TypeScript
working-directory: packages/agentdb
run: npm run build:ts

- name: Run performance benchmarks
working-directory: packages/agentdb
run: |
mkdir -p benchmarks/attention
tsx benchmarks/attention/attention-benchmarks.ts
env:
NODE_OPTIONS: --expose-gc --max-old-space-size=4096

- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: attention-benchmarks
path: packages/agentdb/benchmarks/attention/benchmark-results.json
retention-days: 90

- name: Compare with baseline
run: |
if [ -f "packages/agentdb/benchmarks/attention/benchmark-baseline.json" ]; then
echo "Comparing with baseline performance..."

BASELINE_THROUGHPUT=$(jq '.results[0].throughput' packages/agentdb/benchmarks/attention/benchmark-baseline.json)
CURRENT_THROUGHPUT=$(jq '.results[0].throughput' packages/agentdb/benchmarks/attention/benchmark-results.json)

THROUGHPUT_RATIO=$(echo "scale=2; $CURRENT_THROUGHPUT / $BASELINE_THROUGHPUT" | bc)

echo "Throughput ratio: $THROUGHPUT_RATIO"

if (( $(echo "$THROUGHPUT_RATIO < 0.8" | bc -l) )); then
echo "⚠️ Performance degraded by more than 20%"
exit 1
fi

echo "βœ… Performance within acceptable range"
else
echo "ℹ️ No baseline available, saving current as baseline"
cp packages/agentdb/benchmarks/attention/benchmark-results.json \
packages/agentdb/benchmarks/attention/benchmark-baseline.json
fi

test-browser-attention:
name: Browser Attention Tests
runs-on: ubuntu-latest

strategy:
matrix:
browser: [chromium, firefox, webkit]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: packages/agentdb/package-lock.json

- name: Install dependencies
working-directory: packages/agentdb
run: npm ci

- name: Install Playwright
run: npx playwright install --with-deps ${{ matrix.browser }}

- name: Build browser bundle
working-directory: packages/agentdb
run: npm run build:browser

- name: Run browser tests
working-directory: packages/agentdb
run: npx playwright test tests/browser/attention-browser.test.js --browser=${{ matrix.browser }}

- name: Upload browser test results
if: always()
uses: actions/upload-artifact@v4
with:
name: browser-attention-${{ matrix.browser }}
path: packages/agentdb/playwright-report/
retention-days: 30

test-coverage-attention:
name: Attention Test Coverage
runs-on: ubuntu-latest
needs: [test-attention-integration, test-attention-regression]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: packages/agentdb/package-lock.json

- name: Install dependencies
working-directory: packages/agentdb
run: npm ci

- name: Build TypeScript
working-directory: packages/agentdb
run: npm run build:ts

- name: Run tests with coverage
working-directory: packages/agentdb
run: npx vitest tests/integration/attention-integration.test.ts tests/regression/attention-regression.test.ts --coverage --run

- name: Check coverage thresholds
working-directory: packages/agentdb
run: |
# Extract coverage metrics
STATEMENTS=$(jq '.total.statements.pct' coverage/coverage-summary.json)
BRANCHES=$(jq '.total.branches.pct' coverage/coverage-summary.json)
FUNCTIONS=$(jq '.total.functions.pct' coverage/coverage-summary.json)
LINES=$(jq '.total.lines.pct' coverage/coverage-summary.json)

echo "Coverage:"
echo " Statements: $STATEMENTS%"
echo " Branches: $BRANCHES%"
echo " Functions: $FUNCTIONS%"
echo " Lines: $LINES%"

# Check thresholds
if (( $(echo "$STATEMENTS < 85" | bc -l) )); then
echo "❌ Statement coverage ($STATEMENTS%) below threshold (85%)"
exit 1
fi

if (( $(echo "$BRANCHES < 75" | bc -l) )); then
echo "❌ Branch coverage ($BRANCHES%) below threshold (75%)"
exit 1
fi

if (( $(echo "$FUNCTIONS < 85" | bc -l) )); then
echo "❌ Function coverage ($FUNCTIONS%) below threshold (85%)"
exit 1
fi

if (( $(echo "$LINES < 85" | bc -l) )); then
echo "❌ Line coverage ($LINES%) below threshold (85%)"
exit 1
fi

echo "βœ… All coverage thresholds met"

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: attention-coverage
path: packages/agentdb/coverage/
retention-days: 30

- name: Comment PR with coverage
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
continue-on-error: true
with:
script: |
const fs = require('fs');
const coverage = JSON.parse(fs.readFileSync('packages/agentdb/coverage/coverage-summary.json', 'utf8'));

const comment = `## πŸ§ͺ Attention Mechanism Test Coverage

| Metric | Coverage |
|--------|----------|
| Statements | ${coverage.total.statements.pct}% |
| Branches | ${coverage.total.branches.pct}% |
| Functions | ${coverage.total.functions.pct}% |
| Lines | ${coverage.total.lines.pct}% |

${coverage.total.statements.pct >= 85 ? 'βœ…' : '⚠️'} **Statements**: ${coverage.total.statements.covered}/${coverage.total.statements.total}
${coverage.total.branches.pct >= 75 ? 'βœ…' : '⚠️'} **Branches**: ${coverage.total.branches.covered}/${coverage.total.branches.total}
${coverage.total.functions.pct >= 85 ? 'βœ…' : '⚠️'} **Functions**: ${coverage.total.functions.covered}/${coverage.total.functions.total}
${coverage.total.lines.pct >= 85 ? 'βœ…' : '⚠️'} **Lines**: ${coverage.total.lines.covered}/${coverage.total.lines.total}
`;

await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

test-attention-all:
name: All Attention Tests Passed
runs-on: ubuntu-latest
needs:
- test-attention-integration
- test-attention-regression
- test-attention-performance
- test-browser-attention
- test-coverage-attention

steps:
- name: All tests passed
run: |
echo "# βœ… All Attention Tests Passed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "All attention mechanism tests completed successfully:" >> $GITHUB_STEP_SUMMARY
echo "- βœ… Integration tests (all platforms)" >> $GITHUB_STEP_SUMMARY
echo "- βœ… Regression tests (backward compatibility)" >> $GITHUB_STEP_SUMMARY
echo "- βœ… Performance benchmarks (meets baseline)" >> $GITHUB_STEP_SUMMARY
echo "- βœ… Browser tests (all browsers)" >> $GITHUB_STEP_SUMMARY
echo "- βœ… Coverage (>85%)" >> $GITHUB_STEP_SUMMARY
Loading
Loading