refactor: use project-named state file and store prompt/params directly
- 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:
parent
870023865d
commit
0ecf1f0f9e
7 changed files with 98 additions and 82 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue