Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ VOYAGE_API_KEY=pa-xxxxx
# See docs/slack-app-setup.md for step-by-step instructions
SLACK_SIGNING_SECRET=xxxxx
SLACK_BOT_TOKEN=xoxb-xxxxx

# --- Synapse CLI (for context broker commands) ---
# See docs/synapse-design.md for usage instructions
SYNAPSE_ENDPOINT=https://your-cluster.your-org.harperfabric.com
SYNAPSE_PROJECT=your-project-name
SYNAPSE_AUTH=Basic dXNlcjpwYXNz
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
branches: ['**']
pull_request:
branches: [main]

jobs:
test:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- run: npm ci

- name: Format check
run: npm run format:check

- name: Lint
run: npm run lint:check

- name: Test
run: npm test
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches: [main]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- run: npm ci

- name: Test
run: npm test

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
16 changes: 16 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"node_modules/"
],
"rules": {},
"overrides": [
{
"files": ["test/**"],
"rules": {
"unicorn/no-new-array": "off",
"require-yield": "off"
}
}
]
}
33 changes: 33 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{ "breaking": true, "release": "major" },
{ "type": "feat", "release": "minor" },
{ "type": "*", "release": "patch" }
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{ "npmPublish": false }
],
[
"@semantic-release/git",
{
"assets": ["package.json", "package-lock.json"]
}
],
"@semantic-release/github"
]
}
30 changes: 27 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,47 @@ An agent-agnostic AI memory system using Harper Fabric as the vector database an

## Key Files

- `resources.js` - Core application: SlackWebhook, MemorySearch, MemoryTable classes + classifyMessage, generateEmbedding, verifySlackSignature helpers
- `schema.graphql` - Memory table with HNSW vector index (no @export since we extend it)
- `resources.js` - Core application: SlackWebhook, MemorySearch, MemoryTable + all Synapse resource classes + helpers
- `schema.graphql` - Memory and SynapseEntry tables with HNSW vector indexes (no @export since we extend them)
- `config.yaml` - Harper app config (loadEnv, REST, schema, resource files)
- `.env.example` - All required environment variables documented
- `bin/synapse.js` - Synapse CLI: sync, emit, search, watch, status commands

## Development

```bash
npm run dev # Start locally on port 9926
npm test # Run all 35 tests
npm test # Run all 77 tests
npm run deploy # Deploy to Harper Fabric
```

## Architecture

Slack webhook -> classify (Claude) + embed (Voyage AI) -> store in Memory table -> query via MCP from Claude Desktop/Cursor.

## Synapse

Universal Context Broker — ingests development context from any AI tool (Claude Code, Cursor, Windsurf, Copilot) and emits it in any other tool's native format. Full design spec: `docs/synapse-design.md`.

### New Key Files

- `bin/synapse.js` - CLI: sync, emit, search, watch, status commands
- `test/synapse-*.test.js` - Tests for classify, search, ingest, emit

### New Resource Classes (in resources.js)

- `SynapseEntry` - Table extension (strips embeddings, same pattern as MemoryTable)
- `SynapseSearch` - Semantic search with mandatory `projectId` scoping
- `SynapseIngest` - Parses tool-native formats into SynapseEntry records
- `SynapseEmit` - Formats SynapseEntry records into tool-native output

### Conventions

- SynapseEntry table follows same patterns as Memory (HNSW vector index, classification via Claude Haiku, embeddings via Voyage AI)
- Use renamed import: `const { SynapseEntry: SynapseEntryBase } = tables;`
- All Synapse queries must filter on `projectId`
- Default status filter is `active` (excludes superseded/archived)

## Agent Skills

Skills from `harperfast/skills` are tracked in `skills-lock.json` and installed into `.agents/skills/` (git-ignored). Refer to the relevant skill rules when making changes:
Expand Down
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ npm test

Tests live in `test/` alongside the code they cover:

| File | Covers |
|------|--------|
| `classify.test.js` | `classifyMessage()` |
| `embedding.test.js` | `generateEmbedding()` |
| `webhook.test.js` | `SlackWebhook`, `verifySlackSignature()` |
| `search.test.js` | `MemorySearch` |
| File | Covers |
| ------------------- | ---------------------------------------- |
| `classify.test.js` | `classifyMessage()` |
| `embedding.test.js` | `generateEmbedding()` |
| `webhook.test.js` | `SlackWebhook`, `verifySlackSignature()` |
| `search.test.js` | `MemorySearch` |

## Submitting a Pull Request

Expand All @@ -76,6 +76,7 @@ Please keep PRs focused — one feature or fix per PR.
## Reporting Issues

Open an issue on GitHub with:

- A clear description of the problem
- Steps to reproduce
- Your Node.js version (`node --version`)
Expand Down
Loading
Loading