Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
af88f0f
merge(main): squash integration of 3 branches
Sep 10, 2025
d0eea6a
feat(context,embeddings): add Context Spine (heartbeat + Google Calen…
Sep 12, 2025
414922c
feat: add ChatGPT command suite (weekly/daily/checkins, daily brief, …
Sep 14, 2025
b7de2dd
docs: add usage docs for personal command suite; update command pages…
Sep 14, 2025
9656481
feat(obsidian): add vault structure (notes, plans, docs, history, aid…
Sep 14, 2025
e9be46c
obsidian: sync vault changes
Sep 14, 2025
f55ef7d
chore: add .gitignore for Obsidian vault (ignore workspace state, kee…
Sep 14, 2025
5f24605
docs: add Obsidian Git quick-setup guide
Sep 14, 2025
411a6d3
obsidian(test): add test note
Sep 14, 2025
93a79d2
chore(obsidian): ignore UI state (.obsidian/*) and untrack workspace/…
Sep 14, 2025
9456676
docs: integrate Project Memory + add Codex-Prompts for vault ops
Sep 14, 2025
74a983a
docs: populate Project Memory, link templates, add folder indexes
Sep 14, 2025
db34cb1
docs: replace Project Memory placeholder with real content; refresh i…
Sep 14, 2025
6d47ad2
docs(reviews): seed 2025-09-14 daily, 2025-W37 weekly, 2025-09 monthl…
Sep 14, 2025
636690d
docs(reviews): populate from templates, backfill last 7 dailies, wire…
Sep 14, 2025
bac804b
chore(automation): add obsidian note maker + systemd timers (daily/we…
Sep 14, 2025
8c08aa5
docs(auto): daily note 2025-09-15; ensure cross-links
Sep 14, 2025
96051ee
docs(auto): weekly note 2025-W38; ensure cross-links
Sep 14, 2025
28937a3
docs(auto): monthly note 2025-09; ensure cross-links
Sep 14, 2025
0ed96dc
chore(automation): serialize git ops with flock to avoid index.lock
Sep 14, 2025
b84078d
chore(ops): add vault health check + Makefile shortcuts; weekly healt…
Sep 14, 2025
d9003e6
history: log 2025-09-15 vault build session (automation + timers + he…
Sep 14, 2025
60c66fe
docs(memory): add Recent History links to Project Memory
Sep 14, 2025
fb4bcbe
chore(health): log automated health snapshot 2025-09-15
Sep 14, 2025
656332a
docs(release): add v0.1.0 release notes
Sep 14, 2025
b8e60f6
docs(recipes): add Aiden/Pinecone query recipes
Sep 14, 2025
cf88f36
docs(tools): move Query Recipes into tools/; link from Project Memory
Sep 15, 2025
f44bf16
docs(tools): add README for tools/ section
Sep 15, 2025
8897fd1
docs(tasks+history): add Tasks Dashboard and History Timeline; link f…
Sep 15, 2025
4a93e01
chore(history): switch to History-Timeline.md and update link
Sep 15, 2025
f9216ae
docs(seo): add 2025 SEO Blueprint reference and link from funnel
Sep 15, 2025
fd44251
docs(seo): add operational plan stub (seo-strategy.md)
Sep 15, 2025
f341e2a
docs(learning): add Learning index and wire into Project Memory
Sep 15, 2025
97c71db
docs(learning): add Learning index with categories and link from Proj…
Sep 15, 2025
bf9c565
docs(learning): seed Learning hub with index + auto-tagged placeholders
Sep 15, 2025
5c0d9ca
chore(learning): add brain-dump sorter to auto-file references
Sep 15, 2025
0c192e3
docs(codex): consolidate vault ops prompts (YAML/tags/learning/histor…
Sep 15, 2025
fc34752
docs(auto): daily note 2025-09-16; ensure cross-links
Sep 15, 2025
2c4abfe
docs(auto): daily note 2025-09-17; ensure cross-links
Sep 16, 2025
df0d390
docs(auto): daily note 2025-09-18; ensure cross-links
Sep 17, 2025
a4f7662
docs(auto): daily note 2025-09-19; ensure cross-links
Sep 19, 2025
7d815e5
docs(auto): daily note 2025-09-20; ensure cross-links
Sep 20, 2025
ff3b51e
docs(auto): daily note 2025-09-21; ensure cross-links
Sep 20, 2025
5482e85
feat(usage+ops): log Anthropic API usage, add !usage-daily + live gau…
Sep 21, 2025
6c085a6
chore(git): drop Obsidian UI state from repo; ignore nested .obsidian/**
Sep 21, 2025
2db960f
chore(git): untrack Excalidraw snapshot (ignored)
Sep 21, 2025
b548a89
merge: feat/context-spine-embeddings into main
Sep 21, 2025
36daa49
docs(auto): daily note 2025-09-22; ensure cross-links
Sep 21, 2025
e7ca25b
docs(auto): weekly note 2025-W39; ensure cross-links
Sep 21, 2025
1cbf767
docs(obsidian): restore vault pages without secrets
Sep 22, 2025
51648f5
Merge branch 'main' into merge/feat-context-spine-embeddings
mrhpython Sep 22, 2025
0352e49
fix: resolve merge conflicts in package files and regenerate lockfile
Sep 22, 2025
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
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions .agent-os/instructions/core/aurea-codex-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SYSTEM UPDATE FOR AUREA — TRUTH-FIRST CODEX WORKFLOW (NON-BYPASSABLE)

**Scope:** Do not edit files directly. Output only: PLAN → DIFFS → COMMANDS → TESTS → VERIFICATION → ROLLBACK.

**Contracts to enforce:**
- NON SIMULATION CONTRACT (no persona/emotion/trust simulation).
- Truth-first engineering (separate DATA/REASONING/SPECULATION; surface contradictions; use ASSUMPTION when needed).
- Rights & Safety: refuse unsafe or rights-violating actions; propose safe alternatives.

**Output format (always):**
1. PLAN (≤8 steps, risks/unknowns)
2. DIFFS (fenced ```diff blocks with correct paths)
3. COMMANDS (Codex-executable shell lines incl. git)
4. TESTS (unit/integration proving acceptance)
5. VERIFICATION (local/CI checklist)
6. ROLLBACK (safe revert)

**Determinism & Safety:**
- Idempotent commands; no destructive ops without gating/dry-run.
- Secrets via env vars only; `.env.example` updates if needed.
- Explicit failure messages; halt on contradictions.

**Acceptance criteria:** Each task must define clear, testable bullets that would fail pre-change and pass post-change.

31 changes: 31 additions & 0 deletions .agent-os/instructions/core/codex-runbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CODEX RUNBOOK — APPLY PATCHES WITH TRUTH KERNEL SAFETY

**Objective:** Apply Aurea’s DIFFS exactly; validate with audit + tests; commit and push.

## Steps (strict order)
1) **Repo prep**
- `git status --porcelain`
- `git pull --rebase`
- `git checkout -b feat/<slug> || git switch feat/<slug>`
2) **Apply patches**
- For each ```diff block from Aurea, apply using:
- `git apply --index --reject` # fail on rejects
- Ensure any new directories exist before apply.
3) **Install & build**
- `npm ci`
- `npm run build || true` # only if a build script exists
4) **Static checks & tests**
- `npm test`
- `node backend/scripts/audit-truth.cjs`
5) **Dry-run and (if required) safe execute**
- If `sf` exists: `sf dry` # never run `sf apply --apply` unless explicitly requested
6) **Commit & push**
- `git add -A`
- `git commit -m "feat: <concise summary of change>"`
- `git push -u origin HEAD`
7) **PR**
- Create PR titled `feat: <summary> (TruthKernel)`
- PR body includes acceptance-criteria checklist and last audit/test outputs.

**Failure policy:** On ANY failure (apply/test/audit), stop and post the failing command, exit code, and last 120 lines of logs. No partial commits.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# spec.md

## Intent
Build a UK-focused semantic search API that integrates Jina AI's embedding and reranking services with TruthLens verification, enabling RAG-powered document search with fact-checking capabilities for workspace knowledge bases.

## Acceptance Criteria
1. Successfully index 100+ workspace documents via Jina Reader API
2. Search response time <300ms for 95% of queries
3. Rerank top-10 results with >85% relevance accuracy
4. TruthLens confidence scores correlate with rerank scores (r>0.7)
5. API handles 100 concurrent requests without degradation
6. All responses include source citations and confidence metrics

## Thin-Slice MVP
A REST API endpoint that accepts a search query, embeds it using Jina, searches a vector store, reranks results, and returns TruthLens-verified responses with citations.

```
POST /api/v1/search
{
"query": "How does TruthLens verify facts?",
"limit": 5,
"verify": true
}
→ Returns ranked, verified results with confidence scores
```

## Tasks (≤12)

### Setup [2h]
1. Configure Jina API credentials and rate limits in `.env`
2. Initialize PostgreSQL with pgvector extension for embeddings

### Core Implementation [8h]
3. Create `JinaAdapter` class with embed/rerank methods
4. Build document chunker (1000 tokens, 200 overlap)
5. Implement batch document indexer with progress tracking
6. Create vector search function with similarity threshold
7. Build reranking pipeline for top-20 candidates
8. Implement TruthLens verification against indexed sources

### API & Integration [4h]
9. Create FastAPI endpoint with request/response models
10. Add caching layer for frequent embeddings (Redis TTL=1h)
11. Implement async processing for parallel operations

### Testing & Deploy [2h]
12. Write integration tests with mock documents and deploy to Railway/Render

## Week 1 Metrics
- **Indexing Volume**: 500+ documents processed
- **Query Latency**: P95 <300ms, P50 <150ms
- **Relevance Score**: >85% for test query set
- **API Uptime**: >99% availability
- **Cost Efficiency**: <£50 total API spend
- **User Feedback**: 10+ beta testers provide relevance ratings

## Run (approved)
echo "[spec] sanity checks"
ls -alh /home/michael/soulfield/workspace/specs
echo "[policy] show TruthLens rules"
head -n 20 /home/michael/soulfield/workspace/knowledge/TruthLens.md
echo "[index] first 10 lines"
head -n 10 /home/michael/soulfield/workspace/data/index.json

37 changes: 37 additions & 0 deletions .agent-os/standards/CODEX RUNBOOK APPLY PATCHES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CODEX RUNBOOK — APPLY PATCHES WITH TRUTH KERNEL SAFETY

Objective: Apply Aurea’s DIFFS exactly; validate with audit + tests; commit and push.

Steps (strict order):
1) Repo prep
- git status --porcelain
- git pull --rebase
- git checkout -b feat/<slug> || git switch feat/<slug>

2) Apply patches
- For each ```diff block from Aurea, apply using `git apply --index --reject` (fail on rejects).
- If new files: ensure directories exist before apply.

3) Install & build
- npm ci
- npm run build || true # only if build script exists

4) Static checks & tests
- npm test
- node backend/scripts/audit-truth.cjs

5) Dry-run and (if required) safe execute
- if `sf` exists: `sf dry` # do not run `sf apply --apply` unless explicitly requested

6) Commit & push
- git add -A
- git commit -m "feat: <concise summary of change>"
- git push -u origin HEAD

7) PR (if platform supports it)
- Create PR titled "feat: <summary> (TruthKernel)"
- PR body: include checklist of acceptance criteria and audit/test outputs.

Failure policy:
- On ANY failure (apply/test/audit), stop and post the failing command, exit code, and last 120 lines of logs. No partial commits.

23 changes: 23 additions & 0 deletions .chatgpt/commands/brain-dump-analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# /brain-dump-analysis

Purpose: synthesize braindumps into themes, questions, breached rules, and realizations.

Process:
- Read `braindumps/` markdown files.
- Extract keywords and frequent phrases.
- Identify questions (“?”), and lines like “rule(s) I keep breaking…”.
- Output ASCII mind map + bullet lists.

Output: `braindumps/analysis/insights-YYYY-MM-DD.md`

## Usage

Ensure you have markdown files under `braindumps/`, then run:

```
node tools/brain-dump-analysis.cjs
# or
node tools/sf.cjs brain-dump-analysis
```

Generates: `braindumps/analysis/insights-<today>.md` containing themes, questions, and a simple ASCII mind map.
24 changes: 24 additions & 0 deletions .chatgpt/commands/daily-brief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# /daily-brief (markets)

Purpose: structured market preparation without external calls.

Sources:
- Local workspace markdowns (keywords/interests)

Content:
- Sessions for ES + majors FX (placeholders OK)
- Checklist: econ calendar, overnight ranges, ATR%, key levels
- Why-each-item-matters notes
- Action checklist slots

Output: `briefs/daily-brief-YYYY-MM-DD.md`

## Usage

```
node tools/daily-brief.cjs
# or
node tools/sf.cjs daily-brief
```

The brief is structure-only (no web calls). Fill checklist items manually.
34 changes: 34 additions & 0 deletions .chatgpt/commands/daily-checkin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# /daily-checkin

Purpose: end-of-day reflection and planning.

Prompts:
- mood 1–10, energy 1–10
- top 3 wins
- tomorrow’s #1
- blockers

Outputs:
- `journal/daily/YYYY-MM-DD.md`
- `journal/daily/YYYY-MM-DD-reflection.md` (trend of last 3 days, momentum score, suggestions, best time block)

## Usage

Run from repo root (Node ≥ 20):

```
node tools/daily-checkin.cjs
# or
node tools/sf.cjs daily-checkin
```

Non-interactive (smoke) via env (good for tests/automation):

```
TEST_INPUT='{"mood":7,"energy":6,"wins":"win1;win2;win3","tomorrow1":"Top focus","blockers":"X"}' \
node tools/daily-checkin.cjs
```

Files written:
- `journal/daily/<today>.md`
- `journal/daily/<today>-reflection.md`
39 changes: 39 additions & 0 deletions .chatgpt/commands/weekly-checkin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# /weekly-checkin

Purpose: capture weekly TRADING + STUDY metrics and generate a compact report.

Prompts to collect:
- TRADING: R values list, regime tag, volatility proxy.
- STUDY: focused hours, problems solved, PRs merged, tests added, coverage %, commits, learning sprints, notes.

Calculations:
- Expectancy (R) = average(R)
- Win rate = wins / N
- Max drawdown (R) = min cumulative R trough
- Kelly-lite (informational) = winrate – (1 – winrate)/(avg_win_R/|avg_loss_R|)
- Study velocity = focused_hours + problems_solved*0.5 + PRs*0.5

Outputs:
- Append JSON block to `metrics/metrics-history.md`
- Create `metrics/weekly-report-YYYY-MM-DD.md` with tables, deltas, emoji signals, and 3–5 recommendations.

## Usage

Interactive:

```
node tools/weekly-checkin.cjs
# or
node tools/sf.cjs weekly-checkin
```

Non-interactive (CI/smoke):

```
TEST_INPUT='{"R_list":"1 -0.5 0.7","focused_hours":5,"problems_solved":4,"prs_merged":2}' \
node tools/weekly-checkin.cjs
```

Artifacts:
- `metrics/metrics-history.md` (appended block)
- `metrics/weekly-report-<today>.md`
9 changes: 9 additions & 0 deletions .chatgpt/subagents/daily-reflection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
System: You are ChatGPT daily reflection coach. Keep tone supportive and brief.

Input: mood (1–10), energy (1–10), top wins, blockers, last 3 days trends.
Output:
- Tiny trend for mood/energy (up/down/flat)
- Accomplishment momentum score
- 2–3 gentle suggestions
- Best time block for tomorrow (AM if trend up, PM otherwise)

8 changes: 8 additions & 0 deletions .chatgpt/subagents/metrics-analyst.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
System: You are ChatGPT metrics analyst. Be concise, numerical, and actionable. Use tables, deltas, and emoji signals (🚀 📈 📉 ➡️).

Given weekly TRADING R data and STUDY metrics, compute:
- Expectancy (R), Win rate, Max drawdown (R)
- Kelly-lite signal (informational only)
- Study velocity
Then produce 3–5 concrete recommendations.

69 changes: 62 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,70 @@
## Copy to `.env` and fill values
## Copy this file to `.env` and fill in values.
## Only `.env` is loaded at runtime; this is just a template.

# Core
# ---- Core (Aiden / API server) ----
# Anthropic key (preferred env var name)
ANTHROPIC_API_KEY=
# Legacy/alternate name (also supported)
CLAUDE_API_KEY=
AIDEN_MODEL=
# Claude model used by Aiden
AIDEN_MODEL=claude-opus-4.1-20250805
# Run offline when 1 (returns "dev offline"); set 0 for live API calls
DEV_NO_API=0
# HTTP port for backend/index.cjs
PORT=8790
CONTEXT_SPINE=0

# ---- Embeddings ----
# Provider for text embeddings used by memory and context spine
EMBED_PROVIDER=local # local | openai
# Model name for OpenAI provider only
EMBED_MODEL=text-embedding-3-small # used only if EMBED_PROVIDER=openai
# Heartbeat embedding throttle (embed 1 of every N heartbeats)
HEARTBEAT_EMBED_EVERY=4 # embed one of every N heartbeats
OBSIDIAN_DIR=./workspace/docs/Obsidian
NOTES_DIR=./workspace/docs/Obsidian

# Retention (days) for context items (heartbeats/calendar past events)
CONTEXT_RETENTION_DAYS=14

# ---- Vector Memory (Pinecone + embeddings) ----
# Enable Pinecone-backed memory (1 to enable)
USE_PINECONE=0
# Pinecone credentials and index settings
PINECONE_API_KEY=
PINECONE_INDEX=soulfield-memory
PINECONE_CLOUD=aws
PINECONE_REGION=us-east-1
# OpenAI API key for embeddings (1536-dim)
OPENAI_API_KEY=
# Optional: batch size for upserts
MEMORY_UPSERT_BATCH=64

# Optional adapters
# ---- Adapters ----
# Jina API (embeddings/rerank)
JINA_API_KEY=
# Default embedding model for tools/test-memory-suite.cjs
JINA_MODEL=jina-embeddings-v2-base-en

# InfraNodus API
INFRANODUS_API_KEY=
# Optional custom base URL
INFRANODUS_API_BASE=https://api.infranodus.com

# Vector memory (optional)
USE_PINECONE=0
PINECONE_API_KEY=
# Bright Data (scraper)
BRIGHTDATA_TOKEN=

# ---- Misc / Tooling ----
# GitHub automation scripts
GITHUB_TOKEN=
# Optional hint if you swap embedding providers (not read by current code)
# EMBED_PROVIDER=openai

# ---- Google Calendar (OAuth2) ----
# Used by contextSpine.js for calendar sync
GCAL_CLIENT_ID=
GCAL_CLIENT_SECRET=
GCAL_REDIRECT_URI=
GCAL_REFRESH_TOKEN=
GCAL_WINDOW_HOURS=24
GCAL_CALENDAR_ID=primary
Loading