Skip to content

fix: repair master defects blocking the fresh build - #5709

Merged
Sinity merged 5 commits into
masterfrom
claude/masterfix
Sep 28, 2026
Merged

Sinity merged 5 commits into
masterfrom
claude/masterfix

Conversation

@Sinity

@Sinity Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a batch of defects that fail on master and would affect the fresh build.

Problem (evidence, reproduced on origin/master)

  • Read authorizer regression: open_read_connection re-applied read pragmas after open_readonly_connection installed the read authorizer, so every call failed with sqlite3.DatabaseError: not authorized (search, status, all of tests/integration/test_workflows.py). Plain parameterized sibling ATTACHes on profiled readers were denied the same way.
  • Grok exports never ingested (polylogue-5yig1): the streamed Grok export route wrote its shard to the preparation directory instead of the worker's attempt directory; the ownership check deferred the path, and canonical ingest refused with deferred=1 forever. The deferral named no cause.
  • Selected session profiles never published (polylogue-bh8v1): converge_selected computed a profile whose prerequisites (summary, usage rollup) had never been converged, so the publisher refused it and the outcome was misreported as binding_moved.
  • Retained raw replay refused: retained JSON preparation bound a null enrichment digest when no enrichment ran, while the publisher always recomputes it, so publication failed with "enrichment evidence changed"; SchemaSkewError could not be unpickled across the worker pool, surfacing as a dead worker.
  • Import cycle embedding_write -> embeddings -> derivation -> embedding_write.
  • raw_existence_changes (from fix(storage): bound live frontier admission with journals #5657) had no excision-carrier declaration, so session excision refused.
  • Stale or incomplete tests: otel-genai had no unknown-outcome routes, schema drift used the v1 floor, the converger fake lacked derivation_barrier, the judged-memory loop mutated without a daemon, and the deadline test froze the process-wide monotonic clock (hanging the worker pool).

Solution

  • Readers apply pragmas only inside the factory, before the authorizer; attach_database routes a query-only reader through attach_readonly_database (read-only URI) and is used by sibling/embedding/source-tier attaches.
  • The Grok shard uses the attempt directory; an artifact outside its attempt directory now fails the path visibly (only an OS error while checking stays retryable).
  • converge_selected converges the exact prerequisite_keys first and names a refused publication publication_refused.
  • The JSON worker binds the same evidence value the publisher recomputes; SchemaSkewError defines __reduce__.
  • polylogue.storage.embeddings re-exports nothing; the one consumer imports the submodule.
  • raw_existence_changes is a tombstone carrier (content-free, and excision's own delete appends to it).
  • The pass deadline reads a dedicated _pass_clock.

Verification

Focused devtools test selections in this worktree; results in the review thread once the final run completes. devtools schema closure noted below.

Residuals

None known beyond those listed in follow-up comments.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-28T07:31:27.336538Z 79995fb New commits
ℹ️ 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.

@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: 604c539299

ℹ️ 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 polylogue/daemon/convergence.py Resolved
Comment thread polylogue/daemon/convergence.py Resolved
@Sinity
Sinity enabled auto-merge (squash) September 28, 2026 02:31
@Sinity

Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Both Codex P2 threads on ae1ebdd are fixed in eba2df2 and resolved: (1) each prerequisite publication re-decides the primary-publication barrier inside its writer admission, like the target's own publish, and a held prerequisite returns the target pending with the barrier reason; (2) stop_requested() is checked after each prerequisite compute and before its writer admission, so a stop returns the target pending without mutating derived state.

Sinity and others added 5 commits September 28, 2026 09:23
- Profiled readers no longer re-assign pragmas after the read authorizer
  is installed, and sibling/embedding/source-tier attachments go through
  attach_database, read-only on a query-only reader. open_read_connection
  (search, status, workflows) failed every call with 'not authorized'.
- The Grok streamed-export route wrote its shard outside the worker's
  attempt directory, so every Grok export was deferred forever; a worker
  artifact that escapes its attempt directory now fails the path visibly.
- Selected session-profile convergence converges the exact prerequisite
  keys (summary, usage rollup) before publishing, and names a refused
  publication instead of reporting binding_moved.
- Retained JSON preparation binds the same enrichment evidence the
  publisher recomputes, so a pass that enriched nothing no longer fails
  publication with 'enrichment evidence changed'; SchemaSkewError pickles
  across the worker pool boundary.
- The embeddings package no longer re-exports submodules, breaking the
  embedding_write -> embeddings -> derivation import cycle.
- Tests: otel-genai unknown-outcome routes, a newer-tier schema-drift
  case, the converger fake's derivation_barrier keyword, and a read-only
  attachment regression.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ne clock

The preamble loop judges a candidate, a durable mutation only the
resident daemon writes. The raw-convergence deadline test froze the
process-wide monotonic clock, which also froze the retained worker
pool's waits; the pass deadline now reads its own clock.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ent routes

The periodic retry drains through _drain_convergence_debt_backlog (#5692),
so patching the single-page helper let the real drain run. Status is served
by the daemon (#5550); with none running it reports unavailable rather than
materialization counts, which the find/analyze/readiness surfaces still
compute.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
helper_summary now takes embedding_status_payload from
polylogue.cli.shared.embed_stats instead of reaching into storage, so the
layering gate sees no new cli->storage import; the stale baseline entry is
pruned. The otel-genai fixture builder annotates its loaded JSON so mypy
accepts the return.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
@Sinity
Sinity merged commit c1e9434 into master Sep 28, 2026
3 checks passed
@Sinity
Sinity deleted the claude/masterfix branch September 28, 2026 07:37
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