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

@ -132,7 +132,8 @@ class TestBuildCommand:
assert result.exit_code == 0
call_args = mock_run.call_args
assert call_args[0][2] == "output.txt"
# positional args: (config, project_dir, project_name, target)
assert call_args[0][3] == "output.txt"
class TestCleanCommand:
@ -141,7 +142,8 @@ class TestCleanCommand:
def test_clean_removes_targets(self, cli_project: Path) -> None:
_ = (cli_project / "output.txt").write_text("generated")
_ = (cli_project / "image.png").write_bytes(b"\x89PNG")
_ = (cli_project / ".bulkgen.state.yaml").write_text("targets: {}")
state_file = ".project.bulkgen-state.yaml"
_ = (cli_project / state_file).write_text("targets: {}")
with patch("bulkgen.cli.Path") as mock_path_cls:
mock_path_cls.cwd.return_value = cli_project
@ -150,7 +152,7 @@ class TestCleanCommand:
assert result.exit_code == 0
assert not (cli_project / "output.txt").exists()
assert not (cli_project / "image.png").exists()
assert not (cli_project / ".bulkgen.state.yaml").exists()
assert not (cli_project / state_file).exists()
assert "Cleaned 2 artifact(s)" in result.output
def test_clean_no_artifacts(self, cli_project: Path) -> None: