Repository navigation
[RFC] Local Environment Files in Managed Worktrees #7420
sebasanblas
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a discussion-first RFC; I am not proposing a code pull request until maintainers confirm the desired behavior.
Context
I am using Multica with a frontend repository that has different build targets, such as beta, staging, and production.
The repository intentionally keeps environment-specific files out of Git, for example:
.env.beta.local.env.staging.local.env.production.localThe project works correctly in its primary local checkout because those files exist there. However, when Multica runs an issue against a
github_reporesource, it creates an isolated worktree from the daemon-managed cache. The local environment files ignored by Git are not present in that worktree, so the agent cannot properly run the build or native validation.The current alternatives have important trade-offs:
local_directoryin direct mode exposes the user's current branch and forces tasks to run serially.local_directoryin worktree mode preserves isolation, but ignored files are still not copied automatically.Problem
Multica has a strong isolation model for
github_reporesources, but there does not appear to be a generic mechanism for a local daemon to provide Git-ignored configuration files to isolated worktrees.This is not limited to
.envfiles. A repository may need:The desired behavior is to keep the repository isolated while allowing the local daemon to explicitly provide the configuration required to run the task.
Proposed two-layer model
I would like to ask whether Multica would consider combining the following two layers.
Layer 1: repository-declared files
Support the same convention used by Codex-managed worktrees:
This file would act as an explicit list of ignored paths that may be copied into a managed worktree.
The convention should be opt-in and explicit. Multica should not automatically copy all
.env*files or all ignored files.Layer 2: daemon-local source or profile
For a
github_reporesource, allow a local daemon to register a source checkout or environment profile associated with that repository.The server would store only metadata such as:
The actual file contents would remain on the local machine.
Before starting the agent, the daemon would:
.worktreeinclude.This would allow the repository to remain a normal
github_reporesource while still using local configuration available only on the daemon.Security and lifecycle requirements
Any implementation should:
.env*;For actual secrets, a future profile could resolve values from the local environment, the macOS Keychain, or another external secret manager without storing the value in Multica.
Alternative approaches
I see three possible directions:
.worktreeincludesupport directly to Multica's local worktree preparation.The first option is probably the smallest change. The second seems more extensible for repositories that need multiple environment variants and configuration that is not limited to files.
Questions for maintainers
.worktreeincludecompatibility as a repository-level contract be reasonable?github_reporesource rather than with the entire project?custom_env?I am primarily looking for architectural guidance before implementing anything. If this direction does not fit Multica's model, I would appreciate guidance on the intended workflow.
Related references
All reactions