Skip to content

[Task]: Add a QA-native repo understanding artifact #155

Closed

Description

@sumithr

Priority / sequencing

P0 / priority: high

Suggested labels

  • ux

Roadmap fields

Status: Backlog; Priority: P0; Size: L; Order: first implementation slice under #154; Depends on: #154

Problem

sumo-qa currently relies on each workflow to inspect the repo ad hoc. That works for one conversation, but it prevents product-grade repo understanding, incremental updates, diff impact analysis, report output, and reusable QA evidence.

Generic code graphs are not enough. sumo-qa needs a QA-native map that captures code structure plus tests, CI evidence, risk surfaces, fixtures, migrations, routes, commands, and known coverage links.

Expected outcome

Add a deterministic, validated .sumo-qa/repo-map.json artifact and first-slice generator that maps a repository well enough for QA workflows to answer:

  • what exists;
  • what can break;
  • what tests or checks appear to exercise it;
  • what evidence is stale, missing, or unmapped.

Scope

  • Add a versioned schema and Pydantic or dataclass models for repo-map data.
  • Add a deterministic local generator, exposed by MCP and reusable by CLI work in [Task]: Add product-grade CLI commands for analyze, review, report, and status #160.
  • Write .sumo-qa/repo-map.json only when explicitly requested by the tool/command.
  • Capture first-slice entities:
    • project metadata: root, git hash when available, generated timestamp, generator version;
    • files: path, category, language, size, hash/fingerprint;
    • test files and likely test target links by path/name conventions;
    • package manifests and likely test commands;
    • CI/workflow configs and jobs;
    • app/config/infrastructure/schema/migration/fixture files;
    • route/endpoint hints where cheaply detectable;
    • coarse dependency edges from imports or manifest relationships where available.
  • Include skipped-file and unsupported-language summaries.
  • Add validation and actionable error envelopes for malformed or stale artifacts.
  • Preserve all current workflows when the artifact is absent.

Proposed artifact shape

Minimum useful shape:

{
  "schema_version": "1.0",
  "project": {
    "root": "/repo",
    "name": "repo-name",
    "git_commit": "abc123",
    "generated_at": "2026-05-25T00:00:00Z",
    "generator_version": "sumo-qa x.y.z"
  },
  "nodes": [
    {
      "id": "file:src/app.py",
      "type": "source_file",
      "path": "src/app.py",
      "language": "python",
      "category": "app",
      "tags": ["api"],
      "fingerprint": "sha256:..."
    }
  ],
  "edges": [
    {
      "source": "file:tests/test_app.py",
      "target": "file:src/app.py",
      "type": "likely_tests",
      "confidence": "medium",
      "reason": "path/name convention"
    }
  ],
  "commands": [],
  "warnings": []
}

Node and edge vocabulary should stay small in the first slice. Expand only when downstream workflows need it.

Acceptance criteria

  • .sumo-qa/repo-map.json is versioned and schema-validated.
  • Generator is deterministic on the same repo state.
  • Artifact includes source/freshness metadata: generated timestamp, git commit/hash when available, root path, generator version, and skipped-file summary.
  • First-slice node types cover source files, test files, docs, config, CI, manifests, fixtures, migrations/schema, and infrastructure.
  • First-slice edge types cover likely test links, imports/dependencies where available, configured-by, and command/CI relationships.
  • Tool output is compact and does not dump the full artifact by default.
  • Existing token-budget tests are not materially worsened.
  • Docs explain whether the artifact should be committed, ignored, or treated as local cache.
  • No mandatory graph DB, vector DB, embedding, external LLM, or network dependency is introduced.

Test plan

  • Unit tests for schema validation, malformed artifact handling, and stale artifact detection.
  • Fixture repo tests for deterministic generation across at least Python and Node-style layouts.
  • Snapshot or golden-file test for a small generated repo map.
  • pytest tests/test_tools_list_contract.py tests/test_token_weight_regression.py tests/test_skill_conformance.py
  • Add a small worked example once [Task]: Add repo-map query and diff-impact analysis tools #156 connects review/planning flows to the artifact.

Context

Activity

  1. added
    enhancement
    ux
    priority: high
    on May 25, 2026
  2. sumithr commented on May 25, 2026

    @sumithr
    OwnerAuthor

    Iteration notes:

    Suggested PR slices:

    1. Schema/models only: add repo-map models, validation, fixture artifact, and tests. No MCP tool yet.
    2. Local scanner service: generate nodes for files, manifests, tests, CI configs, fixtures, migrations, and commands. Keep dependency edges minimal.
    3. MCP/CLI wrapper: expose compact status from the service without dumping the full artifact.
    4. Docs and examples: document .sumo-qa/repo-map.json, freshness, and commit/cache guidance.

    Keep the first schema intentionally conservative. It is easier to add node/edge types after #156 consumes them than to support an over-broad graph forever.

  3. added 11 commits that reference this issue on May 28, 2026
    6ad5964
    d7f77c1
    a3fe315
    ac24533
    ece1a23
    4415e73
    33c76b2
    97625fe
    6af266b
    5c6fab8
    ac8c87a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority: highux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions