Skip to content

Measurement hardening: deterministic extraction, bounded transcripts, per-model reasoning effort (v5) - #162

Merged
fazpu merged 2 commits into
mainfrom
fix/measurement-hardening
Jul 27, 2026
Merged

Measurement hardening: deterministic extraction, bounded transcripts, per-model reasoning effort (v5)#162
fazpu merged 2 commits into
mainfrom
fix/measurement-hardening

Conversation

@fazpu

@fazpu fazpu commented Jul 27, 2026

Copy link
Copy Markdown
Member

Measurement hardening: deterministic extraction, bounded transcripts, per-model reasoning effort

Closes #154, #155, #156.

What

#154 — extraction is measurement, not creativity. Every extraction-class
ModelRequest (E0 structurer, E1 prefixer, E2 selection+Claimify, E3
normalizer, P1 fact labels, P2 community labels, resolver T4, observation and
supersession adjudicators) pins temperature=0.0. Gold-span coverage was
wandering 7/8 → 4/8 across identical-binding runs. An AST test discovers every
module under workers/ and spine/ (fixed lists rot) and fails closed on any
un-pinned site, including attribute-qualified spellings.

#156 — the transcript surface is recent-first bounded with a disclosed cap.
QueryEngine.transcript keeps the newest limit rows (default 40), always
sets the envelope truncation marker with exact totals, and the
identity_as_of recipe (v3) exposes an optional limit (minimum 1) so a
truncated history is recoverable through the public surface. The entity
transcript SQL gains a primary-key tie-breaker so the truncation boundary is
deterministic under batch inserts (same-timestamp rows).

#155 — per-model reasoning effort. REMEMBERSTACK_OPENROUTER_REASONING_EFFORT_MAP
(JSON object, model id → effort) overrides the global pin per model, so
flash-class models can run none while luna-class models think. Validated
strictly (allowed literals only, non-empty keys, empty string = unset),
forwarded through Compose x-app, and reported in canonical form by the
readiness bindings so the effective policy is measurement provenance.

Provenance consequences (review findings, applied)

  • Every generate-owning component version bumps (:temp0-1 generation):
    structurer, prefixer, extractor, normalizer, fact-label, resolver, both
    adjudicators, community detector. Temperature is a generation parameter;
    outputs made without the pin must not replay/skip under the pinned identity.
  • identity_as_of recipe v2 → v3: ON CONFLICT DO NOTHING would otherwise pin
    existing deployments to the pre-truncation descriptor. Upgrade test proves a
    persisted v2 row is superseded on re-seed.
  • Protocol v4 → v5: the tool-catalog hash changed (honest descriptor +
    limit parameter), so RS-LoCoMo-Full-v5 with a dated design note. The v4
    glm-4.7-flash smoke scores are not comparable forward.
  • New catalog hash: 34d2069ae37fabf033d2b1f0fae2ed9e7c1ad5c3f6e1fd14b2971344cd89c3a6.

Review trail

Grok-4.5 implemented the base branch; Codex (gpt-5.6-sol, xhigh) reviewed with
verdict REQUEST-CHANGES (5 MAJOR, 4 MINOR); this revision applies all nine
findings. Final review and adjustments by Claude. Consciously omitted: a
version-constants regression test (a hardcoded string-inequality test rots
instantly; the bump discipline stays review-enforced).

Gate

ruff format --check + ruff check + pyright (0 errors) + full pytest
including Postgres-gated suites — results in the checks below.

fazpu and others added 2 commits July 27, 2026 14:05
Pin extraction-class ModelRequest calls to temperature=0.0 so E/P1
measurement surfaces stop wandering across identical-binding runs
(#154). Bound transcript/identity_as_of to a recent-first default of 40
rows with explicit envelope truncation (#156). Add a per-model
REMEMBERSTACK_OPENROUTER_REASONING_EFFORT_MAP override on top of the
global effort pin so models that need effort=none can coexist with
reasoning models (#155).

Update the identity_as_of descriptor for honesty (catalog hash
recomputed) and record the transcript bound as a dated design
amendment.
…rt map

Codex review (REQUEST-CHANGES, 5 MAJOR / 4 MINOR) on the measurement-
hardening branch, all findings applied:

- Bump every generate-owning component version (:temp0-1 generations):
  temperature is a generation parameter; outputs made without the pin must
  not replay under the pinned identity. Pin the p2_analytics label call too.
- identity_as_of v2 -> v3 with an optional bounded `limit` parameter
  (minimum 1) so a truncated history is recoverable through the public
  surface; upgrade test proves a persisted v2 row is superseded despite
  ON CONFLICT DO NOTHING.
- Protocol RS-LoCoMo-Full-v4 -> v5: the tool-catalog hash changed, dated
  design note added; new hash 34d2069ae37f.
- Forward REMEMBERSTACK_OPENROUTER_REASONING_EFFORT_MAP through Compose
  x-app (it never reached containers) and report it canonically in the
  readiness model bindings.
- Deterministic entity-transcript truncation boundary (primary-key tie-
  breaker across both union arms).
- AST temperature test discovers all workers/ and spine/ modules and
  attribute-qualified ModelRequest spellings; effort-map tests assert our
  error messages and cover malformed env forms.

Gate: ruff format/check, pyright 0 errors, pytest 934 passed (incl.
Postgres-gated suites).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKENhTLJg1HqhbdwCmmkbc
@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/rememberstack/adapters
  openrouter.py
  src/rememberstack/adapters/testing
  model_provider.py
  src/rememberstack/profiles
  selfhost.py
  src/rememberstack/spine
  observation_adjudication.py 521-527
  resolver.py 235-241
  supersession.py
  src/rememberstack/surfaces
  query_engine.py 456
  src/rememberstack/workers
  e0.py
  e1.py
  e3.py
  p1.py
  p2_analytics.py
Project Total  

This report was generated by python-coverage-comment-action

@fazpu
fazpu merged commit 368ab4c into main Jul 27, 2026
6 checks passed
@fazpu
fazpu deleted the fix/measurement-hardening branch July 27, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extraction is nondeterministic run-to-run: gold-span coverage 7/8 → 4/8 under identical bindings

1 participant