Skip to content

docs(proofs): align the neural-convergence plan and proof ledger with PROOF-POLICY - #1025

Open
hyperpolymath wants to merge 8 commits into
mainfrom
claude/proof-policy-alignment
Open

hyperpolymath wants to merge 8 commits into
mainfrom
claude/proof-policy-alignment

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Why

The PageRank and ESN convergence proofs were planned in Lean 4 with Mathlib: HANDOVER-neural-convergence.adoc, needs.adoc, gap-analysis.adoc and AFFIRMATION.adoc all say so. The handover rewrite in #959 kept that plan. The estate PROOF-POLICY, owner rulings of 2026-10-26 and 2026-11-04, rules it out:

  • §1: convergence is theory. Theory lives in Agda under agda --safe --without-K --cubical-compatible.
  • §2: theory is rechecked in Rocq and Lean, and Mathlib is not allowed.
  • §8: results are graded with Proof Witness Grades (PWG-3 / 2i / 2ii / 1). §8 replaces the grade ladder in the mathesis brief, which PROOF-STATUS.adoc was still quoting.

This PR fixes the plan and the ledger. It adds no proof, test or runtime behaviour.

What changes

  • docs/proofs/HANDOVER-neural-convergence.adoc is rewritten. It states two theory theorems over an abstract ordered commutative ring. That needs no postulate and no real analysis; the activation and the matrix enter only as hypotheses.
    • T-RC (reservoir contraction): if every absolute row sum of W is at most ρ and the activation is 1-Lipschitz, the leaky update is a sup-norm contraction with modulus (1 − a) + a·ρ. This covers both the ESN and the LSM.
    • T-PR (damped PageRank): the map c + d·P·x is an ℓ¹ contraction with modulus d when P is non-negative and column-substochastic. The old plan assumed a column-stochastic P, but graph_of_trust.ex leaves the column of a dangling node at zero.
    • The engineering premises hypatia has to meet (scaled row sums, convergence at runtime, edge weights) are listed separately, as TESTED or ASSUMED.
  • verification/PROOF-STATUS.adoc:
    • Grades now cite PROOF-POLICY §8, pinned by commit.
    • The status token, the correspondence state and the PWG are kept in separate fields.
    • COMPLETE and PARTIAL are replaced with §5 tokens. Every former COMPLETE row names a file that a Verify Proofs job kernel-checks and fails hard on.
    • KinGate becomes TESTED, as the policy's §4 worked example requires.
    • LogtalkMigration is recorded as PROVEN / AGDA-VERIFIED / PWG-3.
    • A new neural-convergence section lists T-RC and T-PR as OPEN and ungraded.
    • The §6 toolchain-deviation records, which are missing, are recorded as OPEN.
  • needs.adoc no longer says Agda was retired. Only OutcomeLog.agda was.
  • Dangling PROOFS-GAP.md references in Elixir comments and a test moduledoc are repointed.
  • The ESN moduledoc no longer claims teacher forcing (feedback_weights is never used). The LSM's stale "integrate-and-fire" comment is corrected.

Deliberately not in this PR

  • The Lean precondition files (PageRankInvariants.lean, ESNSpectralScaling.lean) still describe the Mathlib plan in their header comments. They are engineering proofs, and PROOF-POLICY §3 moves them to Idris2 when they are next touched, so they are corrected in that move.
  • verify-proofs.yml: its comments still say "Mathesis Grade 3". I left the workflow untouched.

Validation

  • mix test test/neural_test.exs test/graph_of_trust_convergence_test.exs: 31 tests, 0 failures.
  • mix format --check-formatted is clean on the touched Elixir files.
  • lake build is clean on main; no Lean file changes here.
  • Every test name, bound and size the ledger cites was checked against test/neural_test.exs and test/graph_of_trust_convergence_test.exs.

Generated by Claude Code

… PROOF-POLICY

The neural-convergence plan (HANDOVER, needs, gap-analysis, AFFIRMATION)
put the PageRank and ESN theorems in Lean with Mathlib. The estate
PROOF-POLICY (owner rulings 2026-10-26 and 2026-11-04) makes convergence
theory: Agda source under --safe --without-K --cubical-compatible,
rechecked in Rocq and Lean, no Mathlib, graded by Proof Witness Grades.

- HANDOVER-neural-convergence.adoc rewritten: two theory theorems over
  an abstract ordered commutative ring. T-RC is the reservoir sup-norm
  contraction with modulus (1 - a) + a*rho, covering both ESN and LSM.
  T-PR is the damped PageRank l1 contraction for a column-substochastic
  P; the old plan assumed column-stochastic, which dangling nodes break.
  Separately, the engineering premises hypatia meets are listed as
  TESTED or ASSUMED.
- PROOF-STATUS.adoc: grades cite PROOF-POLICY section 8, pinned by
  commit, instead of the superseded mathesis brief. The status, the
  correspondence state and the PWG are kept in separate fields.
  COMPLETE/PARTIAL become section 5 tokens. The KinGate TLC row becomes
  TESTED, per the policy's worked example. LogtalkMigration is recorded
  as PROVEN / AGDA-VERIFIED / PWG-3. New neural-convergence section with
  T-RC and T-PR OPEN and ungraded. The missing section 6 toolchain
  deviation records are now recorded as OPEN.
- needs.adoc no longer says Agda is retired, since only OutcomeLog.agda
  was.
- Replace dangling PROOFS-GAP.md references in Elixir comments and a
  test moduledoc.
- Drop the ESN moduledoc's teacher-forcing claim (feedback_weights is
  never used) and the LSM's stale integrate-and-fire comment.

No proof, test or runtime behaviour changes. mix test
test/neural_test.exs test/graph_of_trust_convergence_test.exs: 31 tests,
0 failures; mix format --check-formatted clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9b5ef0f3-b542-4ae0-9614-cc960baddd22
Commits

Reviewing files that changed from the base of the PR and between c639c46 and 730833c.

Files selected for processing: 13

  • .machine_readable/testing/blitz.a2ml
  • AFFIRMATION.adoc
  • docs/proofs/HANDOVER-neural-convergence.adoc
  • docs/proofs/gap-analysis.adoc
  • docs/proofs/needs.adoc
  • docs/testing/audit.adoc
  • lib/neural/echo_state_network.ex
  • lib/neural/graph_of_trust.ex
  • lib/neural/liquid_state_machine.ex
  • test/graph_of_trust_convergence_test.exs
  • verification/PROOF-STATUS.adoc
  • verification/README.adoc
  • verification/proofs/tlaplus/KinGate.tla
Finishing Touches

Generate docstrings

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

scripts/check-proof-status.sh treats every backticked span in a table row
or a file section as a file path or as an identifier that file must
contain. The previous commit named the two planned Agda modules as paths
(they do not exist yet) and backticked status tokens (PROVEN) in the
LogtalkMigration row and the P8 section. Name the planned modules in
plain text and write the status tokens unquoted there.

bash scripts/check-proof-status.sh: 41 files, 77 identifiers, 0
mismatches, the same coverage as on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 9, 2026 15:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T16:27:28.751635Z 730833c New commits
🔒 Security Review ❌ Failed 2026-11-09T16:20:58.385878Z
We couldn’t complete this review. Comment @codex security review to try again.
730833c 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: f283827402

ℹ️ 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 verification/PROOF-STATUS.adoc Resolved
Comment thread verification/PROOF-STATUS.adoc Resolved
… declarations

Address the Codex review of #1025:

- T-RC: the bound holds for 0 <= a <= 1 and rho >= 0, but it is a
  contraction, and forgetting, only when q = (1 - a) + a*rho < 1, i.e.
  0 < a and rho < 1. Hypatia's values are recorded: q = 0.99 (ESN) and
  0.97 (LSM).
- T-PR: a contraction only when d < 1; with d = 1 the result is
  non-expansiveness. Hypatia uses d = 0.85.
- Reservoir scaling: the largest absolute row sum is at most
  @reservoir_norm, not always equal to it. Sparsity leaves size-1
  reservoirs all zero for most seeds (ESN seeds 1-4, LSM seeds 1-5,
  checked). Equality is what the tests check for non-degenerate sizes.
- GRPC.idr and REST.idr hold declarations and state no proposition, so
  they no longer read PROVEN; the vocabulary note and the coverage row
  say so.

bash scripts/check-proof-status.sh: 41 files, 77 identifiers, 0
mismatches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ

@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: 5522f7bc9b

ℹ️ 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 .machine_readable/testing/blitz.a2ml Resolved
Comment thread docs/proofs/needs.adoc Resolved
Comment thread AFFIRMATION.adoc Resolved
Comment thread verification/PROOF-STATUS.adoc Resolved
…the affirmation

Address the second Codex review of #1025:

- blitz.a2ml, audit.adoc and gap-analysis.adoc called T-PR a "full
  PageRank convergence proof". T-PR proves only that two runs approach
  each other. Convergence to a fixed point needs completeness and is a
  separate, unplanned theorem; they now say so.
- The coverage map still read "Grade 3 / AGDA-VERIFIED" for
  LogtalkMigration; it now reads PWG-3.
- AFFIRMATION now speaks of one open *theorem* obligation, and names the
  open PROOF-POLICY section 6 toolchain deviation records separately.

bash scripts/check-proof-status.sh: document agrees with the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ
needs.adoc listed KinGate.tla under "Completed Proofs" as H8 ✅ and said
H1-H9 are complete, which contradicts the ledger: a bounded TLC model
check is TESTED, not PROVEN (PROOF-POLICY section 4). The section now
names tested models, H8 records its bounds, and the priority line
separates proved, runtime-asserted and tested obligations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ

@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: 470175a70c

ℹ️ 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 on lines 204 to +207
Finite, implementation-independent table correspondence for the retired
ECHIDNA `+security_learning.lgt+` alert semantics versus
`+Hypatia.Rules.SecurityErrors+`. Per the estate verifier mapping this
is Agda territory; per Mathesis this is now *Grade 3* on the
is Agda territory. It is `+PWG-3+` (PROOF-POLICY §8) on the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Classify the migration model as engineering, not PWG-3

The model explicitly transcribes ECHIDNA and Hypatia implementation tables, so it is an engineering property under PROOF-POLICY §§1, 3, and 8.1, not implementation-independent theory. PWG applies only to theory, while an existing engineering proof in another prover retains its checked status until it is next moved to Idris2. Recording PWG-3 and opening Rocq/Lean recheck legs therefore misgrades this artifact; retain its PROVEN evidence without a PWG or theory recheck obligations.

Useful? React with 👍 / 👎.

Comment thread docs/proofs/needs.adoc Resolved
Comment thread docs/proofs/needs.adoc Resolved
Comment thread docs/proofs/needs.adoc Resolved
…claims

Address the third Codex review of #1025:

- KinGate.tla now carries the PROOF-POLICY section 4 exception record
  beside the artefact (obligation H8, tool TLA+/TLC, why not Idris2, and
  status TESTED with the KinGate.cfg bounds), so "recorded section 4
  exception" in needs.adoc is true. Comment lines only; the spec is
  unchanged.
- needs.adoc: H6 is a runtime assertion with an echidnabot audit, not a
  kernel-checked proof, and is now named as an exception next to H8.
- needs.adoc and gap-analysis.adoc no longer credit
  PageRankInvariants.lean with normalisation or column-stochastic
  premises. It proves non-negativity of edge weights and weight sums over
  N only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ

@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: 5430d1c2d9

ℹ️ 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 verification/PROOF-STATUS.adoc Resolved
Comment thread verification/PROOF-STATUS.adoc Resolved
Comment thread docs/proofs/needs.adoc Resolved
Comment thread AFFIRMATION.adoc Resolved
…endment

Address the fourth Codex review of #1025:

- Quarantine.idr: the model has no transition into Permanent (updateState
  only moves Ok to Soft or Hard and leaves quarantined states unchanged),
  so the row no longer claims ok/soft/hard/permanent transitions.
- ParserTotality.lean: round-trip is checked only on fixed example token
  lists, not as a general theorem. The PROOF-STATUS and needs.adoc rows
  say so.
- TLC is not pinned: verify-proofs fetches releases/latest and caches it
  under a fixed key, so "tla2tools 2.19" names only the recorded April
  run. needs.adoc and the section 6 deviation note say so.
- AFFIRMATION: the edited item is marked as a dated 2026-11-09 amendment,
  so the June affirmed-at timestamp is not read as covering it.

bash scripts/check-proof-status.sh: document agrees with the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

…oved

A self-audit of every PROVEN row against its file, after four Codex
rounds kept finding overclaims in rows this PR relabelled. Every other
row's listed properties have a matching theorem or definition-level
guarantee. Two did not:

- GraphQL.idr proves queryReturnsApiResponse and
  mutationReturnsApiResponse; subscriptions are declared with no proof.
- PipelineState.idr makes illegal transitions unconstructible through the
  ValidTransition GADT (by construction); the terminal/active
  classification is only defined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@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: 730833c348

ℹ️ 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".

trajectories from `+x+` and `+y+` stay within `+q^k·δ+`, where
`+q = (1 − a) + a·ρ+`. Prove it by induction on the sequence. This is
forgetting only when `+q < 1+`, that is when `+0 < a+` and `+ρ < 1+`; with
`+a = 0+` or `+ρ ≥ 1+` the bound is non-expansive at best. State the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe the expansive reservoir case correctly

When 0 < a ≤ 1 and ρ > 1, the stated modulus is q = 1 + a(ρ − 1) > 1, so this bound permits expansion rather than non-expansiveness. The same incorrect characterization is repeated in verification/PROOF-STATUS.adoc; distinguish the a = 0 or ρ = 1 non-expansive boundary from the ρ > 1 expansive case so the formalization plan does not request a false corollary.

Useful? React with 👍 / 👎.

Comment on lines +296 to +297
work is the two theory theorems T-PR and T-RC (2026-11-09: Agda source,
Rocq and Lean rechecks, no Mathlib; see `+docs/proofs/HANDOVER-neural-convergence.adoc+`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Refresh the gap analysis before presenting its new status

The new November status conflicts with this document's still-current TL;DR and inventory: lines 8–12 say Agda is retired and only TLA+ is CI-gated, while lines 34–84 list the Lean and Idris proofs as ungated. The inspected .github/workflows/verify-proofs.yml now gates Idris2, Lean, TLA+, and Agda, so readers encounter opposite descriptions of the proof estate in one analysis; update or explicitly supersede the stale opening inventory rather than changing only the final status.

Useful? React with 👍 / 👎.

Comment on lines 159 to +161
|`+verification/proofs/idris2/BatchRollback.idr+` |Idris2
|Transactionality (all-or-nothing), Reversibility (snapshot
restoration), Fault tolerance (failure handling) |COMPLETE
restoration), Fault tolerance (failure handling) |PROVEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit the batch row to conditional rollback restoration

When executeWithFailure is used, it always returns Failed with a partially modified snapshot and never invokes rollback; batchIsTransactional proves only that calling the separately defined rollback function would return the supplied original snapshot. Kernel-checking that theorem therefore does not prove all-or-nothing execution or that failure triggers rollback, so narrow the PROVEN claim to rollback restoration/reversibility or add a theorem that connects a failed execution to an actual rollback.

Useful? React with 👍 / 👎.

Comment on lines 163 to +166
|`+verification/proofs/lean4/RateLimiting.lean+` |Lean 4 |Counter
never exceeds configured bound, tryAccept preserves invariant, prune
preserves invariant, inductive sequence processing, rejection guarantee,
concrete configs (per-bot/global/burst) |COMPLETE
concrete configs (per-bot/global/burst) |PROVEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope the rate-limit proof to simultaneous events

For an event sequence containing different timestamps, the checked file has no inductive theorem establishing the advertised bound: processEvents_preserves_invariant explicitly requires every event to satisfy e.timestamp = t, and count_bounded_after_accepts carries the same simultaneous-event premise. The one-step theorem is also conditional on the invariant already holding at the current event's timestamp, so marking unrestricted sequence processing as PROVEN overstates the witness; qualify this row to simultaneous arrivals or add the missing chronological/arbitrary-sequence proof.

Useful? React with 👍 / 👎.

Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 9, 2026 21:36
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Repository owner deleted a comment from coderabbitai Bot Nov 9, 2026
Repository owner deleted a comment from coderabbitai Bot Nov 9, 2026
hyperpolymath added a commit that referenced this pull request Nov 9, 2026
…ce (#1028)

## The bug

`build_edges/1` emits one edge per verified success. When the same
evidence is recorded twice, the PageRank iteration in `iterate_trust/4`
sees parallel edges:

- it **divided** a source's trust by the summed weight of *all* of its
out-edges, duplicates included;
- it **credited** each target with only the *first* matching edge
(`Enum.find`).

So column sums fell below 1 and trust leaked, and how much leaked
depended on how many times the evidence had been logged. Tripling an
unchanged outcome log moved a recipe's trust from 0.38 to 0.59 and a
bot's from 0.89 to 0.94.

I found this while checking the PageRank convergence theorem's premises
for #1025. The leak does not break convergence, because the matrix stays
column-substochastic, but it makes the scores depend on logging noise.

## The fix

- **Rank over the set of edges** (`Enum.uniq` before the adjacency is
built), as the Jaccard cross-repo edges already do. Trust then depends
on what was observed, not on how often it was logged. `graph.edges`
itself is unchanged.
- **Credit every edge to a target**, so the columns of the transition
matrix sum to 1 even if parallel edges reappear.

**This changes production trust scores.** Wherever an outcome log holds
repeated (recipe, repo, bot) successes, the scores will move.

The alternative would let repeated successes count with their
multiplicity. That would also need the Jaccard cross-repo edges
reweighted by count; otherwise duplication still shifts mass between
edge kinds. I chose set semantics because the cross-repo edges already
work that way. Say if you want multiplicity instead.

## Validation

- New test, `recording the same evidence k times leaves every trust
score unchanged`:
- fails on main (`bot-qualification-fixture: once=0.889 thrice=0.939`);
- still fails with only the summing change (`0.980` vs `1.0`), because
the Jaccard edges ignore multiplicity;
  - passes with this commit.
- `mix test`: 2689 tests, 0 failures, 246 excluded.
- `mix format --check-formatted` is clean.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0165rGu3tsKmJtevmrdMVyfJ)_

Co-authored-by: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants