mystack-rig 1.10.2__tar.gz → 1.11.1__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 (167) hide show
  1. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/PKG-INFO +9 -5
  2. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/README.md +8 -4
  3. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/encrypt.py +11 -0
  4. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/git_author.py +22 -0
  5. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/remote_dev.py +50 -3
  6. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_git/tasks/authorize.yml +26 -5
  7. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/vault_keys.py +10 -0
  8. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/PKG-INFO +9 -5
  9. mystack_rig-1.11.1/src/mystack_rig.egg-info/scm_version.json +8 -0
  10. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/conftest.py +12 -0
  11. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_git_credentials_and_author.py +120 -11
  12. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_init_command.py +89 -2
  13. mystack_rig-1.10.2/src/mystack_rig.egg-info/scm_version.json +0 -8
  14. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/.coveragerc +0 -0
  15. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/.git-blame-ignore-revs +0 -0
  16. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/.github/workflows/release.yml +0 -0
  17. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/.github/workflows/tests.yml +0 -0
  18. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/.gitignore +0 -0
  19. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/CLAUDE.md +0 -0
  20. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/CLI_STORAGE_SUMMARY.md +0 -0
  21. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/Dockerfile +0 -0
  22. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/GIT_CLONE_FEATURE.md +0 -0
  23. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/GLOSSARY.md +0 -0
  24. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/HETZNER_STORAGE_GUIDE.md +0 -0
  25. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/HETZNER_STORAGE_SECURITY_GUIDE.md +0 -0
  26. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/LICENSE +0 -0
  27. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/Makefile +0 -0
  28. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/README_REAL_E2E.md +0 -0
  29. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/STORAGE_CLI_GUIDE.md +0 -0
  30. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0001-per-profile-generated-state-bucket.md +0 -0
  31. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0002-outputs-as-separate-object-via-file-handoff.md +0 -0
  32. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0003-mcp-servers-declared-once-rendered-at-authorize.md +0 -0
  33. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md +0 -0
  34. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0005-docker-in-configure-for-devcontainers.md +0 -0
  35. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0006-workspace-user-instead-of-root.md +0 -0
  36. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md +0 -0
  37. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/architecture.md +0 -0
  38. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/architecture.png +0 -0
  39. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/architecture.svg +0 -0
  40. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/docs/roles.md +0 -0
  41. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/forged-idea.md +0 -0
  42. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/pyproject.toml +0 -0
  43. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/pytest.ini +0 -0
  44. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/requirements.txt +0 -0
  45. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/sample.env +0 -0
  46. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/scripts/coverage_badge.py +0 -0
  47. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/scripts/pypi_version.py +0 -0
  48. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/setup.cfg +0 -0
  49. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/__init__.py +0 -0
  50. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/__init__.py +0 -0
  51. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/__main__.py +0 -0
  52. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/agents.py +0 -0
  53. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/ansible_filters/__init__.py +0 -0
  54. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/ansible_filters/rig_live.py +0 -0
  55. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/ansible_filters/rig_mcp.py +0 -0
  56. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/assets/rig-agent-queue +0 -0
  57. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/assets/rig-agent-state +0 -0
  58. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/assets/tmux.conf +0 -0
  59. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/config.py +0 -0
  60. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/devcontainers.py +0 -0
  61. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/git.py +0 -0
  62. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/last_env.py +0 -0
  63. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/last_session.py +0 -0
  64. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/last_target.py +0 -0
  65. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/live_agent.py +0 -0
  66. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/log.py +0 -0
  67. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/main.py +0 -0
  68. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/mcp.py +0 -0
  69. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/outputs.py +0 -0
  70. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/repos.py +0 -0
  71. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/requirements.txt +0 -0
  72. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_base/defaults/main.yml +0 -0
  73. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_base/tasks/install.yml +0 -0
  74. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_claude_code/defaults/main.yml +0 -0
  75. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_claude_code/tasks/authorize.yml +0 -0
  76. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_claude_code/tasks/install.yml +0 -0
  77. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_code_server/defaults/main.yml +0 -0
  78. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_code_server/tasks/authorize.yml +0 -0
  79. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_code_server/tasks/install.yml +0 -0
  80. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_cursor_cli/defaults/main.yml +0 -0
  81. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_cursor_cli/tasks/authorize.yml +0 -0
  82. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_cursor_cli/tasks/install.yml +0 -0
  83. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_destroy/defaults/main.yml +0 -0
  84. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_destroy/tasks/destroy.yml +0 -0
  85. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_git/defaults/main.yml +0 -0
  86. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_git/tasks/install.yml +0 -0
  87. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_home_ownership/defaults/main.yml +0 -0
  88. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_home_ownership/tasks/authorize.yml +0 -0
  89. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_home_ownership/tasks/install.yml +0 -0
  90. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_live_agent/defaults/main.yml +0 -0
  91. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_live_agent/tasks/authorize.yml +0 -0
  92. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_live_agent/tasks/install.yml +0 -0
  93. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_mcp/defaults/main.yml +0 -0
  94. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_mcp/tasks/authorize.yml +0 -0
  95. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_opencode/defaults/main.yml +0 -0
  96. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_opencode/tasks/authorize.yml +0 -0
  97. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_opencode/tasks/install.yml +0 -0
  98. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_workspace_repos/defaults/main.yml +0 -0
  99. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml +0 -0
  100. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_workspace_user/defaults/main.yml +0 -0
  101. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_workspace_user/tasks/authorize.yml +0 -0
  102. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/roles/rig_workspace_user/tasks/install.yml +0 -0
  103. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/snapshots.py +0 -0
  104. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/state_bucket.py +0 -0
  105. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/storage.py +0 -0
  106. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/vpn.py +0 -0
  107. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/cli/workspace_user.py +0 -0
  108. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/SOURCES.txt +0 -0
  109. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/dependency_links.txt +0 -0
  110. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/entry_points.txt +0 -0
  111. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/requires.txt +0 -0
  112. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/scm_file_list.json +0 -0
  113. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/src/mystack_rig.egg-info/top_level.txt +0 -0
  114. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/test_hetzner_integration.py +0 -0
  115. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/_roles.py +0 -0
  116. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/fixtures/vpn-gateway.yml +0 -0
  117. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_agents.py +0 -0
  118. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_ansible_galaxy.py +0 -0
  119. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_attach_command.py +0 -0
  120. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_bundled_roles.py +0 -0
  121. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_credential_security.py +0 -0
  122. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_destroy_command.py +0 -0
  123. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_dev_command.py +0 -0
  124. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_devcontainers.py +0 -0
  125. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_encrypt_command.py +0 -0
  126. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_encrypt_coverage.py +0 -0
  127. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_firewall_client_ip.py +0 -0
  128. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_git_clone_unit.py +0 -0
  129. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_git_manager.py +0 -0
  130. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_gitignore_init.py +0 -0
  131. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_hetzner_storage.py +0 -0
  132. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_inspect_describe.py +0 -0
  133. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_last_env.py +0 -0
  134. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_last_session.py +0 -0
  135. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_last_target.py +0 -0
  136. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_live_agent.py +0 -0
  137. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_live_agent_cli.py +0 -0
  138. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_log.py +0 -0
  139. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_main_coverage.py +0 -0
  140. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_mcp_command.py +0 -0
  141. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_mcp_render.py +0 -0
  142. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_outputs.py +0 -0
  143. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_outputs_storage.py +0 -0
  144. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_pypi_version.py +0 -0
  145. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_python_floor.py +0 -0
  146. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_r2_storage.py +0 -0
  147. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_real_e2e_integration.py +0 -0
  148. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_real_e2e_storage.py +0 -0
  149. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_real_e2e_vpn.py +0 -0
  150. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_real_e2e_vpn_tunnel.py +0 -0
  151. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_remote_dev.py +0 -0
  152. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_remote_dev_coverage_extensions.py +0 -0
  153. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_repo_command.py +0 -0
  154. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_rig_ansible_vars.py +0 -0
  155. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_rig_config.py +0 -0
  156. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_run_remote_decoding.py +0 -0
  157. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_secret_prompt_hidden.py +0 -0
  158. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_setup_provision.py +0 -0
  159. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_simulation_storage.py +0 -0
  160. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_small_module_coverage.py +0 -0
  161. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_snapshots.py +0 -0
  162. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_state_bucket.py +0 -0
  163. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_storage_basic.py +0 -0
  164. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_vault_keys.py +0 -0
  165. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_vpn_optional.py +0 -0
  166. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_vpn_unit.py +0 -0
  167. {mystack_rig-1.10.2 → mystack_rig-1.11.1}/tests/test_workspace_git_clone.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mystack-rig
3
- Version: 1.10.2
3
+ Version: 1.11.1
4
4
  Summary: Ephemeral remotes with full local parity for coding agents
5
5
  Author: mystack-cloud
6
6
  License-Expression: MIT
@@ -494,8 +494,10 @@ MIT
494
494
  box in both;
495
495
  - a system-wide git credential helper (`/usr/local/bin/rig-git-credential`)
496
496
  answers `github.com` / `gitlab.com` HTTPS requests from that same file (and, for a
497
- Repo with its own `password_var` such as `<project>_git_pat`, requests to that
498
- Repo's host from `~/.config/rig/git-hosts`), so
497
+ Repo with its own `password_var` such as `<project>_git_pat`, requests for
498
+ that Repo's `group/project` from `~/.config/rig/git-hosts`; rig sets
499
+ `credential.useHttpPath` so two Repos on one host can carry different tokens,
500
+ and a Repo without its own token falls back to the provider token), so
499
501
  `git clone`, `git push` and the `materialize.yml` clone task all use plain
500
502
  URLs (`https://github.com/org/repo.git`) and nothing sits in `.git/config`
501
503
  or `git remote -v`. Other users on the VM (besides root) can't read the file and get no
@@ -512,8 +514,10 @@ scaffolded by an older rig still have the token-in-URL clone task in their
512
514
  with *Author identity unknown*. `authorize.yml` sets `user.name` / `user.email`
513
515
  (global) from `rig_git_author_name` / `rig_git_author_email`, which rig derives
514
516
  from your identity: the identity as the name and `<identity>@rig.local` as the
515
- email. Set `git_author_name` / `git_author_email` in `.rig/vars.yml`, or in your
516
- personal `.rig/vars.{identity}.yml`, to use a real name and a GitHub-linked
517
+ email. `rig init` suggests your local `git config user.name` / `user.email` and
518
+ stores your answer as `git_author_name` / `git_author_email` in your personal
519
+ `.rig/vars.{identity}.yml` (skipped when git has neither). You can also set them
520
+ by hand in `.rig/vars.yml` or that file, to use a real name and a GitHub-linked
517
521
  email (the derived `rig.local` address is deliberately not a
518
522
  `users.noreply.github.com` one, which GitHub would attribute to whoever owns
519
523
  that handle).
@@ -472,8 +472,10 @@ MIT
472
472
  box in both;
473
473
  - a system-wide git credential helper (`/usr/local/bin/rig-git-credential`)
474
474
  answers `github.com` / `gitlab.com` HTTPS requests from that same file (and, for a
475
- Repo with its own `password_var` such as `<project>_git_pat`, requests to that
476
- Repo's host from `~/.config/rig/git-hosts`), so
475
+ Repo with its own `password_var` such as `<project>_git_pat`, requests for
476
+ that Repo's `group/project` from `~/.config/rig/git-hosts`; rig sets
477
+ `credential.useHttpPath` so two Repos on one host can carry different tokens,
478
+ and a Repo without its own token falls back to the provider token), so
477
479
  `git clone`, `git push` and the `materialize.yml` clone task all use plain
478
480
  URLs (`https://github.com/org/repo.git`) and nothing sits in `.git/config`
479
481
  or `git remote -v`. Other users on the VM (besides root) can't read the file and get no
@@ -490,8 +492,10 @@ scaffolded by an older rig still have the token-in-URL clone task in their
490
492
  with *Author identity unknown*. `authorize.yml` sets `user.name` / `user.email`
491
493
  (global) from `rig_git_author_name` / `rig_git_author_email`, which rig derives
492
494
  from your identity: the identity as the name and `<identity>@rig.local` as the
493
- email. Set `git_author_name` / `git_author_email` in `.rig/vars.yml`, or in your
494
- personal `.rig/vars.{identity}.yml`, to use a real name and a GitHub-linked
495
+ email. `rig init` suggests your local `git config user.name` / `user.email` and
496
+ stores your answer as `git_author_name` / `git_author_email` in your personal
497
+ `.rig/vars.{identity}.yml` (skipped when git has neither). You can also set them
498
+ by hand in `.rig/vars.yml` or that file, to use a real name and a GitHub-linked
495
499
  email (the derived `rig.local` address is deliberately not a
496
500
  `users.noreply.github.com` one, which GitHub would attribute to whoever owns
497
501
  that handle).
@@ -410,6 +410,17 @@ def _git_host(url: str) -> str:
410
410
  return match.group(1) if match else ""
411
411
 
412
412
 
413
+ def git_repo_path(url: str) -> str:
414
+ """Lower-cased ``group/project`` of an https:// remote ("" if there is none).
415
+
416
+ The leading slash and a trailing ``.git`` are dropped, matching how the
417
+ credential helper normalises the ``path`` git sends it.
418
+ """
419
+ match = re.match(r"^[a-z+]+://(?:[^@/]+@)?[^/]+/(.*)$", (url or "").strip().lower())
420
+ path = match.group(1).strip("/") if match else ""
421
+ return path[: -len(".git")] if path.endswith(".git") else path
422
+
423
+
413
424
  def detect_git_provider(url: str) -> str | None:
414
425
  """Return 'github' or 'gitlab' for a remote URL.
415
426
 
@@ -20,6 +20,7 @@ attribute the commits to somebody else.
20
20
 
21
21
  from __future__ import annotations
22
22
 
23
+ import subprocess
23
24
  from collections.abc import Callable
24
25
  from typing import Any, Optional
25
26
 
@@ -35,6 +36,27 @@ def _clean(value: Any) -> str:
35
36
  return " ".join(value.split())
36
37
 
37
38
 
39
+ def detect_local_git_author() -> dict[str, str]:
40
+ """The developer's own ``user.name`` / ``user.email`` from local git config.
41
+
42
+ Used by ``rig init`` to suggest the author for commits made on the
43
+ Environment. Either field is ``""`` when git has none (or is missing).
44
+ """
45
+ found = {}
46
+ for field, key in (("name", "user.name"), ("email", "user.email")):
47
+ try:
48
+ result = subprocess.run(
49
+ ["git", "config", "--get", key],
50
+ capture_output=True,
51
+ text=True,
52
+ timeout=10,
53
+ )
54
+ found[field] = _clean(result.stdout) if result.returncode == 0 else ""
55
+ except (OSError, subprocess.SubprocessError):
56
+ found[field] = ""
57
+ return found
58
+
59
+
38
60
  def derive_git_author(identity: str) -> dict[str, str]:
39
61
  """Author derived from the rig identity alone."""
40
62
  name = _clean(identity)
@@ -715,7 +715,7 @@ def build_rig_ansible_vars(
715
715
 
716
716
 
717
717
  def git_repo_token_vars(project: Any) -> list[dict[str, str]]:
718
- """``{host, user, var}`` for each HTTPS clone Repo that has its own ``password_var``.
718
+ """``{host, path, user, var}`` for each HTTPS clone Repo that has its own ``password_var``.
719
719
 
720
720
  Only the variable *name* is passed on; authorize resolves the secret, so a
721
721
  PAT stored per Repo (``<project>_git_pat``) reaches the VM's git credential
@@ -723,7 +723,7 @@ def git_repo_token_vars(project: Any) -> list[dict[str, str]]:
723
723
  """
724
724
  if project is None:
725
725
  return []
726
- from cli.encrypt import _git_host, detect_git_provider
726
+ from cli.encrypt import _git_host, detect_git_provider, git_repo_path
727
727
 
728
728
  found: list[dict[str, str]] = []
729
729
  for item in (project.get_vars("git") or {}).get("clone_repos") or []:
@@ -734,7 +734,7 @@ def git_repo_token_vars(project: Any) -> list[dict[str, str]]:
734
734
  if not (repo.startswith("https://") and var and host):
735
735
  continue
736
736
  user = "x-access-token" if detect_git_provider(repo) == "github" else "oauth2"
737
- entry = {"host": host, "user": user, "var": var}
737
+ entry = {"host": host, "path": git_repo_path(repo), "user": user, "var": var}
738
738
  if entry not in found:
739
739
  found.append(entry)
740
740
  return found
@@ -5177,6 +5177,49 @@ class Workspace:
5177
5177
  return True
5178
5178
 
5179
5179
 
5180
+ def _prompt_git_author(root: str, identity: str, input_fn=None) -> dict[str, str]:
5181
+ """Suggest the local git author for commits on the Environment.
5182
+
5183
+ The default per field is what is already in the identity's vars, else the
5184
+ developer's local git config. With neither there is nothing to suggest, so
5185
+ the prompt is skipped and rig falls back to the identity-derived author.
5186
+ Without a terminal (and no ``input_fn``) the suggestion is used unasked.
5187
+ """
5188
+ from cli.git_author import EMAIL_VAR, NAME_VAR, detect_local_git_author
5189
+ from cli.vault_keys import personal_vars_path, read_plain_yaml_string
5190
+
5191
+ path = personal_vars_path(root, identity)
5192
+ local = detect_local_git_author()
5193
+ suggested = {
5194
+ "name": read_plain_yaml_string(path, NAME_VAR) or local["name"],
5195
+ "email": read_plain_yaml_string(path, EMAIL_VAR) or local["email"],
5196
+ }
5197
+ if not (suggested["name"] or suggested["email"]):
5198
+ return {"name": "", "email": ""}
5199
+ if input_fn is None and not sys.stdin.isatty():
5200
+ # Non-interactive (piped stdin, CI): take what is there without asking.
5201
+ return suggested
5202
+ print("Git author for commits made on the Environment (from your local git config):")
5203
+ return {
5204
+ "name": _prompt("Git author name", suggested["name"] or None, input_fn),
5205
+ "email": _prompt("Git author email", suggested["email"] or None, input_fn),
5206
+ }
5207
+
5208
+
5209
+ def _store_git_author(root: str, identity: str, author: dict[str, str]) -> None:
5210
+ """Write the chosen author to ``.rig/vars.<identity>.yml`` (plain text: not secret)."""
5211
+ from cli.git_author import EMAIL_VAR, NAME_VAR
5212
+ from cli.vault_keys import personal_vars_path, upsert_plain_yaml_string
5213
+
5214
+ path = personal_vars_path(root, identity)
5215
+ for var, field in ((NAME_VAR, "name"), (EMAIL_VAR, "email")):
5216
+ value = author.get(field, "").replace('"', "").strip()
5217
+ if value:
5218
+ upsert_plain_yaml_string(path, var, value)
5219
+ if author.get("name") or author.get("email"):
5220
+ print(f"Git author saved to {os.path.relpath(path, root)}")
5221
+
5222
+
5180
5223
  def interactive_env_init(
5181
5224
  start: str | None = None,
5182
5225
  input_fn=None,
@@ -5350,6 +5393,8 @@ def interactive_env_init(
5350
5393
  input_fn or input,
5351
5394
  )
5352
5395
 
5396
+ git_author = _prompt_git_author(root, ident, input_fn)
5397
+
5353
5398
  # Collect PATs before writing config so password_var can be attached on add.
5354
5399
  pat_assignments, default_pats = collect_repo_pats(
5355
5400
  selected,
@@ -5374,6 +5419,8 @@ def interactive_env_init(
5374
5419
  ):
5375
5420
  return False
5376
5421
 
5422
+ _store_git_author(root, ident, git_author)
5423
+
5377
5424
  try:
5378
5425
  store_repo_pats(
5379
5426
  pats_to_store,
@@ -48,7 +48,9 @@
48
48
  {% endif %}
49
49
  no_log: true
50
50
  # PATs stored per Repo (password_var, e.g. <project>_git_pat): one
51
- # "host user token" line each, for the credential helper below.
51
+ # "host path user token" line each, for the credential helper below.
52
+ # path is the Repo's group/project ("-" matches every Repo on the host),
53
+ # so two Repos on one host can carry different tokens.
52
54
  - name: Write the per-repo token file (workspace user only)
53
55
  copy:
54
56
  dest: /home/{{ rig_user }}/.config/rig/git-hosts
@@ -58,7 +60,7 @@
58
60
  {% for t in rig_git_repo_tokens | default([]) %}
59
61
  {% set _tok = lookup('vars', t.var, default='') %}
60
62
  {% if _tok | length > 0 %}
61
- {{ t.host }} {{ t.user }} {{ _tok }}
63
+ {{ t.host }} {{ t.path | default('-', true) }} {{ t.user }} {{ _tok }}
62
64
  {% endif %}
63
65
  {% endfor %}
64
66
  no_log: true
@@ -83,19 +85,32 @@
83
85
  # the workspace user (and root) can read it; anyone else gets no answer.
84
86
  [ "$1" = get ] || exit 0
85
87
  host=""
88
+ path=""
86
89
  while IFS='=' read -r key value; do
87
90
  [ -z "$key" ] && break
88
91
  [ "$key" = host ] && host="$value"
92
+ [ "$key" = path ] && path="$value"
89
93
  done
90
- # A token stored for this exact host (per-Repo password_var) wins.
94
+ # A token stored for this Repo (per-Repo password_var) wins, then a
95
+ # host-wide one ("-" path); otherwise the provider token below.
96
+ # git only sends path= when credential.useHttpPath is true.
97
+ repo=$(printf '%s' "$path" | tr 'A-Z' 'a-z')
98
+ repo="${repo#/}"; repo="${repo%/}"; repo="${repo%.git}"
91
99
  hosts=/home/{{ rig_user }}/.config/rig/git-hosts
92
100
  if [ -r "$hosts" ]; then
93
- while read -r h u p; do
94
- if [ "$h" = "$host" ] && [ -n "$p" ]; then
101
+ anyhost=""
102
+ while read -r h rp u p; do
103
+ [ "$h" = "$host" ] && [ -n "$p" ] || continue
104
+ if [ "$rp" = "$repo" ] && [ -n "$repo" ]; then
95
105
  printf 'username=%s\npassword=%s\n' "$u" "$p"
96
106
  exit 0
97
107
  fi
108
+ if [ "$rp" = "-" ] && [ -z "$anyhost" ]; then anyhost="$u $p"; fi
98
109
  done < "$hosts"
110
+ if [ -n "$anyhost" ]; then
111
+ printf 'username=%s\npassword=%s\n' "${anyhost%% *}" "${anyhost#* }"
112
+ exit 0
113
+ fi
99
114
  fi
100
115
  [ -r /home/{{ rig_user }}/.config/rig/git-provider.env ] || exit 0
101
116
  . /home/{{ rig_user }}/.config/rig/git-provider.env
@@ -110,4 +125,10 @@
110
125
  command:
111
126
  argv: ["git", "config", "--system", "credential.helper", "/usr/local/bin/rig-git-credential"]
112
127
  changed_when: false
128
+ # Without this git sends only the host, so two Repos on one host would
129
+ # share a token.
130
+ - name: Send the repo path with every git credential lookup
131
+ command:
132
+ argv: ["git", "config", "--system", "credential.useHttpPath", "true"]
133
+ changed_when: false
113
134
  tags: [rig_git_provider_tokens, credentials, git]
@@ -279,6 +279,16 @@ def read_wrap_fields(identity_vars_path: str) -> dict:
279
279
  return found
280
280
 
281
281
 
282
+ def read_plain_yaml_string(path: str, name: str) -> str:
283
+ """A top-level scalar string from a YAML vars file ("" if absent); vaults stay untouched."""
284
+ if not os.path.exists(path):
285
+ return ""
286
+ with open(path, encoding="utf-8") as handle:
287
+ content = handle.read()
288
+ match = re.search(rf"^{re.escape(name)}:[ \t]*[\"']?([^\"'\n]*?)[\"']?[ \t]*$", content, re.MULTILINE)
289
+ return match.group(1).strip() if match else ""
290
+
291
+
282
292
  def upsert_plain_yaml_string(path: str, name: str, value: str) -> None:
283
293
  """Insert or replace a top-level scalar string in a YAML vars file."""
284
294
  directory = os.path.dirname(path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mystack-rig
3
- Version: 1.10.2
3
+ Version: 1.11.1
4
4
  Summary: Ephemeral remotes with full local parity for coding agents
5
5
  Author: mystack-cloud
6
6
  License-Expression: MIT
@@ -494,8 +494,10 @@ MIT
494
494
  box in both;
495
495
  - a system-wide git credential helper (`/usr/local/bin/rig-git-credential`)
496
496
  answers `github.com` / `gitlab.com` HTTPS requests from that same file (and, for a
497
- Repo with its own `password_var` such as `<project>_git_pat`, requests to that
498
- Repo's host from `~/.config/rig/git-hosts`), so
497
+ Repo with its own `password_var` such as `<project>_git_pat`, requests for
498
+ that Repo's `group/project` from `~/.config/rig/git-hosts`; rig sets
499
+ `credential.useHttpPath` so two Repos on one host can carry different tokens,
500
+ and a Repo without its own token falls back to the provider token), so
499
501
  `git clone`, `git push` and the `materialize.yml` clone task all use plain
500
502
  URLs (`https://github.com/org/repo.git`) and nothing sits in `.git/config`
501
503
  or `git remote -v`. Other users on the VM (besides root) can't read the file and get no
@@ -512,8 +514,10 @@ scaffolded by an older rig still have the token-in-URL clone task in their
512
514
  with *Author identity unknown*. `authorize.yml` sets `user.name` / `user.email`
513
515
  (global) from `rig_git_author_name` / `rig_git_author_email`, which rig derives
514
516
  from your identity: the identity as the name and `<identity>@rig.local` as the
515
- email. Set `git_author_name` / `git_author_email` in `.rig/vars.yml`, or in your
516
- personal `.rig/vars.{identity}.yml`, to use a real name and a GitHub-linked
517
+ email. `rig init` suggests your local `git config user.name` / `user.email` and
518
+ stores your answer as `git_author_name` / `git_author_email` in your personal
519
+ `.rig/vars.{identity}.yml` (skipped when git has neither). You can also set them
520
+ by hand in `.rig/vars.yml` or that file, to use a real name and a GitHub-linked
517
521
  email (the derived `rig.local` address is deliberately not a
518
522
  `users.noreply.github.com` one, which GitHub would attribute to whoever owns
519
523
  that handle).
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.11.1",
3
+ "distance": 0,
4
+ "node": "g93446e39bd4097cdd3f6bfdfa455af1bd6548116",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-12-02"
8
+ }
@@ -136,6 +136,18 @@ def _isolate_rig_config(tmp_path, monkeypatch):
136
136
  monkeypatch.setenv("RIG_CONFIG", str(tmp_path / "rig-config"))
137
137
 
138
138
 
139
+ @pytest.fixture(autouse=True)
140
+ def _isolate_local_git_author(monkeypatch):
141
+ """rig init suggests the developer's git author; tests must not read the real one."""
142
+ from cli import git_author
143
+
144
+ def none_detected() -> dict[str, str]:
145
+ return {"name": "", "email": ""}
146
+
147
+ none_detected.__wrapped__ = git_author.detect_local_git_author # type: ignore[attr-defined]
148
+ monkeypatch.setattr(git_author, "detect_local_git_author", none_detected)
149
+
150
+
139
151
  @pytest.fixture(autouse=True)
140
152
  def _isolate_rig_tmp_keys(tmp_path, monkeypatch):
141
153
  """
@@ -219,10 +219,11 @@ def _helper_script(tmp_path):
219
219
  return script, token_file
220
220
 
221
221
 
222
- def _ask(script, op, host):
222
+ def _ask(script, op, host, path=None):
223
+ extra = f"path={path}\n" if path is not None else ""
223
224
  return subprocess.run(
224
225
  [str(script), op],
225
- input=f"protocol=https\nhost={host}\n\n",
226
+ input=f"protocol=https\nhost={host}\n{extra}\n",
226
227
  capture_output=True,
227
228
  text=True,
228
229
  check=True,
@@ -251,7 +252,7 @@ def test_helper_stays_silent_when_it_has_nothing_to_say(tmp_path):
251
252
  def test_helper_serves_a_per_repo_token_for_its_host(tmp_path):
252
253
  """A PAT stored per Repo (password_var) answers git pull, even on a host rig can't classify."""
253
254
  script, token_file = _helper_script(tmp_path)
254
- (tmp_path / "git-hosts").write_text("git.corp.example oauth2 glpat-repo\ngitlab.com oauth2 glpat-own\n")
255
+ (tmp_path / "git-hosts").write_text("git.corp.example - oauth2 glpat-repo\ngitlab.com - oauth2 glpat-own\n")
255
256
  token_file.write_text("GITLAB_TOKEN=glpat-default\n")
256
257
 
257
258
  assert _ask(script, "get", "git.corp.example") == "username=oauth2\npassword=glpat-repo\n"
@@ -261,7 +262,7 @@ def test_helper_serves_a_per_repo_token_for_its_host(tmp_path):
261
262
 
262
263
  def test_helper_without_provider_file_still_serves_per_repo_token(tmp_path):
263
264
  script, _token_file = _helper_script(tmp_path)
264
- (tmp_path / "git-hosts").write_text("gitlab.com oauth2 glpat-own\n")
265
+ (tmp_path / "git-hosts").write_text("gitlab.com - oauth2 glpat-own\n")
265
266
 
266
267
  assert _ask(script, "get", "gitlab.com") == "username=oauth2\npassword=glpat-own\n"
267
268
 
@@ -277,11 +278,11 @@ def test_authorize_writes_per_repo_tokens_from_their_vars():
277
278
  rendered = template.render(
278
279
  lookup=lambda _kind, name, default="": secrets.get(name, default),
279
280
  rig_git_repo_tokens=[
280
- {"host": "gitlab.com", "user": "oauth2", "var": "p_git_pat"},
281
- {"host": "x.example", "user": "oauth2", "var": "unset"},
281
+ {"host": "gitlab.com", "path": "g/p", "user": "oauth2", "var": "p_git_pat"},
282
+ {"host": "x.example", "path": "g/q", "user": "oauth2", "var": "unset"},
282
283
  ],
283
284
  )
284
- assert [ln for ln in rendered.splitlines() if ln.strip()][1:] == ["gitlab.com oauth2 glpat-1"]
285
+ assert [ln for ln in rendered.splitlines() if ln.strip()][1:] == ["gitlab.com g/p oauth2 glpat-1"]
285
286
  assert next(t for t in _authorize_tasks() if t["name"] == "Provider tokens for git, gh and glab")["when"].count(
286
287
  "rig_git_repo_tokens"
287
288
  )
@@ -300,7 +301,7 @@ def test_token_files_are_never_empty_when_no_token_is_set():
300
301
  lookup=lambda _kind, _name, default="": default,
301
302
  _rig_gh_token="",
302
303
  _rig_gl_token="",
303
- rig_git_repo_tokens=[{"host": "gitlab.com", "user": "oauth2", "var": "p_git_pat"}],
304
+ rig_git_repo_tokens=[{"host": "gitlab.com", "path": "g/p", "user": "oauth2", "var": "p_git_pat"}],
304
305
  )
305
306
  assert rendered.strip() == "# managed by rig"
306
307
 
@@ -324,13 +325,58 @@ def test_git_repo_token_vars_lists_https_repos_with_their_own_password_var():
324
325
  }
325
326
 
326
327
  assert git_repo_token_vars(Project()) == [
327
- {"host": "gitlab.com", "user": "oauth2", "var": "a_git_pat"},
328
- {"host": "github.com", "user": "x-access-token", "var": "b_git_pat"},
329
- {"host": "git.corp.example", "user": "oauth2", "var": "c_git_pat"},
328
+ {"host": "gitlab.com", "path": "o/a", "user": "oauth2", "var": "a_git_pat"},
329
+ {"host": "gitlab.com", "path": "o/a2", "user": "oauth2", "var": "a_git_pat"},
330
+ {"host": "github.com", "path": "o/b", "user": "x-access-token", "var": "b_git_pat"},
331
+ {"host": "git.corp.example", "path": "o/c", "user": "oauth2", "var": "c_git_pat"},
330
332
  ]
331
333
  assert git_repo_token_vars(None) == []
332
334
 
333
335
 
336
+ def test_helper_serves_a_different_token_per_repo_on_one_host(tmp_path):
337
+ """Three Repos on one GitLab host, one token each; the provider token covers the rest."""
338
+ script, token_file = _helper_script(tmp_path)
339
+ (tmp_path / "git-hosts").write_text(
340
+ "gitlab.boxine.de grp/one oauth2 tok-1055\n"
341
+ "gitlab.boxine.de grp/two oauth2 tok-2000\n"
342
+ "gitlab.boxine.de grp/three oauth2 tok-3000\n"
343
+ )
344
+ token_file.write_text("GITLAB_TOKEN=tok-1127\n")
345
+ host = "gitlab.boxine.de"
346
+
347
+ assert _ask(script, "get", host, "grp/one.git") == "username=oauth2\npassword=tok-1055\n"
348
+ assert _ask(script, "get", host, "grp/two.git") == "username=oauth2\npassword=tok-2000\n"
349
+ assert _ask(script, "get", host, "Grp/Three") == "username=oauth2\npassword=tok-3000\n"
350
+ # No entry for this Repo: the provider token, not the first match on the host.
351
+ assert _ask(script, "get", host, "grp/review-agent.git") == "username=oauth2\npassword=tok-1127\n"
352
+ # git without useHttpPath sends no path: same fallback.
353
+ assert _ask(script, "get", host) == "username=oauth2\npassword=tok-1127\n"
354
+
355
+
356
+ def test_helper_prefers_the_repo_token_over_a_host_wide_one(tmp_path):
357
+ script, token_file = _helper_script(tmp_path)
358
+ (tmp_path / "git-hosts").write_text("h.example - oauth2 tok-host\nh.example g/p oauth2 tok-repo\n")
359
+ token_file.write_text("GITLAB_TOKEN=tok-provider\n")
360
+
361
+ assert _ask(script, "get", "h.example", "g/p.git") == "username=oauth2\npassword=tok-repo\n"
362
+ assert _ask(script, "get", "h.example", "g/other.git") == "username=oauth2\npassword=tok-host\n"
363
+
364
+
365
+ def test_authorize_sends_the_repo_path_to_the_helper():
366
+ block = _provider_block()
367
+ task = next(t for t in block if t["name"].startswith("Send the repo path"))
368
+ assert task["command"]["argv"] == ["git", "config", "--system", "credential.useHttpPath", "true"]
369
+
370
+
371
+ def test_git_repo_path_normalises_clone_urls():
372
+ from cli.encrypt import git_repo_path
373
+
374
+ assert git_repo_path("https://gitlab.com/Grp/Proj.git") == "grp/proj"
375
+ assert git_repo_path("https://user@gitlab.com/grp/sub/proj/") == "grp/sub/proj"
376
+ assert git_repo_path("git@gitlab.com:grp/proj.git") == ""
377
+ assert git_repo_path("") == ""
378
+
379
+
334
380
  def test_helper_works_through_real_git(tmp_path):
335
381
  script, token_file = _helper_script(tmp_path)
336
382
  token_file.write_text("GH_TOKEN=ghp_abc\n")
@@ -355,6 +401,40 @@ def test_helper_works_through_real_git(tmp_path):
355
401
  assert "password=ghp_abc" in out
356
402
 
357
403
 
404
+ def test_real_git_picks_the_token_for_each_repo_url(tmp_path):
405
+ """With credential.useHttpPath, git passes the repo path and each URL gets its own token."""
406
+ script, token_file = _helper_script(tmp_path)
407
+ (tmp_path / "git-hosts").write_text(
408
+ "gitlab.example grp/one oauth2 tok-one\ngitlab.example grp/two oauth2 tok-two\n"
409
+ )
410
+ token_file.write_text("GITLAB_TOKEN=tok-provider\n")
411
+ env = {
412
+ **os.environ,
413
+ "GIT_CONFIG_NOSYSTEM": "1",
414
+ "GIT_CONFIG_GLOBAL": os.devnull,
415
+ "GIT_TERMINAL_PROMPT": "0",
416
+ "GIT_CONFIG_COUNT": "2",
417
+ "GIT_CONFIG_KEY_0": "credential.helper",
418
+ "GIT_CONFIG_VALUE_0": str(script),
419
+ "GIT_CONFIG_KEY_1": "credential.useHttpPath",
420
+ "GIT_CONFIG_VALUE_1": "true",
421
+ }
422
+
423
+ def fill(url):
424
+ return subprocess.run(
425
+ ["git", "credential", "fill"],
426
+ input=f"url={url}\n\n",
427
+ capture_output=True,
428
+ text=True,
429
+ env=env,
430
+ check=True,
431
+ ).stdout
432
+
433
+ assert "password=tok-one" in fill("https://gitlab.example/grp/one.git")
434
+ assert "password=tok-two" in fill("https://gitlab.example/grp/two.git")
435
+ assert "password=tok-provider" in fill("https://gitlab.example/grp/other.git")
436
+
437
+
358
438
  # --- the agent's non-login shell must get the tokens too ------------------------
359
439
 
360
440
 
@@ -381,3 +461,32 @@ def test_agent_launch_exports_the_token_to_the_agent_process(tmp_path):
381
461
  cmd = cmd.replace("mkdir -p /workspace && cd /workspace && exec claude", 'printf "%s" "$GH_TOKEN"')
382
462
  out = subprocess.run(["bash", "-c", cmd], capture_output=True, text=True, check=True).stdout
383
463
  assert out == "ghp_agent"
464
+
465
+
466
+ def test_detect_local_git_author_reads_the_global_git_config(tmp_path, monkeypatch):
467
+ from cli import git_author
468
+
469
+ config = tmp_path / "gitconfig"
470
+ config.write_text("[user]\n\tname = Ada Lovelace\n\temail = ada@example.com\n")
471
+ monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(config))
472
+ monkeypatch.setenv("GIT_CONFIG_SYSTEM", os.devnull)
473
+ real = git_author.detect_local_git_author.__wrapped__
474
+ assert real() == {"name": "Ada Lovelace", "email": "ada@example.com"}
475
+
476
+
477
+ def test_detect_local_git_author_is_empty_without_git_config(tmp_path, monkeypatch):
478
+ from cli import git_author
479
+
480
+ monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(tmp_path / "missing"))
481
+ monkeypatch.setenv("GIT_CONFIG_SYSTEM", os.devnull)
482
+ assert git_author.detect_local_git_author.__wrapped__() == {"name": "", "email": ""}
483
+
484
+
485
+ def test_detect_local_git_author_survives_a_missing_git_binary(monkeypatch):
486
+ from cli import git_author
487
+
488
+ def boom(*_a, **_k):
489
+ raise FileNotFoundError("git")
490
+
491
+ monkeypatch.setattr(git_author.subprocess, "run", boom)
492
+ assert git_author.detect_local_git_author.__wrapped__() == {"name": "", "email": ""}