From 7a8cc9c5507c26dfd34a3d63fc0faec450204d03 Mon Sep 17 00:00:00 2001 From: Will Freeman Date: Sun, 19 Jul 2026 15:09:56 -0600 Subject: [PATCH] update gh actions, move kb dir --- .github/workflows/deflock-api-deploy.yml | 10 ++-------- CLAUDE.md | 5 ++--- api/CLAUDE.md | 2 +- {kb => api/kb}/CLAUDE.md | 0 {kb => api/kb}/ai-tooling-faq.md | 0 {kb => api/kb}/getting-involved-and-organizing.md | 0 {kb => api/kb}/map-data-access.md | 0 {kb => api/kb}/privacy-and-data-concerns.md | 0 {kb => api/kb}/reporting-and-fixing-map-entries.md | 0 {kb => api/kb}/signage-and-property-reports.md | 0 {kb => api/kb}/what-are-these-cameras.md | 0 api/services/KnowledgeBase.ts | 2 +- 12 files changed, 6 insertions(+), 13 deletions(-) rename {kb => api/kb}/CLAUDE.md (100%) rename {kb => api/kb}/ai-tooling-faq.md (100%) rename {kb => api/kb}/getting-involved-and-organizing.md (100%) rename {kb => api/kb}/map-data-access.md (100%) rename {kb => api/kb}/privacy-and-data-concerns.md (100%) rename {kb => api/kb}/reporting-and-fixing-map-entries.md (100%) rename {kb => api/kb}/signage-and-property-reports.md (100%) rename {kb => api/kb}/what-are-these-cameras.md (100%) diff --git a/.github/workflows/deflock-api-deploy.yml b/.github/workflows/deflock-api-deploy.yml index 3acf6e3..e42b075 100644 --- a/.github/workflows/deflock-api-deploy.yml +++ b/.github/workflows/deflock-api-deploy.yml @@ -13,13 +13,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - - run: bun install - working-directory: ./api - - name: Configure SSH run: | mkdir -p ~/.ssh @@ -33,8 +26,9 @@ jobs: --exclude node_modules \ ./api/ ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }}:/home/nullplate/deflock/api - - name: Restart services + - name: Install dependencies and restart service run: | ssh ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }} " + cd /home/nullplate/deflock/api && bun install --frozen-lockfile && sudo systemctl restart deflock-api " diff --git a/CLAUDE.md b/CLAUDE.md index 286e726..65c926f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -17,9 +17,8 @@ repo or behind an API here — it doesn't. - `webapp/` — Vue 3 + Vuetify + MapLibre GL frontend (the public site at deflock.org). - `api/` — Fastify/Bun backend for everything that *isn't* OSM map data: geocoding, GitHub sponsors, and the contact form (including AI-assisted triage into Zammad). See - `api/CLAUDE.md`. -- `kb/` — knowledge base markdown consumed by the AI contact-screening classifier in `api/`. - See `kb/CLAUDE.md`. + `api/CLAUDE.md`. Includes `api/kb/` — knowledge base markdown consumed by the AI + contact-screening classifier. See `api/kb/CLAUDE.md`. - `cms/` — Directus CMS (content management for site content, e.g. blog). - `serverless/`, `terraform/` — AWS Lambda batch jobs (scheduled, not request-driven) for ALPR stats/counts and caching, provisioned via Terraform. diff --git a/api/CLAUDE.md b/api/CLAUDE.md index a3c6a37..68cd6f0 100644 --- a/api/CLAUDE.md +++ b/api/CLAUDE.md @@ -15,7 +15,7 @@ Handles everything for DeFlock that isn't OpenStreetMap map data: geocoding prox `openai` package). See `ZammadClient`, `NominatimClient`, `GithubClient`, `TurnstileClient`. - Config/data that isn't a secret is checked into git and read at startup, not hardcoded and not fetched at runtime — e.g. `data/zipcodes-us.json`, `prompts/contact-screening.md`, and - `../kb/*.md`. Editing these requires a server restart to take effect (loaded once at module + `kb/*.md`. Editing these requires a server restart to take effect (loaded once at module init). - OpenTelemetry (`telemetry.ts`) exports logs/metrics to Grafana Cloud via a local otelcol sidecar. Errors are bucketed by a substring-matching `classifyErrorMessage()` in `server.ts` diff --git a/kb/CLAUDE.md b/api/kb/CLAUDE.md similarity index 100% rename from kb/CLAUDE.md rename to api/kb/CLAUDE.md diff --git a/kb/ai-tooling-faq.md b/api/kb/ai-tooling-faq.md similarity index 100% rename from kb/ai-tooling-faq.md rename to api/kb/ai-tooling-faq.md diff --git a/kb/getting-involved-and-organizing.md b/api/kb/getting-involved-and-organizing.md similarity index 100% rename from kb/getting-involved-and-organizing.md rename to api/kb/getting-involved-and-organizing.md diff --git a/kb/map-data-access.md b/api/kb/map-data-access.md similarity index 100% rename from kb/map-data-access.md rename to api/kb/map-data-access.md diff --git a/kb/privacy-and-data-concerns.md b/api/kb/privacy-and-data-concerns.md similarity index 100% rename from kb/privacy-and-data-concerns.md rename to api/kb/privacy-and-data-concerns.md diff --git a/kb/reporting-and-fixing-map-entries.md b/api/kb/reporting-and-fixing-map-entries.md similarity index 100% rename from kb/reporting-and-fixing-map-entries.md rename to api/kb/reporting-and-fixing-map-entries.md diff --git a/kb/signage-and-property-reports.md b/api/kb/signage-and-property-reports.md similarity index 100% rename from kb/signage-and-property-reports.md rename to api/kb/signage-and-property-reports.md diff --git a/kb/what-are-these-cameras.md b/api/kb/what-are-these-cameras.md similarity index 100% rename from kb/what-are-these-cameras.md rename to api/kb/what-are-these-cameras.md diff --git a/api/services/KnowledgeBase.ts b/api/services/KnowledgeBase.ts index 30d62ac..0556d58 100644 --- a/api/services/KnowledgeBase.ts +++ b/api/services/KnowledgeBase.ts @@ -1,7 +1,7 @@ import { existsSync, readdirSync, readFileSync } from 'fs'; import { join } from 'path'; -const KB_DIR = join(__dirname, '../../kb'); +const KB_DIR = join(__dirname, '../kb'); export interface KbDocument { filename: string;