Skip to content
Open
Changes from all commits
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
43 changes: 43 additions & 0 deletions .github/instructions/Heartbeat.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Dual-Domain Health & Agent Sync

on:
push:
branches: [ "main" ]
schedule:
- cron: '0 * * * *' # Automated health check every hour
workflow_dispatch: # Allows you to manually trigger a sync

jobs:
health-and-sync:
runs-on: ubuntu-latest
Comment on lines +1 to +12
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains a GitHub Actions workflow, but it’s being added under .github/instructions/ with a .instructions.md extension. GitHub Actions will not load workflows from this path, so the health check/sync job will never run. Move this YAML to .github/workflows/ (e.g. heartbeat.yml) if the intent is to create an actual workflow.

Copilot uses AI. Check for mistakes.
steps:
- uses: actions/checkout@v4

# 1. Sync Agent Instructions to the Central Governance Dashboard
- name: Sync Agent Rules
run: |
curl -X POST https://your-railway-app.up.railway.app/update-agent-logic \
-H "Authorization: Bearer ${{ secrets.GOVERNANCE_TOKEN }}" \
-F "instructions=@Agent.Instructions.pdf"
Comment on lines +19 to +21
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sync step uploads Agent.Instructions.pdf, but that file doesn’t exist in this repository, so this step will fail every run. Either add the file to the repo/artifact, or update the step to point at the actual instructions source (and consider failing fast with a clear error if it’s missing).

Suggested change
curl -X POST https://your-railway-app.up.railway.app/update-agent-logic \
-H "Authorization: Bearer ${{ secrets.GOVERNANCE_TOKEN }}" \
-F "instructions=@Agent.Instructions.pdf"
INSTRUCTIONS_FILE=".github/instructions/Heartbeat.instructions.md"
if [ ! -f "$INSTRUCTIONS_FILE" ]; then
echo "Expected instructions file not found: $INSTRUCTIONS_FILE"
exit 1
fi
curl --fail -X POST https://your-railway-app.up.railway.app/update-agent-logic \
-H "Authorization: Bearer ${{ secrets.GOVERNANCE_TOKEN }}" \
-F "instructions=@${INSTRUCTIONS_FILE}"

Copilot uses AI. Check for mistakes.

# 2. Check the Arcade (GitHub Pages)
- name: Arcade Health Check
run: |
status_code=$(curl -o /dev/null -s -w "%{http_code}" https://nicholai.org)
if [ $status_code -ne 200 ]; then
echo "Arcade (nicholai.org) is down! Status: $status_code"
curl -X POST https://your-railway-app.up.railway.app/alert \
-d '{"domain": "nicholai.org", "status": "down", "contact": "nicholaimadias@gmail.com"}'
Comment on lines +29 to +30
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alert request sends a JSON string via curl -d but does not set Content-Type: application/json. Many endpoints will reject or mis-parse this. Add the appropriate Content-Type header (and consider -sS / timeouts) so failures are surfaced clearly and the payload is parsed as intended.

Copilot uses AI. Check for mistakes.
exit 1
Comment on lines +29 to +31
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alert payload includes a hard-coded personal email address and the workflow hard-codes the external alerting endpoint. If this repo is public, this leaks PII and makes it easy to accidentally notify the wrong contact. Prefer storing contact info and the alert base URL in repository/environment secrets or variables, and avoid committing personal contact details into the workflow.

Copilot uses AI. Check for mistakes.
fi
Comment on lines +26 to +32
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In GitHub Actions, run: steps execute with bash -e, so if curl fails due to DNS/timeout/etc, this step will exit immediately and skip the alert POST. To ensure alerts fire on network failures, capture the curl exit code (or default the status code to 000) and branch on that instead of letting set -e abort the script.

Copilot uses AI. Check for mistakes.

# 3. Check the Listings (Netlify)
- name: Listings Health Check
run: |
status_code=$(curl -o /dev/null -s -w "%{http_code}" https://amazinggracehomeliving.com)
if [ $status_code -ne 200 ]; then
echo "Listings (Amazing Grace) is down! Status: $status_code"
curl -X POST https://your-railway-app.up.railway.app/alert \
-d '{"domain": "amazinggracehomeliving.com", "status": "down", "contact": "nicholaimadias@gmail.com"}'
Comment on lines +40 to +41
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same JSON alert issue here: the request body is JSON, but the Content-Type: application/json header isn’t set, which can cause the alerting service to misinterpret the payload. Set the correct content type and add basic curl hardening (timeouts / -sS) to improve reliability.

Copilot uses AI. Check for mistakes.
exit 1
fi
Comment on lines +37 to +43
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above: if curl fails, the step will terminate before reaching the alert POST due to bash -e. Handle curl failures explicitly so the workflow reliably sends an alert when the domain is unreachable.

Copilot uses AI. Check for mistakes.
Loading