chore: rename bulkgen to hokusai
This commit is contained in:
parent
a28cc97aed
commit
4def49350e
32 changed files with 215 additions and 213 deletions
24
CLAUDE.md
24
CLAUDE.md
|
|
@ -1,17 +1,17 @@
|
|||
# CLAUDE.md - bulkgen development guide
|
||||
# CLAUDE.md - hokusai development guide
|
||||
|
||||
## Project overview
|
||||
|
||||
bulkgen is a `make`-like build tool for AI-generated artifacts (images and text). A YAML config file defines targets with dependencies; bulkgen builds a DAG with networkx and executes generation in parallel topological order using Mistral (text) and BlackForestLabs (images) as providers.
|
||||
hokusai is a `make`-like build tool for AI-generated artifacts (images and text). A YAML config file defines targets with dependencies; hokusai builds a DAG with networkx and executes generation in parallel topological order using Mistral (text) and BlackForestLabs (images) as providers.
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
uv sync # install dependencies
|
||||
uv run bulkgen build # build all targets
|
||||
uv run bulkgen build X # build target X and its transitive deps
|
||||
uv run bulkgen clean # remove generated artifacts + state file
|
||||
uv run bulkgen graph # print dependency graph with stages
|
||||
uv run hokusai build # build all targets
|
||||
uv run hokusai build X # build target X and its transitive deps
|
||||
uv run hokusai clean # remove generated artifacts + state file
|
||||
uv run hokusai graph # print dependency graph with stages
|
||||
uv run pytest # run tests
|
||||
```
|
||||
|
||||
|
|
@ -45,14 +45,14 @@ ruff format --check
|
|||
### Module structure
|
||||
|
||||
```
|
||||
main.py # Entry point: imports and runs bulkgen.cli.app
|
||||
bulkgen/
|
||||
main.py # Entry point: imports and runs hokusai.cli.app
|
||||
hokusai/
|
||||
__init__.py
|
||||
cli.py # Typer CLI: build, clean, graph commands
|
||||
config.py # Pydantic models for YAML config
|
||||
graph.py # networkx DAG construction and traversal
|
||||
builder.py # Build orchestrator: incremental + parallel
|
||||
state.py # .bulkgen.state.yaml hash tracking
|
||||
state.py # .hokusai.state.yaml hash tracking
|
||||
providers/
|
||||
__init__.py # Abstract Provider base class (ABC)
|
||||
image.py # BlackForestLabs image generation
|
||||
|
|
@ -61,7 +61,7 @@ bulkgen/
|
|||
|
||||
### Data flow
|
||||
|
||||
1. **cli.py** finds the `*.bulkgen.yaml` in cwd, calls `load_config()` from `config.py`
|
||||
1. **cli.py** finds the `*.hokusai.yaml` in cwd, calls `load_config()` from `config.py`
|
||||
2. **config.py** parses YAML into `ProjectConfig` (pydantic), which contains `Defaults` and `dict[str, TargetConfig]`
|
||||
3. **graph.py** builds an `nx.DiGraph` from target dependencies. `get_build_order()` uses `nx.topological_generations()` to return parallel batches
|
||||
4. **builder.py** `run_build()` iterates generations. Per generation:
|
||||
|
|
@ -77,13 +77,13 @@ bulkgen/
|
|||
- **Prompt resolution**: if the `prompt` string is a path to an existing file, its contents are read; otherwise it's used as-is. Done in `builder.py:_resolve_prompt()`.
|
||||
- **BFL client is synchronous**: wrapped in `asyncio.to_thread()` in `providers/image.py`. Uses `ClientConfig(sync=True, timeout=300)` for internal polling.
|
||||
- **Mistral client is natively async**: uses `complete_async()` directly in `providers/text.py`.
|
||||
- **Incremental builds**: `.bulkgen.state.yaml` tracks per-target: input file hashes, prompt hash, model name, and extra params hash. Any change marks the target dirty.
|
||||
- **Incremental builds**: `.hokusai.state.yaml` tracks per-target: input file hashes, prompt hash, model name, and extra params hash. Any change marks the target dirty.
|
||||
- **Error isolation**: if a target fails, its dependents are marked "Dependency failed" but independent targets continue building.
|
||||
- **State saved per-generation**: partial progress survives crashes. At most one generation of work is lost.
|
||||
|
||||
### Provider interface
|
||||
|
||||
All providers implement `bulkgen.providers.Provider`:
|
||||
All providers implement `hokusai.providers.Provider`:
|
||||
```python
|
||||
async def generate(self, target_name, target_config, resolved_prompt, resolved_model, project_dir) -> None
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue