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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
trap - EXIT
test "$(docker compose --env-file .env.example exec -T postgres \
psql -U rememberstack -d rememberstack -Atc \
'SELECT version_num FROM alembic_version')" = 'p9_26_0047'
'SELECT version_num FROM alembic_version')" = 'p9_27_0048'
test "$(docker compose --env-file .env.example exec -T postgres \
psql -U rememberstack -d rememberstack -Atc \
'SELECT count(*) FROM deployments')" = '1'
Expand Down
18 changes: 12 additions & 6 deletions benchmarks/locomo/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RS-LoCoMo-Full-v22 setup
# RS-LoCoMo-Full-v23 setup

This directory contains the unshipped full-system LoCoMo adapter. It does not vendor or
auto-download LoCoMo. Supply the exact pinned `locomo10.json` only after confirming its
Expand All @@ -16,12 +16,12 @@ The safe first command is local and makes no API or model call:
uv run --extra benchmark python -m benchmarks.locomo prepare \
--dataset /absolute/path/locomo10.json \
--tier smoke \
--protocol full-v22 \
--protocol full-v23 \
--output .benchmark-runs/locomo-smoke
```

The harness validates the pinned bytes, renders session documents, and fingerprints the
eight-question smoke plan. `--protocol` is prepare-only; `full-v22` is the one
eight-question smoke plan. `--protocol` is prepare-only; `full-v23` is the one
current-system protocol, and every later stage reads that immutable choice from
`run.json`. Do not run remote stages until reviewing
[`locomo_benchmark_design.md`](../../plan/designs/locomo_benchmark_design.md).
Expand Down Expand Up @@ -64,6 +64,12 @@ call sees the complete bounded candidate snapshot and returns a supplied
candidate id or `new`. There is no insufficient-evidence result or
confidence-routed frontier call.

V23 fingerprints D107 WP-T.0b: the query space exposes the same canonical
half-open bounds as `memory_v1.canonical_bounds` and `claims_canonical`, and
`examples.claims_as_of` overlaps those bounds and counts unknown precision by
precision alone. Ingestion, adjudication, and the library `claims_as_of` path
are those of v22; the surface manifest hash rolls.

V22 fingerprints D107 WP-T.0a: the observation adjudicator and `claims_as_of`
compare canonical half-open bounds (a day is the whole calendar day, an
instant a non-empty point, adjacent units do not overlap); everything else is
Expand Down Expand Up @@ -157,9 +163,9 @@ Pass the resulting
with `--p3-root`. The runner rejects a mount whose `.snapshot-version` differs
from readiness.

## Gemma 4 on Vertex as the answer agent (`full-v22-gemma-vertex`)
## Gemma 4 on Vertex as the answer agent (`full-v23-gemma-vertex`)

`full-v22-gemma-vertex` is a *variant* of `full-v22`, not a new benchmark
`full-v23-gemma-vertex` is a *variant* of `full-v23`, not a new benchmark
identity: every pin is identical -- ingestion bindings, prompts, tool catalog,
budgets, temperature, and the frozen Luna judge -- except that the answer
agent is `google/gemma-4-26b-a4b-it-maas`, Google's managed Gemma 4 26B-A4B
Expand Down Expand Up @@ -188,7 +194,7 @@ Prepare it explicitly; every later stage reads the immutable choice:
uv run --extra benchmark python -m benchmarks.locomo prepare \
--dataset /absolute/path/locomo10.json \
--tier smoke \
--protocol full-v22-gemma-vertex \
--protocol full-v23-gemma-vertex \
--output .benchmark-runs/locomo-gemma-smoke
```

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/locomo/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""The pinned RS-LoCoMo-Full-v22 benchmark adapter."""
"""The pinned RS-LoCoMo-Full-v23 benchmark adapter."""
2 changes: 1 addition & 1 deletion benchmarks/locomo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
prog="python -m benchmarks.locomo",
description=(
"RS-LoCoMo-Full-v22: prepare is local; ingest/answer/judge require "
"RS-LoCoMo-Full-v23: prepare is local; ingest/answer/judge require "
"explicit execution acknowledgements"
),
)
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/locomo/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Typed values for the full-system RS-LoCoMo-Full-v22 protocol."""
"""Typed values for the full-system RS-LoCoMo-Full-v23 protocol."""

from __future__ import annotations

Expand Down Expand Up @@ -31,8 +31,8 @@
Category = Literal[1, 2, 3, 4, 5]
RetainedCategory = Literal[1, 2, 3, 4]
Tier = Literal["smoke", "development", "publication"]
ProtocolKey = Literal["full-v22", "full-v22-gemma-vertex"]
ProtocolName = Literal["RS-LoCoMo-Full-v22", "RS-LoCoMo-Full-v22-GemmaVertex"]
ProtocolKey = Literal["full-v23", "full-v23-gemma-vertex"]
ProtocolName = Literal["RS-LoCoMo-Full-v23", "RS-LoCoMo-Full-v23-GemmaVertex"]
SourceTimezoneBasis = Literal["assumed_utc"]
AnswerAgentModel = Literal["openai/gpt-5.6-luna", "google/gemma-4-26b-a4b-it-maas"]
JudgeModel = Literal["openai/gpt-5.6-luna"]
Expand Down Expand Up @@ -126,7 +126,7 @@ class QuestionManifest(FrozenModel):
class RunConfiguration(FrozenModel):
"""Immutable identity of one prepared benchmark run."""

protocol_name: ProtocolName = "RS-LoCoMo-Full-v22"
protocol_name: ProtocolName = "RS-LoCoMo-Full-v23"
adapter_version: NonEmpty
prepared_at: datetime
repository_revision: NonEmpty
Expand Down Expand Up @@ -477,7 +477,7 @@ class SessionDiagnosticSummary(FrozenModel):
class RunSummary(FrozenModel):
"""Publication-ready local aggregate with no hidden denominator."""

protocol_name: ProtocolName = "RS-LoCoMo-Full-v22"
protocol_name: ProtocolName = "RS-LoCoMo-Full-v23"
protocol_fingerprint: NonEmpty
tier: Tier
questions: int = Field(ge=1)
Expand Down
22 changes: 11 additions & 11 deletions benchmarks/locomo/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from rememberstack.model import Envelope
from rememberstack.model import ToolDescriptor

PROTOCOL_NAME: Final = "RS-LoCoMo-Full-v22"
DEFAULT_PROTOCOL_KEY: Final = "full-v22"
ADAPTER_VERSION: Final = "locomo-full-adapter-2026.09-canonical-bounds-v22"
PROTOCOL_NAME: Final = "RS-LoCoMo-Full-v23"
DEFAULT_PROTOCOL_KEY: Final = "full-v23"
ADAPTER_VERSION: Final = "locomo-full-adapter-2026.09-query-space-canonical-bounds-v23"
MAX_TOOL_CALLS: Final = 8
MAX_AGENT_CALLS: Final = 9
ANSWER_READER_RETRY_BUDGET: Final = 2
Expand All @@ -45,7 +45,7 @@
EXPECTED_DOCUMENT_BINDING_GENERATION: Final = "document-t0-v1"

EXPECTED_SURFACE_MANIFEST_HASH: Final = (
"3583f86ac5bb883481ba2cf4d9e7a0da1ac5e650ada140b97998fe273aa7edeb"
"c7a7c0e5bfc9126ba1d7ed7bedcf2489a8537393801b4288742fdbd29079539e"
)
EXPECTED_PIPELINE_STAGES: Final = (
"convert",
Expand Down Expand Up @@ -118,12 +118,12 @@
JUDGE_MODEL: Final = "openai/gpt-5.6-luna"
JUDGE_REASONING_EFFORT: Final = "none"
TEMPERATURE: Final = 0.0
GEMMA_VERTEX_PROTOCOL_NAME: Final = "RS-LoCoMo-Full-v22-GemmaVertex"
GEMMA_VERTEX_PROTOCOL_KEY: Final = "full-v22-gemma-vertex"
GEMMA_VERTEX_PROTOCOL_NAME: Final = "RS-LoCoMo-Full-v23-GemmaVertex"
GEMMA_VERTEX_PROTOCOL_KEY: Final = "full-v23-gemma-vertex"
GEMMA_VERTEX_ANSWER_AGENT_MODEL: Final = "google/gemma-4-26b-a4b-it-maas"
"""Gemma 4 26B-A4B IT served by Google as a managed open model (MaaS).

The variant protocol keeps every v22 pin -- ingestion bindings, prompts,
The variant protocol keeps every v23 pin -- ingestion bindings, prompts,
tool catalog, budgets, judge -- and swaps only the answer agent to this model
on Vertex, with thinking deliberately pinned off and the answer step pinned as
`DiscriminatedAnswerAgentStep`, the
Expand Down Expand Up @@ -235,8 +235,8 @@ class LoCoMoProtocol:
"""Which adapter serves the judge; kept on OpenRouter for comparability."""


_FULL_V22 = LoCoMoProtocol(
key="full-v22",
_FULL_V23 = LoCoMoProtocol(
key="full-v23",
name=PROTOCOL_NAME,
answer_agent_model=ANSWER_AGENT_MODEL,
judge_model=JUDGE_MODEL,
Expand All @@ -257,7 +257,7 @@ class LoCoMoProtocol:
answer_word_cap=None,
)

_FULL_V22_GEMMA_VERTEX = LoCoMoProtocol(
_FULL_V23_GEMMA_VERTEX = LoCoMoProtocol(
key=GEMMA_VERTEX_PROTOCOL_KEY,
name=GEMMA_VERTEX_PROTOCOL_NAME,
answer_agent_model=GEMMA_VERTEX_ANSWER_AGENT_MODEL,
Expand All @@ -282,7 +282,7 @@ class LoCoMoProtocol:
)

PROTOCOL_REGISTRY: Final[Mapping[ProtocolKey, LoCoMoProtocol]] = MappingProxyType(
{_FULL_V22.key: _FULL_V22, _FULL_V22_GEMMA_VERTEX.key: _FULL_V22_GEMMA_VERTEX}
{_FULL_V23.key: _FULL_V23, _FULL_V23_GEMMA_VERTEX.key: _FULL_V23_GEMMA_VERTEX}
)


Expand Down
10 changes: 5 additions & 5 deletions benchmarks/locomo/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def ingest_sample(
_require_current_ingest_bindings(model_bindings=build.model_bindings)
if build.document_binding_generation != EXPECTED_DOCUMENT_BINDING_GENERATION:
raise ExecutionGuardError(
"deployment document binding generation differs from RS-LoCoMo-Full-v22"
"deployment document binding generation differs from RS-LoCoMo-Full-v23"
)
_require_current_query_surface(context=context, client=client)
_require_exact_live_ingests(
Expand Down Expand Up @@ -576,7 +576,7 @@ def answer_sample(
):
raise ExecutionGuardError(
"the deployment did not report the exact completed"
" RS-LoCoMo-Full-v22 pipeline, live graph, and fresh P3 projection"
" RS-LoCoMo-Full-v23 pipeline, live graph, and fresh P3 projection"
)
_require_serving_revision(context=context, readiness=readiness)
prior_readiness = context.state.readiness.get(sample_id)
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def _validate_run(
"""Recompute immutable run identity before any local or remote stage."""
selected_protocol = protocol_for_name(configuration.protocol_name)
if configuration.dataset_sha256 != DATASET_SHA256:
raise BenchmarkRunError("run dataset hash is not RS-LoCoMo-Full-v22")
raise BenchmarkRunError("run dataset hash is not RS-LoCoMo-Full-v23")
if item_ids_hash(item_ids=manifest.item_ids) != manifest.item_ids_sha256:
raise BenchmarkRunError("run manifest item hash changed")
if manifest_bytes_hash(manifest=manifest) != configuration.manifest_sha256:
Expand All @@ -1210,7 +1210,7 @@ def _validate_run(
if manifest.tier != configuration.tier:
raise BenchmarkRunError("run manifest tier changed")
if configuration.dataset_commit != DATASET_COMMIT:
raise BenchmarkRunError("run dataset commit is not RS-LoCoMo-Full-v22")
raise BenchmarkRunError("run dataset commit is not RS-LoCoMo-Full-v23")
if configuration.adapter_version != ADAPTER_VERSION:
raise BenchmarkRunError("run adapter version differs from current code")
if _models_hash(values=documents) != configuration.documents_sha256:
Expand Down Expand Up @@ -1468,7 +1468,7 @@ def _require_current_ingest_bindings(*, model_bindings: dict[str, str]) -> None:
if model_bindings.get(name) != expected.get(name)
)
raise ExecutionGuardError(
"deployment ingest model bindings differ from RS-LoCoMo-Full-v22: "
"deployment ingest model bindings differ from RS-LoCoMo-Full-v23: "
+ ", ".join(mismatches)
)

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/locomo/sharding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ as source-derived data.
| --- | ---: | --- |
| `LOCOMO_PYTHON` | `.venv/bin/python` | repository virtual-environment Python |
| `LOCOMO_TIER` | `publication` | prepared manifest tier |
| `LOCOMO_PROTOCOL` | `full-v22` | prepare-time protocol key |
| `LOCOMO_PROTOCOL` | `full-v23` | prepare-time protocol key |
| `LOCOMO_MOUNT_ROOT` | `$RUN_DIR/.mounts` | host/container-identical P3 mount root |
| `LOCOMO_MAX_DOCUMENTS` | `100` | per-sample ingest authorization |
| `LOCOMO_MAX_QUESTIONS` | `1540` | run-absolute answer item authorization |
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/locomo/sharding/run_shard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ run_dir=$2
dataset_path=$3
python_bin=${LOCOMO_PYTHON:-.venv/bin/python}
tier=${LOCOMO_TIER:-publication}
protocol=${LOCOMO_PROTOCOL:-full-v22}
protocol=${LOCOMO_PROTOCOL:-full-v23}
mount_root=${LOCOMO_MOUNT_ROOT:-$run_dir/.mounts}
max_documents=${LOCOMO_MAX_DOCUMENTS:-100}
max_questions=${LOCOMO_MAX_QUESTIONS:-1540}
Expand Down Expand Up @@ -59,7 +59,7 @@ backup_python() {
"$python_bin" "$@"
}

# RS-LoCoMo-Full-v22's non-secret ingest identity. Override ambient self-host
# RS-LoCoMo-Full-v23's non-secret ingest identity. Override ambient self-host
# defaults so every shard runs the exact Luna/Qwen pipeline the protocol checks.
export REMEMBERSTACK_STRUCTURER_MODEL=openai/gpt-5.6-luna
export REMEMBERSTACK_SKELETON_CHECK_MODEL=openai/gpt-5.6-luna
Expand Down
19 changes: 14 additions & 5 deletions plan/designs/locomo_benchmark_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
> assured surface rolls this protocol; the sequencing is
> `plan/plans/temporal_clocks.md`. Contract: `temporal_clocks_design.md` §6–§8.

> **Binding D107 amendment, WP-T.0a (2026-09-03).** The current protocol is
> **Binding D107 amendment, WP-T.0b (2026-09-04).** The current protocol is
> `RS-LoCoMo-Full-v23`. It retains v22's dataset, rendered documents, models,
> tools, budgets, prompts, scoring, and ingest component versions. The query
> space now publishes `memory_v1.canonical_bounds` and `claims_canonical`, and
> `examples.claims_as_of` overlaps the half-open canonical window and counts
> unknown precision by precision alone (audit 4.21). The surface manifest
> hash, protocol identity, and fingerprint roll; ingestion provenance and the
> library `claims_as_of` result set do not.

> **Historical D107 amendment, WP-T.0a (2026-09-03).** The WP-T.0a protocol was
> `RS-LoCoMo-Full-v22`. It retains v21's dataset, rendered documents, models,
> tools, budgets, prompts, and scoring. Its pinned `adjudicate_observations`
> component version now carries canonical half-open bounds (D107 §5): the
Expand Down Expand Up @@ -109,7 +118,7 @@ and spend ceiling.
## 2. Fixed protocol

```text
protocol RS-LoCoMo-Full-v22
protocol RS-LoCoMo-Full-v23
dataset commit 3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376
dataset SHA-256 79fa87e90f04081343b8c8debecb80a9a6842b76a7aa537dc9fdf651ea698ff4
categories 1, 2, 3, 4
Expand Down Expand Up @@ -681,7 +690,7 @@ compatibility form. The response contains:
same-snapshot proven-absent-anchor execution checks when live graph is required;
- an overall `ready` that is the conjunction of the requested capabilities;
- every non-secret ingestion/query model binding; and
- the non-secret `document_binding_generation`, which Full-v22 requires to be
- the non-secret `document_binding_generation`, which Full-v23 requires to be
exactly `document-t0-v1` and stores in `run.json` plus the protocol
fingerprint.

Expand Down Expand Up @@ -827,11 +836,11 @@ Local preparation:
uv run --extra benchmark python -m benchmarks.locomo prepare \
--dataset /absolute/path/locomo10.json \
--tier smoke \
--protocol full-v22 \
--protocol full-v23 \
--output .benchmark-runs/locomo-smoke
```

`--protocol` exists only on `prepare`. The sole choice is `full-v22`; ingest,
`--protocol` exists only on `prepare`. The sole choice is `full-v23`; ingest,
answer, judge, and summarize read it from the prepared run and expose no
protocol override.

Expand Down
30 changes: 30 additions & 0 deletions src/rememberstack/core/open_query_prose.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,31 @@
ORDER BY g.hops, g.relation_ids;\
"""

#: Purpose string for the shipped ``examples.claims_as_of`` identity.
CLAIMS_AS_OF_PURPOSE: Final = (
"Claims whose canonical world-time window overlaps an inclusive interval;"
" unknown-precision claims are counted by precision, not by bounds"
)

#: SQL body for the shipped ``examples.claims_as_of`` identity (byte-stable).
#: Overlap is half-open on ``canon_start`` / ``canon_end``; the caller's
#: inclusive ``to`` becomes ``to + 1 µs`` so ``($1, $1)`` is a point query.
CLAIMS_AS_OF_SQL: Final = (
"SELECT c.claim_id, c.claim_text, c.source_handle,"
" c.claim_valid_from, c.claim_valid_until, c.claim_valid_precision,"
" c.canon_start, c.canon_end,"
" ("
" SELECT count(*) FROM claims_canonical AS u"
" WHERE u.claim_valid_precision = 'unknown'"
" ) AS unknown_precision_excluded"
" FROM claims_canonical AS c"
" WHERE c.claim_valid_precision <> 'unknown'"
" AND c.canon_start < ($2::timestamptz + '1 microsecond'::interval)"
" AND (c.canon_end IS NULL OR c.canon_end > $1::timestamptz)"
" ORDER BY c.claim_valid_from DESC, c.claim_id"
" LIMIT 50"
)

#: Purpose string for the shipped ``examples.claims_verbatim`` identity.
CLAIMS_VERBATIM_PURPOSE: Final = (
"Claims as asserted, nominated semantically and joined to live testimony"
Expand All @@ -145,6 +170,11 @@
HONESTY_WARNINGS: Final[tuple[str, ...]] = (
"Claims are immutable source testimony; they do not answer current-truth"
" questions.",
"Claim world-time overlap is half-open on claims_canonical.canon_start /"
" canon_end. memory_v1.canonical_bounds is a top-level FROM function that"
" canonicalises an explicit window; it is not a row expression. Unknown-"
"precision claims have no interval and are counted by precision, never by"
" bounds.",
"Empty SQL is untyped exploratory_tabular: a view's source grain is never"
" a claim about an arbitrary outer query's result grain.",
"Graph helper absence is bounded by the disclosed traversal budgets; inspect"
Expand Down
Loading
Loading