Skip to content

Work across repositories

A SupaCloud project has exactly one repository: one repository URL, one git provider and one default branch. An agent’s workspace is a clone of that repository and nothing else. The platform’s delivery pushes the task branch to that repository, and the agent’s pr.create tool opens a pull request only on the project’s own repository — it takes no repository argument at all.

Work that spans several repositories is therefore modelled as one project per repository. Content moves from one repository to another as a pull request in the project that receives it, worked by that project’s own agent.

  • Each repository is its own project, in the same Workspace. Create them one by one or with Import, which makes one project per repository — see Create a project and connect its repository.
  • The receiving project owns the change. Its tracker holds the issue, its agent does the work, its pull request carries the change, and its gates and sensitive paths decide the merge.
  • The source repository is read, never written. The receiving agent reads it at a pinned commit, never pushes to it and opens no pull request against it.
  • The forge permission is the boundary. Give the forge account behind the receiving project’s git credential read access to the source repository and write access to its own repository only. That permission holds against anything an agent runs in its shell.
  1. Create a project for each repository in the same Workspace, or press Import on the projects board and tick both repositories. Import gives every project it creates the credential you imported with, so check the credential of both projects in the next steps.

  2. On the receiving project, open the Configuration tab, then the Repository & source row, pick the access-token credential described above, and press Save at the bottom of the tab. Only a Workspace owner or admin can change this tab.

  3. Still on the receiving project, open the Guardrails row. Under Sensitive paths, press Add class for the files that come from the other repository: give it a Class name, list the files under Globs, one per line, keep Hold the merge for a person ticked (a new class starts with it), also tick Hold the run when an agent edits it, and press Save in that section. A change to those files then waits for a person at merge, under every merge policy and at every autonomy level. An agent that edits one of them with its file-editing tools — in the import run too — also raises a safety hold for a person; whether that hold pauses the run depends on the agent, as Approve or reject agent actions explains. The merge hold is the one that always applies: a change made any other way, such as a copy in the shell, still waits for a person at merge.

  4. The source project needs a credential of its own only if its own agents work on it. Then give it one from a different forge account, so the account behind the receiving project’s credential still only reads the source. Nothing on the source project refers to the receiving project.

  1. File the import as an issue in the receiving project’s tracker. Name the source repository, the exact commit it imports, and the files it may change — for example Sync mirrored contracts from bw-ideas@<sha>.

  2. Let the receiving project work it — through its backlog (see Run the backlog) or as a task launched from the issue (see Launch a task from an issue).

  3. As the issue asks, the agent reads the source repository at that commit into a scratch directory outside its checkout and copies the named files into its own checkout. It does not add the source as a remote, does not commit it and does not push to it. If it edits the imported files with its file-editing tools, the edit raises a safety hold for a person to decide.

  4. The agent opens the pull request on the receiving repository. Review and merge follow that project’s gates; because the imported files are a sensitive-path class, a person merges it.

A change that has to travel the other way is the same procedure with the roles swapped: it becomes an issue and a pull request in the other project, worked by that project’s agent or by a person. An agent whose profile allows the supacloud.ops.* tools can start such a task itself with task.create; the task then runs as the other project’s agent, with that project’s credential, and its pull request follows that project’s gates.

bw-fm27 is a game repository. bw-ideas holds the concept documents, research and ideas behind it. bw-fm27 carries copies of two files that are authored in bw-ideas: contracts/toolchain.lock.yaml and contracts/compatibility_matrix.yaml.

  • Two projects, one Workspace. bw-ideas and bw-fm27 are separate projects, each with its own repository.

  • Credential. The forge account behind bw-fm27’s access-token credential can write to bw-fm27 and only read bw-ideas.

  • Sensitive paths on bw-fm27. One class:

    Field Value
    Class name mirrored
    Globs contracts/toolchain.lock.yaml, contracts/compatibility_matrix.yaml
    Effects Hold the merge for a person · Hold the run when an agent edits it
  • The import. A bw-fm27 work item such as Sync mirrored contracts from bw-ideas@<sha> is worked by a bw-fm27 agent. It reads bw-ideas at that commit, updates the two files in bw-fm27, and opens a pull request on bw-fm27. The owner approves any hold the run raises and merges the pull request.

  • Changing the source. A change to the contracts themselves is made in bw-ideas — by a person or a bw-ideas agent, as a bw-ideas pull request. bw-fm27 picks it up with the next import at the new commit.

  • A project has no second repository, and SupaCloud clones no other repository into an agent’s workspace.
  • One project’s agent does not open a pull request against another project’s repository.
  • Nothing is copied between repositories automatically; every import is a pull request that an issue asked for.