File size: 5,363 Bytes
ecde4d1
3ad5bcd
bc993e4
 
 
ecde4d1
bc993e4
ecde4d1
cfa1fc1
ecde4d1
bc993e4
3ad5bcd
ecde4d1
 
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
 
 
 
 
 
 
 
 
 
 
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
 
 
 
bc993e4
3ad5bcd
bc993e4
3ad5bcd
 
 
 
 
 
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
 
bc993e4
 
3ad5bcd
bc993e4
 
3ad5bcd
 
 
 
bc993e4
 
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
 
 
 
 
 
 
 
 
bc993e4
 
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
bc993e4
3ad5bcd
 
 
 
 
 
 
 
 
 
bc993e4
 
 
 
3ad5bcd
 
 
 
 
 
 
 
 
 
 
bc993e4
 
 
 
3ad5bcd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
title: SEED Autonomous Unicorn Company
emoji: 🌱
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 6.5.1
app_file: app.py
python_version: 3.10.13
pinned: false
license: apache-2.0
short_description: Autonomous software company
---

# SEED — Autonomous Unicorn Company v1

SEED is an autonomous, observable, open-source software company hosted on Hugging Face. Unlike the earlier deterministic demonstration, this version performs real work when its ZeroGPU API endpoint is invoked:

- collects current public signals from Hacker News, GitHub Issues and arXiv;
- runs an open-weight coding model on ZeroGPU;
- coordinates CEO, market, product, technology, development, testing, compliance, growth, resource-control and self-improvement roles;
- selects an evidence-backed product direction;
- creates product specifications and Python candidate code;
- performs Python syntax and security checks;
- asks independent Tester and Compliance roles to approve or reject the candidate;
- promotes only candidates that pass all gates;
- opens new organizational positions when a specific capability gap is found;
- persists state, research, generated code, reports and audit events to a Hugging Face Dataset repository;
- displays all activity through this Space.

## Important runtime fact

ZeroGPU allocates a GPU only when a function decorated with `@spaces.GPU` is called. A sleeping free Space cannot wake itself. This repository deliberately contains **no Hugging Face Scheduled Jobs and requires no prepaid Job credit**.

To work while nobody is viewing the Space, configure a free external HTTP wake-up to call the `autonomous_cycle` Gradio API endpoint. The wake-up performs no AI and stores no data. Everything produced by the company remains on Hugging Face.

See [`docs/FREE_WAKE_UP.md`](docs/FREE_WAKE_UP.md).

## Required Space secrets and variables

Open **Settings → Variables and secrets**.

### Secrets

```text
HF_TOKEN=<fine-grained token with write access to the memory Dataset repo>
SEED_TRIGGER_SECRET=<long random secret>
```

### Variables

```text
SEED_MEMORY_REPO=Italianhype/seed-company-memory
SEED_MODEL_ID=Qwen/Qwen2.5-Coder-1.5B-Instruct
SEED_INTERVAL_MINUTES=120
SEED_MEMORY_PRIVATE=false
```

`HF_TOKEN` is required for durable Hub persistence. Without it, the Space still runs but falls back to ephemeral local state.

## Hardware

Keep the Space on **ZeroGPU**. `autonomous_cycle()` is decorated with `@spaces.GPU(duration=180)` and executes model inference only while a cycle is running. Dashboard rendering, public research and Hub persistence use CPU.

## Open model

The default model is `Qwen/Qwen2.5-Coder-1.5B-Instruct`, licensed Apache 2.0. Change `SEED_MODEL_ID` to another compatible open-weight causal language model after validating its license and ZeroGPU memory requirements.

## API wake-up

The Space exposes this named Gradio endpoint:

```text
autonomous_cycle(secret: str, force: bool) -> str
```

Example request:

```bash
export SEED_SPACE_URL="https://italianhype-seed-autonomous-unicorn.hf.space"
export SEED_TRIGGER_SECRET="your-secret"
export HF_TOKEN="your-caller-token"
./scripts/trigger_cycle.sh
```

A free HTTP cron can send the equivalent POST every two hours.

## Hugging Face memory structure

The Dataset repository configured by `SEED_MEMORY_REPO` is created automatically when the Space token has permission:

```text
state/company_state.json
artifacts/cycle-0001/research/evidence.json
artifacts/cycle-0001/strategy/board_decision.json
artifacts/cycle-0001/product/*.py
artifacts/cycle-0001/tests/test_candidate.py
artifacts/cycle-0001/review/quality_gate.json
artifacts/cycle-0001/reports/cycle_summary.md
...
```

Every cycle is a single Hub commit containing the state snapshot and all new artifacts.

## Safety and release boundary

This version produces and evaluates real candidate code but does not execute arbitrary generated code and does not overwrite the stable Space runtime. It uses `ast.parse`, Python compilation and a blocked-import policy before independent AI review. Candidate artifacts are persisted for inspection and future isolated testing.

The autonomous organization can change its roles and product direction, but it cannot control payments, contracts, tokens or the immutable release boundary.

## Local tests

```bash
python -m venv .venv
source .venv/bin/activate
pip install pydantic pytest huggingface_hub requests
pytest -q
```

Local execution uses the deterministic fallback unless `SEED_LOAD_MODEL=true` and compatible CUDA hardware are available.

## Repository structure

```text
app.py                         Gradio dashboard and ZeroGPU API
seed_company/engine.py         Real multi-role autonomous cycle
seed_company/runtime.py        Open-weight model runtime and JSON contracts
seed_company/research.py       Current public evidence collection
seed_company/store.py          Local atomic + Hugging Face Dataset persistence
seed_company/models.py         Typed organization and product state
seed_company/projections.py    Dashboard projections
agents/founding_roles.yaml     Founding organization and role policy
docs/FREE_WAKE_UP.md           Free unattended wake-up setup
scripts/trigger_cycle.*        Reference API clients
tests/                         Deterministic engine and persistence tests
```

## License

Apache License 2.0.