feat(voice): implement local S2S responsiveness candidate and direct TTS routing
Add local S2S responsiveness candidate pinning ASR options and sentence-at-a-time generation. Route speech synthesis directly to OpenAI API for fluent Persian phonetics with gpt-4o-mini-tts-2025-12-15. Add responsiveness, budget carry, and browser watch unit tests along with acceptance benchmarks and evaluation evidence.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Actual proxied auth/API/native setup/normal close; sends no microphone audio."""
|
||||
import asyncio
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
from uuid import uuid4
|
||||
@@ -7,7 +8,12 @@ import httpx
|
||||
from websockets.asyncio.client import connect
|
||||
|
||||
root=Path('.local-s2s-build')
|
||||
account=json.loads((root/'browser-login.json').read_text())
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--account',type=Path,default=root/'browser-login.json')
|
||||
parser.add_argument('--ledger',type=Path,default=root/'phase4-browser-paid/browser-paid-ledger.json')
|
||||
parser.add_argument('--output',type=Path,default=root/'phase4-browser-connection-result.json')
|
||||
args=parser.parse_args()
|
||||
account=json.loads(args.account.read_text())
|
||||
origin='http://127.0.0.2:4201'
|
||||
|
||||
async def main():
|
||||
@@ -26,7 +32,7 @@ async def main():
|
||||
report['providers']=metadata.json()
|
||||
assert next(p for p in report['providers']['providers'] if p['id']=='local_s2s')['can_start']
|
||||
assert not next(p for p in report['providers']['providers'] if p['id']=='openai')['can_start']
|
||||
ledger=root/'phase4-browser-paid'/'browser-paid-ledger.json'
|
||||
ledger=args.ledger
|
||||
before=len(json.loads(ledger.read_text())['attempts'])
|
||||
try:
|
||||
async with connect('ws://127.0.0.2:4201'+session['stream_path'],origin=origin,
|
||||
@@ -44,7 +50,7 @@ async def main():
|
||||
client.post('/api/v1/auth/logout')
|
||||
report['component_attempts_before']=before
|
||||
report['component_attempts_after']=len(json.loads(ledger.read_text())['attempts'])
|
||||
(root/'phase4-browser-connection-result.json').write_text(json.dumps(report,indent=2)+'\n')
|
||||
args.output.write_text(json.dumps(report,indent=2)+'\n')
|
||||
assert report.get('session_ready')
|
||||
assert before==report['component_attempts_after'],'Unexpected inference during connection-only check'
|
||||
print(json.dumps(report))
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"status": "ready_for_human_test",
|
||||
"date": "2026-10-17",
|
||||
"environment": "isolated Windows Docker test",
|
||||
"cost_controls": "disabled_by_explicit_user_request",
|
||||
"memory_prevention": false,
|
||||
"providers": {
|
||||
"openai": {
|
||||
"session_ready": true,
|
||||
"events": [
|
||||
"session_ready"
|
||||
]
|
||||
},
|
||||
"local_s2s": {
|
||||
"session_ready": true,
|
||||
"events": [
|
||||
"session_ready"
|
||||
]
|
||||
}
|
||||
},
|
||||
"local_components": {
|
||||
"asr": "gpt-4o-transcribe",
|
||||
"asr_endpoint": "https://api.openai.com/v1/audio/transcriptions",
|
||||
"tts": "gpt-4o-mini-tts-2025-12-15",
|
||||
"voice": "alloy",
|
||||
"tts_endpoint": "https://api.openai.com/v1/audio/speech",
|
||||
"llm": "openai/gpt-4.1-mini via OpenRouter"
|
||||
},
|
||||
"calibration": {
|
||||
"calibration_id": "cd5c3bac-5c83-454a-bb34-19d6c2045294",
|
||||
"status": "calibrated",
|
||||
"complete_support": 6,
|
||||
"unsupported_false_positives": 0,
|
||||
"cutoff": {
|
||||
"profile": {
|
||||
"provider": "ollama",
|
||||
"endpoint": "http://localhost:11434/v1",
|
||||
"model": "bge-m3",
|
||||
"dimensions": 1024,
|
||||
"preprocessing_version": "v1"
|
||||
},
|
||||
"distance": 0.33686461167069426,
|
||||
"retrieval_policy": "exact-first-cosine-id-50x2-whole-5-12000/nfc-digits-kaf-yeh-lower-whitespace-terminal-period-v2"
|
||||
},
|
||||
"provider_calls": 10,
|
||||
"final_authorization_confirmed": true
|
||||
},
|
||||
"unit_tests": "85 passed",
|
||||
"human_voice_acceptance": "pending",
|
||||
"rapid_switch_before_media_cleanup": "403 observed; explicit close and waiting for WebSocket close passed"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Combined voice and calibrated RAG test ? 2026-10-17
|
||||
|
||||
Explicit user override: cost admission controls are disabled for this isolated run. Historical bills/reserves are preserved and are no longer this run's admission ceiling. Memory prevention remains off. Docker memory bounds, request timeouts and cancellation remain. Session lifetime is restored to the existing 600-second setting.
|
||||
|
||||
Both OpenAI Realtime (existing gpt-realtime-2.1/marin/low/1.30 profile) and local_s2s reached session_ready through the actual frontend proxy. Local ASR gpt-4o-transcribe and TTS gpt-4o-mini-tts-2025-12-15/alloy route directly to OpenAI; LLM remains GPT-4.1 mini through OpenRouter. Direct audio refuses missing OpenAI credentials instead of forwarding the router key. Existing OpenRouter ASR compatibility remains. Four new routing regressions plus affected tests: 85 passed.
|
||||
|
||||
RAG uses a new isolated rag_bge_local_s2s_test database and dedicated volumes. The approved original hash and ten frozen labels were preserved; proper intake/worker published six chunks, then fenced selection activated the document. Ollama bge-m3/1024/v1 reproduced the original measured cutoff 0.33686461167069426, six supported cases and zero false positives in four unsupported cases. The old report currently contains 0.65 despite its guide/trials documenting the stricter measured cutoff; it was left unchanged. The new measured report is independently retained.
|
||||
|
||||
Runtime files are ignored under .local-s2s-build: windows-combined.compose.json, combined-compose.py, combined-engine.py and combined-evidence/. The launcher forwards only the two required OpenAI keys from the existing .env into the API runtime; it writes no copied provider credentials or full .env mount. Engine uses existing server-only secret mounts. Start from repository root using `.venv/Scripts/python .local-s2s-build/combined-compose.py up -d --no-deps candidate_api candidate_worker local-s2s-engine`. Do not use obsolete budget launchers/watchdogs for this run.
|
||||
|
||||
Browser: http://127.0.0.2:4201/login, existing test credentials. Refresh and log in again because test identity belongs to the new isolated database. Ask the approved sample pump-pressure question and unsupported land-price question on both providers. Only the approved calibration sample is loaded here; other operational documents were not silently copied.
|
||||
|
||||
Both provider setups and explicit normal close passed. OpenAI-to-local switching passed after waiting for WebSocket closure. Abruptly disconnecting and immediately starting another provider produced 403 while the single media slot was still cleaning up; immediate-switch acceptance remains open. No microphone, listening, ASR accuracy or full spoken RAG acceptance is claimed. Phase 3/4 remain open.
|
||||
|
||||
## Temporary automatic document intake override
|
||||
|
||||
2026-10-17, explicit user request: candidate API, worker and migration/operator configuration now use the existing OpenRouter Vision profile google/gemini-2.5-flash, 60-second timeout. INGEST_OCR_REVIEW_REQUIRED=false, INGEST_FACTUAL_REVIEW_REQUIRED=false and INGEST_ALLOW_PARTIAL_EXTRACTION=true. This last existing switch also bypasses direct-PDF visual review while retaining automatic-admission warnings. Factual placeholders remain excluded by the existing policy. No human approval was fabricated. This temporary setup admits outputs with warnings and is not a manual accuracy certification.
|
||||
|
||||
The launcher forwards only INGEST_VISION_API_KEY in addition to the two necessary OpenAI keys; no additional credential file is created. Existing originals/jobs/profiles are immutable: four files were independently reimported through proper intake with deterministic operation IDs. Old failed rows remain historical. New ready records: photo db37c610-4fb8-4f9f-aa9d-481720a64a86 (5 chunks), DOCX ba72acfa-4f3c-403e-bafe-879b08ed0ccb (100), PDF 5905? 0abd2545-05af-4c7c-8194-6a9182d164e7 (3), PDF 7364? d9c23e5a-8a51-4696-94ac-4a060957c58b (21). Two intermediate stricter-policy PDF attempts failed and remain historical too. All four final jobs published successfully; no pending administrator review. Knowledge selection was not changed by this intake operation; ready documents can be selected separately for RAG. Original calibration sample remains selected.
|
||||
|
||||
Validation: 75 relevant unit tests passed (test_phase5_review.py, test_partial_extraction.py, test_gemini_vision.py); real hosted Vision + local bge-m3 embedding + atomic worker publication succeeded. No application behavior code or database migration was changed for this configuration-only operation.
|
||||
|
||||
## Local speech pace and selector label
|
||||
|
||||
Explicit user request: LOCAL_S2S_TTS_SPEED=1.3 in the isolated runtime; default remains 1.0. Applied before native TTS setup/warmup, forwarded by the existing handler to the speech request, read from the actual initialized handler in component attestation, and included in session identity. No sample-rate or playback-buffer change. Provider metadata label changed to ????? ?????; frontend displays that server-provided label. 45 focused unit tests passed, including applied speed and rejection of a handler-speed mismatch.
|
||||
|
||||
## Follow-up: pace 1.6 and unanswered person query
|
||||
|
||||
User requested a further pace increase: active local TTS speed is now 1.6 (previously 1.3). Both actual proxied session_ready/normal-close checks passed again; local paid startup probes passed.
|
||||
|
||||
Read-only diagnosis: all five ready documents are active at knowledge revision 6. Local tool queries were the Persian equivalent of Mr. Danesh and deputy of planning; OpenAI queried Danesh. Both returned succeeded/no_evidence, not provider errors. The extracted 5905 PDF contains the salutation Mr. Danesh followed by deputy of planning. Candidate distances for Mr. Danesh started at 0.5615, while the active calibration cutoff is 0.33686461167069426; all 50 candidates were filtered out. Role query nearest distance 0.4371 was rejected too. Existing exact lexical matching handles article/date/alphanumeric identifiers, not person names. The calibration sample does not establish recall for these real document questions. No threshold or retrieval contract was changed; a name-query retrieval repair and real-corpus evaluation remain pending. Original PDF text-layer matching did not independently verify the OCR person spelling, so the extracted text is evidence of the retrieval defect, not manual certification of the original image.
|
||||
@@ -38,6 +38,7 @@ real = mode == 'real'
|
||||
duplex = '--duplex' in sys.argv
|
||||
retention = '--retention' in sys.argv or '--retention-active' in sys.argv
|
||||
retention_active = '--retention-active' in sys.argv
|
||||
responsive = '--responsive' in sys.argv
|
||||
assert not (retention and real)
|
||||
assert not (duplex and real)
|
||||
models = ('openai/whisper-large-v3', 'openai/gpt-4.1-mini', 'google/gemini-3.8-flash-lite-tts', 'Kore') if real else ('fixture/stt', 'fixture/llm', 'fixture/tts', 'fixture')
|
||||
@@ -54,7 +55,7 @@ config = VoiceSettings(_env_file=None, provider='local_s2s', local_s2s_enabled=T
|
||||
local_s2s_stt_model=models[0], local_s2s_llm_model=models[1],
|
||||
local_s2s_tts_model=models[2], local_s2s_tts_voice=models[3],
|
||||
local_s2s_request_timeout_seconds=timeout, local_s2s_max_output_tokens=limit,
|
||||
local_s2s_retain_interrupted_answers=retention)
|
||||
local_s2s_retain_interrupted_answers=retention, local_s2s_responsive=responsive)
|
||||
config.require_voice()
|
||||
adapter = LocalS2SAdapter(None, config=config, settings=RuntimeSettings(_env_file=None))
|
||||
calls, events, logs, owned = [], [], [], {}
|
||||
@@ -98,7 +99,7 @@ async def upstream(request):
|
||||
class InterruptedStream(httpx.AsyncByteStream):
|
||||
async def __aiter__(self):
|
||||
initial=deepcopy(chunks[0])
|
||||
initial['choices'][0]['delta']['content']=fixture_text+' One preserved sentence. Another preserved sentence. Pending fragment'
|
||||
initial['choices'][0]['delta']['content']=fixture_text+(' Pending fragment' if responsive else ' One preserved sentence. Another preserved sentence. Pending fragment')
|
||||
yield ('data: '+json.dumps(initial)+'\n\n').encode()
|
||||
try:
|
||||
while not late_release.is_set():
|
||||
@@ -135,7 +136,7 @@ def start_components(key, timeout):
|
||||
finally:
|
||||
if real:
|
||||
await transport.close_owned()
|
||||
guard = OwnedGateway(key, port=8766, transport=transport, timeout=timeout)
|
||||
guard = OwnedGateway(key, port=8766, transport=transport, timeout=timeout, responsive=responsive)
|
||||
thread = Thread(target=guard.serve_forever, daemon=True)
|
||||
thread.start()
|
||||
assert guard.ready.wait(3)
|
||||
@@ -317,7 +318,7 @@ worker.start()
|
||||
key = Path('/secret/openrouter-test.key').read_text().strip() if real else 'offline-fixture-key'
|
||||
outcome = lifecycle.run_owned(build, key, timeout, emit=emit)
|
||||
worker.join(15)
|
||||
summary = dict(active_retention_verified=owned.get('active_retention_verified',False), retention_verified=owned.get('retention_verified',False), mode=mode, duplex=duplex, duplex_frames=owned.get('duplex_frames',0), lifecycle_outcome=outcome, client_done=client_done.is_set(),
|
||||
summary = dict(responsive=responsive, single_sentence_probe=responsive and retention_active, active_retention_verified=owned.get('active_retention_verified',False), retention_verified=owned.get('retention_verified',False), mode=mode, duplex=duplex, duplex_frames=owned.get('duplex_frames',0), lifecycle_outcome=outcome, client_done=client_done.is_set(),
|
||||
client_error=owned.get('client_error'), events=dict(Counter(e['type'] for e in events)),
|
||||
native_events=[{k:v for k,v in e.items() if k != 'delta'} if e['type'] == 'response.output_audio.delta' else e for e in events] if real else events, fixture_attempts=dict(Counter(calls)),
|
||||
fixture_llm_payloads=provider_payloads,
|
||||
|
||||
@@ -4,6 +4,7 @@ Persistent reservations include failed requests. Exactly two attempts per compon
|
||||
cover construction probes and one turn. No retries or ledger reset are supported.
|
||||
"""
|
||||
from decimal import Decimal
|
||||
import base64
|
||||
from io import BytesIO
|
||||
import json
|
||||
from pathlib import Path
|
||||
@@ -51,11 +52,21 @@ def validate_request(request):
|
||||
request.url.scheme == 'https' and request.url.path in (
|
||||
'/api/v1/audio/speech', '/api/v1/audio/transcriptions', '/api/v1/chat/completions'))
|
||||
if stage == 'transcriptions':
|
||||
message = BytesParser(policy=default).parsebytes(
|
||||
('Content-Type: '+request.headers['content-type']+'\r\nMIME-Version: 1.0\r\n\r\n').encode()+request.content)
|
||||
fields = {p.get_param('name', header='content-disposition'): p.get_payload(decode=True)
|
||||
for p in message.iter_parts()}
|
||||
require(fields['model'].decode() == MODELS[stage] and fields['language'] == b'fa')
|
||||
if request.headers.get('content-type','').startswith('application/json'):
|
||||
from app.modules.voice.local_s2s import RESPONSIVE_ASR_PROMPT
|
||||
data=json.loads(request.content)
|
||||
require(set(data)=={'model','language','response_format','temperature','input_audio','provider'} and
|
||||
data['model']==MODELS[stage] and data['language']=='fa' and data['response_format']=='json' and
|
||||
type(data['temperature']) is int and data['temperature']==0 and
|
||||
data['provider']=={'options':{'groq':{'prompt':RESPONSIVE_ASR_PROMPT}}} and
|
||||
set(data['input_audio'])=={'data','format'} and data['input_audio']['format']=='wav')
|
||||
fields={'file':base64.b64decode(data['input_audio']['data'],validate=True)}
|
||||
else:
|
||||
message = BytesParser(policy=default).parsebytes(
|
||||
('Content-Type: '+request.headers['content-type']+'\r\nMIME-Version: 1.0\r\n\r\n').encode()+request.content)
|
||||
fields = {p.get_param('name', header='content-disposition'): p.get_payload(decode=True)
|
||||
for p in message.iter_parts()}
|
||||
require(fields['model'].decode() == MODELS[stage] and fields['language'] == b'fa')
|
||||
with wave.open(BytesIO(fields['file']), 'rb') as audio:
|
||||
require(audio.getnchannels() == 1 and audio.getsampwidth() == 2 and
|
||||
audio.getcomptype() == 'NONE' and
|
||||
|
||||
@@ -14,24 +14,83 @@ previous=importlib.util.module_from_spec(spec);spec.loader.exec_module(previous)
|
||||
class BrowserBudget(previous.BrowserBudget):
|
||||
def __init__(self,root,*,upstream=None):
|
||||
previous.native.validate_prices(root)
|
||||
report=json.loads((root/'prior-final-billing.json').read_text())
|
||||
reconciliation=report['reconciliation']
|
||||
previous.require(reconciliation['confirmed_cost_usd']=='0.003504399' and
|
||||
reconciliation['unknown_reservations_usd']=='0.417' and
|
||||
reconciliation['conservative_exposure_usd']=='0.420504399')
|
||||
carried=Decimal(reconciliation['confirmed_cost_usd'])+Decimal(reconciliation['unknown_reservations_usd'])
|
||||
self.maximum_attempts={'speech':6,'transcriptions':6,'completions':6}
|
||||
carry_path=root/'previous-phase4-ledger.json'
|
||||
if carry_path.exists():
|
||||
carry=json.loads(carry_path.read_text())
|
||||
previous.require(Decimal(carry['previous_reserved_and_billed_usd'])==carried)
|
||||
attempts=carry['attempts']
|
||||
previous.require(all(row['stage'] in previous.RESERVES and
|
||||
Decimal(row['reserved_usd'])==previous.RESERVES[row['stage']] for row in attempts))
|
||||
used=sum((Decimal(row['reserved_usd']) for row in attempts),Decimal(0))
|
||||
previous.require(carried+used==Decimal(carry['reserved_usd']))
|
||||
carried+=used # Includes cancelled, failed and unknown invoices; no releases.
|
||||
checkpoint=root/'carried-budget-preparation.json'
|
||||
if checkpoint.exists():
|
||||
# Migration from another host: documentary carry, never invented bills.
|
||||
prior=json.loads(checkpoint.read_text())
|
||||
previous.require(prior['prior_conservative_exposure_usd']=='0.704504399' and
|
||||
prior['total_cap_usd']=='1' and prior['paid_calls_on_this_host']==0 and
|
||||
prior['prior_private_ledgers_available'] is False and
|
||||
prior['source']=='docs/evaluation/local-s2s/phase-04-interruption-incident.md' and
|
||||
prior['status']=='preparation_only_not_a_live_admission_ledger' and
|
||||
not (root/'previous-phase4-ledger.json').exists() and
|
||||
not (root/'prior-final-billing.json').exists())
|
||||
carried=Decimal(prior['prior_conservative_exposure_usd'])
|
||||
self.maximum_attempts={'speech':4,'transcriptions':4,'completions':4}
|
||||
runs_path=root/'previous-windows-runs.json'
|
||||
old_ledger=root/'previous-windows-ledger.json'
|
||||
old_billing=root/'previous-windows-billing.json'
|
||||
previous.require(old_ledger.exists()==old_billing.exists())
|
||||
if runs_path.exists():
|
||||
previous.require(not old_ledger.exists())
|
||||
runs=json.loads(runs_path.read_text())
|
||||
previous.require(isinstance(runs,list) and 0<len(runs)<=16)
|
||||
files=[]
|
||||
for run in runs:
|
||||
previous.require(set(run)=={'ledger','billing'} and
|
||||
all(Path(run[key]).name==run[key] for key in run))
|
||||
files.append((root/run['ledger'],root/run['billing']))
|
||||
self.maximum_attempts={'speech':5,'transcriptions':4,'completions':4}
|
||||
else:
|
||||
files=[(old_ledger,old_billing)] if old_ledger.exists() else []
|
||||
generation_ids=set()
|
||||
for ledger_file,billing_file in files:
|
||||
ledger=json.loads(ledger_file.read_text())
|
||||
bills=json.loads(billing_file.read_text())
|
||||
attempts=ledger['attempts']
|
||||
previous.require(ledger['previous_reserved_and_billed_usd']==str(carried) and
|
||||
0<len(attempts)==len(bills) and
|
||||
len({row['generation_id'] for row in bills})==len(bills))
|
||||
reserved=Decimal(0)
|
||||
billed=Decimal(0)
|
||||
for attempt in attempts:
|
||||
stage=attempt['stage']
|
||||
previous.require(stage in previous.RESERVES and
|
||||
sum(row['stage']==stage for row in attempts)<=ledger.get('maximum_attempts',{}).get(stage,4))
|
||||
reserve=Decimal(attempt['reserved_usd'])
|
||||
previous.require(reserve==previous.RESERVES[stage] and
|
||||
attempt['status']=='headers_received' and attempt['http_status']==200 and
|
||||
attempt['generation_id'] not in generation_ids)
|
||||
generation_ids.add(attempt['generation_id'])
|
||||
matches=[row for row in bills if row['generation_id']==attempt['generation_id']]
|
||||
previous.require(len(matches)==1)
|
||||
bill=matches[0]
|
||||
previous.require(bill['stage']==stage and bill['http_status']==200)
|
||||
cost=Decimal(str(bill['billing']['total_cost']))
|
||||
previous.require(cost.is_finite() and 0<=cost<=reserve)
|
||||
reserved+=reserve
|
||||
billed+=cost
|
||||
previous.require(Decimal(ledger['reserved_usd'])==carried+reserved)
|
||||
carried+=billed # Release only exact-ID, successful, individually billed attempts.
|
||||
else:
|
||||
report=json.loads((root/'prior-final-billing.json').read_text())
|
||||
reconciliation=report['reconciliation']
|
||||
previous.require(reconciliation['confirmed_cost_usd']=='0.003504399' and
|
||||
reconciliation['unknown_reservations_usd']=='0.417' and
|
||||
reconciliation['conservative_exposure_usd']=='0.420504399')
|
||||
carried=Decimal(reconciliation['confirmed_cost_usd'])+Decimal(reconciliation['unknown_reservations_usd'])
|
||||
self.maximum_attempts={'speech':6,'transcriptions':6,'completions':6}
|
||||
carry_path=root/'previous-phase4-ledger.json'
|
||||
if carry_path.exists():
|
||||
carry=json.loads(carry_path.read_text())
|
||||
previous.require(Decimal(carry['previous_reserved_and_billed_usd'])==carried)
|
||||
attempts=carry['attempts']
|
||||
previous.require(all(row['stage'] in previous.RESERVES and
|
||||
Decimal(row['reserved_usd'])==previous.RESERVES[row['stage']] for row in attempts))
|
||||
used=sum((Decimal(row['reserved_usd']) for row in attempts),Decimal(0))
|
||||
previous.require(carried+used==Decimal(carry['reserved_usd']))
|
||||
carried+=used # Includes cancelled, failed and unknown invoices; no releases.
|
||||
self.maximum_attempts={'speech':4,'transcriptions':4,'completions':4}
|
||||
maximum=carried+sum(previous.RESERVES[k]*v for k,v in self.maximum_attempts.items())
|
||||
previous.require(maximum<1)
|
||||
endpoints=json.loads((root/'endpoints-google-gemini-3.8-flash-lite-tts.json').read_text())['data']['endpoints']
|
||||
@@ -43,6 +102,7 @@ class BrowserBudget(previous.BrowserBudget):
|
||||
self.state={'previous_reserved_and_billed_usd':str(carried),'reserved_usd':str(carried),
|
||||
'maximum_cumulative_usd':str(maximum),'maximum_attempts':self.maximum_attempts,
|
||||
'unknown_prior_reservations_usd':'0.417','attempts':[],
|
||||
'carry_basis':('documentary_checkpoint_with_local_bills' if (root/'previous-windows-ledger.json').exists() or (root/'previous-windows-runs.json').exists() else 'documentary_checkpoint') if checkpoint.exists() else 'private_ledgers',
|
||||
'purpose':'phase3_4_local_browser_only_no_openai_inference'}
|
||||
with self.path.open('x') as output:json.dump(self.state,output,indent=2)
|
||||
self.upstream=upstream or httpx.AsyncHTTPTransport(retries=0,trust_env=False)
|
||||
|
||||
@@ -12,15 +12,18 @@ module=importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
|
||||
def start_components(key, timeout):
|
||||
transport=module.BrowserBudget(Path('/evidence'))
|
||||
class OwnedGateway(ComponentServer):
|
||||
async def _run(self):
|
||||
try:
|
||||
await super()._run()
|
||||
finally:
|
||||
await transport.close_owned()
|
||||
gateway=OwnedGateway(key,port=8766,transport=transport,timeout=timeout)
|
||||
def start_components(key, timeout, **options):
|
||||
if os.environ.get('LOCAL_S2S_TTS_MODEL') == 'google/gemini-3.8-flash-lite-tts':
|
||||
transport=module.BrowserBudget(Path('/evidence'))
|
||||
class OwnedGateway(ComponentServer):
|
||||
async def _run(self):
|
||||
try:
|
||||
await super()._run()
|
||||
finally:
|
||||
await transport.close_owned()
|
||||
gateway=OwnedGateway(key,port=8766,transport=transport,timeout=timeout,**options)
|
||||
else:
|
||||
gateway=ComponentServer(key,port=8766,timeout=timeout,**options)
|
||||
thread=Thread(target=gateway.serve_forever,daemon=True)
|
||||
thread.start()
|
||||
if not gateway.ready.wait(5):
|
||||
@@ -31,4 +34,6 @@ lifecycle.start_components=start_components
|
||||
# The key is mounted only into this engine, never Compose environment/API/browser.
|
||||
import os
|
||||
os.environ['OPENROUTER_API_KEY']=Path('/secret/openrouter-test.key').read_text().strip()
|
||||
if Path('/secret/openai-test.key').exists():
|
||||
os.environ['OPENAI_API_KEY']=Path('/secret/openai-test.key').read_text().strip()
|
||||
raise SystemExit(main())
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"date": "2026-10-17",
|
||||
"status": "candidate_live_human_comparison_pending",
|
||||
"image": "sha256:ddbb90366f19f8077b1cb40a77e529393459485fb8ae0cb9d074ffea641c265f",
|
||||
"unit_tests": {
|
||||
"passed": 157,
|
||||
"seconds": 8.51
|
||||
},
|
||||
"postgres": {
|
||||
"passed": 3,
|
||||
"seconds": 6.72,
|
||||
"skips": 0
|
||||
},
|
||||
"native_fixture": {
|
||||
"responsive": true,
|
||||
"single_sentence_probe": true,
|
||||
"active_retention_verified": true,
|
||||
"retention_verified": true,
|
||||
"client_error": null,
|
||||
"normal_complete": true,
|
||||
"unit_released": true,
|
||||
"paid_calls": 0,
|
||||
"final_cleanup": {
|
||||
"stage": "close",
|
||||
"cleanup": {
|
||||
"gateway_shutdown": 0,
|
||||
"gateway_close": 0,
|
||||
"runtime_stop": 0,
|
||||
"gateway_join": 0,
|
||||
"gateway_alive": 0
|
||||
},
|
||||
"request_counts": {
|
||||
"accepted": 10,
|
||||
"/v1/audio/transcriptions": 2,
|
||||
"released": 10,
|
||||
"/v1/chat/completions": 4,
|
||||
"/v1/audio/speech": 4,
|
||||
"disconnected": 2,
|
||||
"shutdown_pending": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"native_single_sentence_seconds": 18.272,
|
||||
"connection": {
|
||||
"conversation_id": "c4ad0ece-e0e4-42fd-b9c3-63eaab1f5494",
|
||||
"session_id": "2931f6df-176c-4f95-8bb3-55f2c4920312",
|
||||
"events": [
|
||||
"session_ready"
|
||||
],
|
||||
"providers": {
|
||||
"default_provider": "local_s2s",
|
||||
"connection_checked": false,
|
||||
"providers": [
|
||||
{
|
||||
"id": "openai",
|
||||
"label": "OpenAI",
|
||||
"can_start": false,
|
||||
"reason": "not_configured"
|
||||
},
|
||||
{
|
||||
"id": "local_s2s",
|
||||
"label": "\u0633\u06cc\u0633\u062a\u0645 \u062c\u062f\u06cc\u062f",
|
||||
"can_start": true,
|
||||
"reason": null
|
||||
},
|
||||
{
|
||||
"id": "gemini",
|
||||
"label": "Gemini",
|
||||
"can_start": false,
|
||||
"reason": "disabled"
|
||||
}
|
||||
]
|
||||
},
|
||||
"session_ready": true,
|
||||
"close": {
|
||||
"session_id": "2931f6df-176c-4f95-8bb3-55f2c4920312",
|
||||
"status": "closed",
|
||||
"close_reason": "user_requested"
|
||||
},
|
||||
"component_attempts_before": 3,
|
||||
"component_attempts_after": 3
|
||||
},
|
||||
"watch": {
|
||||
"stage": "ready",
|
||||
"memory_enforcement": false,
|
||||
"minimum_windows_available_bytes": 4080177152,
|
||||
"minimum_vm_available_bytes": 4225368064,
|
||||
"startup_seconds": 24.639
|
||||
},
|
||||
"budget": {
|
||||
"previous_reserved_and_billed_usd": "0.710884452",
|
||||
"reserved_usd": "0.769884452",
|
||||
"maximum_cumulative_usd": "0.981884452",
|
||||
"maximum_attempts": {
|
||||
"speech": 5,
|
||||
"transcriptions": 4,
|
||||
"completions": 4
|
||||
},
|
||||
"carry_basis": "documentary_checkpoint_with_local_bills"
|
||||
},
|
||||
"nominal_expiry_tehran": "2026-10-17T11:01:18.153111+03:30",
|
||||
"human_asr_improvement": "not_measured",
|
||||
"human_latency_improvement": "not_measured"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
# Isolated responsiveness candidate ? 2026-10-17
|
||||
|
||||
Status: **implemented and live for human comparison; ASR/latency improvement not accepted**. User requested fixes after two real short-utterance transcription errors and server speech-start-to-audio delays5.6?10.5s. This candidate does not claim those errors are resolved without new real audio.
|
||||
|
||||
## Changes
|
||||
|
||||
`LOCAL_S2S_RESPONSIVE=true` opts into a separate frozen local profile; defaultfalse preserves old profiles. The LLM emits each complete sentence instead of waiting for3. Actual initialized handler attestation checks the applied value, and the profile digest/patch revision `rag-local-s2s-responsive-v1` distinguish old reservations. No old execution profile is rewritten.
|
||||
|
||||
ASR uses temperature0 and a generic conversational Persian transcription hint; neither known test utterance is embedded and returned transcripts are not rewritten. Native setup applies settings before warmup. The gateway preserves exact WAV bytes while translating multipart into documented JSON `input_audio` and `provider.options.groq.prompt`; `fa` stays explicit. OpenRouter documents plain multipart `prompt` as accepted but ignored and documents provider-specific options here: [STT contract](https://openrouter.ai/docs/guides/overview/multimodal/stt). The hint applies only when Groq serves the request; other routes still receive explicit language and temperature. No unsupported latency routing preference is claimed.
|
||||
|
||||
The gateway records numeric component header/first-body times without text, audio or keys, to separate provider delay from pipeline delay. Existing HTTP PCM streaming is retained; `openai_tts_stream` remainsfalse because its upstream flag is not a general HTTP-streaming switch. PCM format, audio speed, playback/queue capacity, silence/padding settings, models/voices and retained-answer policy remain unchanged. Smaller sentence requests may increase TTS call counts; budget caps still apply.
|
||||
|
||||
## Validation
|
||||
|
||||
-157 focused unit tests passed in8.51s: wire bytes/options, applied policy/attestation, profile mismatch, cancellation/history, budget/supervisor and baseline behavior.
|
||||
-3 PostgreSQL profile/replay/revocation tests passed in6.72s, zero skips, `--require-postgres` on a fresh dedicated tmpfs PostgreSQL. Owned container removed; operational and browser DB unchanged. Responsive and baseline reservations both pin original profiles on replay.
|
||||
-COPY-only image `sha256:ddbb90366f19f8077b1cb40a77e529393459485fb8ae0cb9d074ffea641c265f`, verified parent `66aceba8e58a`; no dependencies downloaded/changed and private inputs excluded from context.
|
||||
-Actual pinned native engine with real assets, networknone and fixture provider I/O passed. Final stricter18.272s run supplies only one complete sentence and holds generation open; audio arrives before completion, active cancellation/retained drafts/next generation and stale-output exclusion pass. Client error null; cleanup/pending zero, paid calls0. Controlled duration is not a Persian latency benchmark.
|
||||
-Actual candidate startup24.639s; STT/LLM/TTS probes all200. Authenticated proxied session_ready and closed/user_requested pass; connection check did not increase inference count. This proves setup/probe compatibility, not human accuracy or quality.
|
||||
-Initial local test runs exposed a Windows BOM decoding issue in the edited engine file and a missing RuntimeSettings argument in the new test; both corrected before the passing runs. No assertion weakened.
|
||||
|
||||
## Live handoff and budget
|
||||
|
||||
Browser http://127.0.0.2:4201/login, same private account/password and ?????? ?????. API and engine use the new image and responsive flag in the isolated stack. Memory prevention remains OFF per user; Docker3GiB/no-swap, deadlines and30minute expiry remain. Nominal expiry (Tehran): 2026-10-17T11:01:18.153111+03:30.
|
||||
|
||||
New exclusive directory `.local-s2s-build/windows-responsive-paid-01` carries both previous local ledgers and exact-ID receipts in order. All prior$0.710884452 exposure remains accounted. Current reserve **$0.769884452**, maximum **$0.981884452**, below the original$1 total. Limits:4 STT,4 LLM,5 TTS attempts including startup. Extra TTS allowance covers sentence splitting; no unrestricted OpenAI. Failed/unknown attempts keep reserves, partial or discontinuous billing chains fail closed, old ledgers remain unchanged. No automatic restart.
|
||||
|
||||
Human next: repeat the same short Persian utterances, listen to response onset and interrupt/request the same answer. Exact acoustic timing needs browser/capture measurements; server timing alone excludes the final audible-output path. Same-answer compliance and factual RAG remain pending. [Sanitized actual results](responsive-candidate-20261017.json).
|
||||
|
||||
## Human retest: latency still high, evaluation quota failure
|
||||
|
||||
User reports high latency persists and supplied browser error `LIVE_PROVIDER_UNAVAILABLE` for session e67dea1c-74bc-427e-8143-8187546e7cd3. Exact evaluation ledger denial: speech attempt_limit,5 admitted. Sentence splitting increased TTS calls; the sixth speech call was refused before provider I/O.13 admitted requests all returned200 (4STT,4LLM,5TTS); reserved exposure$0.981884452 held pending billing. This is an evaluation quota failure, not proof of provider outage or a successful repair. Engine stopped; UI/API remain available. No new inference during diagnosis.
|
||||
|
||||
Measured user-request component first-body delays: STT2046/1553/2058ms; LLM765/768/767ms; TTS2491/1578/2036/3741ms. These server timings exclude user speech and final browser audible onset. Sentence-at-a-time alone has not established acceptable end-to-end latency. Do not repeat this capped handoff or claim the latency fix accepted. Next funded evaluation must account for per-answer sentence/TTS calls before admitting generation, or use a deliberately bounded small scenario after exact bill reconciliation. Budget stays$1; memory prevention staysoff.
|
||||
|
||||
User explicitly asks to minimize coding quota consumption: keep follow-up investigation/changes narrowly targeted, avoid broad test/build/document churn.
|
||||
@@ -0,0 +1,82 @@
|
||||
"""One exclusive, bounded Windows browser handoff. Never restart its ledger."""
|
||||
import argparse
|
||||
import ctypes
|
||||
import json
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
ROOT=Path(__file__).resolve().parents[3]
|
||||
EVIDENCE=ROOT/'.local-s2s-build/windows-browser-paid'
|
||||
REPORT=ROOT/'.local-s2s-build/windows-browser-watch.json'
|
||||
COMPOSE=['docker','compose','--project-directory',str(ROOT),'--env-file',str(ROOT/'.local-s2s-build/windows-browser.env'),'-f',str(ROOT/'docs/evaluation/local-s2s/windows-browser.compose.yml')]
|
||||
|
||||
class Memory(ctypes.Structure):
|
||||
_fields_=[('length',ctypes.c_ulong),('load',ctypes.c_ulong)]+[(name,ctypes.c_ulonglong) for name in ('total','available','page_total','page_available','virtual_total','virtual_available','extended')]
|
||||
|
||||
def available():
|
||||
memory=Memory();memory.length=ctypes.sizeof(memory)
|
||||
if not ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(memory)):raise OSError('Windows memory query failed')
|
||||
return memory.available
|
||||
|
||||
def vm_available():
|
||||
data=subprocess.check_output(COMPOSE+['exec','-T','candidate_db','cat','/proc/meminfo'],text=True,timeout=10)
|
||||
return int(next(line.split()[1] for line in data.splitlines() if line.startswith('MemAvailable:')))*1024
|
||||
|
||||
def main(*, enforce_memory=False):
|
||||
state={'stage':'preflight','memory_enforcement':enforce_memory,'minimum_windows_available_bytes':available(),'minimum_vm_available_bytes':vm_available()}
|
||||
def save():REPORT.write_text(json.dumps(state,indent=2)+'\n',encoding='utf-8')
|
||||
if (EVIDENCE/'browser-paid-ledger.json').exists():raise SystemExit('Exclusive ledger already exists; no restart allowed')
|
||||
if enforce_memory:
|
||||
# Admit using this host's measured native peak plus the floor and256MiB margin.
|
||||
trial=json.loads((ROOT/'docs/evaluation/local-s2s/windows-native-retention-20261017.json').read_text())
|
||||
observed=trial['supervisor']
|
||||
if observed['exit_code']!=0 or observed['abort'] is not None:raise SystemExit('Missing successful native memory evidence')
|
||||
required=2500*1024**2+(observed['start_windows_available_bytes']-observed['minimum_windows_available_bytes'])+256*1024**2
|
||||
state['required_windows_start_bytes']=required
|
||||
if state['minimum_windows_available_bytes']<required or state['minimum_vm_available_bytes']<=5*1024**3:
|
||||
state.update(stage='blocked',reason='prestart_memory');save();raise SystemExit(1)
|
||||
stop=False
|
||||
def terminate(*args):
|
||||
nonlocal stop
|
||||
stop=True
|
||||
for sig in (signal.SIGINT,signal.SIGTERM):signal.signal(sig,terminate)
|
||||
began=time.monotonic();owned=False
|
||||
try:
|
||||
owned=True
|
||||
subprocess.run(COMPOSE+['up','--pull','never','--no-deps','-d','local-s2s-engine'],check=True,timeout=40)
|
||||
state['stage']='starting';save()
|
||||
while not stop:
|
||||
win=available();vm=vm_available()
|
||||
state['minimum_windows_available_bytes']=min(win,state['minimum_windows_available_bytes'])
|
||||
state['minimum_vm_available_bytes']=min(vm,state['minimum_vm_available_bytes'])
|
||||
if enforce_memory and min(win,vm)<2500*1024**2:state['reason']='memory_floor';break
|
||||
if time.monotonic()-began>1800:state['reason']='handoff_expired_30_minutes';break
|
||||
status=subprocess.check_output(COMPOSE+['ps','--all','--format','json','local-s2s-engine'],text=True,timeout=10)
|
||||
rows=[json.loads(line) for line in status.splitlines() if line.startswith('{')]
|
||||
if rows and rows[0].get('State') not in ('running','created'):state['reason']='engine_exited';break
|
||||
if state['stage']=='starting':
|
||||
logs=subprocess.check_output(COMPOSE+['logs','--no-log-prefix','--tail','10','local-s2s-engine'],text=True,timeout=10)
|
||||
if '"stage": "startup"' in logs:
|
||||
state.update(stage='ready',startup_seconds=round(time.monotonic()-began,3));print('Browser engine ready',flush=True)
|
||||
elif time.monotonic()-began>180:state['reason']='startup_deadline';break
|
||||
save();time.sleep(2)
|
||||
except BaseException as exc:
|
||||
state['reason']=type(exc).__name__
|
||||
raise
|
||||
finally:
|
||||
if owned:subprocess.run(COMPOSE+['stop','--timeout','5','local-s2s-engine'],timeout=15)
|
||||
state.update(stage='stopped',elapsed_seconds=round(time.monotonic()-began,3));state.setdefault('reason','operator_stop');save()
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--enforce-memory-floor',action='store_true',help='Opt in to host/VM memory admission and automatic low-memory stop')
|
||||
parser.add_argument('--evidence',type=Path)
|
||||
parser.add_argument('--report',type=Path)
|
||||
parser.add_argument('--compose',type=Path)
|
||||
args=parser.parse_args()
|
||||
if args.evidence:EVIDENCE=args.evidence.resolve()
|
||||
if args.report:REPORT=args.report.resolve()
|
||||
if args.compose:COMPOSE[-1]=str(args.compose.resolve())
|
||||
main(enforce_memory=args.enforce_memory_floor)
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"date": "2026-10-17",
|
||||
"status": "ready_for_human_test",
|
||||
"memory_enforcement": false,
|
||||
"budget": {
|
||||
"previous_reserved_and_billed_usd": "0.704698199",
|
||||
"reserved_usd": "0.763698199",
|
||||
"maximum_cumulative_usd": "0.940698199",
|
||||
"carry_basis": "documentary_checkpoint_with_local_bills"
|
||||
},
|
||||
"connection": {
|
||||
"conversation_id": "a515ec75-1fb4-496d-879b-ed824df881e9",
|
||||
"session_id": "991b5a14-07b6-4891-bd16-eebaeab35487",
|
||||
"events": [
|
||||
"session_ready"
|
||||
],
|
||||
"providers": {
|
||||
"default_provider": "local_s2s",
|
||||
"connection_checked": false,
|
||||
"providers": [
|
||||
{
|
||||
"id": "openai",
|
||||
"label": "OpenAI",
|
||||
"can_start": false,
|
||||
"reason": "not_configured"
|
||||
},
|
||||
{
|
||||
"id": "local_s2s",
|
||||
"label": "\u0633\u06cc\u0633\u062a\u0645 \u062c\u062f\u06cc\u062f",
|
||||
"can_start": true,
|
||||
"reason": null
|
||||
},
|
||||
{
|
||||
"id": "gemini",
|
||||
"label": "Gemini",
|
||||
"can_start": false,
|
||||
"reason": "disabled"
|
||||
}
|
||||
]
|
||||
},
|
||||
"session_ready": true,
|
||||
"close": {
|
||||
"session_id": "991b5a14-07b6-4891-bd16-eebaeab35487",
|
||||
"status": "closed",
|
||||
"close_reason": "user_requested"
|
||||
},
|
||||
"component_attempts_before": 3,
|
||||
"component_attempts_after": 3
|
||||
},
|
||||
"watch": {
|
||||
"stage": "ready",
|
||||
"memory_enforcement": false,
|
||||
"minimum_windows_available_bytes": 4233564160,
|
||||
"minimum_vm_available_bytes": 4304089088,
|
||||
"startup_seconds": 26.674
|
||||
},
|
||||
"nominal_expiry_tehran": "2026-10-17T10:40:19.606602+03:30",
|
||||
"openai_comparison_ready": false,
|
||||
"real_rag_ready": false,
|
||||
"human_result": "pending"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Second Windows browser handoff ? 2026-10-17
|
||||
|
||||
Status: **ready for human voice/interruption test; Phase3/4 not accepted**.
|
||||
|
||||
The user requested temporary disabling of memory prevention and an actual restart for testing. The engine is running with `memory_enforcement=false`; memory measurements alone no longer block/stop it. Docker3GiB/no-swap, startup/30minute deadlines and exclusive budget remain.
|
||||
|
||||
## Verified
|
||||
|
||||
-15 budget/supervisor tests passed in0.51s. Exact-ID billed carry replaces only the three verified old startup reservations with$0.0001938 actual costs, preserving the full$0.704504399 older exposure. Missing/mismatched/negative receipts fail closed; old live ledger is unchanged.
|
||||
- New exclusive directory `.local-s2s-build/windows-browser-paid-02`; previous ledger and receipt copies retained. New baseline$0.704698199; three actual startup requests returned200; current conservative exposure$0.763698199; maximum$0.940698199 under the original$1 cap. At most three further admissions per component remain, not guaranteed complete turns.
|
||||
- Engine startup26.674s; actual proxied login, selected local WebSocket `session_ready` and normal close passed. No audio sent; paid attempts remained3 before/after connection. API and static frontend are healthy. Existing account/password unchanged.
|
||||
- Watcher now accepts evidence/report/compose paths for fresh exclusive runs; old defaults remain. [Sanitized actual handoff](windows-browser-handoff-02-20261017.json).
|
||||
|
||||
Browser http://127.0.0.2:4201/login; credentials `.local-s2s-build/windows-browser-login.txt`. Select ?????? ?????. First ask for a short three-sentence general answer; interrupt with a same-answer repeat, listen to its completion, then request a short continuation. Report audio/transcript behavior and exact errors. Keep prompts/answers short within the per-component caps. No document claims should be tested in this transport-only database.
|
||||
|
||||
Nominal expiry (Tehran): 2026-10-17T10:40:19.606602+03:30. Memory prevention remains off; time/budget/provider failures can still end a session. No automatic restart of this ledger.
|
||||
|
||||
Next gates: human microphone/interruption/repetition acceptance; approved factual corpus and bounded compatible embeddings/shared search; then bounded OpenAI admission, paired comparisons and restoration. Current fixture and connection successes close none of these acceptance gates.
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"date": "2026-10-17",
|
||||
"status": "ready_for_human_transport_interruption_test_not_phase_acceptance",
|
||||
"browser_url": "http://127.0.0.2:4201/login",
|
||||
"image": "sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1",
|
||||
"connection": {
|
||||
"conversation_id": "1ad9d329-7ca7-4280-a38f-3f12fc33c1d1",
|
||||
"session_id": "5cad13f2-d1c0-486b-902f-0a1e2c74b868",
|
||||
"events": [
|
||||
"session_ready"
|
||||
],
|
||||
"providers": {
|
||||
"default_provider": "local_s2s",
|
||||
"connection_checked": false,
|
||||
"providers": [
|
||||
{
|
||||
"id": "openai",
|
||||
"label": "OpenAI",
|
||||
"can_start": false,
|
||||
"reason": "not_configured"
|
||||
},
|
||||
{
|
||||
"id": "local_s2s",
|
||||
"label": "\u0633\u06cc\u0633\u062a\u0645 \u062c\u062f\u06cc\u062f",
|
||||
"can_start": true,
|
||||
"reason": null
|
||||
},
|
||||
{
|
||||
"id": "gemini",
|
||||
"label": "Gemini",
|
||||
"can_start": false,
|
||||
"reason": "disabled"
|
||||
}
|
||||
]
|
||||
},
|
||||
"session_ready": true,
|
||||
"close": {
|
||||
"session_id": "5cad13f2-d1c0-486b-902f-0a1e2c74b868",
|
||||
"status": "closed",
|
||||
"close_reason": "user_requested"
|
||||
},
|
||||
"component_attempts_before": 3,
|
||||
"component_attempts_after": 3
|
||||
},
|
||||
"budget": {
|
||||
"previous_reserved_and_billed_usd": "0.704504399",
|
||||
"reserved_usd": "0.763504399",
|
||||
"maximum_cumulative_usd": "0.940504399",
|
||||
"maximum_attempts": {
|
||||
"speech": 4,
|
||||
"transcriptions": 4,
|
||||
"completions": 4
|
||||
},
|
||||
"carry_basis": "documentary_checkpoint"
|
||||
},
|
||||
"startup_http_statuses": [
|
||||
200,
|
||||
200,
|
||||
200
|
||||
],
|
||||
"watch_at_handoff": {
|
||||
"stage": "ready",
|
||||
"minimum_windows_available_bytes": 3021164544,
|
||||
"minimum_vm_available_bytes": 4236189696,
|
||||
"required_windows_start_bytes": 3816460288,
|
||||
"startup_seconds": 30.553
|
||||
},
|
||||
"watchdog_started_utc": "2026-10-17T06:06:40Z",
|
||||
"nominal_expiry_tehran": "2026-10-17T10:06:40+03:30",
|
||||
"rag_ready": false,
|
||||
"openai_bounded_admission_ready": false,
|
||||
"human_result": "pending"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
# Windows browser handoff ? 2026-10-17
|
||||
|
||||
Status: **ready for human microphone/interruption checks; neither Phase3 nor Phase4 accepted**.
|
||||
|
||||
Browser: http://127.0.0.2:4201/login. Private account details are in `.local-s2s-build/windows-browser-login.txt`. Select ?????? ?????. This is an isolated voice transport environment; real document RAG and bounded OpenAI comparison are not ready.
|
||||
|
||||
## Actual evidence
|
||||
|
||||
- Separate project `rag-local-s2s-windows-test` owns a fresh PostgreSQL database, originals/extractions volumes and account; existing operational and prior test data unchanged. API8092 readiness200, new administrator bootstrap successful.
|
||||
- Actual Angular source built in19.165s; Vite preview serves the generated bundle and proxies HTTP/WebSocket. Development server used553MiB; preview used64MiB at the observed sample. Existing frontend package.json changes preserved.
|
||||
- Actual proxied login and metadata passed. Explicitly selected local session reached `session_ready`; close persisted `closed/user_requested`. No microphone data sent. Component attempts remained3 before/after the connection check.
|
||||
- Three actual startup requests (STT/LLM/TTS) returned200. No manual retry/reset. Full documentary carry$0.704504399 retained; current reserved exposure$0.763504399; exclusive cumulative ceiling$0.940504399 below the original$1 cap. This is conservative exposure, not final invoicing. Four attempts per stage include startup, so at most three further admissions per stage remain; batching/failure/interruption may consume these earlier than three user turns.
|
||||
- Key was available under existing legacy `API_KEY` with OpenRouter endpoint; copied privately to engine-only secret mount. API/browser receive neither it nor OpenAI inference keys. Preserved original profile remains private and unchanged. OpenAI metadata is `not_configured` in this test API until separate bounded admission exists.
|
||||
- Watchdog uses the measured native Windows memory increase plus2500MiB runtime floor and256MiB margin for preflight (3,816,460,288 bytes), and >5GiB Docker VM availability. Both Windows and VM runtime floors remain2500MiB. Only its engine stops on low memory, startup failure or30minute expiry; no restart of the exclusive ledger is allowed. Nominal expiry **10:06:40 Tehran,2026-10-17**; memory/exit can end it earlier.
|
||||
|
||||
## Implementation and checks
|
||||
|
||||
The evaluation budget guard adds an explicit documentary carry mode. It validates the exact known checkpoint and rejects mixed private/documentary evidence; it does not fabricate historical requests or invoices. Existing private-ledger paths remain supported. Failures retain reservations; quota denial occurs before provider I/O. Guard code is mounted read-only into the candidate. The connection checker accepts optional account/ledger/report paths, retaining old defaults.
|
||||
|
||||
- Budget/history/evaluation/provider selection: **60 passed in9.14s**.
|
||||
- Budget/supervisor checks: **10 passed in0.69s**, including six overlapping budget cases. They test exclusive-ledger rejection, changed-carry rejection, failure retention, low-memory no-launch and only-owned-engine shutdown on memory/expiry.
|
||||
- Compose validation, Windows configuration-only no-inference run, real metadata validation in a disposable directory and final `git diff --check` passed.
|
||||
- Actual startup and authenticated proxied native connection are real-provider evidence limited to the described checks. They do not establish human Persian quality, interrupted-answer compliance or factual correctness. [Sanitized handoff](windows-browser-handoff-20261017.json).
|
||||
|
||||
## Human action now required
|
||||
|
||||
Use short, non-document questions. Exercise interruption with a same-answer repeat and then a brief continuation, listening for stale audio/errors and retained answer behavior. Keep answers short because the budget has only three additional admissions per component. Report the exact error code if any. No phase closure from this handoff.
|
||||
|
||||
Approved corpus/factual annotations, compatible bounded embedding/search preparation, OpenAI admission, paired comparison and restoration remain pending. Do not enable unrestricted OpenAI or bypass calibration to call document retrieval ready. If this handoff expires, create a new carried ledger only after reconciliation; never rerun this ledger.
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"date": "2026-10-17",
|
||||
"cause": "watchdog_memory_floor_before_user_connections",
|
||||
"watchdog": {
|
||||
"stage": "stopped",
|
||||
"minimum_windows_available_bytes": 2606247936,
|
||||
"minimum_vm_available_bytes": 4236189696,
|
||||
"required_windows_start_bytes": 3816460288,
|
||||
"startup_seconds": 30.553,
|
||||
"reason": "memory_floor",
|
||||
"elapsed_seconds": 175.791
|
||||
},
|
||||
"failed_user_sessions": [
|
||||
"a4a1f0b8-b5e0-4dcf-9707-6b177ef93a34",
|
||||
"c542c2a6-81f9-486b-bc0a-18de0dec0453"
|
||||
],
|
||||
"api_error": "LIVE_SETUP_FAILED",
|
||||
"api_exception": "gaierror",
|
||||
"paid_attempts_after_user_connections": 3,
|
||||
"new_billed_startup_usd": "0.0001938",
|
||||
"prior_exposure_held_usd": "0.704504399",
|
||||
"reconciled_conservative_exposure_usd": "0.704698199",
|
||||
"human_voice_acceptance": "not_run_engine_unavailable"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Windows browser startup failure ? 2026-10-17
|
||||
|
||||
The browser handoff is **no longer live**. The Windows watchdog stopped only its owned engine after175.791s with reason `memory_floor`; minimum Windows availability2,606,247,936 bytes, just below2500MiB. This was a guarded stop, not a proven OOM or interruption/history defect. The frontend/API stayed available.
|
||||
|
||||
The two user WebSocket attempts at06:29:54 and06:30:01 UTC occurred after that stop. API diagnostics show `stream_setup`, `gaierror`, `LIVE_SETUP_FAILED`; frontend close1011 corresponds to failed engine setup. Three login401s were followed by login200 and authenticated me/configuration/session requests; those login failures do not explain the later voice failures. Initial me401 before login is expected.
|
||||
|
||||
Engine logs show only the three startup requests and normal shutdown. Ledger still contains exactly three attempts; neither failed browser connection admitted inference. There is no microphone/barge-in quality result.
|
||||
|
||||
## Billing reconciliation
|
||||
|
||||
Read-only generation lookups for all three exact ledger IDs returned200. Actual costs: STT$0.0000075, LLM$0.0000228, TTS$0.0001635; total **$0.0001938**. The corresponding new$0.059 startup reserve can be replaced only in a new carry; the historical$0.704504399 remains held in full. Reconciled conservative exposure **$0.704698199**. Original exclusive ledger remains untouched and must not restart. Full billing receipts retained privately; [sanitized evidence](windows-browser-stop-20261017.json).
|
||||
|
||||
No new inference or engine restart was performed during diagnosis. The current host had3463MiB free after engine stop. Native fixture peak alone underestimated live handoff memory pressure; next admission must include the observed live decline and browser/UI headroom instead of silently reducing the runtime floor. Free memory with the actual browser open before another paid startup. A new carried-forward exclusive ledger is required; old documentary constructor currently accepts only its original checkpoint, so do not substitute the new exposure into it without implementing/verifying a billing-linked carry path.
|
||||
|
||||
Phase3/4 remain unaccepted. Next user dependency: free nonessential memory with the browser open; plan roughly4.5GiB available before another supervised trial. No unrelated process was terminated. The previous advertised handoff expiry was an upper bound; this earlier memory stop supersedes its ready state.
|
||||
|
||||
## User override: memory prevention disabled
|
||||
|
||||
The user explicitly requested disabling memory prevention temporarily. `watch-windows-browser.py` now defaults to observation only: neither Windows/VM pre-start thresholds nor the runtime2500MiB floor block or stop the engine. Memory samples are still recorded. `--enforce-memory-floor` explicitly restores both checks. The3GiB/no-swap Docker limit, exclusive-ledger rejection, budget admission, startup deadline and30minute expiry remain unchanged.
|
||||
|
||||
Validation:11 budget/supervisor tests passed in0.40s, including default low-memory launch continuing until the time limit and opt-in memory enforcement. No engine restart or paid call was made. The previously stopped engine remains stopped; any new paid launch still needs verified billing-linked carry. Earlier requests to free RAM are superseded by this explicit user override.
|
||||
@@ -0,0 +1,206 @@
|
||||
{
|
||||
"name": "rag-local-s2s-windows-test",
|
||||
"services": {
|
||||
"candidate_db": {
|
||||
"image": "pgvector/pgvector:pg16",
|
||||
"environment": {
|
||||
"POSTGRES_DB": "windows_local_s2s_test",
|
||||
"POSTGRES_USER": "windows_s2s_test",
|
||||
"POSTGRES_PASSWORD": "isolated-windows-only"
|
||||
},
|
||||
"volumes": [
|
||||
"windows_postgres:/var/lib/postgresql/data"
|
||||
],
|
||||
"healthcheck": {
|
||||
"test": [
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U windows_s2s_test -d windows_local_s2s_test"
|
||||
],
|
||||
"interval": "3s",
|
||||
"timeout": "3s",
|
||||
"retries": 20
|
||||
},
|
||||
"mem_limit": "512m",
|
||||
"memswap_limit": "512m"
|
||||
},
|
||||
"candidate_migrations": {
|
||||
"image": "sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1",
|
||||
"environment": {
|
||||
"PROVIDER": "local_s2s",
|
||||
"VOICE_PROVIDER": "local_s2s",
|
||||
"VOICE_SELECTABLE_PROVIDERS": "[\"openai\",\"local_s2s\"]",
|
||||
"LOCAL_S2S_ENABLED": "true",
|
||||
"LOCAL_S2S_RETAIN_INTERRUPTED_ANSWERS": "true",
|
||||
"VOICE_TRANSPORT_TESTING": "true",
|
||||
"LOCAL_S2S_ENDPOINT": "ws://local-s2s-engine:8765/v1/realtime",
|
||||
"LOCAL_S2S_TOKEN": "${LOCAL_S2S_TOKEN:?Private test token required}",
|
||||
"LOCAL_S2S_STT_MODEL": "openai/whisper-large-v3",
|
||||
"LOCAL_S2S_LLM_MODEL": "openai/gpt-4.1-mini",
|
||||
"LOCAL_S2S_TTS_MODEL": "gpt-4o-mini-tts-2025-12-15",
|
||||
"LOCAL_S2S_TTS_VOICE": "alloy",
|
||||
"LOCAL_S2S_MAX_OUTPUT_TOKENS": "128",
|
||||
"LOCAL_S2S_REQUEST_TIMEOUT_SECONDS": "30",
|
||||
"LIVE_SESSION_SECONDS": "60",
|
||||
"LIVE_DIAGNOSTIC_TRACE_ENABLED": "1",
|
||||
"MAX_PROVIDER_SESSIONS": "1",
|
||||
"TRUSTED_ORIGINS": "[\"http://127.0.0.2:4201\",\"http://127.0.0.2:8092\"]",
|
||||
"TRUSTED_HOSTS": "[\"127.0.0.2:4201\",\"127.0.0.2:8092\"]",
|
||||
"COOKIE_SECURE": "false",
|
||||
"OPENAI_API_KEY": "",
|
||||
"OPENAI_REALTIME_API_KEY": "",
|
||||
"INGEST_DATABASE_URL": "postgresql+psycopg://windows_s2s_test:isolated-windows-only@candidate_db:5432/windows_local_s2s_test",
|
||||
"INGEST_ORIGINAL_DIRECTORY": "/app/data/local-s2s-test/originals",
|
||||
"INGEST_EXTRACTION_DIRECTORY": "/app/data/local-s2s-test/extractions",
|
||||
"INGEST_EMBEDDING_PROVIDER": "openai",
|
||||
"INGEST_EMBEDDING_ENDPOINT": "http://127.0.0.1:9/v1",
|
||||
"INGEST_EMBEDDING_MODEL": "text-embedding-3-small",
|
||||
"INGEST_EMBEDDING_DIMENSIONS": "1536",
|
||||
"INGEST_EMBEDDING_API_KEY": "transport-no-inference",
|
||||
"INGEST_EMBEDDING_LIMITS": "{\"unit\":\"utf8_bytes\",\"max_input_units\":4096,\"max_batch_units\":4096,\"max_batch_inputs\":1}"
|
||||
},
|
||||
"command": [
|
||||
"alembic",
|
||||
"upgrade",
|
||||
"head"
|
||||
],
|
||||
"volumes": [
|
||||
"./.local-s2s-build/windows-empty.env:/app/.env:ro"
|
||||
],
|
||||
"depends_on": {
|
||||
"candidate_db": {
|
||||
"condition": "service_healthy"
|
||||
}
|
||||
},
|
||||
"mem_limit": "512m",
|
||||
"memswap_limit": "512m"
|
||||
},
|
||||
"candidate_api": {
|
||||
"image": "sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1",
|
||||
"environment": {
|
||||
"PROVIDER": "local_s2s",
|
||||
"VOICE_PROVIDER": "local_s2s",
|
||||
"VOICE_SELECTABLE_PROVIDERS": "[\"openai\",\"local_s2s\"]",
|
||||
"LOCAL_S2S_ENABLED": "true",
|
||||
"LOCAL_S2S_RETAIN_INTERRUPTED_ANSWERS": "true",
|
||||
"VOICE_TRANSPORT_TESTING": "true",
|
||||
"LOCAL_S2S_ENDPOINT": "ws://local-s2s-engine:8765/v1/realtime",
|
||||
"LOCAL_S2S_TOKEN": "${LOCAL_S2S_TOKEN:?Private test token required}",
|
||||
"LOCAL_S2S_STT_MODEL": "openai/whisper-large-v3",
|
||||
"LOCAL_S2S_LLM_MODEL": "openai/gpt-4.1-mini",
|
||||
"LOCAL_S2S_TTS_MODEL": "gpt-4o-mini-tts-2025-12-15",
|
||||
"LOCAL_S2S_TTS_VOICE": "alloy",
|
||||
"LOCAL_S2S_MAX_OUTPUT_TOKENS": "128",
|
||||
"LOCAL_S2S_REQUEST_TIMEOUT_SECONDS": "30",
|
||||
"LIVE_SESSION_SECONDS": "60",
|
||||
"LIVE_DIAGNOSTIC_TRACE_ENABLED": "1",
|
||||
"MAX_PROVIDER_SESSIONS": "1",
|
||||
"TRUSTED_ORIGINS": "[\"http://127.0.0.2:4201\",\"http://127.0.0.2:8092\"]",
|
||||
"TRUSTED_HOSTS": "[\"127.0.0.2:4201\",\"127.0.0.2:8092\"]",
|
||||
"COOKIE_SECURE": "false",
|
||||
"OPENAI_API_KEY": "",
|
||||
"OPENAI_REALTIME_API_KEY": "",
|
||||
"INGEST_DATABASE_URL": "postgresql+psycopg://windows_s2s_test:isolated-windows-only@candidate_db:5432/windows_local_s2s_test",
|
||||
"INGEST_ORIGINAL_DIRECTORY": "/app/data/local-s2s-test/originals",
|
||||
"INGEST_EXTRACTION_DIRECTORY": "/app/data/local-s2s-test/extractions",
|
||||
"INGEST_EMBEDDING_PROVIDER": "openai",
|
||||
"INGEST_EMBEDDING_ENDPOINT": "http://127.0.0.1:9/v1",
|
||||
"INGEST_EMBEDDING_MODEL": "text-embedding-3-small",
|
||||
"INGEST_EMBEDDING_DIMENSIONS": "1536",
|
||||
"INGEST_EMBEDDING_API_KEY": "transport-no-inference",
|
||||
"INGEST_EMBEDDING_LIMITS": "{\"unit\":\"utf8_bytes\",\"max_input_units\":4096,\"max_batch_units\":4096,\"max_batch_inputs\":1}"
|
||||
},
|
||||
"command": [
|
||||
"python",
|
||||
"-m",
|
||||
"app.server",
|
||||
"--host",
|
||||
"0.0.0.0",
|
||||
"--port",
|
||||
"8000"
|
||||
],
|
||||
"volumes": [
|
||||
"./.local-s2s-build/windows-empty.env:/app/.env:ro",
|
||||
"windows_originals:/app/data/local-s2s-test/originals",
|
||||
"windows_extractions:/app/data/local-s2s-test/extractions"
|
||||
],
|
||||
"ports": [
|
||||
"127.0.0.2:8092:8000"
|
||||
],
|
||||
"depends_on": {
|
||||
"candidate_migrations": {
|
||||
"condition": "service_completed_successfully"
|
||||
}
|
||||
},
|
||||
"mem_limit": "768m",
|
||||
"memswap_limit": "768m"
|
||||
},
|
||||
"local-s2s-engine": {
|
||||
"image": "sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1",
|
||||
"entrypoint": [
|
||||
"python",
|
||||
"/checks/phase4-browser-engine.py"
|
||||
],
|
||||
"command": [
|
||||
"--allow-paid-startup"
|
||||
],
|
||||
"environment": {
|
||||
"LOCAL_S2S_ENABLED": "true",
|
||||
"LOCAL_S2S_RETAIN_INTERRUPTED_ANSWERS": "true",
|
||||
"LOCAL_S2S_ENDPOINT": "ws://local-s2s-engine:8765/v1/realtime",
|
||||
"LOCAL_S2S_TOKEN": "${LOCAL_S2S_TOKEN:?Private test token required}",
|
||||
"LOCAL_S2S_STT_MODEL": "openai/whisper-large-v3",
|
||||
"LOCAL_S2S_LLM_MODEL": "openai/gpt-4.1-mini",
|
||||
"LOCAL_S2S_TTS_MODEL": "gpt-4o-mini-tts-2025-12-15",
|
||||
"LOCAL_S2S_TTS_VOICE": "alloy",
|
||||
"LOCAL_S2S_MAX_OUTPUT_TOKENS": "128",
|
||||
"LOCAL_S2S_REQUEST_TIMEOUT_SECONDS": "30",
|
||||
"LOCAL_S2S_ALLOW_PAID_STARTUP": "true",
|
||||
"OPENROUTER_API_KEY": "",
|
||||
"LOCAL_S2S_SILERO_SOURCE": "/vad/silero-vad",
|
||||
"LOCAL_S2S_NLTK_DATA": "/assets/nltk",
|
||||
"LOCAL_S2S_ASSET_MANIFEST": "/assets/assets.json",
|
||||
"LOCAL_S2S_ASSET_MANIFEST_SHA256": "869eb6be1f444ecded8908b9339078cc5845df367207a63ed28173c4974dca26",
|
||||
"OMP_NUM_THREADS": "1",
|
||||
"OPENBLAS_NUM_THREADS": "1",
|
||||
"PYTHONPATH": "/app",
|
||||
"PROVIDER": "local_s2s",
|
||||
"VOICE_PROVIDER": "local_s2s",
|
||||
"VOICE_TRANSPORT_TESTING": "true"
|
||||
},
|
||||
"volumes": [
|
||||
"./.local-s2s-build/windows-empty.env:/app/.env:ro",
|
||||
"./.local-s2s-build/windows-openrouter-test.key:/secret/openrouter-test.key:ro",
|
||||
"./.local-s2s-build/windows-openai-test.key:/secret/openai-test.key:ro",
|
||||
"./.local-s2s-build/windows-browser-paid:/evidence:rw",
|
||||
"./.local-s2s-build/assets-linux/nltk:/assets/nltk:ro",
|
||||
"./.local-s2s-build/assets-linux/vad:/vad/silero-vad:ro",
|
||||
"./.local-s2s-build/windows-continuation-20261017/assets-lf.json:/assets/assets.json:ro",
|
||||
"./services/local_s2s/components.py:/app/services/local_s2s/components.py:ro",
|
||||
"./docs/evaluation/local-s2s/phase4-browser-engine.py:/checks/phase4-browser-engine.py:ro",
|
||||
"./docs/evaluation/local-s2s/phase4-browser-budget.py:/checks/phase4-browser-budget.py:ro",
|
||||
"./docs/evaluation/local-s2s/browser-budget.py:/checks/browser-budget.py:ro",
|
||||
"./docs/evaluation/local-s2s/native-budget-transport.py:/checks/native-budget-transport.py:ro"
|
||||
],
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"security_opt": [
|
||||
"no-new-privileges:true"
|
||||
],
|
||||
"tmpfs": [
|
||||
"/tmp:rw,noexec,nosuid,size=64m"
|
||||
],
|
||||
"mem_limit": "3g",
|
||||
"memswap_limit": "3g",
|
||||
"cpus": 2,
|
||||
"pids_limit": 128,
|
||||
"restart": "no"
|
||||
}
|
||||
},
|
||||
"volumes": {
|
||||
"windows_postgres": {},
|
||||
"windows_originals": {},
|
||||
"windows_extractions": {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
# Windows continuation preparation — 2026-10-17
|
||||
|
||||
Status: isolated candidate image rebuilt; supervised native retention fixture passed; paid/browser preparation pending; Phase 3 and Phase 4 live acceptance remain pending.
|
||||
|
||||
The user confirmed that previous real tests ran on another computer and authorized continuation on this Windows host. Previous private ledgers and native candidate images are not present here. Existing test PostgreSQL/original/extraction volumes remain available and have not been reset. Docker Desktop was started; existing unrelated restart-policy containers started automatically and were left unchanged.
|
||||
|
||||
## Recovered inputs
|
||||
|
||||
- Clean upstream pin `619e3fe4f71d1c6f35c15870d588a3638de34722`, acquired in `tmp/local-s2s-upstream-619e3fe4`; all 17 recorded SHA-256 fingerprints match after disabling Git archive CRLF conversion.
|
||||
- Reviewed 134-package Linux CPU lock copied unchanged into `.local-s2s-build/requirements.lock`; original pinned Python base retained.
|
||||
- All 14 NLTK/Silero asset fingerprints match the existing Linux asset manifest, under `.local-s2s-build/assets-linux`. The Silero directory in this reconstruction is `vad`, not `silero-vad`; mounts must use the actual path.
|
||||
- Existing Angular checkout `D:/raymand/projects/faq_chatbot_frontend` contains provider selection at commit `a26c597`. Its existing package.json modification was preserved.
|
||||
- Build succeeded: `rag-local-s2s-candidate:windows-rebuild-20261017`, image ID `sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1`. Original base/lock were retained; native validation remains unrun. A Dockerfile warning about the unset default base ARG remains; the build supplied the explicit pinned base.
|
||||
|
||||
## Budget
|
||||
|
||||
Carry the full conservative exposure **$0.704504399** from `phase-04-interruption-incident.md`; no release based on missing invoices. Remaining headroom before new reservations is **$0.295495601**, within the original **$1** authorization. This is a documentary carry, not recovered per-request billing evidence or a functioning inference admission ledger.
|
||||
|
||||
Public endpoint metadata for all three component models was refreshed without inference. Existing `native-budget-transport.py` price validation passed. Private preparation evidence is `.local-s2s-build/windows-continuation-20261017/`. Do not fabricate old attempt rows to satisfy an old ledger constructor, reset old ledgers, or enable unguarded OpenAI. A fresh exclusive admission ledger must explicitly support this documentary carry before paid startup.
|
||||
|
||||
## Checks and remaining gates
|
||||
|
||||
- `.venv/Scripts/python -m pytest -q -p no:cacheprovider tests/unit/test_local_s2s_history.py tests/unit/test_local_s2s_evaluation.py tests/unit/test_phase2_provider_selection.py`: **54 passed in 9.63s**.
|
||||
- `git diff --check`: passed before this report.
|
||||
- No new paid provider request, engine startup, audio tuning or operational provider switch.
|
||||
- Windows available physical RAM fell below 1GiB during dependency download; Linux VM MemAvailable alone is insufficient evidence of Windows host headroom. Do not start the native engine until host and VM memory admission is satisfied. Original Linux runners use `/proc/meminfo` and require a Windows-compatible supervisor before reuse here.
|
||||
- Native fixture validation, bounded cost admission, Windows-specific Compose mounts/images, browser authentication/handoff, approved RAG corpus and bounded embeddings, paired provider measurements and actual restoration remain pending. Existing Linux overrides reference unavailable image digests and `/dev/null`; do not launch them unchanged on this host.
|
||||
|
||||
## Completed image check
|
||||
|
||||
`docker run --rm --pull never --network none --read-only --memory 128m --memory-swap 128m --pids-limit 64 --cap-drop ALL --security-opt no-new-privileges --entrypoint python rag-local-s2s-candidate:windows-rebuild-20261017 -m pip check`: exit 0, `No broken requirements found.` No key mounted and no engine initialized.
|
||||
|
||||
Final Windows physical memory available: **393MiB**; native/paid/browser startup was not attempted. User was asked to free nonessential applications. Build and asset downloads are complete and retained. No unrelated process or container was stopped.
|
||||
|
||||
## Supervised native retention run with 4.8GB reported RAM
|
||||
|
||||
The user authorized testing after freeing memory. Actual preflight: Windows 5,038,092,288 bytes available, Docker VM 6,191,755,264 bytes. One controlled Windows trial admitted at >=4500MiB Windows / >5GiB VM, with the original 3GiB/no-swap container limit, 2 CPUs, network disabled and no provider key. The supervisor sampled both memory domains and stopped only its owned container if either fell below2500MiB or180s elapsed. This trial does not change existing launch defaults or establish a universal minimum.
|
||||
|
||||
**Passed in35.555s, exit0**, no memory abort. Minimum available: Windows4,111,507,456 bytes; VM4,471,754,752 bytes. Active cancellation, two retained-history receipts, next generation, stale-output exclusion, intent correlation, normal completion and unit release passed. Client error null; all cleanup errors/pending requests zero; paid calls zero. See [sanitized result](windows-native-retention-20261017.json). No actual browser, Persian quality or original transient error acceptance follows from fixture I/O.
|
||||
|
||||
The Windows checkout's mounted asset manifest has CRLF bytes; its LF-normalized digest matches the historical869eb6be1f444ecded8908b9339078cc5845df367207a63ed28173c4974dca26. A normalized private copy was prepared as `windows-continuation-20261017/assets-lf.json` for later pinned live startup; tracked manifest unchanged. All14 asset payload hashes matched before execution.
|
||||
|
||||
Next: a fresh exclusive inference budget guard supporting documentary carry (without fabricated old attempts), Windows Compose/profiles and browser handoff. No paid inference is enabled by this native success; OpenAI admission and real RAG preparation remain pending.
|
||||
|
||||
## Later browser preparation
|
||||
|
||||
Superseded for readiness by [actual browser handoff](windows-browser-handoff-20261017.md): startup and authenticated proxied connection passed, current reserve$0.763504399. Human microphone/interruption and Phase3/4 acceptance remain pending. Earlier missing-key and preparation-only statements describe their historical checkpoint.
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"date": "2026-10-17",
|
||||
"session_id": "bcc45066-2ddc-4182-8a48-043a571d2194",
|
||||
"user_confirmed_intentional_speech_interruptions": 2,
|
||||
"user_confirmed_no_stale_audio": true,
|
||||
"subsequent_turn_completed": true,
|
||||
"last_played_ms": 14336,
|
||||
"generation_active_cancellation": "not_exercised_both_responses_completed_before_playback_interruption",
|
||||
"same_answer_repeat": "not_tested",
|
||||
"asr_accuracy": "two_user_confirmed_short_utterance_errors",
|
||||
"rag": "not_tested",
|
||||
"phase3": "in_progress",
|
||||
"phase4": "pending",
|
||||
"new_billed_usd": "0.006186253",
|
||||
"prior_exposure_held_usd": "0.704698199",
|
||||
"reconciled_conservative_exposure_usd": "0.710884452",
|
||||
"trace": [
|
||||
"2026-10-17 06:41:58 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=terminal_processed turn=live-turn-1 audio=none state=backlog_bytes=298512 elapsed_ms=10256 lock_wait_ms=0 peak_backlog_bytes=298512 terminal_cancelled=0 terminal_completed=1 terminal_limited=0",
|
||||
"2026-10-17 06:41:59 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=audio_discard_interruption turn=live-turn-1 audio=live-audio-50ca3096e62349d9b685614f10593b78 state=backlog_bytes=202272 credit_bytes=72000 discarded_bytes=130272 elapsed_ms=11878 generated_bytes=322560 peak_backlog_bytes=298512 played_ms=2506 queued_bytes=130272 reserved_bytes=0 sent_bytes=192288",
|
||||
"2026-10-17 06:41:59 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=turn_interrupted_sent turn=live-turn-1 audio=none state=authority_ms=0 backlog_bytes=72000 elapsed_ms=11888 emit_ms=9 peak_backlog_bytes=298512 queued_controls=1",
|
||||
"2026-10-17 06:42:00 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=truncate_acknowledged turn=live-turn-1 audio=live-audio-50ca3096e62349d9b685614f10593b78 state=backlog_bytes=67392 credit_bytes=67392 elapsed_ms=12900 generated_bytes=322560 peak_backlog_bytes=298512 played_ms=2602 queued_bytes=0 reserved_bytes=0 sent_bytes=192288",
|
||||
"2026-10-17 06:42:05 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=terminal_processed turn=live-turn-2 audio=none state=backlog_bytes=313632 elapsed_ms=17926 lock_wait_ms=0 peak_backlog_bytes=313632 terminal_cancelled=0 terminal_completed=1 terminal_limited=0",
|
||||
"2026-10-17 06:42:10 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=audio_discard_interruption turn=live-turn-2 audio=live-audio-f023853c650f4b0d8a363321863cde31 state=backlog_bytes=97056 credit_bytes=72000 discarded_bytes=25056 elapsed_ms=22300 generated_bytes=325632 peak_backlog_bytes=313632 played_ms=4762 queued_bytes=25056 reserved_bytes=0 sent_bytes=300576",
|
||||
"2026-10-17 06:42:10 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=turn_interrupted_sent turn=live-turn-2 audio=none state=authority_ms=0 backlog_bytes=72000 elapsed_ms=22306 emit_ms=5 peak_backlog_bytes=313632 queued_controls=1",
|
||||
"2026-10-17 06:42:11 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=truncate_acknowledged turn=live-turn-2 audio=live-audio-f023853c650f4b0d8a363321863cde31 state=backlog_bytes=68160 credit_bytes=68160 elapsed_ms=23309 generated_bytes=325632 peak_backlog_bytes=313632 played_ms=4842 queued_bytes=0 reserved_bytes=0 sent_bytes=300576",
|
||||
"2026-10-17 06:42:22 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=terminal_processed turn=live-turn-3 audio=none state=backlog_bytes=627984 elapsed_ms=34142 lock_wait_ms=0 peak_backlog_bytes=635394 terminal_cancelled=0 terminal_completed=1 terminal_limited=0",
|
||||
"2026-10-17 06:42:33 [INFO] [app.modules.voice.diagnostics] Voice trace session=bcc45066-2ddc-4182-8a48-043a571d2194 stage=audio_ended_sent turn=live-turn-3 audio=none state=authority_ms=7 backlog_bytes=62496 elapsed_ms=45903 emit_ms=0 peak_backlog_bytes=635394 queued_controls=0"
|
||||
],
|
||||
"engine": "stopped_after_attempt_caps_reached",
|
||||
"asr_observations": [
|
||||
{
|
||||
"intended": "?? ????",
|
||||
"reported_transcript": "?????"
|
||||
},
|
||||
{
|
||||
"intended": "?? ??? ???????",
|
||||
"reported_transcript": "?? ??? ??? ????"
|
||||
}
|
||||
],
|
||||
"latency": [
|
||||
{
|
||||
"turn": 1,
|
||||
"speech_start_to_audio_started_ms": 7704,
|
||||
"user_transcript_to_audio_started_ms": 4128,
|
||||
"assistant_first_transcript_to_audio_started_ms": 2319,
|
||||
"stt_headers_seconds": 2.36,
|
||||
"tts_headers_seconds": 2.287
|
||||
},
|
||||
{
|
||||
"turn": 2,
|
||||
"speech_start_to_audio_started_ms": 5552,
|
||||
"user_transcript_to_audio_started_ms": 3378,
|
||||
"assistant_first_transcript_to_audio_started_ms": 2386,
|
||||
"stt_headers_seconds": 1.472,
|
||||
"tts_headers_seconds": 2.332
|
||||
},
|
||||
{
|
||||
"turn": 3,
|
||||
"speech_start_to_audio_started_ms": 10531,
|
||||
"user_transcript_to_audio_started_ms": 4518,
|
||||
"assistant_first_transcript_to_audio_started_ms": 3404,
|
||||
"stt_headers_seconds": 5.119,
|
||||
"tts_headers_seconds": 3.358
|
||||
}
|
||||
],
|
||||
"latency_limits": "Server event timings, not browser audible onset; start-to-audio includes user speech and endpointing. Transcript roles inferred from native event ordering; trace does not log roles."
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
# Windows real browser interruption ? 2026-10-17
|
||||
|
||||
Status: **intentional playback interruption and continuation passed; Phase3/4 remain open**.
|
||||
|
||||
The user spoke over two assistant answers and explicitly confirmed both cuts were intentional and no old audio returned. Actual API trace for session `bcc45066-2ddc-4182-8a48-043a571d2194` records two playback discards, two interruption events and two matching context-repair acknowledgements. Each underlying response had already completed generation before the interruption; this is real completed-but-unplayed interruption evidence, not real active-generation cancellation evidence. Third response completed and playback reached14336ms. Normal close HTTP200; no session diagnostic error was found.
|
||||
|
||||
The transcript alone does not prove that a same-answer repetition was requested or preserved correctly. User ASR strings include malformed Persian; intended original utterances/audio are required before attributing or scoring errors. No spoken-original facts were invented and no pronunciation/model change was made.
|
||||
|
||||
All four admissions per STT/LLM/TTS were consumed (one startup and three user turns),12 total, all HTTP200. The completed engine was stopped to avoid another quota-denied session; API/frontend remain available. No budget increase, ledger reuse or audio tuning change. Memory prevention remains disabled per user.
|
||||
|
||||
Exact-ID lookup returned12 successful billing receipts: **$0.006186253** new actual cost. Prior exposure$0.704698199 remains held. Reconciled conservative exposure **$0.710884452**, leaving$0.289115548 before new reservations under the same$1 cap. Original live ledger is unchanged; this reconciliation belongs in the next exclusive carry. Private receipt file `.local-s2s-build/windows-browser-billing-02.json`. [Sanitized evidence](windows-live-interruption-20261017.json).
|
||||
|
||||
Remaining: clarify intended ASR utterances; real same-answer repeat and active-generation cancellation; approved corpus, bounded compatible embeddings/shared RAG, factual/source cases; bounded OpenAI comparison and restoration. Do not close either phase from this partial success.
|
||||
|
||||
## User-confirmed ASR and latency defects
|
||||
|
||||
The user confirmed intended utterances were ??? ????? and ??? ??? ????????; reported transcripts were malformed. These are now confirmed short-utterance transcription errors, not unscored guesses. Original audio was not retained for phonetic scoring.
|
||||
|
||||
Server speech-start to audio-started:7.704s,5.552s,10.531s. These include the user's speaking time and endpointing, not just model latency. First assistant transcript to audio-started:2.319s,2.386s,3.404s. User-transcript to audio-started:4.128s,3.378s,4.518s. Transcript roles are inferred from the native user/assistant-delta/assistant-done sequence; current trace records only event type. Browser audible onset was not measured.
|
||||
|
||||
Actual per-request upstream header timing: STT2.360/1.472/5.119s; TTS2.287/2.332/3.358s; LLM1.360/0.697/0.685s. First native audio receipt to browser audio-start event was14/19/13ms. Most of the observed text-to-first-audio gap aligns with upstream TTS response wait. Provider/model inference time versus networking cannot be separated by header timing alone. No evidence supports attributing these seconds to the frontend playback buffer.
|
||||
|
||||
Current configured STT is non-realtime Persian transcription; sequential STT/LLM/TTS stages add waits. Upstream default sentence batching is3; its contribution was not independently measured. `openai_tts_stream=false` is not evidence of fully buffered HTTP audio: the pinned handler already uses HTTP streaming/aiter_bytes, so flipping that flag blindly is not an established fix.
|
||||
|
||||
Latency and short-utterance ASR remain open acceptance defects. No speed/buffer/model change, image restart or paid request was made during this diagnosis. Next repair/evaluation should isolate endpointing/STT and upstream TTS first-audio delay with stage-level timing, preserving interruption/history and budget controls.
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"date": "2026-10-17",
|
||||
"scope": "actual native engine, fixture providers; no browser or human acceptance",
|
||||
"image": "sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1",
|
||||
"supervisor": {
|
||||
"mode": "normal_retention_active",
|
||||
"paid_calls": 0,
|
||||
"external_network": "none",
|
||||
"start_windows_available_bytes": 5038092288,
|
||||
"start_vm_available_bytes": 6191755264,
|
||||
"abort": null,
|
||||
"exit_code": 0,
|
||||
"elapsed_seconds": 35.555,
|
||||
"minimum_windows_available_bytes": 4111507456,
|
||||
"minimum_vm_available_bytes": 4471754752
|
||||
},
|
||||
"result": {
|
||||
"active_retention_verified": true,
|
||||
"retention_verified": true,
|
||||
"client_error": null,
|
||||
"normal_complete": true,
|
||||
"unit_released": true,
|
||||
"fixture_cancelled": true,
|
||||
"mismatch_rejected": true,
|
||||
"intent_correlated": true,
|
||||
"runtime_state": "stopped",
|
||||
"paid_calls": 0,
|
||||
"events": {
|
||||
"session.created": 1,
|
||||
"session.updated": 3,
|
||||
"input_audio_buffer.speech_started": 1,
|
||||
"input_audio_buffer.speech_stopped": 1,
|
||||
"input_audio_buffer.committed": 1,
|
||||
"conversation.item.created": 1,
|
||||
"conversation.item.input_audio_transcription.completed": 1,
|
||||
"response.created": 3,
|
||||
"response.output_item.added": 3,
|
||||
"response.content_part.added": 3,
|
||||
"response.output_audio_transcript.delta": 3,
|
||||
"response.output_audio.delta": 7,
|
||||
"response.output_audio.done": 3,
|
||||
"response.output_audio_transcript.done": 3,
|
||||
"response.content_part.done": 3,
|
||||
"response.output_item.done": 3,
|
||||
"response.done": 3,
|
||||
"s2s.history.retained": 2
|
||||
},
|
||||
"final_cleanup": {
|
||||
"stage": "close",
|
||||
"cleanup": {
|
||||
"gateway_shutdown": 0,
|
||||
"gateway_close": 0,
|
||||
"runtime_stop": 0,
|
||||
"gateway_join": 0,
|
||||
"gateway_alive": 0
|
||||
},
|
||||
"request_counts": {
|
||||
"accepted": 10,
|
||||
"/v1/audio/transcriptions": 2,
|
||||
"released": 10,
|
||||
"/v1/chat/completions": 4,
|
||||
"/v1/audio/speech": 4,
|
||||
"shutdown_pending": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"stdout_sha256": "cccca7b80b93822825e2be7482869b6809109100a1b12cb8e42ea2337e5ddfd5"
|
||||
}
|
||||
Reference in New Issue
Block a user