Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
02fc852
fix: change user-message-hook exit code from USER_MESSAGE_ONLY to SUC…
laihenyi Dec 23, 2025
1471600
chore: add .osgrep/ to .gitignore
laihenyi Dec 23, 2025
3ceaff6
Merge remote-tracking branch 'origin/main'
laihenyi Dec 23, 2025
676002d
feat: implement Titans-inspired memory management (Phase 1-3)
laihenyi Dec 24, 2025
baca65d
fix: change user-message-hook exit code from USER_MESSAGE_ONLY to SUC…
laihenyi Dec 23, 2025
8068fbd
chore: add .osgrep/ to .gitignore
laihenyi Dec 23, 2025
47dc52e
merge: integrate main branch into feature/titans-phase1-3
laihenyi Dec 24, 2025
1bf08a8
merge: integrate main branch into feature/titans-phase1-3
thedotmack Dec 25, 2025
443bab9
build: rebuild plugin scripts after merge
thedotmack Dec 25, 2025
f48758f
fix: integrate surprise score into ImportanceScorer with layered fall…
laihenyi Dec 26, 2025
202c866
feat: pipeline architecture with checkpoint/resume capability
laihenyi Dec 26, 2025
38bd95d
feat: add metrics API endpoints and enhanced checkpoint tracking
laihenyi Dec 26, 2025
805d9fc
feat: implement hybrid pipeline mode with metrics tracking
laihenyi Dec 26, 2025
c882c5d
fix: add MCP transport error handling to prevent silent crashes
laihenyi Dec 26, 2025
942b6aa
Merge remote-tracking branch 'origin/main' into feature/titans-with-p…
laihenyi Dec 26, 2025
f2c98bb
feat: implement Sleep Agent with Nested Learning architecture
laihenyi Dec 27, 2025
8bd9d3c
feat: implement Sleep Agent with Nested Learning architecture
laihenyi Dec 28, 2025
834e1a9
feat: add session statistics API endpoints
laihenyi Dec 28, 2025
257196c
feat: add StatusLine and PreCompact lifecycle hooks
laihenyi Dec 28, 2025
67a0f97
feat: add usage hints and feature status summary to context injection
laihenyi Dec 28, 2025
b340c13
chore: update build system for new hooks
laihenyi Dec 28, 2025
3d65370
docs: add English version of nested-learning-analysis
laihenyi Dec 28, 2025
8c60f32
chore: add continuous-claude-v2-comparison.md to gitignore
laihenyi Dec 28, 2025
552f9d0
Merge origin/main into feature/titans-with-pipeline
laihenyi Dec 28, 2025
984d4b6
fix: StatusLine savings display survives worker restart
laihenyi Dec 28, 2025
d85f112
fix: address PR #464 diffray-bot review issues
laihenyi Dec 28, 2025
133b09d
Merge origin/main into feature/titans-with-pipeline
laihenyi Dec 29, 2025
794d639
fix: update code to use renamed database columns
laihenyi Dec 29, 2025
04c2bdb
Merge origin/main into feature/titans-with-pipeline
laihenyi Dec 29, 2025
d55c49d
fix: address HIGH and MEDIUM priority diffray-bot review issues
laihenyi Dec 30, 2025
89414fe
fix: address LOW priority diffray-bot review issues
laihenyi Dec 30, 2025
910da1c
Merge remote-tracking branch 'origin/main' into feature/titans-with-p…
laihenyi Dec 30, 2025
e0b88bc
fix: resolve merge conflicts with origin/main
laihenyi Dec 30, 2025
4ea2137
fix: implement database file size check in CleanupJob
laihenyi Dec 30, 2025
ec687cb
docs: improve TODO comments to document technical debt
laihenyi Dec 30, 2025
f4c4eca
docs: document decision chain detection implementation requirements
laihenyi Dec 30, 2025
ee451c9
fix: complete all diffray-bot LOW priority issue fixes
laihenyi Dec 30, 2025
6b7e147
docs: add comprehensive diffray-bot LOW priority fixes documentation
laihenyi Dec 30, 2025
19824fc
docs: comprehensive documentation update for PR #464
laihenyi Dec 30, 2025
877cfc2
feat: add version management and local settings preservation
laihenyi Dec 31, 2025
8fdde4b
fix: eliminate all error: any type safety issues
laihenyi Dec 31, 2025
c9983e1
feat: add AI auto-fix boundaries and multi-agent code review
laihenyi Jan 1, 2026
b8f2a73
fix: pass project context from cwd in observation handler
laihenyi Jan 2, 2026
ef27eae
merge: resolve conflict with origin/main
laihenyi Jan 2, 2026
5fa8dbe
build: rebuild bundles after merge
laihenyi Jan 2, 2026
245498d
fix: aggressive zombie process cleanup on worker restart/stop
laihenyi Jan 2, 2026
c2eb063
fix: auto-start worker when hooks are called without worker running
laihenyi Jan 3, 2026
8645fca
merge: integrate origin/main with PR #556 Live Context System
laihenyi Jan 6, 2026
b043030
merge: resolve conflicts with origin/main (v9.0.1)
laihenyi Jan 8, 2026
58b36bc
build: rebuild plugin after merge with origin/main v9.0.1
laihenyi Jan 8, 2026
cdbd4e5
fix: add savings calculation to /api/stats endpoint for StatusLine
laihenyi Jan 8, 2026
8583978
resolve: merge conflicts with origin/main handler architecture
laihenyi Jan 10, 2026
d17d074
Merge remote-tracking branch 'origin/main' into feature/titans-with-p…
laihenyi Jan 10, 2026
dbf68b1
fix: replace console.log with logger in background services
laihenyi Jan 10, 2026
7fb7087
Merge remote-tracking branch 'origin/main' into feature/titans-with-p…
laihenyi Jan 11, 2026
c0d28d0
Merge branch 'main' into feature/titans-with-pipeline
laihenyi Jan 12, 2026
d6cf885
Merge branch 'main' into feature/titans-with-pipeline
laihenyi Jan 15, 2026
74153a9
feat: integrate migration 011/012 and add session stats API
laihenyi Jan 17, 2026
982d6b8
chore: ignore test directories (Hex/, Tok/, integration_test/)
laihenyi Jan 18, 2026
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
56 changes: 46 additions & 10 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0 # Full history for better context

- name: Run Claude Code Review
id: claude-review
Expand All @@ -40,18 +40,54 @@ jobs:
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Please review this pull request and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage
## Multi-Agent Code Review with Confidence Scoring

Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
Perform a comprehensive code review from multiple perspectives. For each finding,
assign a confidence score (0-100) based on evidence strength.

Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
### Review Perspectives

1. **Compliance Agent**: Check adherence to CLAUDE.md guidelines
- Verify code follows project conventions
- Check if changes respect Allow/Deny List boundaries

2. **Bug Detection Agent**: Identify potential bugs
- Logic errors, edge cases, null/undefined handling
- Race conditions, async issues

3. **Performance Agent**: Spot performance issues
- N+1 queries, unnecessary iterations
- Memory leaks, blocking operations

4. **Security Agent**: Find security vulnerabilities
- Input validation, injection risks
- Credential exposure, auth bypasses

5. **Context Agent**: Analyze git history for context
- Review commit messages for intent
- Check if changes align with PR description

### Output Format

Only report findings with confidence >= 80. Format each finding as:

```
### [Category] Finding Title
**Confidence**: XX/100
**File**: path/to/file.ts:line
**Issue**: Description of the problem
**Suggestion**: How to fix it
```

### Summary Section

End with a summary:
- Total findings by category
- Overall code quality assessment (1-10)
- Recommendation: APPROVE, REQUEST_CHANGES, or COMMENT

Use `gh pr comment` with your Bash tool to post the review.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

148 changes: 148 additions & 0 deletions .github/workflows/self-healing-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Self-Healing CI (YOLO Push)

# Trigger when lint/type-check workflows fail
on:
workflow_run:
workflows: ["CI"] # Update this to match your CI workflow name
types: [completed]
branches: [main, dev, "feature/*"]

jobs:
auto-fix:
# Only run on failure, skip if already a retry
if: |
github.event.workflow_run.conclusion == 'failure' &&
!contains(github.event.workflow_run.head_commit.message, '[auto-fix]')

runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: read
id-token: write
actions: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Get failed workflow logs
id: get-logs
run: |
# Fetch the failed workflow run logs
gh run view ${{ github.event.workflow_run.id }} --log-failed > /tmp/failed-logs.txt 2>&1 || true
echo "logs_file=/tmp/failed-logs.txt" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Claude Auto-Fix
id: claude-fix
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
## Self-Healing CI: Auto-Fix Mode

The CI workflow failed. Analyze the error and fix it if allowed.

### Failed Workflow Logs
Check the file at /tmp/failed-logs.txt for error details.

### STRICT BOUNDARIES (from CLAUDE.md)

✅ **ALLOWED to auto-fix:**
- ESLint errors and warnings
- Prettier formatting issues
- TypeScript type errors
- Unused imports, import ordering
- Spelling errors (cspell)
- Missing peer dependencies

❌ **NEVER auto-fix (escalate to human):**
- Security-related code
- Database logic (src/services/sqlite/)
- Hook execution flow (src/hooks/*.ts)
- API design changes
- Architecture/pattern changes
- Privacy tag handling (src/utils/tag-stripping.ts)
- Business logic changes

### Instructions

1. Read /tmp/failed-logs.txt to understand the failure
2. Determine if the error is in the ALLOWED category
3. If ALLOWED:
- Make the minimal fix required
- Stage changes with `git add`
- DO NOT commit (the workflow will handle it)
- Output: "FIX_APPLIED=true"
4. If NOT ALLOWED or unclear:
- Output: "FIX_APPLIED=false"
- Explain why human review is needed

Be conservative. When in doubt, escalate to human review.

claude_args: '--allowed-tools "Bash(git add:*),Bash(git diff:*),Bash(git status:*),Bash(npm run lint:*),Bash(npm run format:*),Bash(npm run typecheck:*),Bash(cat:*),Read,Edit,Write,Glob,Grep"'

- name: Check if fix was applied
id: check-fix
run: |
if git diff --staged --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Commit and push fix
if: steps.check-fix.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Create commit with [auto-fix] tag to prevent infinite loops
git commit -m "[auto-fix] CI: Auto-fix lint/type errors

Automated fix applied by YOLO Push workflow.
Original failure: ${{ github.event.workflow_run.id }}

🤖 Generated with Claude Code"

git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create issue if fix not possible
if: steps.check-fix.outputs.has_changes == 'false'
run: |
gh issue create \
--title "🔴 CI Failure Requires Human Review" \
--body "## CI Auto-Fix Failed

The self-healing CI could not automatically fix this failure.

**Failed Workflow:** ${{ github.event.workflow_run.html_url }}
**Branch:** ${{ github.event.workflow_run.head_branch }}
**Commit:** ${{ github.event.workflow_run.head_sha }}

### Reason
The error is either:
- In a protected area (see Deny List in CLAUDE.md)
- Too complex for automatic resolution
- Requires architectural decisions

Please review and fix manually."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ src/ui/viewer.html

# Prevent other malformed path directories
http*/
https*/
https*/Hex/
Tok/
integration_test/
1 change: 1 addition & 0 deletions .serena/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cache
84 changes: 84 additions & 0 deletions .serena/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# list of languages for which language servers are started; choose from:
# al bash clojure cpp csharp csharp_omnisharp
# dart elixir elm erlang fortran go
# haskell java julia kotlin lua markdown
# nix perl php python python_jedi r
# rego ruby ruby_solargraph rust scala swift
# terraform typescript typescript_vts yaml zig
# Note:
# - For C, use cpp
# - For JavaScript, use typescript
# Special requirements:
# - csharp: Requires the presence of a .sln file in the project folder.
# When using multiple languages, the first language server that supports a given file will be used for that file.
# The first language is the default language and the respective language server will be used as a fallback.
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
languages:
- typescript

# the encoding used by text files in the project
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
encoding: "utf-8"

# whether to use the project's gitignore file to ignore files
# Added on 2025-04-07
ignore_all_files_in_gitignore: true

# list of additional paths to ignore
# same syntax as gitignore, so you can use * and **
# Was previously called `ignored_dirs`, please update your config if you are using that.
# Added (renamed) on 2025-04-07
ignored_paths: []

# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false

# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []

# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""

project_name: "claude-mem"
included_optional_tools: []
55 changes: 55 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ Claude-mem is a Claude Code plugin providing persistent memory across sessions.
npm run build-and-sync # Build, sync to marketplace, restart worker
```

## Version Management

Switch between stable and development versions to avoid instability during active development.

```bash
npm run version:status # Show current branch, installed version, cached versions
npm run version:stable # Switch to main branch (stable)
npm run version:dev # Switch to dev branch (auto-stashes changes)
```

**Workflow**:
- When your local version is stable, stay on that branch
- Use `version:stable` to quickly rollback if updates cause issues
- The script handles worker restart and git stash automatically

**Local Settings Preservation**: `sync-marketplace` preserves these files during sync:
- `/.mcp.json` - MCP server configuration
- `/local/` - User customizations directory
- `*.local.*` - Any file with .local. in name
- `/.env.local` - Local environment variables

## Configuration

Settings are managed in `~/.claude-mem/settings.json`. The file is auto-created with defaults on first run.
Expand Down Expand Up @@ -88,3 +109,37 @@ This architecture preserves the open-source nature of the project while enabling
## Important

No need to edit the changelog ever, it's generated automatically.

## AI Auto-Fix Boundaries (YOLO Push)

Define the scope of what AI can autonomously fix in CI pipelines.

### ✅ Allow List (Auto-fix permitted)

These mechanical issues can be fixed automatically without human review:

- **Linting**: ESLint errors and warnings
- **Formatting**: Prettier formatting issues
- **Types**: TypeScript type errors (missing types, type mismatches)
- **Imports**: Unused imports, import ordering, missing imports for used symbols
- **Spelling**: Variable/function name typos caught by cspell
- **Dependencies**: Missing peer dependencies in package.json

### ❌ Deny List (Human review required)

These areas require human judgment and must NOT be auto-fixed:

- **Security**: Any code in authentication, authorization, or credential handling
- **Database**: `src/services/sqlite/` - Schema changes, migrations, query logic
- **Hooks Core**: `src/hooks/*.ts` - Hook execution flow and lifecycle
- **API Design**: New endpoints, breaking changes to existing APIs
- **Architecture**: New abstractions, pattern changes, dependency additions
- **Privacy**: `src/utils/tag-stripping.ts` - Privacy tag handling logic
- **Business Logic**: Observation compression, scoring algorithms
- **Configuration**: `settings.json` schema changes, default values

### 🔄 Retry Policy

- Maximum 2 auto-fix attempts per CI failure
- Escalate to human review after max retries
- Never auto-fix the same file more than once per PR
Loading