Skip to main content

Scenario 12: Technical-debt planning

Use Scenario 12 to investigate a bounded debt question and prepare a repayment proposal. Keep it separate from the dashboard summary and.

User Guides

Use Scenario 12 to investigate a bounded debt question and prepare a repayment proposal. Keep it separate from the dashboard summary and configuration-hygiene checks: those surfaces answer different questions and carry different evidence.

Choose the right surface

Choose the right surface
Need Surface Result
Explain and sequence debt work for an accepted task typed Scenario 12 analysis and proposed plan
Read the current project summary codegraph_quality_tech_debt_report_get() dead methods, hotspots, quality summary
Detect orphaned or ineffective configuration python -m src.cli dogfood config-check configuration-hygiene findings

The dashboard MCP has no input fields and does not create a repayment plan. The dogfood command covers the documented debt workflow; create the repayment plan from the selected findings.

Prerequisites and scope

Name the affected component, decision horizon, revision, and acceptance constraints. Attach current tests or production evidence when the debt claim depends on behavior, latency, incidents, or operating cost.

Do not treat a complexity score or dead-code candidate as automatic priority. Product impact, change frequency, ownership, remediation cost, and risk require separate evidence.

Run the typed scenario

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

request = RoleBoundScenarioInvocationRequest(
    query="Rank debt in the import pipeline and propose bounded repayment slices.",
    employee_id="codegraph_developer",
    scenario_id="scenario_12",
    event_type="implementation_start",
    context={
        "project_key": "codegraph",
        "namespace": "default",
        "task_id": "<task-id>",
        "source_refs": ["<revision-ref>", "<quality-evidence-ref>"],
        "file_paths": ["<bounded-source-path>"],
    },
)
result = invoke_role_bound_scenario_request(request)

Run the dashboard MCP separately when you need a current aggregate:

codegraph_quality_tech_debt_report_get()

Read the result

For Scenario 12, retain the proposed slices, source evidence, assumptions, risks, and scenario invocation metadata. For the dashboard summary, retain the observation time and project revision. For config-check, retain the exact configuration revision and command output.

Reproduce decision-relevant findings in source or a focused test before scheduling work. Treat a synthesized plan as the starting proposal and record the confirmed debt severity with its evidence.

Safety and authority boundaries

None of the three surfaces edits code, commits a plan, changes product priority, or closes an acceptance criterion. A human owner must approve scope and priority. Implementation still requires tests-first mutation, focused validation, structural review, AppSec and QA evidence where applicable.

Keep results from different revisions in separate scores. When dashboard data is missing, inspect the source and task evidence before recording the debt status.

Failure and recovery

  • MCP error text: verify active project context and CPG availability; do not interpret the error as a zero value.
  • Generic Scenario 12 output: narrow the component, evidence refs, and decision question.
  • Config-check finding: confirm the key is truly unused before deleting configuration.
  • Disputed priority: record the product and operational evidence separately, then rerun the decision review.

Source contract

This guide is bound to:

  • src/mcp/tools/project_suite/tech_debt.py — no-argument dashboard aggregation;
  • src/workflow/scenarios/code_quality/tech_debt.py — scenario analysis;
  • src/digital_employees/runtime/scenarios/role_bound_scenario_invoker.py — typed routing;
  • src/digital_employees/runtime/scenarios/employee_scenario_invocation.py — developer ownership and event policy;
  • src/cli/dogfood_suite/dogfood_commands.py — configuration-hygiene command.