Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Copyright (c) 2026 EFrMG; MIT License. The permission notice is retained in
licenses/triage-o-mator-MIT.txt. The adapter removes install-specific imports;
it does not acquire evidence or import triage decisions.

The native CI log adapter in src/reposition/ci_logs.py also adapts offline
validation from triage-o-mator bin/_ci_logs.py, bin/_checks.py and
bin/_acquire.py, Copyright (c) 2026 EFrMG, under the same retained MIT license.
It removes acquisition and install imports and adds frozen bounded associations
and raw UTF-8 segment projections.

Supporting text in the README header and social preview graphics uses DejaVu
Sans glyph outlines. Copyright (c) 2003 Bitstream, Inc. All Rights Reserved.
Bitstream Vera is a trademark of Bitstream, Inc. DejaVu changes are in the
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ evidence, not automated duplicate decisions or calibrated confidence scores.
The `cache-index`, `cache-query` and `cache-retrieve` commands work directly with
triage-o-mator's immutable evidence cache. They provide component-aware ranked
fragments, exact snapshot/corpus selection, source verification and progressive
reads across all nine components. The complete JSON response has an enforceable
reads across all nine snapshot components and separately saved CI failure-log
segments (`ci_logs`). CI captures keep their raw segment ranges and exact check,
run and attempt bindings; they do not establish complete job-log coverage. The complete JSON response has an enforceable
UTF-8 byte budget. Derived indexes live beside the acquisition cache and have
their own storage ceiling.

See the [workflow and contracts](docs/cache-integration.md), including resource
limits and an optional `bin/cache` integration patch. This API
limits and the maintained triage-o-mator `bin/cache` bridge. This API
keeps acquisition and approvals with the caller; real-cache and independent
review evaluation remain the next qualification steps.

Expand Down
69 changes: 68 additions & 1 deletion docs/cache-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ comment, field or diff region. Its default starts at the matched unit; an explic
`--byte-offset 0` starts at that source boundary. Follow a fragment's returned
`continuation` parameters to read further without changing source selection.

An optional [triage-o-mator bridge](../integrations/triage-o-mator/README.md)
The optional [triage-o-mator maintained bridge](../integrations/triage-o-mator/README.md)
provides `bin/cache search-index`, `query`, `retrieve` and `search-info`, while
preserving existing literal search and readers when Reposition is absent.

Expand All @@ -61,6 +61,16 @@ match the indexed selection, even with an explicit `--db`. Without a scope,
metadata only: it does not verify source checkpoints or payloads, and remains
usable for inspecting a stale index before rebuilding. Its JSON explicitly
marks both source-verification flags false; it is not a freshness claim.
The `reposition.cache-info.v2` response gives `indexed_snapshot_count` and
omits `indexed_snapshots` by default. Consumers of the v1 full list must opt
into pagination. Use `--snapshot-ids-limit N` (maximum 100) to request IDs in
sorted order, and pass the returned
`indexed_snapshots_next_offset` as `--snapshot-ids-offset` for the next page,
with the first page's manifest `checksum` as `--checkpoint`. Nonzero offsets
require this checkpoint; any supplied checkpoint must match the current manifest
checksum. Replacement therefore rejects continuation from an older index.
A null next offset means the list is complete. The manifest still retains the
complete checksummed set of IDs.

## Scope and authority

Expand Down Expand Up @@ -102,6 +112,7 @@ Projection version 1 retains original string slices:
| `checks` | Check run/suite/status names, output, status, conclusion and kind |
| `closing_issues` | One explicit relationship URL |
| `timeline` | One event, body or available linked-issue field |
| `ci_logs` | Separately captured native CI failure-log segments and retained check/workflow/job names |

Long fields/regions split at deterministic UTF-8 byte and line ceilings, with
small overlap. Defaults: 4,096 bytes, 200 lines and 128 bytes overlap. Chunk policy
Expand All @@ -115,6 +126,62 @@ diff offsets count UTF-8 bytes in the object itself. All ranges are half-open.
Locators retain source record IDs where available, filename, line range, original
field size and comment/hunk boundary. Hashes cover exact original UTF-8 slices.

## Separately captured CI failure logs

Default builds also discover currently saved native `ci-failure-log` captures for
verified failed checks of the exact selected PR snapshots. Use `--component
ci_logs` to index only these captures. An explicit ordinary component selection,
such as `--component summary`, skips CI association discovery. No logs are fetched,
no install code is imported, and no source cache files are changed.

This is a separate searchable component, outside snapshot component completeness.
The adapter verifies the selected summary and typed checks, derives each exact
native `ci-logs` pointer path, and freezes its bytes and immutable packet reference
before indexing. There is no directory scan or latest/historical fallback. The
build rechecks the selected pointer bytes before publication; drift refuses the
replacement and preserves the old index. Later pointer replacement or deletion
does not change an existing index's frozen selection. Rebuild explicitly to adopt
new captures. Packet references live in SQLite source bindings, not a potentially
large metadata response. Metadata reports the bounded selection digest and counts.

`--max-ci-logs` defaults to 1,000 (maximum 10,000). It bounds inspected PRs,
eligible check/pointer lookups and captured packets. Capped members/checks, missing
associations, unsupported providers, unavailable or partial source metadata,
unavailable/partial captures, packet omissions and non-UTF-8 segments remain visible in aggregate
coverage. Unverifiable legacy checks are unavailable for CI discovery; they remain
eligible for ordinary snapshot-component search. The discovery pass has a separate
128 MiB unique source-object read ceiling and respects per-object limits.

Query and retrieve use only frozen immutable packet references. Each returned
capture revalidates its packet hash and size, capture and selected snapshots,
summary identities, raw typed checks and suites, head, check source object/index,
check name, workflow run/attempt, job, attempt membership and segment bounds.
A capture from another metadata snapshot is accepted only with revalidated binding
and exact equality of PR identity/head and complete raw check and suite data;
both snapshot IDs remain in fragment metadata. Checksums verify retained content,
not the authenticity of external provenance or current GitHub state.

Raw base64 segment bytes must decode as strict UTF-8 to be searchable. ANSI
escapes are masked with spaces for FTS matching and excerpt placement, so
colored words remain discoverable within short excerpts. Stored projections and cited
excerpts preserve original ANSI/control characters, hashes and offsets; no
normalized search-text offsets are presented as source coordinates. Unsupported non-UTF-8 segments are counted and omitted. Segment
locators use `ci-segment-utf8`, with offsets relative to the retained segment,
original job-log byte/line ranges and segment index. Byte ranges are half-open;
`original_start_line`/`original_end_line` preserve the native inclusive line range.
Excerpts also expose original job-log byte offsets. Hashes cover the exact decoded UTF-8 source slice. Name
fields use the existing decoded JSON string coordinate space. The immutable
packet SHA-256 URI and structural locator identify the retained raw source.
Progressive reads stay inside one retained segment and never bridge omitted lines.
CI fragment metadata retains provider, source repository, status, head,
check/workflow/job names and IDs, run attempt, partial/revalidation flags and
omissions. Partial capture, unvalidated binding and omitted regions remain separate
from snapshot coverage and action approval.

The request verification ceiling includes unique packet, checks and summary
object bytes, including both snapshots' source dependencies when reused. Whole
response, projection, unit and index-storage ceilings apply to these fragments too.

## Query and output policy

FTS5 `unicode61` provides case folding and its default diacritic normalization,
Expand Down
113 changes: 29 additions & 84 deletions integrations/triage-o-mator/README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,38 @@
# Optional triage-o-mator integration
# triage-o-mator integration

This proposed patch adds four offline commands to triage-o-mator's `bin/cache`.
The first draft PR targets current master at
[`80cdcdd77d875c4fdcd96f3367f2f8a7d253e63a`](https://github.com/EFrMG/triage-o-mator/tree/80cdcdd77d875c4fdcd96f3367f2f8a7d253e63a).
Earlier compatibility checks cover the `write-operations` commit
[`f956c1299ab7f28107aa4db7943d97ce0baa4f2a`](https://github.com/EFrMG/triage-o-mator/tree/f956c1299ab7f28107aa4db7943d97ce0baa4f2a).
The patch also supports its original base,
[`dddc487660ffda17ba7e3626c9d9be72e29a6dce`](https://github.com/EFrMG/triage-o-mator/tree/dddc487660ffda17ba7e3626c9d9be72e29a6dce).
The historical receipts cover the earlier patch; the refreshed patch and
[current-master receipt](../../validation/triage-master.json) name the current
integration base. Recheck later upstream changes before adoption.
Existing commands work without Reposition. The patch does not alter acquisition,
TUI notifications, ledger decisions or GitHub actions.

To try the complete synthetic retrieval workflow before modifying triage-o-mator,
run `./reposition demo --cache` from a Reposition checkout. It needs no installation
and handles the fixture, IDs and source-verification steps automatically.

This bridge supports Reposition `0.2.0.dev1` and cache format version 1. Install
the tested engine into the Python environment used by `bin/cache`:

```sh
python -m pip install --no-deps \
'git+https://github.com/Univeracity/reposition.git@10bd0641b50d514984dad6dee480f140ab86ee44'
```

The bridge rejects other engine versions until compatibility is checked. Use
this source or the matching supplied wheel: the unrelated package with the same
PyPI name is not this project. Installation may need network access; subsequent
indexing, queries, retrieval and metadata inspection remain offline. Reposition
has no third-party runtime dependencies.

From a clean upstream checkout:

```sh
git apply --check /path/to/reposition/integrations/triage-o-mator/cache-retrieval.patch
git apply /path/to/reposition/integrations/triage-o-mator/cache-retrieval.patch
```

From the selected triage install:
triage-o-mator maintains its optional Reposition bridge in
[`bin/_reposition.py`](https://github.com/EFrMG/triage-o-mator/blob/master/bin/_reposition.py).
Its [installation and supported-build guide](https://github.com/EFrMG/triage-o-mator/blob/master/docs/reposition.md)
owns the pinned engine version, bundle installation and bridge configuration.
Use that guide for the build supported by your triage-o-mator checkout.
Reposition does not carry a second bridge implementation or installation patch.

```sh
bin/cache --expected-repo OWNER/REPO search-index --snapshot INVENTORY_SNAPSHOT --component summary
bin/cache --expected-repo OWNER/REPO search-index --corpus CORPUS_ID
bin/cache --expected-repo OWNER/REPO query --corpus CORPUS_ID \
--query 'terminal fails after suspend'
bin/cache --expected-repo OWNER/REPO retrieve --corpus CORPUS_ID \
--unit UNIT_ID --checkpoint INDEX_CHECKPOINT
bin/cache search-info --corpus CORPUS_ID
```
From a selected triage install, the bridge provides `bin/cache search-index`,
`query`, `retrieve` and `search-info`. Acquisition and GitHub actions remain with
triage-o-mator. See Reposition's [retrieval contract](../../docs/cache-integration.md)
for source verification, selection, checkpoints and response budgets.

The bridge honors install repository/host identity, requires a bound cache and
refuses `--cache` namespace overrides. Global `--host` and `--expected-repo` go
before the command. Other flags match Reposition's `cache-*` commands, including
`--replace`, `--rebuild`, filters and `--cursor`. New views are stored beside the
cache rather than consuming its acquisition budget. Installation remains optional.

The patch updates `docs/evidence.md`, `docs/evidence-reference.md` and
`prompts/prepare-analysis.md` with bounded query-then-retrieve guidance. For a TUI,
consume the structured JSON, retain scope and checkpoint, show gaps and omissions,
and open larger verified fragments only for selected candidates. Retrieval itself
does not create approval or closure suggestions.

Validate a trusted checkout with the patch applied:
Validate a trusted triage-o-mator checkout with its pinned engine installed:

```sh
python /path/to/reposition/scripts/check_triage_compat.py \
--checkout /path/to/triage-o-mator --output compatibility.json
PYTHONPATH=src python3 scripts/check_triage_compat.py \
--checkout /path/to/triage-o-mator --pre-index-state missing-index \
--output /tmp/reposition-compatibility.json
```

This uses a temporary synthetic install and upstream EvidenceCache/corpus
publication. It checks legacy search without Reposition, missing-package behavior,
identity guards, verified query/retrieve and unchanged authoritative cache bytes.
It also checks `search-info` against foreign host/name/stable IDs, explicit scope,
and literal search before/after bridge use. Metadata inspection does not audit
source checkpoints or payloads; its JSON reports both verification flags false.
It makes no acquisition requests. Do not run it against untrusted executable
checkout code. Real-cache size/latency and review decisions require separate trials.
Run this from the matching Reposition checkout. The checker creates a disposable
synthetic install, publishes evidence and corpora through triage-o-mator's owning
code, and checks verified retrieval, identity guards, metadata inspection,
`pr-checks` compatibility and unchanged authoritative cache bytes without GitHub
requests. Its default `--pre-index-state missing-package` supports the earlier
standalone bridge trial; the maintained pinned integration expects `missing-index`.

The [validation receipt](../../validation/triage-master.json) records
the checked upstream commit, patch SHA-256 and successful compatibility results.
It covers the pinned commit; later branch changes require another check.
## Historical trials

See the [complete retrieval contract](../../docs/cache-integration.md).

The patch includes two workflow tests and a separate CI job with the pinned
optional engine; the ordinary CI job retains the no-package path. Run checks on
both sides whenever cache/adapter behavior changes. The
[review and cost trial](../../docs/triage-review-trial.md) contains reproducible
same-symptom/different-cause examples, query/retrieval costs, memory and storage
measurements, and the boundaries of synthetic validation. Real-backlog trials
remain the next qualification step before TUI or suggestion workflows.
The [original integration receipt](../../validation/triage-master.json) records a
proposal tested against triage-o-mator commit
[`80cdcdd77d875c4fdcd96f3367f2f8a7d253e63a`](https://github.com/EFrMG/triage-o-mator/tree/80cdcdd77d875c4fdcd96f3367f2f8a7d253e63a).
The [review and cost trial](../../docs/triage-review-trial.md) records that earlier
engine's synthetic retrieval measurements and limitations. These are historical
records and do not validate the current build; rerun compatibility checks when
the engine or owning cache contracts change.
72 changes: 0 additions & 72 deletions integrations/triage-o-mator/_reposition.py

This file was deleted.

Loading
Loading