Skip to content

docs: state the derived-tier identity regime that replaced delta classes - #4702

Merged
Sinity merged 1 commit into
masterfrom
schema/doc-truth
Sep 5, 2026
Merged

Sinity merged 1 commit into
masterfrom
schema/doc-truth

Conversation

@Sinity

@Sinity Sinity commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

CLAUDE.md and docs/internals.md described storage/sqlite/lifecycle.py, its per-version delta classes, and the index fast-forward executor as the current derived-tier schema regime. All three were deleted when the identity-hash regime landed. This replaces that text with what the code does now, and corrects the generated message_id formula in the four places that still carry the pre-identity_source form.

Problem

CLAUDE.md's "Schema regimes" paragraph and docs/internals.md lines 127-210 are what an agent reads to classify a schema change before editing, and they named a mechanism that no longer exists:

  • polylogue/storage/sqlite/lifecycle.py — gone
  • polylogue/storage/sqlite/archive_tiers/index_fast_forward_executor.py — gone
  • devtools/index_fast_forward.py — gone

Five further references cited the deleted module as the authority for individual version transitions. The practical cost is a wrong cost model: the old text says a derived-tier change is a cheap classified delta, when at head every derived-schema edit moves derived_schema_identity() and forces a full reconvergence.

Separately, messages.message_id gained n:/p: prefixes and a companion identity_source column. Four documents still showed COALESCE(native_id, position||'.'||variant_index), which is a load-bearing formula CLAUDE.md tells readers to know cold.

Solution

  • CLAUDE.md: state the two regimes as they are — durable tiers on numbered additive migrations, derived tiers on one identity hash over DDL plus the lowering/materializer/replay fingerprints, with reconvergence as the only remedy. Add the sentence that makes the cost visible: a derived-schema edit costs a full reconvergence. Add that durable DDL carries no enum-generated membership CHECK, since vocabulary now validates at the write boundary.
  • docs/internals.md: replace the derived-tier, fast-forward-executor and ownership-map blocks with the identity-hash regime; correct the two descriptions of what devtools verify schema-manifest enforces; drop the deleted-module citations from the version-history entries while keeping their semantic content.
  • Correct the message_id formula in CLAUDE.md, docs/schema.md and docs/material-protocol-v1.md, noting identity_source.

Classification

Metadata-only. No DDL, no migration, no tier version, no code. The existing durable archive at /realm/state/polylogue is untouched.

Verification

nix develop --command uv run devtools verify --quick

green, including gate schema-manifest ... ok and gate doc-commands ... ok.

Each deleted-path claim was checked against the filesystem rather than inferred: lifecycle.py, index_fast_forward_executor.py and devtools/index_fast_forward.py are all absent at HEAD. The replacement text's anchors were read at head — schema_identity.py:derived_schema_identity(), schema_bootstrap.py:assert_derived_schema_identity, verify_schema_manifest.py:_durable_ddl_evolution_violations.

Residual risk

Documentation only, so no runtime behavior changes. The remaining risk is the reverse of the one fixed: the version-history entries below the regime section still enumerate index versions 37-94, which describe derived archives the restart destroys. They are left in place here because several carry live semantic facts (which event kinds stopped materializing, which tables became views); pruning them is a judgment call that belongs with the restart, not with this correction.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid

CLAUDE.md and docs/internals.md still described the deleted
storage/sqlite/lifecycle.py, its per-version delta classes, and the
index fast-forward executor as the derived-tier schema regime. They are
the files an agent reads to classify a schema change before editing, so
the stale text routes work toward a mechanism that no longer exists.

Also corrects the generated message_id formula in four places: it grew
n:/p: prefixes and a companion identity_source column, and every copy
still showed the old COALESCE form.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 3b4d7068-7bf1-428c-8304-b6b3bdf6c44e


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T21:00:56.393011Z ef48daf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity enabled auto-merge (squash) September 5, 2026 20:54
@Sinity
Sinity merged commit 1a53a1f into master Sep 5, 2026
3 checks passed
@Sinity
Sinity deleted the schema/doc-truth branch September 5, 2026 20:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef48daf169

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/internals.md Resolved
Comment thread CLAUDE.md Resolved
Comment thread CLAUDE.md Resolved
Comment thread CLAUDE.md Resolved
Comment thread docs/internals.md Resolved
@Sinity

Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Codex review threads on this PR whose cited code is gone (checked against master at 23f91a5):

Resolving these threads.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at ef10e59):

Resolving the fixed, stale and refuted threads; tracked threads stay open.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at f88b4a6):

Resolving every thread listed; confirmed defects are fixed under the named bead.

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