gitvow 0.34.2__tar.gz → 0.34.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 (94) hide show
  1. {gitvow-0.34.2/src/gitvow.egg-info → gitvow-0.34.3}/PKG-INFO +1 -1
  2. {gitvow-0.34.2 → gitvow-0.34.3}/pyproject.toml +1 -1
  3. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/hooks/__init__.py +18 -4
  4. {gitvow-0.34.2 → gitvow-0.34.3/src/gitvow.egg-info}/PKG-INFO +1 -1
  5. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_hooks_disabled.py +10 -0
  6. {gitvow-0.34.2 → gitvow-0.34.3}/LICENSE +0 -0
  7. {gitvow-0.34.2 → gitvow-0.34.3}/README.md +0 -0
  8. {gitvow-0.34.2 → gitvow-0.34.3}/setup.cfg +0 -0
  9. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/__init__.py +0 -0
  10. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/__main__.py +0 -0
  11. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/adapters.py +0 -0
  12. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/carry.py +0 -0
  13. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/claims.py +0 -0
  14. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/cli.py +0 -0
  15. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/collect.py +0 -0
  16. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/decisions.py +0 -0
  17. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/default_policy.json +0 -0
  18. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/digest.py +0 -0
  19. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/export.py +0 -0
  20. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/install.py +0 -0
  21. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/intent.py +0 -0
  22. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/notes.py +0 -0
  23. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/outcomes.py +0 -0
  24. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/pack.py +0 -0
  25. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/paths.py +0 -0
  26. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/policy.py +0 -0
  27. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/pricing.py +0 -0
  28. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/proposals.py +0 -0
  29. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/providers.py +0 -0
  30. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/reach.py +0 -0
  31. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/recall.py +0 -0
  32. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/redact.py +0 -0
  33. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/report.py +0 -0
  34. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/rules.py +0 -0
  35. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/safewrite.py +0 -0
  36. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/scan.py +0 -0
  37. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/selftest.py +0 -0
  38. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/serve.py +0 -0
  39. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/snapshots.py +0 -0
  40. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/state.py +0 -0
  41. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/status.py +0 -0
  42. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/sync.py +0 -0
  43. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/targets.py +0 -0
  44. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow/transcript.py +0 -0
  45. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow.egg-info/SOURCES.txt +0 -0
  46. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow.egg-info/dependency_links.txt +0 -0
  47. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow.egg-info/entry_points.txt +0 -0
  48. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow.egg-info/requires.txt +0 -0
  49. {gitvow-0.34.2 → gitvow-0.34.3}/src/gitvow.egg-info/top_level.txt +0 -0
  50. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_adapters.py +0 -0
  51. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_answered_confirm_commit.py +0 -0
  52. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_carry.py +0 -0
  53. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_claims.py +0 -0
  54. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_collect.py +0 -0
  55. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_command_position.py +0 -0
  56. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_commit_window.py +0 -0
  57. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_cost.py +0 -0
  58. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_decisions.py +0 -0
  59. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_defects_0_32_1.py +0 -0
  60. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_digest.py +0 -0
  61. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_duplicate_hooks.py +0 -0
  62. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_e2e_globalopt.py +0 -0
  63. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_export.py +0 -0
  64. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_external_adapter.py +0 -0
  65. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_git_rules.py +0 -0
  66. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_hardening.py +0 -0
  67. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_hooks.py +0 -0
  68. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_install_cli.py +0 -0
  69. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_intent.py +0 -0
  70. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_native_question.py +0 -0
  71. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_opencode.py +0 -0
  72. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_outcomes.py +0 -0
  73. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_pack.py +0 -0
  74. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_packaging.py +0 -0
  75. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_policy.py +0 -0
  76. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_policy_refresh.py +0 -0
  77. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_proposals.py +0 -0
  78. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_providers.py +0 -0
  79. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_reach.py +0 -0
  80. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_recall.py +0 -0
  81. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_redact.py +0 -0
  82. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_report.py +0 -0
  83. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_rules.py +0 -0
  84. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_scan.py +0 -0
  85. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_serve.py +0 -0
  86. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_snapshots.py +0 -0
  87. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_status.py +0 -0
  88. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_status_environment.py +0 -0
  89. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_symlinked_paths.py +0 -0
  90. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_sync.py +0 -0
  91. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_sync_http.py +0 -0
  92. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_targets.py +0 -0
  93. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_tiers.py +0 -0
  94. {gitvow-0.34.2 → gitvow-0.34.3}/tests/test_transcript_formats.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitvow
3
- Version: 0.34.2
3
+ Version: 0.34.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.34.2"
7
+ version = "0.34.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"}
@@ -666,10 +666,7 @@ def _push_notes_after(cwd: str, command: str) -> None:
666
666
  remote, and say so in the log. Never for our own notes push."""
667
667
  if os.environ.get("GITVOW_PUSHING_NOTES"):
668
668
  return
669
- m = re.search(r"\bpush\b((?:\s+-\S+)*)\s+(?!-)(\S+)", command)
670
- remote = m.group(2) if m else "origin"
671
- if remote.startswith(("refs/", ":")) or ("/" in remote and not remote.startswith(("http", "git@", "ssh"))):
672
- remote = "origin"
669
+ remote = push_remote(command)
673
670
  rc, _, _ = git(["for-each-ref", "--count=1", "refs/notes/gitvow/"], cwd)
674
671
  if rc != 0:
675
672
  return
@@ -728,3 +725,20 @@ HANDLERS = {
728
725
  "Stop": stop,
729
726
  "Subagent": subagent_event,
730
727
  }
728
+
729
+
730
+ def push_remote(command: str) -> str:
731
+ """The remote named by the `git push` in a shell line, read from the git segment itself, not from any word
732
+ `push` in the line: `echo "--- push main" && git push origin main` once yielded `main"`. Default origin."""
733
+ from ..policy import _program_and_args, _segments
734
+
735
+ for seg in _segments(command) or []:
736
+ prog, args = _program_and_args(seg)
737
+ if os.path.basename(prog) != "git" or "push" not in args:
738
+ continue
739
+ after = args[args.index("push") + 1 :]
740
+ positional = [a for a in after if not a.startswith("-")]
741
+ if positional and not positional[0].startswith(("refs/", ":")):
742
+ return positional[0]
743
+ return "origin"
744
+ return "origin"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitvow
3
- Version: 0.34.2
3
+ Version: 0.34.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
@@ -9,6 +9,7 @@ from gitvow.hooks import (
9
9
  hooks_disabled_by_env,
10
10
  post_tool_use,
11
11
  pre_tool_use,
12
+ push_remote,
12
13
  session_start,
13
14
  user_prompt_submit,
14
15
  )
@@ -177,3 +178,12 @@ def test_a_commit_and_push_chain_sends_the_note_with_the_push(repo, home, payloa
177
178
  assert code == 0 and "session note attached" in msg
178
179
  local = git(repo, "rev-parse", "refs/notes/gitvow/sess-1")
179
180
  assert git(bare, "rev-parse", "refs/notes/gitvow/sess-1") == local # the note just written is on the remote
181
+
182
+
183
+ def test_the_remote_comes_from_the_git_segment_not_from_any_push_word():
184
+ assert push_remote('echo "--- push main" && git push origin main 2>&1; echo "exit $?"') == "origin"
185
+ assert push_remote("git -C /r push upstream feature") == "upstream"
186
+ assert push_remote("git push --force-with-lease team HEAD:refs/heads/x") == "team"
187
+ assert push_remote("git push") == "origin"
188
+ assert push_remote("git push :refs/tags/v1") == "origin"
189
+ assert push_remote("gitvow push-notes") == "origin"
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
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
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
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