Skip to content
Closed
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
70 changes: 0 additions & 70 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,76 +173,6 @@ The query workflow that returns cited evidence from published documents.
The typed retrieval request that owns cache-shaping fields and route policy:
scope, filters, data type, channels, ranking options, and agentic toggle.

### Retrieval Run

One execution of a Retrieval Query, recorded across classic, map-nav,
small-corpus, cache-hit, failed, and cancelled outcomes with route, timing,
and terminal-status metadata.

### Retrieval Progress Event

A safe, user-facing update about the current phase of a Retrieval run. It uses
the fixed phases `started`, `planning`, `searching`, `reviewing_sources`, and
`finalizing`; it never contains chain-of-thought or raw planner output.

### Retrieval Stream

The server-to-client event stream for a Retrieval Query. It carries
Retrieval Progress Events during execution and one authoritative final result
or terminal failure, while leaving answer generation to downstream clients.

### Retrieval Duration

The end-to-end server time for a Retrieval Query, measured from retrieval
execution start through final public-result assembly. It includes cache lookup
and excludes authentication, network transfer, SSE delivery time, and
downstream answer generation.

### Retrieval Non-LLM Work

The database and retrieval-engine work for a Retrieval Query: snapshot or
serving-index loading, lexical scoring, ranking, result hydration, citation
assembly, and asset-reference resolution. It excludes planner, harvest,
control, and answer-generation model time, which are measured separately.

### Retrieval Serving Index

The publication-derived read model used to load retrieval structure and
scoring inputs without rebuilding them from the full document corpus for each
query. It is revision-pinned and complete before its document revision becomes
active.

### Retrieval Serving Fallback

The exact legacy retrieval path used when a serving index is missing,
incomplete, or inconsistent. It preserves retrieval quality while sacrificing
the serving-index latency target until the derived data is repaired.

### Retrieval Serving Generation

The namespace-scoped version that identifies one coherent set of active
document revisions and their serving-index statistics. Retrieval captures one
generation and retries or falls back if publication changes it during capture.

### Retrieval Semantic Parity

The compatibility requirement that a serving-index retrieval returns the same
selected chunk IDs, ordering, rounded scores, citations, and asset references
as the legacy retrieval path for the same request.

### Retrieval Revision Pin

The set of document revision IDs captured at retrieval start and used for the
entire retrieval run, including lazy content and asset resolution. A later
publication affects subsequent runs, not the run already in progress.

### Online Retrieval Serving Rollout

The additive rollout of retrieval-serving schema and derived data while
retrieval and document publication remain available. Incomplete or
inconsistent revisions use the exact legacy retrieval path until backfill and
validation finish.

### Workflow Run Request

The agentic Retrieval request passed through planning and step execution. It
Expand Down
20 changes: 2 additions & 18 deletions apps/api/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ def run_migrations_offline() -> None:
include_object=include_object,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
# Keep each migration in its own transaction so migrations that
# require an autocommit block (for example CREATE INDEX
# CONCURRENTLY) can safely commit only their own predecessor.
transaction_per_migration=True,
# Pass through configured SSL connect args.
connect_args=ssl_connect_args,
)
Expand All @@ -123,25 +119,13 @@ def run_migrations_online() -> None:
configured_connection = config.attributes.get("connection")

def run_with_connection(connection: Connection) -> None:
caller_owned_transaction = connection.in_transaction()
if settings.API_STANDALONE_MODE_ENABLED:
ensure_better_auth_user_table(connection)
# The standalone bootstrap query starts SQLAlchemy's implicit
# transaction before Alembic begins tracking migration
# transactions. End only that transaction; never commit a
# transaction supplied by the caller.
if not caller_owned_transaction:
connection.commit()

context.configure(
connection=connection,
target_metadata=target_metadata,
include_object=include_object,
# Required for migrations that use autocommit_block().
transaction_per_migration=True,
# Concurrent DDL cannot run inside a transaction owned by the
# caller. Migrations use regular DDL for that compatibility path.
knowhere_external_transaction=caller_owned_transaction,
)

with context.begin_transaction():
Expand All @@ -152,7 +136,7 @@ def run_with_connection(connection: Connection) -> None:
return

if isinstance(configured_connection, Engine):
with configured_connection.connect() as connection:
with configured_connection.begin() as connection:
run_with_connection(connection)
return

Expand All @@ -165,7 +149,7 @@ def run_with_connection(connection: Connection) -> None:
connect_args=ssl_connect_args,
)

with connectable.connect() as connection:
with connectable.begin() as connection:
run_with_connection(connection)


Expand Down

This file was deleted.

122 changes: 0 additions & 122 deletions apps/api/alembic/versions/1d2e3f4a5b6c_add_document_map_units.py

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading