Skip to content

Promote edge to stable: Polis 2.46.2 - #3467

Merged
colinmegill merged 4 commits into
stablefrom
edge
Nov 23, 2026
Merged

colinmegill merged 4 commits into
stablefrom
edge

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Release plan

Version: 2.46.2

Reason: no new selected migrations

Previous stable: 344be82b03570f780e95e44041e2aab4be536162

Candidate: 1346f631e3ace73871937d467fc8a28dbd4c30f2

release.txt additions:

  • none

Merge the reviewed version preparation into edge, then refresh this plan for the resulting edge SHA before merging the promotion with a merge commit.

colinmegill and others added 4 commits November 22, 2026 15:19
… comment but the moderated-out ones (#3462)

* Delphi shadow: two more comment rules, chosen per conversation

Every shadow run embeds every comment of its conversation and lays out,
clusters and names the comments of one rule. Until now the only rule was
participant_visible/1, what participants are shown. This adds two siblings:

- all_comments/1: every comment, unmoderated, moderated in and moderated out;
- all_but_moderated_out/1: every comment but the moderated-out ones,
  whatever strict moderation says.

Each rule is one function in the input bundle contract's table (RULES), with
its twin in polismath/selection.py and a golden file holding both languages
to the same comments and digest. A conversation's rule is chosen by two new
scheduler settings, DELPHI_SHADOW_ALL_COMMENTS and
DELPHI_SHADOW_ALL_BUT_MODERATED_OUT, lists of conversation codes read as
DELPHI_SHADOW_BENCHMARK is; a code in both is refused at startup by its
position. Listed in neither, a conversation keeps participant_visible/1, and
with both empty every run, admission and log line is what it was.

The rule is an input of the run: the scheduler resolves the lists on its read
login, asks for the census under the conversation's rule, and the admission's
key and run record (config_effective.selection and shadow.selection, digest
and count) follow from it. The selection digest carries the rule's name, so a
conversation moved to another rule is never taken as unchanged and runs again
at its next turn. No schema change; no new query on any pool the
participation path uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Delphi shadow: comment-rule lists add runs, each rule its own job

The two lists no longer choose a conversation's single rule; they add runs.
Every conversation the shadow runs is still run under participant_visible/1
exactly as before, with the same keys, state entries and log lines. A code
on DELPHI_SHADOW_ALL_COMMENTS or DELPHI_SHADOW_ALL_BUT_MODERATED_OUT (or on
both) also gets a run under that rule, after the sets' own runs. Each
(conversation, rule) is its own job:

- it publishes in its own scope (delphi:all_comments,
  delphi:all_but_moderated_out), so no rule's results replace another's;
- its "unchanged, no rerun needed" decision is read from its newest run in
  delphi_jobs, by the history index, never from the scheduler's state file;
- its admission key is the selection digest plus the newest run it follows.
  A crash and restart reuses the same key and job, and a selection that
  changed and changed back runs as a new job rather than getting the
  superseded one back from the queue's binding;
- a run of it still queued when the scheduler lost track of it is taken up
  and watched, not run a second time beside it;
- its rerun window is measured by the database's own clock.

The resolved codes only nominate. Each admission checks, in the census
snapshot, that a code of the list still names the conversation; when none
does, nothing is queued and the codes are resolved again. A code may now be
on both lists. A repeated code, or a second code of a conversation already on
the same list, is one run, counted in the rules log line. A failed resolution
no longer holds back any other run.

No schema change: the scope is free text in the existing admission
function, and the history is read from existing columns on the shadow's read
login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…dentical to the server's; no caller (#3463)

The minter issues anonymous, external-id and signed-in-account participant
tokens with the header, claims, order, types and expiry arithmetic the Node
server uses, signed with the key the process already loads. Nothing calls it:
no route, switch or writer changes, and every request is answered as before.

It refuses an empty conversation, issuer or audience, a user id at or below
zero, and an external id that is only blanks. No token, key or external id
is written to a log line, an error string or a Debug implementation.

A Jest test re-mints each recorded case with the server's own issuers on
every run and compares the signing bytes with the recording, so a change on
either side that alters the bytes fails a public test.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…pied to the shadow (#3464)

* participants: one participant_reply log line for a vote or comment copied to the shadow

The participant middleware writes one structured log line, after its
decision, for a POST /api/v3/votes or POST /api/v3/comments request that
carries nginx's X-Request-Id (32 lowercase hex, the rule the vote_reply
line applies): how the request identified itself, the token's
conversation against this one, whether this request inserted a users row
or the participant row, whether it wrote an xid binding or found one, the
kind of token it issued, and on a refusal which refusal. With the request
id, the route and the conversation number; never a user or participant
number, an xid, a token, an email, an address, a user agent or any text.

Logging only: each fact is a plain assignment where it becomes true, the
line is written in a finally after the reply or next(), with no await and
no database work, inside a try/catch that swallows everything. No status,
body, header, token, database write or ordering changes. Without the
request id, or on any other route, nothing is logged.

A Jest unit test drives the new anonymous person, a participant found by
its token, an external id bound and an external id found, plus a refusal,
asserting the exact line for each, that nothing is logged without the
request id, and that a throwing logger changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* participants: an account check that could not be made is logged as an error, not as the account refusal

The participant_reply line named every XID account error "xid_account" at
warn. The account check raises that error for two different things: a
refusal because the account is privileged (answered 403), and a database
failure while checking (answered 500, the person never classified). Both
lines were identical, so a comparison would count an outage as a policy
refusal. An account error answered with a status of 500 or above is now
"error", written at error; "xid_account" is kept for the refusal. Nothing
a request is answered changes, and no call is added or reordered: the
classifier reads the status of the error it already holds, inside the
line's own try.

The unit test of the line now also covers each refusal (the allow-list,
Treevite, the account refusal and the account check's failure, through
the real account check with only its database read mocked), the errors
passed on to the error handler, the second xid lookup race and the
participant insert race, a token that fails to sign, tokens of each kind
from another conversation, a token bound to another xid, a signed-in
account, a logger that throws on the line for every one of these, and
the fields left out before the conversation is resolved, with no input
copied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@colinmegill
colinmegill marked this pull request as ready for review November 23, 2026 03:18
@github-actions

Copy link
Copy Markdown
Contributor Author

Delphi Coverage Report

File Stmts Miss Cover
polismath/init.py 2 0 100%
polismath/benchmarks/bench_pca.py 128 107 16%
polismath/benchmarks/bench_repness.py 81 65 20%
polismath/benchmarks/bench_update_votes.py 38 28 26%
polismath/benchmarks/benchmark_utils.py 34 0 100%
polismath/components/init.py 1 0 100%
polismath/components/config.py 165 70 58%
polismath/conversation/init.py 2 0 100%
polismath/conversation/conversation.py 1293 264 80%
polismath/conversation/group_vote_counts.py 38 2 95%
polismath/conversation/manager.py 131 42 68%
polismath/database/init.py 1 0 100%
polismath/database/dynamodb.py 392 176 55%
polismath/database/postgres.py 414 95 77%
polismath/delphi_storage/init.py 1 0 100%
polismath/delphi_storage/codec.py 295 22 93%
polismath/delphi_storage/embedding_spool.py 58 6 90%
polismath/delphi_storage/golden_corpus.py 60 9 85%
polismath/delphi_storage/import_report.py 51 3 94%
polismath/delphi_storage/legacy_import.py 171 16 91%
polismath/delphi_storage/postgres.py 49 22 55%
polismath/delphi_storage/production_import.py 614 131 79%
polismath/delphi_storage/resource.py 179 32 82%
polismath/delphi_storage/scan_pacing.py 77 0 100%
polismath/delphi_storage/writer.py 196 13 93%
polismath/embedding_model.py 197 49 75%
polismath/empty_output.py 29 2 93%
polismath/engine_adapter.py 317 265 16%
polismath/job_child/init.py 364 51 86%
polismath/job_child/census.py 74 9 88%
polismath/job_child/input_bundle.py 106 7 93%
polismath/pca_kmeans_rep/init.py 5 0 100%
polismath/pca_kmeans_rep/clusters.py 257 38 85%
polismath/pca_kmeans_rep/corr.py 98 17 83%
polismath/pca_kmeans_rep/group_k_smoother.py 28 0 100%
polismath/pca_kmeans_rep/legacy_kmeans.py 197 8 96%
polismath/pca_kmeans_rep/pca.py 162 19 88%
polismath/pca_kmeans_rep/repness.py 226 5 98%
polismath/poller/init.py 4 0 100%
polismath/poller/admission.py 318 15 95%
polismath/poller/backfill.py 936 32 97%
polismath/poller/capacity.py 485 27 94%
polismath/poller/capacity_queue.py 248 13 95%
polismath/poller/coordinator_bridge.py 317 317 0%
polismath/poller/math_writer.py 120 3 98%
polismath/poller/promotion.py 112 4 96%
polismath/poller/readiness.py 368 13 96%
polismath/poller/rebuild_child.py 133 5 96%
polismath/poller/recompute_line.py 141 8 94%
polismath/poller/service.py 760 50 93%
polismath/poller/worker_pool.py 143 0 100%
polismath/queue/executor.py 221 111 50%
polismath/regression/init.py 4 0 100%
polismath/regression/clojure_comparer.py 188 20 89%
polismath/regression/comparer.py 891 640 28%
polismath/regression/datasets.py 126 27 79%
polismath/regression/recorder.py 36 27 25%
polismath/regression/utils.py 130 85 35%
polismath/replay/init.py 2 0 100%
polismath/replay/attribution_capture.py 49 0 100%
polismath/replay/axis_continuity.py 347 24 93%
polismath/replay/certify.py 999 59 94%
polismath/replay/crosslang.py 128 2 98%
polismath/replay/decision_ties.py 51 8 84%
polismath/replay/diagnostics.py 50 7 86%
polismath/replay/driver.py 73 1 99%
polismath/replay/dsn_admission.py 36 1 97%
polismath/replay/equiv_query.py 10 0 100%
polismath/replay/event_ingress.py 95 1 99%
polismath/replay/fixture_bundle.py 815 62 92%
polismath/replay/fixture_config.py 266 11 96%
polismath/replay/fixture_extract.py 285 12 96%
polismath/replay/fixture_generate.py 103 1 99%
polismath/replay/fixture_samples.py 157 14 91%
polismath/replay/fixture_selection.py 119 0 100%
polismath/replay/fixture_survey.py 147 11 93%
polismath/replay/legacy_pca.py 29 17 41%
polismath/replay/polarity.py 319 25 92%
polismath/replay/poller_equiv.py 776 99 87%
polismath/replay/prodclone.py 193 2 99%
polismath/replay/real_data.py 146 10 93%
polismath/replay/schedule.py 205 10 95%
polismath/replay/served_math.py 159 4 97%
polismath/replay/shard_bench.py 189 65 66%
polismath/replay/stagecompare.py 890 161 82%
polismath/replay/stages.py 256 40 84%
polismath/replay/stepcompare.py 86 1 99%
polismath/replay/store.py 120 11 91%
polismath/replay/tie_capture.py 107 19 82%
polismath/replay/types.py 58 6 90%
polismath/run_math_pipeline.py 284 93 67%
polismath/selection.py 58 0 100%
polismath/step_log.py 95 8 92%
polismath/tools/engine_rebuild.py 230 11 95%
polismath/types.py 6 0 100%
polismath/utils/cli_flags.py 15 0 100%
polismath/utils/clj_hash.py 44 0 100%
polismath/utils/env_flags.py 13 0 100%
polismath/utils/general.py 63 39 38%
polismath/utils/output_profile.py 66 2 97%
polismath/utils/serialization.py 10 5 50%
polismath/utils/vote_convention.py 159 5 97%
umap_narrative/700_datamapplot_for_layer.py 514 470 9%
umap_narrative/701_static_datamapplot_for_layer.py 310 310 0%
umap_narrative/702_consensus_divisive_datamapplot.py 435 275 37%
umap_narrative/801_narrative_report_batch.py 657 209 68%
umap_narrative/803_check_batch_status.py 268 148 45%
umap_narrative/llm_factory_constructor/init.py 2 0 100%
umap_narrative/llm_factory_constructor/model_provider.py 232 106 54%
umap_narrative/narrative_data.py 178 55 69%
umap_narrative/numerical_stages.py 97 17 82%
umap_narrative/polismath_commentgraph/init.py 1 0 100%
umap_narrative/polismath_commentgraph/cli.py 268 268 0%
umap_narrative/polismath_commentgraph/core/init.py 3 3 0%
umap_narrative/polismath_commentgraph/core/clustering.py 108 108 0%
umap_narrative/polismath_commentgraph/core/embedding.py 104 104 0%
umap_narrative/polismath_commentgraph/lambda_handler.py 219 219 0%
umap_narrative/polismath_commentgraph/schemas/init.py 2 0 100%
umap_narrative/polismath_commentgraph/schemas/dynamo_models.py 80 6 92%
umap_narrative/polismath_commentgraph/tests/conftest.py 17 17 0%
umap_narrative/polismath_commentgraph/tests/test_clustering.py 74 74 0%
umap_narrative/polismath_commentgraph/tests/test_embedding.py 55 55 0%
umap_narrative/polismath_commentgraph/tests/test_storage.py 87 87 0%
umap_narrative/polismath_commentgraph/utils/init.py 9 7 22%
umap_narrative/polismath_commentgraph/utils/converter.py 283 50 82%
umap_narrative/polismath_commentgraph/utils/group_data.py 332 279 16%
umap_narrative/polismath_commentgraph/utils/storage.py 616 486 21%
umap_narrative/reset_conversation.py 162 53 67%
umap_narrative/run_pipeline.py 459 158 66%
umap_narrative/topic_naming.py 148 11 93%
Total 26240 7392 72%

@colinmegill
colinmegill merged commit 61c7180 into stable Nov 23, 2026
96 of 97 checks passed

This branch was successfully deployed

1 active deployment
release — 1346f631 Deployed Nov 23, 2026 by colinmegill via publish #21
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