Skip to content

D79 Wave 2: bottom-up summaries + placement (#165) - #170

Merged
fazpu merged 2 commits into
mainfrom
feat/d79-summaries
Jul 29, 2026
Merged

D79 Wave 2: bottom-up summaries + placement (#165)#170
fazpu merged 2 commits into
mainfrom
feat/d79-summaries

Conversation

@fazpu

@fazpu fazpu commented Jul 29, 2026

Copy link
Copy Markdown
Member

Wave 2 of 3 for #165 — bottom-up section summaries and the placement hint, per plan/designs/e0_files_design.md §4.1.

What ships

  • Summary seat REMEMBERSTACK_SUMMARY_MODEL (default z-ai/glm-4.7-flash): one-line summaries per section — leaves read their own direct blocks (oversized leaves shard at block grain), parents read their own blocks + child one-liners with balanced fan-in, the root reduction is one call with two fields (document summary + the D39 placement hint). Ceiling-driven reduction down to pairs; titles capped at every render site; a whitespace token estimate plus a hard character ceiling on every request; strict closed schemas with post-parse normalization (no max_length/pattern keywords that strict providers could 400 on).
  • Per-section cache keyed on block hashes + child rendered lines + model/prompt/params/version: an edited leaf re-summarizes only its ancestor chain (proven by counting provider calls); degraded generations' sidecars join the cache pool so repairs re-pay nothing that succeeded.
  • Generation identity is input/config identity only — model output hashes are OUT of the seed. First-write-wins genuinely holds (D12); a checker-only bump appends its check record and stops — zero summary calls, no minted generation, no pointer churn (test feeds different summary text under a different checker seat and asserts one generation, zero extra calls).
  • Failure degrades to null summaries/placement per subtree, provenance-visible, never failing the document; P3 consumes real placement (slugged, depth-capped) from the current generation only.

Review trail

Codex implemented; Grok-4.5 (2 MAJOR / 5 MINOR) and Opus (6 MAJOR / 5 MINOR) reviewed independently — Opus reproduced three degradations with measurements (a 3000-word heading nulling a document with zero calls; 208KB of CJK passing a 58-"token" count; count-driven reduction giving up). The consolidated fix round (Codex) addressed every finding; Grok re-reviewed the fix diff: APPROVE, confirming all seven majors non-vacuously fixed. Final review and adjudication by Claude (the input-identity seed formulation and the §2.4 schema strip were the final-reviewer calls).

Gate

ruff clean, pyright 0 errors, 1003 passed including the Postgres-gated suites. No migration. Benchmarks and the tool catalog untouched.

@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/rememberstack/model
  __init__.py
  sections.py
  src/rememberstack/profiles
  selfhost.py 391-397, 423-424
  src/rememberstack/spine
  document_catalog.py 244
  projection.py
  src/rememberstack/workers
  __init__.py
  e0.py 741, 1131, 1169
  e0_summary.py 389, 446, 462, 480, 489, 511, 513-515, 528, 539, 561, 580, 584, 598, 609, 611-626, 638-641, 651, 661, 850, 861, 872, 889, 901-911
Project Total  

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

@fazpu
fazpu merged commit a1f05e0 into main Jul 29, 2026
8 checks passed
@fazpu
fazpu deleted the feat/d79-summaries branch July 29, 2026 08:25
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.

1 participant