Skip to content

mng/mind-details#899

Open
joshalbrecht wants to merge 9 commits intojosh/mind_readyfrom
mng/mind-details
Open

mng/mind-details#899
joshalbrecht wants to merge 9 commits intojosh/mind_readyfrom
mng/mind-details

Conversation

@joshalbrecht
Copy link
Contributor

Automated PR created by Claude Code session.

joshalbrecht and others added 9 commits March 17, 2026 09:56
When creating a new mind, after cloning the repo:
1. Record the parent branch and commit hash
2. Checkout a new branch named minds/<mind_name>
3. Write a .parent file (git config format) tracking the parent URL,
   branch, and commit hash
4. Commit the .parent file

Add a "mind update <agent-name>" CLI command that:
A) Stops the mind (mng stop)
B) Fetches and merges the latest code from the parent repository
C) Updates all vendored git subtrees (git subtree pull)
D) Starts the mind back up (mng start)

Also makes run_git and ensure_git_identity public in vendor_mng.py
so they can be reused by parent_tracking.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… helper

- Use GitUrl, GitBranch, and new GitCommitHash primitives in ParentInfo
  instead of bare str fields (style guide compliance)
- Create MindAgentRecord FrozenModel for find_mind_agent return type
  instead of raw dict[str, object]
- Extract shared make_git_repo helper to forwarding_server conftest.py
  to eliminate duplication between parent_tracking_test and vendor_mng_test
- Find agents by name (--include 'name == "..."') instead of by label
- Deduplicate run_mng_stop/run_mng_start into _run_mng_command helper
- Remove unused _MNG_COMMAND_TIMEOUT_SECONDS constant
- Add logger.trace for swallowed JSONDecodeError in _parse_agents_from_output
- Fix pull_subtree docstring reference to private function

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename _parse_agents_from_output to parse_agents_from_mng_output (public)
  and have testing.py's parse_mng_list_json delegate to it, eliminating
  the duplicate JSON parsing logic
- Move make_git_repo from forwarding_server/conftest.py to testing.py
  per project convention (conftest.py is for fixtures, testing.py is for
  explicitly imported helper functions)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix test function names: test_parse_* (was missing underscore after test)
- Move parse_agents_from_mng_output to config/data_types.py (shared module)
  so neither testing.py nor cli/update.py depends on the other

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The docstring referenced cli.update but the function was moved to
config.data_types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move parse_agents_from_mng_output tests from cli/update_test.py to
  config/data_types_test.py (where the function lives)
- Remove now-empty cli/update_test.py
- Restore CLAUDE_CODE_MAX_OUTPUT_TOKENS env var in .claude/settings.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add GitOperationError base class with ParentTrackingError subclass;
  VendorError now inherits from GitOperationError
- Add error_class parameter to run_git so callers can specify the
  appropriate error type (defaults to VendorError for compatibility)
- parent_tracking.py now raises ParentTrackingError instead of VendorError
- Use AgentName and GitUrl domain types in setup_mind_branch_and_parent
  and checkout_mind_branch signatures
- Extract parse_mind_agent_record as a testable function
- Add unit tests for MindAgentRecord and parse_mind_agent_record
- Restore CLAUDE_CODE_MAX_OUTPUT_TOKENS env var in .claude/settings.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ParentTrackingError inherits from GitOperationError (not VendorError),
so the except block needs to catch GitOperationError to handle failures
from both vendor operations and parent tracking operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant