mystack-rig 1.10.2__tar.gz → 1.11.0__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.
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/PKG-INFO +5 -3
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/README.md +4 -2
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/git_author.py +22 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/remote_dev.py +47 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/vault_keys.py +10 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/PKG-INFO +5 -3
- mystack_rig-1.11.0/src/mystack_rig.egg-info/scm_version.json +8 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/conftest.py +12 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_git_credentials_and_author.py +29 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_init_command.py +89 -2
- mystack_rig-1.10.2/src/mystack_rig.egg-info/scm_version.json +0 -8
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/.coveragerc +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/.git-blame-ignore-revs +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/.github/workflows/release.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/.github/workflows/tests.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/.gitignore +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/CLAUDE.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/CLI_STORAGE_SUMMARY.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/Dockerfile +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/GIT_CLONE_FEATURE.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/GLOSSARY.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/HETZNER_STORAGE_GUIDE.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/HETZNER_STORAGE_SECURITY_GUIDE.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/LICENSE +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/Makefile +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/README_REAL_E2E.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/STORAGE_CLI_GUIDE.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0001-per-profile-generated-state-bucket.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0002-outputs-as-separate-object-via-file-handoff.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0003-mcp-servers-declared-once-rendered-at-authorize.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0005-docker-in-configure-for-devcontainers.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0006-workspace-user-instead-of-root.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/architecture.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/architecture.png +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/architecture.svg +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/roles.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/forged-idea.md +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/pyproject.toml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/pytest.ini +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/requirements.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/sample.env +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/scripts/coverage_badge.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/scripts/pypi_version.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/setup.cfg +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/__init__.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/__init__.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/__main__.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/agents.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/ansible_filters/__init__.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/ansible_filters/rig_live.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/ansible_filters/rig_mcp.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/assets/rig-agent-queue +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/assets/rig-agent-state +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/assets/tmux.conf +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/config.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/devcontainers.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/encrypt.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/git.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/last_env.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/last_session.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/last_target.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/live_agent.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/log.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/main.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/mcp.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/outputs.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/repos.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/requirements.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_base/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_base/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_claude_code/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_claude_code/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_claude_code/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_code_server/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_code_server/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_code_server/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_cursor_cli/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_cursor_cli/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_cursor_cli/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_destroy/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_destroy/tasks/destroy.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_git/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_git/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_git/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_home_ownership/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_home_ownership/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_home_ownership/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_live_agent/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_live_agent/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_live_agent/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_mcp/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_mcp/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_opencode/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_opencode/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_opencode/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_repos/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_user/defaults/main.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_user/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_user/tasks/install.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/snapshots.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/state_bucket.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/storage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/vpn.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/workspace_user.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/SOURCES.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/dependency_links.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/entry_points.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/requires.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/scm_file_list.json +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/mystack_rig.egg-info/top_level.txt +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/test_hetzner_integration.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/_roles.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/fixtures/vpn-gateway.yml +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_agents.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_ansible_galaxy.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_attach_command.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_bundled_roles.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_credential_security.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_destroy_command.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_dev_command.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_devcontainers.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_encrypt_command.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_encrypt_coverage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_firewall_client_ip.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_git_clone_unit.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_git_manager.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_gitignore_init.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_hetzner_storage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_inspect_describe.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_last_env.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_last_session.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_last_target.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_live_agent.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_live_agent_cli.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_log.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_main_coverage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_mcp_command.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_mcp_render.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_outputs.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_outputs_storage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_pypi_version.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_python_floor.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_r2_storage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_real_e2e_integration.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_real_e2e_storage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_real_e2e_vpn.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_real_e2e_vpn_tunnel.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_remote_dev.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_remote_dev_coverage_extensions.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_repo_command.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_rig_ansible_vars.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_rig_config.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_run_remote_decoding.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_secret_prompt_hidden.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_setup_provision.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_simulation_storage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_small_module_coverage.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_snapshots.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_state_bucket.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_storage_basic.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_vault_keys.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_vpn_optional.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/tests/test_vpn_unit.py +0 -0
- {mystack_rig-1.10.2 → mystack_rig-1.11.0}/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.
|
|
3
|
+
Version: 1.11.0
|
|
4
4
|
Summary: Ephemeral remotes with full local parity for coding agents
|
|
5
5
|
Author: mystack-cloud
|
|
6
6
|
License-Expression: MIT
|
|
@@ -512,8 +512,10 @@ scaffolded by an older rig still have the token-in-URL clone task in their
|
|
|
512
512
|
with *Author identity unknown*. `authorize.yml` sets `user.name` / `user.email`
|
|
513
513
|
(global) from `rig_git_author_name` / `rig_git_author_email`, which rig derives
|
|
514
514
|
from your identity: the identity as the name and `<identity>@rig.local` as the
|
|
515
|
-
email.
|
|
516
|
-
|
|
515
|
+
email. `rig init` suggests your local `git config user.name` / `user.email` and
|
|
516
|
+
stores your answer as `git_author_name` / `git_author_email` in your personal
|
|
517
|
+
`.rig/vars.{identity}.yml` (skipped when git has neither). You can also set them
|
|
518
|
+
by hand in `.rig/vars.yml` or that file, to use a real name and a GitHub-linked
|
|
517
519
|
email (the derived `rig.local` address is deliberately not a
|
|
518
520
|
`users.noreply.github.com` one, which GitHub would attribute to whoever owns
|
|
519
521
|
that handle).
|
|
@@ -490,8 +490,10 @@ scaffolded by an older rig still have the token-in-URL clone task in their
|
|
|
490
490
|
with *Author identity unknown*. `authorize.yml` sets `user.name` / `user.email`
|
|
491
491
|
(global) from `rig_git_author_name` / `rig_git_author_email`, which rig derives
|
|
492
492
|
from your identity: the identity as the name and `<identity>@rig.local` as the
|
|
493
|
-
email.
|
|
494
|
-
|
|
493
|
+
email. `rig init` suggests your local `git config user.name` / `user.email` and
|
|
494
|
+
stores your answer as `git_author_name` / `git_author_email` in your personal
|
|
495
|
+
`.rig/vars.{identity}.yml` (skipped when git has neither). You can also set them
|
|
496
|
+
by hand in `.rig/vars.yml` or that file, to use a real name and a GitHub-linked
|
|
495
497
|
email (the derived `rig.local` address is deliberately not a
|
|
496
498
|
`users.noreply.github.com` one, which GitHub would attribute to whoever owns
|
|
497
499
|
that handle).
|
|
@@ -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)
|
|
@@ -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,
|
|
@@ -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.
|
|
3
|
+
Version: 1.11.0
|
|
4
4
|
Summary: Ephemeral remotes with full local parity for coding agents
|
|
5
5
|
Author: mystack-cloud
|
|
6
6
|
License-Expression: MIT
|
|
@@ -512,8 +512,10 @@ scaffolded by an older rig still have the token-in-URL clone task in their
|
|
|
512
512
|
with *Author identity unknown*. `authorize.yml` sets `user.name` / `user.email`
|
|
513
513
|
(global) from `rig_git_author_name` / `rig_git_author_email`, which rig derives
|
|
514
514
|
from your identity: the identity as the name and `<identity>@rig.local` as the
|
|
515
|
-
email.
|
|
516
|
-
|
|
515
|
+
email. `rig init` suggests your local `git config user.name` / `user.email` and
|
|
516
|
+
stores your answer as `git_author_name` / `git_author_email` in your personal
|
|
517
|
+
`.rig/vars.{identity}.yml` (skipped when git has neither). You can also set them
|
|
518
|
+
by hand in `.rig/vars.yml` or that file, to use a real name and a GitHub-linked
|
|
517
519
|
email (the derived `rig.local` address is deliberately not a
|
|
518
520
|
`users.noreply.github.com` one, which GitHub would attribute to whoever owns
|
|
519
521
|
that handle).
|
|
@@ -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
|
"""
|
|
@@ -381,3 +381,32 @@ def test_agent_launch_exports_the_token_to_the_agent_process(tmp_path):
|
|
|
381
381
|
cmd = cmd.replace("mkdir -p /workspace && cd /workspace && exec claude", 'printf "%s" "$GH_TOKEN"')
|
|
382
382
|
out = subprocess.run(["bash", "-c", cmd], capture_output=True, text=True, check=True).stdout
|
|
383
383
|
assert out == "ghp_agent"
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def test_detect_local_git_author_reads_the_global_git_config(tmp_path, monkeypatch):
|
|
387
|
+
from cli import git_author
|
|
388
|
+
|
|
389
|
+
config = tmp_path / "gitconfig"
|
|
390
|
+
config.write_text("[user]\n\tname = Ada Lovelace\n\temail = ada@example.com\n")
|
|
391
|
+
monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(config))
|
|
392
|
+
monkeypatch.setenv("GIT_CONFIG_SYSTEM", os.devnull)
|
|
393
|
+
real = git_author.detect_local_git_author.__wrapped__
|
|
394
|
+
assert real() == {"name": "Ada Lovelace", "email": "ada@example.com"}
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def test_detect_local_git_author_is_empty_without_git_config(tmp_path, monkeypatch):
|
|
398
|
+
from cli import git_author
|
|
399
|
+
|
|
400
|
+
monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(tmp_path / "missing"))
|
|
401
|
+
monkeypatch.setenv("GIT_CONFIG_SYSTEM", os.devnull)
|
|
402
|
+
assert git_author.detect_local_git_author.__wrapped__() == {"name": "", "email": ""}
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
def test_detect_local_git_author_survives_a_missing_git_binary(monkeypatch):
|
|
406
|
+
from cli import git_author
|
|
407
|
+
|
|
408
|
+
def boom(*_a, **_k):
|
|
409
|
+
raise FileNotFoundError("git")
|
|
410
|
+
|
|
411
|
+
monkeypatch.setattr(git_author.subprocess, "run", boom)
|
|
412
|
+
assert git_author.detect_local_git_author.__wrapped__() == {"name": "", "email": ""}
|
|
@@ -1027,7 +1027,7 @@ def _init_with_devcontainer(tmp_path, *extra_answers, existing_flag=None):
|
|
|
1027
1027
|
|
|
1028
1028
|
def ask(prompt):
|
|
1029
1029
|
asked.append(prompt)
|
|
1030
|
-
return next(answers)
|
|
1030
|
+
return next(answers, "")
|
|
1031
1031
|
|
|
1032
1032
|
assert interactive_env_init(
|
|
1033
1033
|
str(api),
|
|
@@ -1067,7 +1067,7 @@ def test_init_without_dev_containers_asks_nothing_and_leaves_the_flag_unset(tmp_
|
|
|
1067
1067
|
|
|
1068
1068
|
def ask(prompt):
|
|
1069
1069
|
asked.append(prompt)
|
|
1070
|
-
return next(answers)
|
|
1070
|
+
return next(answers, "")
|
|
1071
1071
|
|
|
1072
1072
|
assert interactive_env_init(
|
|
1073
1073
|
str(api),
|
|
@@ -1079,3 +1079,90 @@ def test_init_without_dev_containers_asks_nothing_and_leaves_the_flag_unset(tmp_
|
|
|
1079
1079
|
manifest = yaml.safe_load((api / "rig.yml").read_text())
|
|
1080
1080
|
assert "devcontainers" not in manifest["editor"]
|
|
1081
1081
|
assert not any("Dev Container" in prompt for prompt in asked)
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
def _init_with_author(tmp_path, monkeypatch, local, *prompts):
|
|
1085
|
+
"""Run init in a fresh repo; ``prompts`` answer the git author questions."""
|
|
1086
|
+
rig = tmp_path / "mystack" / "rig"
|
|
1087
|
+
if not rig.exists():
|
|
1088
|
+
_git_init(rig, "https://github.com/mystack-cloud/rig.git")
|
|
1089
|
+
data_key = tmp_path / "data-key"
|
|
1090
|
+
data_key.write_text("vault-pass\n")
|
|
1091
|
+
monkeypatch.setattr("cli.git_author.detect_local_git_author", lambda: local)
|
|
1092
|
+
asked: list[str] = []
|
|
1093
|
+
rerun = bool(list((rig / ".rig").glob("vars.*.yml"))) # identity already bootstrapped: no identity prompt
|
|
1094
|
+
answers = iter(("all", "rig", "", "", *prompts)) if rerun else _answers("all", "rig", "", "", *prompts)
|
|
1095
|
+
|
|
1096
|
+
def ask(prompt):
|
|
1097
|
+
asked.append(prompt)
|
|
1098
|
+
return next(answers, "")
|
|
1099
|
+
|
|
1100
|
+
assert interactive_env_init(
|
|
1101
|
+
str(rig),
|
|
1102
|
+
input_fn=ask,
|
|
1103
|
+
secret_fn=_secrets(),
|
|
1104
|
+
config_path=str(tmp_path / "rig-config"),
|
|
1105
|
+
data_key_path=str(data_key),
|
|
1106
|
+
)
|
|
1107
|
+
return rig, asked
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
def test_init_suggests_the_local_git_author_and_stores_it(tmp_path, monkeypatch):
|
|
1111
|
+
local = {"name": "Ada Lovelace", "email": "ada@example.com"}
|
|
1112
|
+
rig, asked = _init_with_author(tmp_path, monkeypatch, local, "", "") # accept both
|
|
1113
|
+
|
|
1114
|
+
assert any("Git author name [Ada Lovelace]" in a for a in asked)
|
|
1115
|
+
assert any("Git author email [ada@example.com]" in a for a in asked)
|
|
1116
|
+
stored = yaml.safe_load(_personal_vars_text(rig))
|
|
1117
|
+
assert stored["git_author_name"] == "Ada Lovelace"
|
|
1118
|
+
assert stored["git_author_email"] == "ada@example.com"
|
|
1119
|
+
assert "git_author" not in (rig / ".rig" / "vars.yml").read_text()
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
def test_init_lets_the_developer_override_the_suggested_author(tmp_path, monkeypatch):
|
|
1123
|
+
local = {"name": "Ada Lovelace", "email": "ada@home.example"}
|
|
1124
|
+
rig, _ = _init_with_author(tmp_path, monkeypatch, local, "Ada L", "ada@work.example")
|
|
1125
|
+
|
|
1126
|
+
stored = yaml.safe_load(_personal_vars_text(rig))
|
|
1127
|
+
assert stored["git_author_name"] == "Ada L"
|
|
1128
|
+
assert stored["git_author_email"] == "ada@work.example"
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
def test_init_keeps_the_author_already_stored_for_the_identity(tmp_path, monkeypatch):
|
|
1132
|
+
first, _ = _init_with_author(tmp_path, monkeypatch, {"name": "Ada", "email": "ada@old.example"}, "", "")
|
|
1133
|
+
again, asked = _init_with_author(
|
|
1134
|
+
tmp_path, monkeypatch, {"name": "Someone Else", "email": "else@new.example"}, "", ""
|
|
1135
|
+
)
|
|
1136
|
+
|
|
1137
|
+
assert again == first
|
|
1138
|
+
assert any("Git author name [Ada]" in a for a in asked)
|
|
1139
|
+
assert yaml.load(_personal_vars_text(again), Loader=_VarsLoader)["git_author_email"] == "ada@old.example"
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
def test_init_skips_the_author_prompt_when_git_has_none(tmp_path, monkeypatch):
|
|
1143
|
+
rig, asked = _init_with_author(tmp_path, monkeypatch, {"name": "", "email": ""})
|
|
1144
|
+
|
|
1145
|
+
assert not any("Git author" in a for a in asked)
|
|
1146
|
+
assert "git_author" not in _personal_vars_text(rig)
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
def test_init_stores_only_the_field_git_knows(tmp_path, monkeypatch):
|
|
1150
|
+
rig, _ = _init_with_author(tmp_path, monkeypatch, {"name": "Ada", "email": ""}, "", "")
|
|
1151
|
+
|
|
1152
|
+
stored = yaml.safe_load(_personal_vars_text(rig))
|
|
1153
|
+
assert stored["git_author_name"] == "Ada"
|
|
1154
|
+
assert "git_author_email" not in stored
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
def test_init_takes_the_suggested_author_without_asking_when_not_interactive(tmp_path, monkeypatch):
|
|
1158
|
+
from cli.remote_dev import _prompt_git_author, _store_git_author
|
|
1159
|
+
|
|
1160
|
+
monkeypatch.setattr("cli.git_author.detect_local_git_author", lambda: {"name": "Ada", "email": "ada@example.com"})
|
|
1161
|
+
monkeypatch.setattr("sys.stdin", type("NoTty", (), {"isatty": lambda self: False})())
|
|
1162
|
+
monkeypatch.setattr("builtins.input", lambda *_: pytest.fail("must not prompt"))
|
|
1163
|
+
|
|
1164
|
+
author = _prompt_git_author(str(tmp_path), "mlewk", None)
|
|
1165
|
+
assert author == {"name": "Ada", "email": "ada@example.com"}
|
|
1166
|
+
_store_git_author(str(tmp_path), "mlewk", author)
|
|
1167
|
+
stored = yaml.safe_load((tmp_path / ".rig" / "vars.mlewk.yml").read_text())
|
|
1168
|
+
assert stored == {"git_author_name": "Ada", "git_author_email": "ada@example.com"}
|
|
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
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0001-per-profile-generated-state-bucket.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/docs/adr/0005-docker-in-configure-for-devcontainers.md
RENAMED
|
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
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_home_ownership/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_home_ownership/tasks/authorize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_home_ownership/tasks/install.yml
RENAMED
|
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
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_repos/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_user/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_user/tasks/authorize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.2 → mystack_rig-1.11.0}/src/cli/roles/rig_workspace_user/tasks/install.yml
RENAMED
|
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
|