Skip to content

Commit 0da6699

Browse files
AdametherzLabclaude
andcommitted
v0.1.0: OSSFactory-Scaler — Autonomous OSS product scaling agent team
5 AI agents (Scout, Builder, Demo, Maintainer, Critic) running 25 VDays/day on $5/day OpenRouter budget. Scans AdametherzLab repos, generates upgrades, creates SEO demo pages, triages issues, and tracks Slicing Pie rewards. - 4-tier model cascade: Gemini Flash Lite -> Flash -> Kimi K2.5 -> DeepSeek R1 - Quality gates: compile, tests, readme, security (IP/key/eval detection) - Atomic JSON persistence, Telegram notifications, PM2 ready - Zero runtime npm deps, all Bun built-ins - 16 tests passing, compiles clean Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit 0da6699

31 files changed

Lines changed: 2461 additions & 0 deletions

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OPENROUTER_API_KEY=sk-or-v1-your-key-here
2+
OPENROUTER_APP_TITLE=OSSFactory-Scaler
3+
GITHUB_ORG=AdametherzLab
4+
DAILY_BUDGET_USD=5
5+
VDAYS_PER_DAY=25
6+
OSS_BOT_TOKEN=your-telegram-bot-token
7+
TELEGRAM_USER_ID=your-telegram-user-id
8+
VPS_HOST=your-vps-hostname-or-ip
9+
VPS_USER=root
10+
SSH_KEY_PATH=/path/to/ssh/key
11+
LOG_LEVEL=info

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
dist/
3+
data/
4+
.env
5+
*.tmp
6+
*.log

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Contributing to OSSFactory-Scaler
2+
3+
## Getting Started
4+
5+
1. Fork the repository
6+
2. Clone your fork: `git clone https://github.com/YOUR_USER/OSSFactory-Scaler.git`
7+
3. Install dependencies: `bun install`
8+
4. Copy `.env.example` to `.env` and configure
9+
5. Run tests: `bun test`
10+
11+
## Development
12+
13+
- Runtime: Bun (no Node.js required)
14+
- Zero runtime npm dependencies — only Bun/Node built-ins
15+
- TypeScript with strict mode
16+
17+
## Pull Requests
18+
19+
- Keep changes focused and minimal
20+
- Run `bun test` before submitting
21+
- Run `bun build src/index.ts --target bun` to verify compilation
22+
- Do not commit `.env` files or any secrets
23+
24+
## Security
25+
26+
- Never hardcode API keys, tokens, IPs, or passwords
27+
- All secrets must come from environment variables
28+
- See SECURITY.md for reporting vulnerabilities
29+
30+
## Code Style
31+
32+
- Use TypeScript with explicit types
33+
- Prefer `const` over `let`
34+
- Use async/await over raw promises
35+
- Keep functions under 50 lines when possible

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 AdametherzLab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# OSSFactory-Scaler
2+
3+
Autonomous AI agent team that scales, maintains, and improves open-source repositories. Runs 25 VDays/day on a $5/day OpenRouter budget with 5 specialized agents.
4+
5+
## Agents
6+
7+
| Agent | Role | Model Tier |
8+
|-------|------|------------|
9+
| **Scout** | Scans repos, audits quality, prioritizes work queue | micro |
10+
| **Builder** | Clones repo, generates upgrades, repair cascade, pushes releases | fast -> standard -> engineering |
11+
| **Demo** | Creates/updates SEO-optimized demo pages, deploys to VPS | fast |
12+
| **Maintainer** | Triages issues, labels, auto-responds, health scoring | micro |
13+
| **Critic** | Reviews Builder output, runs quality gates, daily observation | micro |
14+
15+
## Install
16+
17+
```bash
18+
git clone https://github.com/AdametherzLab/OSSFactory-Scaler.git
19+
cd OSSFactory-Scaler
20+
bash scripts/setup.sh
21+
```
22+
23+
## Configuration
24+
25+
Copy `.env.example` to `.env` and fill in your keys:
26+
27+
```bash
28+
cp .env.example .env
29+
```
30+
31+
Required:
32+
- `OPENROUTER_API_KEY` — Your OpenRouter API key
33+
- `GITHUB_ORG` — GitHub org/user to scan (default: AdametherzLab)
34+
35+
Optional:
36+
- `OSS_BOT_TOKEN` / `TELEGRAM_USER_ID` — Telegram notifications
37+
- `VPS_HOST` / `VPS_USER` / `SSH_KEY_PATH` — Demo page deployment
38+
- `DAILY_BUDGET_USD` — Daily spending limit (default: $5)
39+
- `VDAYS_PER_DAY` — Virtual days per real day (default: 25)
40+
41+
## Usage
42+
43+
```bash
44+
# Run directly
45+
bun run src/index.ts
46+
47+
# Run with PM2
48+
npx pm2 start ecosystem.config.cjs
49+
50+
# Run tests
51+
bun test
52+
```
53+
54+
## How It Works
55+
56+
Each VDay (~58 minutes), the agents run sequentially:
57+
58+
1. **Scout** scans repos via `gh repo list`, audits quality, queues work items
59+
2. **Builder** picks top work item, clones repo, generates upgrade via AI cascade, runs quality gates
60+
3. **Critic** reviews recent work, writes 333-char observation
61+
4. **Demo** generates SEO demo pages for recently shipped repos, deploys via SCP
62+
5. **Maintainer** triages open issues, labels them, computes health scores
63+
64+
Every 5th VDay, a team meeting fires with a Slicing Pie leaderboard.
65+
66+
## Slicing Pie Points
67+
68+
| Action | Points |
69+
|--------|--------|
70+
| Ship a release | +10 |
71+
| Create demo page | +8 |
72+
| Fix/triage an issue | +5 |
73+
| Update demo page | +5 |
74+
| Quality improvement | +3 |
75+
| Successful review | +2 |
76+
| Failed ship | -3 |
77+
| Regression introduced | -5 |
78+
| Budget overrun | -2 |
79+
80+
## Quality Gates
81+
82+
1. **Compile**`bun build` passes
83+
2. **Tests**`bun test` with >= 50% pass rate
84+
3. **README** — >= 800 chars with install + usage sections
85+
4. **Security** — No eval(), hardcoded secrets, or IP addresses
86+
5. **Ship-ready** — Composite >= 70/100
87+
88+
## Model Tiers
89+
90+
| Tier | Model | Cost (in/out per 1M) |
91+
|------|-------|---------------------|
92+
| micro | Gemini 2.5 Flash Lite | $0.075 / $0.30 |
93+
| fast | Gemini 2.5 Flash | $0.15 / $0.60 |
94+
| standard | Kimi K2.5 | $0.45 / $2.20 |
95+
| engineering | DeepSeek R1 | $0.55 / $2.19 |
96+
97+
## Data Files
98+
99+
All persisted in `data/` (gitignored):
100+
101+
- `scaler-state.json` — Work queue, audits, completed work
102+
- `token-usage.json` — Per-model spend log
103+
- `slicing-pie.json` — Agent reward history
104+
- `builds/` — Temporary clone directory
105+
106+
## Requirements
107+
108+
- [Bun](https://bun.sh) runtime
109+
- [GitHub CLI](https://cli.github.com) (`gh`) authenticated
110+
- [OpenRouter](https://openrouter.ai) API key
111+
112+
## License
113+
114+
MIT

SECURITY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Security Policy
2+
3+
## Reporting Vulnerabilities
4+
5+
If you discover a security vulnerability, please report it responsibly:
6+
7+
1. **Do NOT** open a public GitHub issue
8+
2. Email: adam@arpe.engineering
9+
3. Include: description, steps to reproduce, potential impact
10+
11+
We will respond within 48 hours and work on a fix.
12+
13+
## Security Practices
14+
15+
- All secrets loaded from environment variables (`.env` gitignored)
16+
- No API keys, tokens, IP addresses, or passwords in source code
17+
- Security quality gate scans for: `eval()`, hardcoded keys, private keys, IP addresses, hardcoded passwords
18+
- Public repo — assume everything in source is visible
19+
20+
## Supported Versions
21+
22+
| Version | Supported |
23+
|---------|-----------|
24+
| 0.x.x | Yes |

bun.lock

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ecosystem.config.cjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: "oss-scaler",
5+
script: "scripts/bun-run.sh",
6+
cwd: __dirname,
7+
interpreter: "bash",
8+
autorestart: true,
9+
max_restarts: 10,
10+
restart_delay: 30000,
11+
env: {
12+
NODE_ENV: "production",
13+
},
14+
},
15+
],
16+
};

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "ossfactory-scaler",
3+
"version": "0.1.0",
4+
"description": "Autonomous AI agent team that scales, maintains, and improves OSS repos",
5+
"type": "module",
6+
"main": "src/index.ts",
7+
"scripts": {
8+
"start": "bun run src/index.ts",
9+
"test": "bun test",
10+
"build": "bun build src/index.ts --target bun --outdir dist"
11+
},
12+
"devDependencies": {
13+
"bun-types": "latest",
14+
"typescript": "^5.0.0"
15+
},
16+
"keywords": [
17+
"oss",
18+
"ai-agents",
19+
"automation",
20+
"typescript",
21+
"bun"
22+
],
23+
"author": "AdametherzLab",
24+
"license": "MIT",
25+
"repository": {
26+
"type": "git",
27+
"url": "https://github.com/AdametherzLab/OSSFactory-Scaler"
28+
}
29+
}

scripts/bun-run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -e
3+
cd "$(dirname "$0")/.."
4+
[ -f .env ] && source .env
5+
exec bun run src/index.ts

0 commit comments

Comments
 (0)