genesis-agent 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- genesis_agent-0.1.1/.dockerignore +45 -0
- genesis_agent-0.1.1/.github/workflows/ci.yml +52 -0
- genesis_agent-0.1.1/.gitignore +28 -0
- genesis_agent-0.1.1/CONTRIBUTING.md +55 -0
- genesis_agent-0.1.1/DECISIONS.md +651 -0
- genesis_agent-0.1.1/Dockerfile +38 -0
- genesis_agent-0.1.1/EVAL.md +228 -0
- genesis_agent-0.1.1/LICENSE +21 -0
- genesis_agent-0.1.1/PKG-INFO +333 -0
- genesis_agent-0.1.1/README.md +307 -0
- genesis_agent-0.1.1/ci/plan.json +4 -0
- genesis_agent-0.1.1/ci/stub_server.py +51 -0
- genesis_agent-0.1.1/evals/counting_adapter.py +21 -0
- genesis_agent-0.1.1/evals/main.py +62 -0
- genesis_agent-0.1.1/evals/report.py +159 -0
- genesis_agent-0.1.1/evals/results/run-20260902T043936Z.jsonl +78 -0
- genesis_agent-0.1.1/evals/results/run-20260912T035718Z.jsonl +78 -0
- genesis_agent-0.1.1/evals/results/smoke-20260902T042845Z.jsonl +3 -0
- genesis_agent-0.1.1/evals/results/smoke-20260912T035425Z.jsonl +3 -0
- genesis_agent-0.1.1/evals/rubric.py +122 -0
- genesis_agent-0.1.1/evals/run_eval.py +98 -0
- genesis_agent-0.1.1/pyproject.toml +49 -0
- genesis_agent-0.1.1/src/genesis/__init__.py +16 -0
- genesis_agent-0.1.1/src/genesis/adapter.py +49 -0
- genesis_agent-0.1.1/src/genesis/agent.py +51 -0
- genesis_agent-0.1.1/src/genesis/anthropic_adapter.py +79 -0
- genesis_agent-0.1.1/src/genesis/cli.py +76 -0
- genesis_agent-0.1.1/src/genesis/core.py +232 -0
- genesis_agent-0.1.1/src/genesis/fakes.py +16 -0
- genesis_agent-0.1.1/src/genesis/interface.py +106 -0
- genesis_agent-0.1.1/src/genesis/ollama_adapter.py +76 -0
- genesis_agent-0.1.1/src/genesis/planner.py +193 -0
- genesis_agent-0.1.1/src/genesis/scaffolder.py +133 -0
- genesis_agent-0.1.1/src/genesis/template_registry.py +61 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/.gitignore +17 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/README.md +17 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/pyproject.toml +22 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/src/greetly/__init__.py +0 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/src/greetly/__main__.py +3 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/src/greetly/cli.py +21 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/src/greetly/core.py +2 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/tests/test_cli.py +10 -0
- genesis_agent-0.1.1/src/genesis/templates/python-cli/tests/test_core.py +5 -0
- genesis_agent-0.1.1/src/genesis/tools.py +57 -0
- genesis_agent-0.1.1/tests/test_adapter.py +6 -0
- genesis_agent-0.1.1/tests/test_agent.py +69 -0
- genesis_agent-0.1.1/tests/test_agent_live.py +25 -0
- genesis_agent-0.1.1/tests/test_anthropic_adapter.py +52 -0
- genesis_agent-0.1.1/tests/test_cli.py +119 -0
- genesis_agent-0.1.1/tests/test_core.py +248 -0
- genesis_agent-0.1.1/tests/test_live_planner.py +54 -0
- genesis_agent-0.1.1/tests/test_ollama_adapter.py +171 -0
- genesis_agent-0.1.1/tests/test_planner.py +123 -0
- genesis_agent-0.1.1/tests/test_scaffolder.py +99 -0
- genesis_agent-0.1.1/tests/test_template_registry.py +54 -0
- genesis_agent-0.1.1/tests/test_tools.py +9 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Build context exclusions.
|
|
2
|
+
#
|
|
3
|
+
# WARNING: templates/ must NOT be excluded. The scaffolder reads the vendored
|
|
4
|
+
# Python CLI template from the filesystem at generation time (D-001); an image
|
|
5
|
+
# without it can plan but not scaffold, and nothing fails until a user tries.
|
|
6
|
+
|
|
7
|
+
# Virtualenvs and build artefacts
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
*.egg-info/
|
|
13
|
+
build/
|
|
14
|
+
dist/
|
|
15
|
+
|
|
16
|
+
# Tooling caches (including the ones vendored inside templates/)
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.ruff_cache/
|
|
19
|
+
.mypy_cache/
|
|
20
|
+
|
|
21
|
+
# VCS and CI config — not needed at runtime
|
|
22
|
+
.git/
|
|
23
|
+
.gitignore
|
|
24
|
+
.github/
|
|
25
|
+
|
|
26
|
+
# Eval artefacts: regenerated on demand, hundreds of KB and growing,
|
|
27
|
+
# and useless inside the image
|
|
28
|
+
evals/results/
|
|
29
|
+
|
|
30
|
+
# Working docs and local agent state. Excluded partly to keep the image lean
|
|
31
|
+
# and partly for layer caching: these change constantly, and a COPY layer that
|
|
32
|
+
# depends on them would rebuild on every doc edit.
|
|
33
|
+
docs/
|
|
34
|
+
CLAUDE.md
|
|
35
|
+
DECISIONS.md
|
|
36
|
+
.claude/
|
|
37
|
+
|
|
38
|
+
# Tests are not needed at runtime. The container is verified by scaffolding a
|
|
39
|
+
# repo and building it, not by running Genesis's own suite. Reversible: drop
|
|
40
|
+
# this line if you later want `pytest` to run inside the image.
|
|
41
|
+
tests/
|
|
42
|
+
|
|
43
|
+
# Scratch and OS noise
|
|
44
|
+
scratch.py
|
|
45
|
+
.DS_Store
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
template:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
defaults:
|
|
9
|
+
run:
|
|
10
|
+
working-directory: src/genesis/templates/python-cli
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.11"
|
|
16
|
+
- run: pip install -e ".[dev]"
|
|
17
|
+
- run: ruff check .
|
|
18
|
+
- run: ruff format --check .
|
|
19
|
+
- run: pytest
|
|
20
|
+
genesis:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
- uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.11"
|
|
27
|
+
- run: pip install -e ".[dev]"
|
|
28
|
+
- run: ruff check .
|
|
29
|
+
- run: ruff format --check .
|
|
30
|
+
- run: pytest
|
|
31
|
+
- name: end-to-end plan and scaffold against a stub model server
|
|
32
|
+
run: |
|
|
33
|
+
python ci/stub_server.py &
|
|
34
|
+
for _ in $(seq 40); do curl -sf http://127.0.0.1:8765/ >/dev/null && break; sleep 0.25; done
|
|
35
|
+
GENESIS_OLLAMA_BASE_URL=http://127.0.0.1:8765/v1 \
|
|
36
|
+
genesis create "a cli todo app" out --adapter ollama --model stub --force
|
|
37
|
+
docker:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- run: docker build -t genesis:ci .
|
|
42
|
+
- run: docker run --rm genesis:ci --version
|
|
43
|
+
- name: every registered template ships inside the image
|
|
44
|
+
run: >
|
|
45
|
+
docker run --rm --entrypoint python genesis:ci -c
|
|
46
|
+
"from genesis.template_registry import TEMPLATES, template_dir;
|
|
47
|
+
assert all(template_dir(t).is_dir() for t in TEMPLATES), TEMPLATES"
|
|
48
|
+
- name: scaffold and build inside the container
|
|
49
|
+
run: >
|
|
50
|
+
docker run --rm -v "$PWD/ci:/plan:ro" genesis:ci
|
|
51
|
+
scaffold /plan/plan.json out
|
|
52
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
# Environments
|
|
9
|
+
.venv/
|
|
10
|
+
venv/
|
|
11
|
+
.env
|
|
12
|
+
|
|
13
|
+
# Tooling caches
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
|
|
17
|
+
# Claude Code local state
|
|
18
|
+
.claude/
|
|
19
|
+
|
|
20
|
+
# OS / editor
|
|
21
|
+
.DS_Store
|
|
22
|
+
.vscode/
|
|
23
|
+
.idea/
|
|
24
|
+
|
|
25
|
+
# Personal / working agreement — kept out of the public repo
|
|
26
|
+
docs/
|
|
27
|
+
scratch.py
|
|
28
|
+
CLAUDE.md
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for looking. Please read the licensing note below **before** writing code — it affects whether a pull request can be accepted at all.
|
|
4
|
+
|
|
5
|
+
## Licensing and contributions
|
|
6
|
+
|
|
7
|
+
Contributions are accepted under the MIT licence. Sign your commits with `git commit -s`, which adds a `Signed-off-by:` line certifying you wrote the code and may submit it under that licence (the [Developer Certificate of Origin](https://developercertificate.org/)).
|
|
8
|
+
|
|
9
|
+
One consequence, stated here because it is easy to discover too late: a DCO certifies provenance, it does **not** transfer copyright. Once external contributions are merged, relicensing future versions would need every contributor's agreement. That is accepted — the intended path if this is ever commercialised is open core, which keeps the CLI MIT either way ([`DECISIONS.md`](DECISIONS.md), D-069). There is no CLA and none is planned.
|
|
10
|
+
|
|
11
|
+
Particularly welcome, beyond code:
|
|
12
|
+
|
|
13
|
+
- **Bug reports.** Especially anything that produces a broken generated repo, since that is the claim the project stakes itself on.
|
|
14
|
+
- **Eval results.** Running the harness against a model that is not in the ladder, and reporting what you got.
|
|
15
|
+
- **Disagreement with a decision.** `DECISIONS.md` records reasoning precisely so it can be argued with. An issue explaining why one is wrong is more valuable than a patch.
|
|
16
|
+
|
|
17
|
+
If you want to work on something substantial, open an issue first so nobody wastes an evening.
|
|
18
|
+
|
|
19
|
+
## Running it
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/jborrajo21/genesis && cd genesis
|
|
23
|
+
python -m venv .venv && source .venv/bin/activate
|
|
24
|
+
pip install -e ".[dev]"
|
|
25
|
+
|
|
26
|
+
pytest # offline; no API key, no network beyond pip
|
|
27
|
+
pytest -m "not slow" # skips the two tests that build a venv
|
|
28
|
+
ruff check . && ruff format --check .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Live tests are opt-in and skip by default: the Anthropic one needs `ANTHROPIC_API_KEY` exported, the Ollama one needs a local server with a model pulled. CI never sets either, so it stays secret-free and deterministic.
|
|
32
|
+
|
|
33
|
+
Run `ruff check . && pytest -q` **immediately before committing**, not only while working — more than one red build here has come from a final edit made after the last check.
|
|
34
|
+
|
|
35
|
+
## How the project is organised
|
|
36
|
+
|
|
37
|
+
| | |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `src/genesis/` | the package — adapters, planner, scaffolder, CLI |
|
|
40
|
+
| `src/genesis/templates/` | template *data*; must stay inside the package or it will not ship in the wheel (D-054) |
|
|
41
|
+
| `tests/` | offline suite; two tests marked `slow` build a real venv |
|
|
42
|
+
| `evals/` | the eval harness — deliberately **not** under `tests/`, because it is non-deterministic, costs money and needs credentials (D-051) |
|
|
43
|
+
| `evals/results/` | persisted runs. Also a regression corpus: stack classification is asserted against every recorded plan |
|
|
44
|
+
|
|
45
|
+
## Things worth knowing before changing anything
|
|
46
|
+
|
|
47
|
+
- **Every non-trivial change gets a `DECISIONS.md` entry** with constraint-based reasoning — what was chosen, what was rejected, and what it costs. "It's cleaner" is not a reason.
|
|
48
|
+
- **Do not tune the planner or the template matchers against the eval set.** Fitting the system to the twenty ideas it is measured on destroys the meaning of the numbers. Findings go in `EVAL.md`; fixes are a separate, later decision.
|
|
49
|
+
- **Re-run the eval only when a change can alter a recorded outcome.** When it provably cannot, replay the persisted plans instead — it is a second and free.
|
|
50
|
+
- **`genesis scaffold` must never require an API key.** That is what allows the CI gate, the offline tests, and the planned keyless hosted tier.
|
|
51
|
+
- **CI and Docker steps assert against public API**, and over whole sets rather than one hardcoded path. Two failures here have come from assertions on private names.
|
|
52
|
+
|
|
53
|
+
## Reporting a bug
|
|
54
|
+
|
|
55
|
+
Include the plan JSON if there is one — it is the input that reproduces most failures, and `genesis plan --output plan.json` will give you it. Exit codes are meaningful: `0` success, `1` failure, `2` a usage error from argument parsing.
|