Skip to content

[Bug] Unindexed coverage lacks an actionable synchronization route #233

Description

@morluto

Description

When corpus_get_coverage is called for a repository that is not present in the local corpus, GitContribute correctly reports the target as unavailable, but the recovery guidance is only a generic sentence. The result does not identify the advertised synchronization operation or provide the arguments needed to continue.

Observed response:

{
  "status": "partial",
  "items": [{
    "item_status": "unavailable",
    "key": "morluto/leantoken",
    "message": "target is not present in the local corpus",
    "reason": "not_indexed",
    "next_action": "Synchronize the repository or thread explicitly, then retry this item."
  }]
}

Steps to Reproduce

  1. Use a GitContribute installation whose local corpus does not contain a repository.
  2. Call corpus_get_coverage with:
    {"targets":[{"owner":"morluto","repo":"leantoken"}]}
  3. Inspect the item-level result.

Expected Behavior

The result should preserve the current unavailable / not_indexed classification, but expose an actionable recovery route. For example, it could return a structured next action containing the exact advertised synchronization tool, its repository or thread arguments, the facets to acquire, and the instruction to retry coverage afterward.

The contract and tool descriptions should also state explicitly that not_indexed means unknown coverage, not evidence that no issue, PR, or code match exists.

Synchronization should remain explicit and bounded: corpus reads must not perform network access implicitly. This report is about discoverability and routing, not a request to make every coverage read auto-sync.

Actual Behavior

The only recovery hint is:

Synchronize the repository or thread explicitly, then retry this item.

An agent has to guess which synchronization operation applies and reconstruct its arguments. Depending on the workflow, it may stop, make an incorrect sync call, or incorrectly treat unavailable coverage as a negative result.

Impact and Scope

This affects workflows that correctly check coverage before searching for duplicates, historical precedents, or source evidence in a repository that has not yet been synchronized. The underlying coverage classification is useful; the missing actionable route makes the normal recovery path unreliable.

Possible Direction

One option is to return a structured next_action object, for example:

{
  "kind": "sync_required",
  "tool": "github_sync_threads",
  "arguments": {
    "repositories": [{"owner": "morluto", "repo": "leantoken"}]
  },
  "then": "corpus_get_coverage"
}

The exact operation and arguments should be selected from the missing facet rather than hard-coded to one sync tool. A dedicated ensure_coverage operation is another possible design. Either approach should have focused coverage for an unindexed repository, an unindexed exact thread, stale coverage, retryable sync results, and the invariant that corpus reads remain network-free.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/appbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions