From 236ff42d157cf74d307d05731d59f6a598cdb880 Mon Sep 17 00:00:00 2001 From: Jordan Partridge Date: Mon, 29 Dec 2025 20:18:50 -0700 Subject: [PATCH] feat(gate): integrate with prefrontal-cortex decision tracking Add prefrontal-cortex integration to gate workflow for automated decision tracking and PR commentary. Changes: - Add step to send gate results to prefrontal-cortex API - Send certification status, coverage, tests, and linting results - Runs on all PRs regardless of gate outcome (if: always()) - Uses PREFRONTAL_WEBHOOK_URL and PREFRONTAL_API_TOKEN secrets Flow: 1. Gate runs certification 2. Results POST to prefrontal-cortex /api/gate/results 3. Prefrontal-cortex logs decision 4. Future: Auto-comment on PR, trigger actions Implements vision#13 --- .github/workflows/gate.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index a869c99e..d3329c5d 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -13,9 +13,13 @@ jobs: permissions: contents: write checks: write + pull-requests: write steps: - uses: actions/checkout@v4 - - uses: synapse-sentinel/gate@v1 + + - name: 🛡️ Run Gate Certification + id: gate + uses: synapse-sentinel/gate@v1 with: check: certify coverage-threshold: 100 @@ -23,3 +27,18 @@ jobs: merge-method: squash github-token: ${{ secrets.GITHUB_TOKEN }} + - name: 🧠 Send Results to Prefrontal Cortex + if: always() && github.event_name == 'pull_request' + run: | + curl -X POST "${{ secrets.PREFRONTAL_WEBHOOK_URL }}" \ + -H "Authorization: Bearer ${{ secrets.PREFRONTAL_API_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{ + \"repo\": \"${{ github.repository }}\", + \"pr\": ${{ github.event.pull_request.number }}, + \"gate_status\": \"${{ steps.gate.outcome }}\", + \"sha\": \"${{ github.event.pull_request.head.sha }}\", + \"coverage\": \"${{ steps.gate.outputs.coverage || 'unknown' }}\", + \"tests\": \"${{ steps.gate.outputs.tests || 'unknown' }}\", + \"linting\": \"${{ steps.gate.outputs.linting || 'unknown' }}\" + }"