gitvow 0.2.2__tar.gz → 0.2.3__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.
Files changed (29) hide show
  1. {gitvow-0.2.2/src/gitvow.egg-info → gitvow-0.2.3}/PKG-INFO +1 -1
  2. {gitvow-0.2.2 → gitvow-0.2.3}/pyproject.toml +1 -1
  3. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/hooks/__init__.py +5 -3
  4. {gitvow-0.2.2 → gitvow-0.2.3/src/gitvow.egg-info}/PKG-INFO +1 -1
  5. {gitvow-0.2.2 → gitvow-0.2.3}/tests/test_hooks.py +17 -0
  6. {gitvow-0.2.2 → gitvow-0.2.3}/LICENSE +0 -0
  7. {gitvow-0.2.2 → gitvow-0.2.3}/README.md +0 -0
  8. {gitvow-0.2.2 → gitvow-0.2.3}/setup.cfg +0 -0
  9. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/__init__.py +0 -0
  10. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/__main__.py +0 -0
  11. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/cli.py +0 -0
  12. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/collect.py +0 -0
  13. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/default_policy.json +0 -0
  14. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/install.py +0 -0
  15. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/policy.py +0 -0
  16. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/redact.py +0 -0
  17. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/selftest.py +0 -0
  18. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/state.py +0 -0
  19. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow/transcript.py +0 -0
  20. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow.egg-info/SOURCES.txt +0 -0
  21. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow.egg-info/dependency_links.txt +0 -0
  22. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow.egg-info/entry_points.txt +0 -0
  23. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow.egg-info/requires.txt +0 -0
  24. {gitvow-0.2.2 → gitvow-0.2.3}/src/gitvow.egg-info/top_level.txt +0 -0
  25. {gitvow-0.2.2 → gitvow-0.2.3}/tests/test_collect.py +0 -0
  26. {gitvow-0.2.2 → gitvow-0.2.3}/tests/test_install_cli.py +0 -0
  27. {gitvow-0.2.2 → gitvow-0.2.3}/tests/test_packaging.py +0 -0
  28. {gitvow-0.2.2 → gitvow-0.2.3}/tests/test_policy.py +0 -0
  29. {gitvow-0.2.2 → gitvow-0.2.3}/tests/test_redact.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitvow
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Provenance and policy gate for AI-agent coding sessions: session trailers on commits, redacted session notes in git, a tool-call gate, and a local ledger. No runtime dependencies.
5
5
  Author-email: Nikhil Bora <nikhil@wirevow.com>
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gitvow"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Provenance and policy gate for AI-agent coding sessions: session trailers on commits, redacted session notes in git, a tool-call gate, and a local ledger. No runtime dependencies."
9
9
  readme = "README.md"
10
10
  license = {text = "Apache-2.0"}
@@ -29,15 +29,17 @@ def notes_ref(session_id: str | None) -> str:
29
29
  def session_start(h: dict[str, Any], home: str | None = None) -> tuple[int, str]:
30
30
  cwd = h.get("cwd") or os.getcwd()
31
31
  st = load_state(cwd)
32
+ same_session = st.get("session_id") == h.get("session_id") # a resumed session keeps its counters
32
33
  st.update(
33
34
  {
34
35
  "session_id": h.get("session_id"),
35
36
  "transcript_path": h.get("transcript_path"),
36
- "started": time.strftime("%Y-%m-%dT%H:%M:%S"),
37
- "steps": st.get("steps", 0),
38
- "agent_blobs": st.get("agent_blobs", {}) if st.get("session_id") == h.get("session_id") else {},
37
+ "started": st.get("started") if same_session and st.get("started") else time.strftime("%Y-%m-%dT%H:%M:%S"),
38
+ "steps": st.get("steps", 0) if same_session else 0,
39
+ "agent_blobs": st.get("agent_blobs", {}) if same_session else {},
39
40
  }
40
41
  )
42
+ st.pop("pending_commit", None)
41
43
  save_state(cwd, st)
42
44
  log_event(cwd, "session_start", {"session_id": h.get("session_id")})
43
45
  return 0, ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitvow
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Provenance and policy gate for AI-agent coding sessions: session trailers on commits, redacted session notes in git, a tool-call gate, and a local ledger. No runtime dependencies.
5
5
  Author-email: Nikhil Bora <nikhil@wirevow.com>
6
6
  License: Apache-2.0
@@ -216,3 +216,20 @@ def test_invalid_rules_fail_closed_nothing_written(repo, home, payload, transcri
216
216
  log = (repo / ".git" / "gitvow-hooks.log").read_text()
217
217
  assert '"kind": "redaction_unavailable"' in log
218
218
  assert "detail" not in [k for ln in log.splitlines() for k in json.loads(ln) if json.loads(ln)["kind"] == "allowed"]
219
+
220
+
221
+ def test_new_session_resets_steps_and_blobs_but_resume_keeps_them(repo, home, payload):
222
+ session_start(payload("SessionStart"), str(home))
223
+ pre_tool_use(payload("PreToolUse", "Bash", {"command": "git commit -m x"}), str(home))
224
+ (repo / "a.txt").write_text("b\n")
225
+ post_tool_use(payload("PostToolUse", "Edit", {"file_path": "a.txt"}), str(home))
226
+ st = json.loads((repo / ".git" / "gitvow-session.json").read_text())
227
+ assert st["steps"] == 1 and st["agent_blobs"] and "pending_commit" in st
228
+ session_start(payload("SessionStart"), str(home)) # same id: resume
229
+ st = json.loads((repo / ".git" / "gitvow-session.json").read_text())
230
+ assert st["steps"] == 1 and st["agent_blobs"] and "pending_commit" not in st
231
+ p = payload("SessionStart")
232
+ p["session_id"] = "sess-2"
233
+ session_start(p, str(home)) # a new session in the same repo starts from zero
234
+ st = json.loads((repo / ".git" / "gitvow-session.json").read_text())
235
+ assert st["session_id"] == "sess-2" and st["steps"] == 0 and st["agent_blobs"] == {}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes