Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 21 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ GEONAMES_USERNAME=
# Default: production
NODE_ENV=development

# Symbolic Resonance Protocol (SRP) enrichment toggle
# Defaults to enabled; set to "false" to disable across the stack
ENABLE_SRP=true

# =============================================================================
# LOGGING CONFIGURATION
# =============================================================================
Expand Down Expand Up @@ -83,14 +87,24 @@ AUTH0_CLIENT_ID=your_auth0_client_id_here
# Example: https://api.yourdomain.com or woven-api
AUTH0_AUDIENCE=https://api.wovenwebapp.com

# Optional override for Auth0 redirect callback path (default '/')
# Example: /post-login
NEXT_PUBLIC_AUTH_CALLBACK_PATH=/

# Gemini AI API Key (REQUIRED for Poetic Brain feature)
# Get this from Google AI Studio: https://makersuite.google.com/app/apikey
# Optional override for Auth0 redirect callback path (default '/math-brain')
# Example: /post-login (must be added to Allowed Callback URLs in Auth0)
NEXT_PUBLIC_AUTH_CALLBACK_PATH=/math-brain

# Optional: control direct social connection for login
# - Default behavior uses 'google-oauth2' to skip Universal Login.
# - To use Universal Login instead, set to 'auto' or leave blank.
# - To use a different connection, set its exact name here.
# Examples:
# NEXT_PUBLIC_AUTH_CONNECTION=google-oauth2
# NEXT_PUBLIC_AUTH_CONNECTION=auto
# NEXT_PUBLIC_AUTH_CONNECTION=
NEXT_PUBLIC_AUTH_CONNECTION=google-oauth2

# Perplexity API Key (REQUIRED for Poetic Brain feature)
# Get this from https://perplexity.ai/settings/api
# Used for AI-powered poetic interpretations of astrological data
GEMINI_API_KEY=your_gemini_api_key_here
PERPLEXITY_API_KEY=your_perplexity_api_key_here

# =============================================================================
# TRANSIT CALCULATION CONFIGURATION
Expand Down
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/copilot-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Copilot Task
about: Narrowly scoped task designed for GitHub Copilot assistance
labels: [copilot]
title: "[Copilot] "
body:
- type: textarea
id: problem
attributes:
label: Problem
description: Describe the exact issue or improvement needed. Reference links or screenshots if helpful.
placeholder: The /math-brain export modal mislabels the Symbolic Weather button.
validations:
required: true
- type: textarea
id: layers
attributes:
label: Woven Map Layer
description: Identify which layer(s) this touches (Frontend, API Function, Netlify Build, Poetic Brain, Docs, etc.).
placeholder: Frontend component (DownloadControls)
validations:
required: true
- type: textarea
id: files
attributes:
label: Files Involved
description: List the key files or directories Copilot should inspect or modify.
placeholder: app/math-brain/components/DownloadControls.tsx
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: Describe the desired outcome after the change.
placeholder: Button text and download filename align with the Symbolic Weather export.
validations:
required: true
- type: textarea
id: acceptance
attributes:
label: Acceptance Criteria
description: Bullet list of verifications (tests, screenshots, docs) required before closing the task.
placeholder: |
- Button label reads “Symbolic Weather (Compact)”
- Downloaded file name matches design spec
- `npm run lint` passes
validations:
required: true
117 changes: 117 additions & 0 deletions .github/agents/doc-organizer.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
name: DocOrganizerAgent
description: >
Scans, analyzes, and organizes all documentation files within the repository. Identifies scattered or duplicate files and flags outdated content by inspecting file timestamps, cross-referencing recent commits/releases/issues, and checking for deprecated information. Suggests restructured documentation hierarchy and generates documentation health reports.
---

# DocOrganizerAgent

**Purpose:**
Automatically organize scattered documentation in the repository and identify outdated docs.

## Capabilities

- Scans all Markdown and documentation files across the repo (`.md`, `.txt`, documentation folders)
- Sorts files by category:
- Core Documentation (`README.md`, `MAINTENANCE_GUIDE.md`, `CHANGELOG.md`)
- API Documentation (`API_INTEGRATION_GUIDE.md`, `MATH_BRAIN_COMPLIANCE.md`)
- Developer Guides (in `Developers Notes/`, troubleshooting guides)
- Strategic Documentation (`README_STRATEGIC_DOCS.md`, `copilot-instructions.md`)
- Error Reports & Debugging (`Error Reports/`, debug files)
- Persona & Analysis docs (`Persona/`, `analysis/`, `coverage/`)
- Legacy & Reference files
- Detects duplicates, scattered files, and missing/untitled docs
- Flags outdated docs by checking:
- Last modified date (files older than 6 months)
- Cross-referencing recent commits, releases, and issues
- Deprecated or mismatched information (e.g., references to old tech stack)
- Broken internal links or outdated examples
- Proposes an improved folder and file structure
- Generates a Documentation Health Summary with:
- Current doc inventory by category
- Outdated docs requiring updates
- Duplicate or redundant files
- Missing critical documentation
- Docs to archive or consolidate
- Respects WovenWebApp conventions:
- Follows commit message standards: `[YYYY-MM-DD] TYPE: Brief description`
- Updates `CHANGELOG.md` for any doc reorganization
- Maintains Raven Calder system terminology in astrology docs
- Preserves AI collaboration notes and attribution

## Customization

Configure these settings to adjust agent behavior:
- **Outdated threshold**: Default 6 months; adjust based on project velocity
- **File types**: Default `.md`, `.txt`; add others as needed
- **Excluded paths**: Ignore `node_modules/`, `.next/`, build artifacts
- **Target doc structure**: Define preferred folder hierarchy

## How to Use

**From Copilot CLI:**
```bash
gh copilot agents run doc-organizer
```

**Via GitHub Actions workflow:**
- Trigger manually or on schedule (e.g., monthly)
- Review output in PR comments or workflow summary
- Agent creates feature branch with proposed changes

**Output Format:**
Agent generates:
1. **Documentation Health Report** (Markdown summary)
2. **Proposed Restructuring Plan** (file moves/renames)
3. **Outdated Docs List** (with reasons and suggested actions)
4. **Updated CHANGELOG.md** entry

## Integration with WovenWebApp Standards

- Agent works on feature branches (`docs/organize-[date]`)
- All changes require human review before merging to `main`
- Follows branch protection & merge guidelines from `copilot-instructions.md`
- Updates essential documentation as needed:
- `CHANGELOG.md` – logs all doc organization changes
- `MAINTENANCE_GUIDE.md` – updates if doc structure changes
- `README.md` – updates links if files move

## Example Workflow

1. Agent scans entire repo for documentation files
2. Categorizes files by type and purpose
3. Identifies:
- 3 duplicate README files in different folders
- 8 files not modified in >6 months
- 2 docs referencing deprecated `index.html` instead of Next.js App Router
- 5 orphaned debug files in root directory
4. Proposes:
- Consolidate duplicate READMEs
- Move debug files to `Error Reports/`
- Archive outdated migration docs to `docs/archive/`
- Update API docs to reference current tech stack
5. Creates feature branch with:
- File reorganization commits
- Updated internal links
- CHANGELOG entry
- Documentation Health Report
6. Human reviewer (Jules/DHCross) approves and merges

## Compliance Checklist

Before running agent:
- [ ] Review `MAINTENANCE_GUIDE.md` for current file organization
- [ ] Check `CHANGELOG.md` for recent doc changes
- [ ] Verify no active doc PRs that would conflict
- [ ] Confirm `main` branch is up to date

After agent run:
- [ ] Review Documentation Health Report
- [ ] Validate proposed file moves don't break links
- [ ] Test that all internal documentation links still work
- [ ] Verify CHANGELOG update follows standards
- [ ] Assign human reviewer for final approval

---

**Note:** This agent respects the WovenWebApp philosophy: "Map, not mandate." It proposes improvements but requires human judgment for final decisions. All changes go through branch protection and require Jules or repo owner review.
25 changes: 25 additions & 0 deletions .github/instructions/ASTROLOGY_AGENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ASTROLOGY_AGENT Profile

## Scope
Specialized Copilot agent for astrological math and symbolic weather logic inside WovenWebApp.

## Responsibilities
- Maintain Netlify functions that calculate chart geometry and symbolic weather (`netlify/functions/astrology-mathbrain.js`).
- Verify SRP hook generation and Balance Meter math in `src/` (`src/math_brain/`, `src/seismograph.js`, `lib/relocation-houses.js`).
- Keep FIELD → MAP → VOICE architecture intact when manipulating data contracts.

## Key References
- `MATH_BRAIN_COMPLIANCE.md`
- `MAP_FIELD_IMPLEMENTATION_COMPLETE.md`
- `RAVEN_PROTOCOL_IMPLEMENTATION_COMPLETE.md`
- `SINGLE_SOURCE_OF_TRUTH_IMPLEMENTATION.md`

## Conventions
- Never hardcode personal names; use payload data or anonymized placeholders.
- All outputs must remain falsifiable; include provenance when practical.
- Update or add tests under `__tests__/` or `tests/functions/` when math logic changes.

## Required Checks
- `npm run test`
- `netlify dev` smoke test for affected endpoints
- Documentation updates for any schema changes
29 changes: 29 additions & 0 deletions .github/instructions/frontend.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Frontend Instructions

These rules govern React UI code under the Next.js App Router (`app/`, `components/`, `hooks/`). Copilot must follow them when editing or generating frontend files.

## File & Naming Conventions
- Components belong in `components/` or the closest feature directory under `app/`.
- Use **PascalCase** filenames (e.g. `MirrorSummaryCard.tsx`).
- Export React **function components** only. Prefer explicit prop interfaces.
- Co-locate custom hooks in `hooks/` with `useSomething.ts` filenames when they are shared across components.

## Styling & Layout
- Tailwind CSS is the source of truth. Use utility classes instead of inline `style` objects.
- Shared design tokens live in `tailwind.config.js`; extend that file instead of hardcoding colors.
- Respect the dark theme. Reuse palette families already in use (`slate`, `indigo`, `emerald`).

## Data Flow & State Management
- Fetch data via helpers in `lib/` or Next.js route handlers; never call Netlify endpoints directly from components.
- Keep React hook dependency arrays accurate. Derive memoized values with `useMemo`/`useCallback` where needed.
- Every async action must surface loading and error UI states. Follow the toast pattern used in `components/ChatClient.tsx`.

## Accessibility & UX
- Ensure interactive elements have accessible labels and keyboard focus states.
- Copy must reflect Raven Calder tone: conversational, agency-first, zero determinism.
- Keep animations subtle (100–200 ms transitions). Avoid motion-heavy effects.

## Testing & Verification
- Update or add Jest tests in `__tests__/` for logical changes; use Playwright specs under `e2e/` for UI flows.
- Run `npm run lint` and `npm run test` before submitting changes.
- When touching shared layout/theme files, validate via `netlify dev` to confirm no regressions.
28 changes: 28 additions & 0 deletions .github/instructions/functions.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Serverless Functions Instructions

These rules apply to Netlify functions stored in `netlify/functions/` and any supporting modules under `lib/`.

## Structure & Naming
- Each function file must export `export const handler = async (event, context) => { ... }`.
- Keep filenames kebab-case (e.g. `astrology-mathbrain.js`).
- Shared helpers belong in `lib/` and are imported into the function file.

## Input Validation & Error Handling
- Validate all query/body params. Return `400` with a descriptive error when required params are missing.
- Wrap external API calls in try/catch. Log errors via `console.error` with contextual metadata.
- Return JSON-encoded responses: `{ statusCode, headers, body: JSON.stringify(payload) }`.
- Never leak secrets or raw stack traces in responses.

## Data & Domain Rules
- Preserve Raven Calder FIELD → MAP → VOICE flow: raw geometry first, then derived metrics, then narrative.
- When modifying seismograph or aspect logic, update corresponding docs (`MATH_BRAIN_COMPLIANCE.md`, etc.).
- Guard privacy: never hardcode personal names; use request payload values or anonymized placeholders.

## Testing & Verification
- Add/update integration tests under `tests/functions/` or Playwright flows that exercise the function.
- Run `npm run test` (Jest/Vitest) and `netlify dev` to confirm the function works in the local Netlify runtime.
- If schema changes, update consumers (frontend hooks, Poetic Brain) and document the change.

## Deployment Checks
- Ensure environment variables are accessed via `process.env.*` and documented in `.env.example`.
- Coordinate with CI (copilot-setup-steps) so builds install required deps before invoking the function.
32 changes: 32 additions & 0 deletions .github/workflows/doc-organizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: DocOrganizer Agent - Monthly Run

on:
# Run on the 1st of every month at 9:00 AM UTC
schedule:
- cron: '0 9 1 * *'

# Allow manual triggering from GitHub Actions UI
workflow_dispatch:

jobs:
run-doc-organizer:
runs-on: ubuntu-latest

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

- name: Setup GitHub CLI
run: |
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y

- name: Run DocOrganizer Agent
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh copilot agents run doc-organizer
7 changes: 6 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
run: npm run build:css

- name: Run Playwright tests
run: npm run test:e2e
run: |
npx netlify dev --port 8888 --context dev &
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

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

The CI workflow starts a Netlify dev server before tests but doesn't specify which project directory or configuration file to use. If the repository structure changes or if there are multiple Netlify configurations, this could fail silently. Consider adding --cwd flag or explicitly pointing to the Netlify config file to make the workflow more robust.

Suggested change
npx netlify dev --port 8888 --context dev &
npx netlify dev --port 8888 --context dev --cwd . --config netlify.toml &

Copilot uses AI. Check for mistakes.
NETLIFY_PID=$!
trap "kill $NETLIFY_PID" EXIT
npx wait-on --timeout 120000 http://127.0.0.1:8888
npm run test:e2e
env:
CI: true
BASE_URL: http://localhost:8888
Expand Down
Loading