Metadata-Version: 2.5
Name: longhouse
Version: 0.1.47
Summary: Keep Claude Code, Codex CLI, and Antigravity CLI sessions in one searchable timeline.
Author-email: David Rose <david.github@drose.io>
License: Apache-2.0
Requires-Python: >=3.12
Requires-Dist: alembic>=1.13.0
Requires-Dist: anthropic>=0.40.0
Requires-Dist: boto3>=1.35.0
Requires-Dist: click<8.2,>=8.1.8
Requires-Dist: cryptography>=44.0.3
Requires-Dist: fastapi>=0.110.0
Requires-Dist: google-auth>=2.40.3
Requires-Dist: httpx[http2]>=0.27.0
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: mcp>=1.0
Requires-Dist: numpy>=2.4.1
Requires-Dist: onnxruntime>=1.28.0
Requires-Dist: openai>=2.14.0
Requires-Dist: opentelemetry-api>=1.41.0
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.41.0
Requires-Dist: opentelemetry-sdk>=1.41.0
Requires-Dist: packaging>=24.2
Requires-Dist: prometheus-client>=0.19.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pyjwt[crypto]>=2.8.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-multipart>=0.0.20
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.32.3
Requires-Dist: rich>=13.0.0
Requires-Dist: sqlalchemy>=2.0.38
Requires-Dist: sse-starlette>=1.6.5
Requires-Dist: tiktoken>=0.7.0
Requires-Dist: tokenizers>=0.23.1
Requires-Dist: typer>=0.9.0
Requires-Dist: uvicorn>=0.24.0
Requires-Dist: watchdog>=6.0.0
Requires-Dist: websockets>=12.0
Requires-Dist: zstandard>=0.23.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: hypothesis>=6.100; extra == 'dev'
Requires-Dist: langchain-core>=1.2.5; extra == 'dev'
Requires-Dist: langchain-openai>=1.1.6; extra == 'dev'
Requires-Dist: pexpect>=4.9; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.25.3; extra == 'dev'
Requires-Dist: pytest-timeout>=2.3.1; extra == 'dev'
Requires-Dist: pytest-xdist>=3.6.1; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: vulture>=2.11; extra == 'dev'
Description-Content-Type: text/markdown

# Longhouse Backend

FastAPI backend and CLI package for Longhouse.

## Install

```bash
uv tool install longhouse
longhouse-server serve
```

Full docs and the recommended hosted/self-host flows live in the main repository README: https://github.com/cipher982/longhouse

## Repairing held interactions

The live catalog owns provider-wait lifecycle. Execution end revokes held
permissions and managed-push provider questions, but does not delete history or
expire durable Longhouse questions merely because activity is stale. Run-less
legacy exits are matched only to an unambiguous owning thread/run that started
before the exit; later executions remain untouched.

Catalog maintenance also repairs historical no-expiry waits, stale runtime
pointers, and run/connection rows contradicted by recorded execution exits.
Run this in the Runtime Host's environment so `catalogd_paths()` uses its active
live-store configuration. It talks to the single catalog writer, not SQLite:

```python
import json
from datetime import UTC, datetime
from zerg.catalogd.client import call_catalogd_sync
from zerg.services.catalogd_supervisor import catalogd_paths

report = call_catalogd_sync(
    catalogd_paths()[1],
    "interaction.expire_due.v2",
    params={"now": datetime.now(UTC).isoformat(), "dry_run": True},
    timeout_seconds=60,
)
print(json.dumps(report, indent=2))
```

Set `dry_run` to `False` to apply the currently evidenced repairs, or add
`session_id` to scope either operation to one session. Reports name affected
interactions and runs. Repeated application is idempotent. Neither this repair
nor normal lifecycle cleanup edits archive transcripts or activity timestamps.

## Repairing imported Cursor activity clocks

Older Cursor imports could use ingestion time as session activity. The engine
now reads provider metadata and matching managed turn receipts instead.
`longhouse-engine parse <agent-transcripts/...jsonl>` prints `last_activity`
from that same source resolver; a missing source clock is not evidence for a
historical correction.

After verifying the source clock, use the same catalog client with method
`storage.cursor.activity.repair.v2` and parameters `session_id`,
`expected_started_at`, `expected_last_activity_at` (the current stored values),
`source_started_at`, `source_last_activity_at` (the verified provider values),
`now`, and `dry_run`. Timestamps are ISO-8601. Preview with `dry_run=True`,
then apply with `False`. Both clocks are compared before writing, preventing
an older audit from overwriting concurrent updates. Source creation may move
earlier, never later, and must precede source activity. Source activity cannot
exceed the expected stored activity. This also repairs old imports that
fabricated both creation and activity clocks.
This corrects timeline recency without rewriting immutable transcript objects.
