refactor: use project-named state file and store prompt/params directly
All checks were successful
Continuous Integration / Build Package (push) Successful in 48s
Continuous Integration / Lint, Check & Test (push) Successful in 1m1s

- State filename now derives from config: cards.bulkgen.yaml produces
  .cards.bulkgen-state.yaml instead of .bulkgen.state.yaml
- Store resolved prompt text and extra params directly in state file
  instead of hashing them, making state files human-readable
- Only file input contents remain hashed (SHA-256)
- Thread project_name through builder and CLI
- Remove hash_string() and _extra_hash() helpers
- Update .gitignore pattern to .*.bulkgen-state.yaml
This commit is contained in:
Konstantin Fickel 2026-02-15 13:56:12 +01:00
parent 870023865d
commit 0ecf1f0f9e
Signed by: kfickel
GPG key ID: A793722F9933C1A5
7 changed files with 98 additions and 82 deletions

View file

@ -147,6 +147,7 @@ async def _build_single_target(
async def run_build(
config: ProjectConfig,
project_dir: Path,
project_name: str,
target: str | None = None,
on_progress: ProgressCallback = _noop_callback,
) -> BuildResult:
@ -171,7 +172,7 @@ async def run_build(
raise ValueError(msg)
graph = get_subgraph_for_target(graph, target)
state = load_state(project_dir)
state = load_state(project_dir, project_name)
generations = get_build_order(graph)
target_names = set(config.targets)
@ -209,7 +210,7 @@ async def run_build(
)
_process_outcomes(outcomes, config, project_dir, state, result, on_progress)
save_state(state, project_dir)
save_state(state, project_dir, project_name)
return result