The old tracked TypeScript snapshot has been removed from the repository history and the root directory is now a Python porting workspace. README and tests now describe and verify the Python-first layout instead of treating the exposed snapshot as the active source tree. A local archive can still exist outside Git, but the tracked repository now presents only the Python porting surface, related essay context, and OmX workflow artifacts. Constraint: Tracked history should collapse to a single commit while excluding the archived snapshot from Git Rejected: Keep the exposed TypeScript tree in tracked history under an archive path | user explicitly wanted only the Python porting repo state in Git Confidence: medium Scope-risk: broad Reversibility: messy Directive: Keep future tracked additions focused on the Python port itself; do not reintroduce the exposed snapshot into Git history Tested: python3 -m unittest discover -s tests -v; python3 -m src.main summary; git diff --check Not-tested: Behavioral parity with the original TypeScript system beyond the current Python workspace surface
20 lines
712 B
Python
20 lines
712 B
Python
from __future__ import annotations
|
|
|
|
from .query_engine import QueryEnginePort
|
|
from .runtime import PortRuntime
|
|
|
|
|
|
class QueryEngineRuntime(QueryEnginePort):
|
|
def route(self, prompt: str, limit: int = 5) -> str:
|
|
matches = PortRuntime().route_prompt(prompt, limit=limit)
|
|
lines = ['# Query Engine Route', '', f'Prompt: {prompt}', '']
|
|
if not matches:
|
|
lines.append('No mirrored command/tool matches found.')
|
|
return '\n'.join(lines)
|
|
lines.append('Matches:')
|
|
lines.extend(f'- [{match.kind}] {match.name} ({match.score}) — {match.source_hint}' for match in matches)
|
|
return '\n'.join(lines)
|
|
|
|
|
|
__all__ = ['QueryEnginePort', 'QueryEngineRuntime']
|