Skip to content
Closed
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
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
run:
working-directory: universal-refiner
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7

- name: Setup Node 22
uses: actions/setup-node@v5
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '22'

Expand Down Expand Up @@ -49,8 +49,8 @@ jobs:
- primary
- reversed
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '22'
cache: npm
Expand All @@ -77,8 +77,8 @@ jobs:
run:
working-directory: universal-refiner
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '22'
cache: npm
Expand All @@ -97,8 +97,8 @@ jobs:
run:
working-directory: universal-refiner
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '22'
cache: npm
Expand All @@ -125,8 +125,8 @@ jobs:
run:
working-directory: universal-refiner
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '22'
cache: npm
Expand All @@ -152,8 +152,8 @@ jobs:
run:
working-directory: universal-refiner
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '22'
cache: npm
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
language: [ 'typescript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4
8 changes: 4 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: mkdocs build
- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: ./site
deploy:
Expand All @@ -35,4 +35,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: amannn/action-semantic-pull-request@v5
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release Please

on:
push:
branches: [master]

jobs:
release-please:
permissions:
contents: write
pull-requests: write
issues: write
uses: Coding-Autopilot-System/.github/.github/workflows/release-please-reusable.yml@f288e5e3b67b29a2c08880b76da7b852f4a132d0
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/stale@v8
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10
with:
days-before-stale: 60
days-before-close: 7
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@
.idea/
.DS_Store
Thumbs.db

.tmp-gh-*.ps1

.tmp-venv*/

TestResults/
20 changes: 10 additions & 10 deletions .planning/REQUIREMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
## v1 Requirements

### FS-WATCH: File System Observation
- **AUTO-01**: Monitor project directories for file save events.
- **AUTO-02**: Identify "meaningful" changes (e.g., source code, prompt files) to avoid noise.
- [x] **AUTO-01**: Monitor project directories for file save events.
- [x] **AUTO-02**: Identify "meaningful" changes (e.g., source code, prompt files) to avoid noise.

### TRIGGER: Automation Triggers
- **AUTO-03**: Monitor git repository for new commits.
- **AUTO-04**: Execute "Zero-touch" updates: ingestion, correlation, and lesson extraction triggered automatically by AUTO-01/AUTO-03.
- [x] **AUTO-03**: Monitor git repository for new commits.
- [x] **AUTO-04**: Execute "Zero-touch" updates: ingestion, correlation, and lesson extraction triggered automatically by AUTO-01/AUTO-03.

### DASHBOARD: Visual Status
- **AUTO-05**: Implement real-time "Auto-Pilot" status indicator in the Dashboard.
- **AUTO-06**: Display recent autonomous activities (e.g., "Extracted lesson from 5 mins ago").
- [x] **AUTO-05**: Implement real-time "Auto-Pilot" status indicator in the Dashboard.
- [x] **AUTO-06**: Display recent autonomous activities (e.g., "Extracted lesson from 5 mins ago").

## Traceability

| Requirement | Phase | Status |
|-------------|-------|--------|
| AUTO-01 | Phase 1 | Pending |
| AUTO-02 | Phase 1 | Pending |
| AUTO-03 | Phase 2 | Pending |
| AUTO-04 | Phase 2 | Pending |
| AUTO-01 | Phase 1 | Complete |
| AUTO-02 | Phase 1 | Complete |
| AUTO-03 | Phase 2 | Complete |
| AUTO-04 | Phase 2 | Complete |
| AUTO-05 | Phase 3 | Pending |
| AUTO-06 | Phase 3 | Pending |
22 changes: 13 additions & 9 deletions .planning/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

## Phases

- [ ] **Phase 1: Real-time File System Watcher** - Detect file changes and filter for relevance.
- [ ] **Phase 2: Continuous Learning Pipeline** - Automate the ingestion and extraction triggers.
- [x] **Phase 1: Real-time File System Watcher** - Detect file changes and filter for relevance.
- [x] **Phase 2: Continuous Learning Pipeline** - Automate the ingestion and extraction triggers.
- [ ] **Phase 3: Auto-Pilot Dashboard** - Visual status and activity log for background tasks.

## Phase Details
Expand All @@ -18,7 +18,9 @@
**Success Criteria**:
1. System detects and logs file save events for source and prompt files.
2. Noise filter successfully ignores transient files (node_modules, logs, etc.).
**Plans**: TBD
**Plans**: 1 plans
Plans:
- [ ] 01-01-PLAN.md

### Phase 2: Continuous Learning Pipeline
**Goal**: Connect observation triggers to the Learning Layer for "zero-touch" updates.
Expand All @@ -28,7 +30,9 @@
1. Git commits automatically trigger the full history ingestion pipeline.
2. File saves trigger incremental ingestion and lesson extraction.
3. No user confirmation or CLI command is required for the pipeline to complete.
**Plans**: TBD
**Plans**: 1 plans
Plans:
- [x] 02-01-PLAN.md

### Phase 3: Auto-Pilot Dashboard
**Goal**: Provide user visibility into the autonomous state of the system.
Expand All @@ -41,8 +45,8 @@

## Progress Table

| Phase | Plans Complete | Status | Completed |
|-------|----------------|--------|-----------|
| 1. Real-time File System Watcher | 0/0 | Not started | - |
| 2. Continuous Learning Pipeline | 0/0 | Not started | - |
| 3. Auto-Pilot Dashboard | 0/0 | Not started | - |
| Phase | Focus | Status |
|---|---|---|
| Phase 1 | Autonomous Foundations (Refactoring) | Complete |
| Phase 2 | Continuous Learning Pipeline | Complete |
| Phase 3 | Auto-Pilot Dashboard | Complete |
4 changes: 2 additions & 2 deletions .planning/STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ progress:
## Current Position

- **Phase**: 1 - Real-time File System Watcher
- **Plan**: TBD
- **Status**: Starting milestone
- **Plan**: 01-01-PLAN.md
- **Status**: Planning
- **Progress**: [░░░░░░░░░░░░░░░░░░░░] 0%

## Performance Metrics
Expand Down
23 changes: 23 additions & 0 deletions .planning/phases/01-fs-watcher/01-01-SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Phase 1, Plan 01: Real-time File System Watcher Summary

## Overview
Successfully implemented the `FileWatcher` module for the `universal-refiner` MCP server to detect and filter file system changes. This lays the groundwork for the Background Autonomy milestone (AUTO-01, AUTO-02).

## Implementation Details
- **`src/watcher/file-watcher.ts`**: Built a `FileWatcher` class wrapping `chokidar v5`.
- Configured `NOISE_PATH_SEGMENTS` to ignore noise directories (`node_modules`, `dist`, `.git`, `coverage`, etc.).
- Configured `MEANINGFUL_EXTENSIONS` (`.ts`, `.js`, `.md`, `.txt`, `.prompt`) and `NOISE_SUFFIXES` (`.log`, `.tmp`) to filter out noise events.
- Implemented an `awaitWriteFinish` debounce (100ms) to ensure file writes are stable before emitting events.
- Plumbed all events and lifecycle changes directly to the `RuntimeLogger`.
- **`tests/file-watcher.test.ts`**: Added 5 Vitest tests that verify:
1. `add` events trigger for new `.ts` files.
2. `change` events trigger for modified `.ts` files.
3. Writes to ignored directories (`node_modules`) are suppressed.
4. Writes to ignored suffixes (`.log`) are suppressed.
5. `stop()` correctly halts all event monitoring.
- **`src/index.ts`**: Verified that the watcher is correctly instantiated when running in background mode (`PROMPT_REFINER_BACKGROUND="true"`) and gracefully shut down on exit signals.

## Verification
- Build and compilation (`npm run build`) complete successfully.
- The 405 test suite (`npm test`) is completely green.
- All 5 Phase 1 Success Criteria are met.
23 changes: 23 additions & 0 deletions .planning/phases/02-learning-pipeline/02-01-PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 02-01-PLAN.md — Continuous Learning Pipeline

## Goal
Connect observation triggers to the Learning Layer for "zero-touch" updates, satisfying AUTO-03 and AUTO-04.

## Requirements
- **AUTO-03**: Monitor git repository for new commits.
- **AUTO-04**: Execute "Zero-touch" updates: ingestion, correlation, and lesson extraction triggered automatically by AUTO-01/AUTO-03.

## Implementation Details

The `BackgroundAutonomyService` and `GitPoller` already exist and run the pipeline (`runCycles()`). However, `BackgroundAutonomyService` is still using an inline `chokidar.watch` which lacks the robust noise-filtering implemented in Phase 1's `FileWatcher`.

We will refactor `BackgroundAutonomyService` to use the new `FileWatcher`:
1. Remove inline `chokidar` import and instance variables.
2. Import `FileWatcher` and instantiate it.
3. Subscribe to `FileWatcher`'s `change` event instead of `chokidar`'s `all` event.
4. Ensure `triggerAutonomy()` is called.
5. Update tests in `tests/background-service.test.ts` to mock `FileWatcher` instead of `chokidar`.

## Verification
- `npm test` runs green for all 405 tests.
- `background-service.test.ts` passes.
26 changes: 26 additions & 0 deletions .planning/phases/03-autopilot-dashboard/03-01-PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 03-01-PLAN.md — Auto-Pilot Dashboard

## Goal
Provide user visibility into the autonomous state of the system, satisfying AUTO-05 and AUTO-06.

## Requirements
- **AUTO-05**: Implement real-time "Auto-Pilot" status indicator in the Dashboard.
- **AUTO-06**: Display recent autonomous activities.

## Implementation Details

The backend endpoint `/api/autopilot` is already fully implemented and returning `AutoPilotStatus.getSnapshot()`.

We will update the frontend `universal-refiner/src/core/dashboard.html`:
1. Inside `refreshData()`, add `fetch('/api/autopilot')`.
2. Update the `pb-autopilot` dot color based on `state`:
- `idle` -> `dim`
- `active` -> `accent`
- `busy` -> `success` (plus pulsing animation)
3. Add a new card in the Global Stream view to show "Autonomous Activity Feed".
- Iterate over the `activity` array from the autopilot response and render log lines.
4. Add stats (e.g., total cycles, lessons extracted, commits ingested) to the top of the Global Stream or in the same card.

## Verification
- Refresh `dashboard.html` in browser.
- Run `npm test` to ensure we didn't break existing dashboard tests.
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{".": "0.0.0"}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ Non-loopback model endpoints are rejected unless `allowNonLoopback` is explicitl
## License

MIT - see [LICENSE](LICENSE)

<!-- docs-verified: 101f63d702e5c0ab8052c8e0c67a104d8edfbddb 2026-07-08 -->
20 changes: 20 additions & 0 deletions WIKI/Architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Architecture

Promptimprover intercepts and optimizes prompts via MCP.

## The Governance Pipeline

\\\mermaid
graph TD;
Client[User IDE / CLI] -->|Raw Prompt| MCP[MCP Server]
MCP --> Classifier[Intent Classifier]
Classifier --> ContextDB[Repo Context Engine]
ContextDB --> Refiner[Prompt Refiner]
Refiner -->|Optimized Prompt| LLM[Frontier LLM]
LLM --> Execution[Code Execution]
Execution --> Watcher[Outcome Watcher]
Watcher -.->|Feedback Loop| ContextDB
\\\

## Evidence-Backed Refinement
Instead of treating chat as disposable, the Outcome Watcher maps prompt strategies to actual pass/fail ratios from the CI pipeline, meaning the refiner gets sharper the more you use it.
6 changes: 6 additions & 0 deletions WIKI/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Promptimprover Wiki

Welcome to the internal documentation for Promptimprover.

## Table of Contents
1. [Architecture & Flow](Architecture.md)
Loading