Skip to content

feat(self-improvement-assistant): add autonomous codebase analysis plugin#114

Closed
konard wants to merge 3 commits intoxlabtg:mainfrom
konard:issue-113-2696a1145665
Closed

feat(self-improvement-assistant): add autonomous codebase analysis plugin#114
konard wants to merge 3 commits intoxlabtg:mainfrom
konard:issue-113-2696a1145665

Conversation

@konard
Copy link
Copy Markdown

@konard konard commented Apr 7, 2026

Summary

Implements the self-improvement-assistant plugin requested in issue #113.

The plugin provides four tools for autonomous codebase analysis and GitHub issue creation:

  • self_analyze_codebase — fetches a GitHub repo's file tree, reads JS/TS source files, and applies heuristic pattern analysis to detect bugs, security vulnerabilities, performance issues, and readability problems. Results are persisted to a local SQLite database.
  • self_create_issue — creates a well-formatted GitHub issue from any analysis finding, with severity badge, file path, description, and fix suggestion. Requires admin scope.
  • self_schedule_analysis — enables or disables periodic autonomous analysis (configurable interval). Requires admin scope.
  • self_list_analysis_history — lists past analysis runs from the local log.

Detected patterns (heuristic, no LLM required)

Category Pattern Severity
Security eval() usage Critical
Security new Function() High
Security innerHTML = assignment High
Security Credential logging Critical
Security Weak hash (MD5/SHA-1) Medium
Performance async in forEach Medium
Performance Missing timer cleanup Low
Readability Empty catch blocks Medium
Readability Loose equality (==) Low
Readability Raw console.* calls Low
Tests Large files without tests Low

Security

  • GitHub token stored exclusively via sdk.secrets — never logged
  • Issue creation is scope: admin-only
  • auto_create_issues defaults to false — requires explicit user action
  • All GitHub API calls use AbortSignal.timeout(15_000)

Files added

  • plugins/self-improvement-assistant/index.js — plugin implementation
  • plugins/self-improvement-assistant/manifest.json — plugin metadata
  • plugins/self-improvement-assistant/README.md — documentation
  • registry.json — plugin entry added

How to reproduce / test

# Load test
node -e "import('./plugins/self-improvement-assistant/index.js').then(m => { const t = m.tools({}); console.log(t.length, 'tools exported') })"

# Or: verify module exports
node --input-type=module <<'EOJS'
const mod = await import('./plugins/self-improvement-assistant/index.js');
console.log('exports:', Object.keys(mod).join(', '));
const tools = mod.tools({ secrets: { get: () => undefined }, log: { info: ()=>{}, warn: ()=>{}, error: ()=>{} }, db: null, storage: { get: ()=>undefined, set: ()=>{} }, pluginConfig: {} });
console.log(tools.length, 'tools:', tools.map(t => t.name).join(', '));
EOJS

Fixes #113


This PR was created automatically by the AI issue solver

konard and others added 2 commits April 7, 2026 07:10
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: xlabtg#113
…ugin

Implements the plugin requested in issue xlabtg#113. The plugin provides:
- self_analyze_codebase: heuristic analysis of JS/TS files for security,
  performance, readability, and test-coverage issues using regex patterns
- self_create_issue: creates structured GitHub issues (admin-only) from findings
- self_schedule_analysis: enables/disables periodic autonomous analysis
- self_list_analysis_history: lists past runs from the local SQLite log

All tokens are handled via sdk.secrets. Issue creation requires admin scope
and auto_create_issues defaults to false for safety.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] 🏗️ План реализации вкладки «Автономное развитие» feat(self-improvement-assistant): add autonomous codebase analysis plugin Apr 7, 2026
@konard konard marked this pull request as ready for review April 7, 2026 07:15
@konard
Copy link
Copy Markdown
Author

konard commented Apr 7, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.954452
  • Calculated by Anthropic: $0.954452 USD
  • Difference: $-0.000000 (-0.00%)

📊 Context and tokens usage:

  • Context window: 67.2K / 1M input tokens (7%), 17.3K / 64K output tokens (27%)

Total: 56.2K + 1.6M cached input tokens, 17.3K output tokens, $0.954452 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (715KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Author

konard commented Apr 7, 2026

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable.

…iable

Replace usage of Node.js `global.__selfImproveTimer` with a module-level
`_selfImproveTimer` variable to fix ESLint no-undef errors in CI lint check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard
Copy link
Copy Markdown
Author

konard commented Apr 7, 2026

🔄 Auto-restart-until-mergeable Log (iteration 1)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.438425
  • Calculated by Anthropic: $0.438425 USD
  • Difference: $0.000000 (+0.00%)

📊 Context and tokens usage:

  • Context window: 43.6K / 1M input tokens (4%), 3.7K / 64K output tokens (6%)

Total: 33.8K + 855.0K cached input tokens, 3.7K output tokens, $0.438425 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (1256KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@xlabtg xlabtg closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🏗️ План реализации вкладки «Автономное развитие»

2 participants