Skip to main content

Scenario 10: Cross-repository impact

Review dependencies, duplication, and consolidation risks across repositories without confusing analysis with approval.

User Guides

Use this scenario when a proposed change in one repository may affect code, dependencies, or duplicated implementations in other repositories. It produces a shared evidence set for review; deployment and architecture owners record their decisions separately.

When to use it

Use Scenario 10 for a bounded workspace that contains several repositories and one explicit question, such as:

  • which repositories call or duplicate a changed interface;
  • where a shared dependency creates circular or high-risk coupling;
  • which consolidation candidates need human review.

For structure inside one repository, use Scenario 11. For a broad source migration, use Scenario 13.

Prerequisites and scope

You need an accepted review task, a current project CPG, and a trusted CodeGraph runtime whose working directory is the intended workspace. Record the repositories and revision of each repository in the task evidence before comparing results.

The underlying workflow reads user_context.workspace_path and otherwise falls back to .. The current role-bound adapter keeps that internal state field inside the workflow. Set the server working directory to a bounded workspace containing the intended repositories.

Indexing side effect: the workflow discovers repositories and calls index_repository_cpg for every result. It can refresh the active project CPG. Treat the run as a controlled indexing operation, not as a read-only query.

Run the typed scenario

Invoke the reviewer-owned scenario with exact task scope:

from src.digital_employees.runtime.scenarios import (
    RoleBoundScenarioInvocationRequest,
    invoke_role_bound_scenario_request,
)

request = RoleBoundScenarioInvocationRequest(
    query="Identify cross-repository dependencies affected by changing BillingClient.",
    employee_id="codegraph_reviewer",
    scenario_id="scenario_10",
    event_type="review_start",
    context={
        "project_key": "codegraph",
        "namespace": "default",
        "task_id": "<task-id>",
        "source_refs": ["<revision-manifest-ref>"],
        "file_paths": ["<bounded-source-path>"],
    },
)
result = invoke_role_bound_scenario_request(request)

Scenario 10 uses the typed role-bound request as its public entry point. The request carries the role, event, and task evidence for the cross-repository analysis.

Read the result

Keep these fields with the review evidence:

  • answer: the synthesized explanation;
  • evidence: dependency, duplication, and circular-dependency observations;
  • metadata.role_bound_scenario_invocation: employee, event, workflow, and preflight evidence;
  • the workspace and repository revision manifest captured before the run.

Verify important claims in the named repository and revision. A similarity or dependency observation creates a review lead; compatibility follows from the comparison and the accountable decision.

Safety and authority boundaries

The run may update CPG data. Source-repository edits, consolidation, merges, and release authorization run through the accountable reviewer, who validates ownership, compatibility, licensing, security, tests, and rollback.

Point the runtime at the approved workspace directory. Repository discovery follows that boundary, so the indexed projects match the task scope.

Failure and recovery

  • No repositories found: verify the server working directory and repository revision manifest.
  • Stale or mixed results: refresh the intended repositories, rerun against the same revisions, and replace the old evidence with the new revision-bound package.
  • Handler or CPG failure: treat fallback or partial output as a hypothesis and record the unavailable evidence source.
  • Unexpected repositories indexed: stop, preserve the log, correct the workspace boundary, and assess whether unrelated code entered the active CPG.

Source contract

This guide is bound to:

  • src/workflow/scenarios/domain_checks/cross_repo.py — discovery, indexing, analysis, and evidence;
  • src/workflow/scenarios/cross_repo_handlers/workflow.py — specialized handlers;
  • src/digital_employees/runtime/scenarios/role_bound_scenario_invoker.py — typed routing;
  • src/digital_employees/runtime/scenarios/employee_scenario_invocation.py — reviewer ownership and event policy.

If those contracts change, validate this page before publication.