Skip to content

Query one question across several OKF bundles #34

Description

@1wgrumph

Migrated from private source issue alphazede/bran-dev#21

Origin

bran-dev — BRAN CLI and ranking. Capability gap, not a defect in shipped
behaviour. Surfaced while answering a real question in the OKF community about
retrieval architecture for large bundle collections.

Harness / version

bran 0.1.0, source commit 0a1de91, branch main.

What

A query is scoped to exactly one repository root, and that root must contain a
.bran/policy.yaml. There is no way to ask one question across several bundles.

query <repo-root> <request> takes a single positional root. There is no
--add-dir or multi-root flag, and pointing BRAN at a directory that merely
contains repositories returns unavailable.

Anyone with more than one repository hits this immediately. It is also the
shape most organisations are in: knowledge spread across many bundles rather
than one very large one.

Current evidence

Container directory holding 13 repositories, 131 GB total:

bran query /path/to/workspace "personal parlay"
  status: unavailable
  warnings: ["native_policy_unavailable"]

The same question, run per repository, answers correctly:

repository on disk candidate corpus result
A 6.3 GB 9.8 MB ranks 1-4 are the matching plan directory
B 13 GB 45.9 MB ranks 1-4 are the matching implementation and tests
C 16 GB 6.0 MB 0 results, correctly, no relevant content

Two things this shows. Per-bundle ranking works and filters hard before the
query runs: a 13 GB checkout yields a 45.9 MB candidate corpus because build
artifacts and vendored dependencies never enter it. And the current answer to
"search everything" is to invoke BRAN once per repository.

Merging those results by hand is not safe. Scores are relative to the corpus
that produced them, so a confidence: 50 in one bundle is not comparable to a
confidence: 50 in another. Concatenating and sorting produces a ranking that
looks authoritative and is not.

Expected

One query can span several policy-bearing roots and return a single ranking
that is meaningful across them, without losing determinism or the offline
guarantee.

Acceptance

  • A query accepts more than one policy-bearing root and returns one ranking.
  • Scores are comparable across bundles, or the response states plainly that
    they are not and declines to interleave them.
  • Each result identifies which bundle it came from.
  • A root without a native policy is still refused, and refusing one root
    does not silently drop it from a multi-root result.
  • Ranking stays deterministic and offline: no provider, no network, no clock
    reads; identical inputs produce identical output.
  • Per-bundle behaviour is unchanged when a single root is given.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions