Skip to content

contract: manuscript is upstream of the contract; lock contract ownership - #46

Merged
nceglia merged 1 commit into
mainfrom
contract/source-of-truth
Aug 5, 2026
Merged

contract: manuscript is upstream of the contract; lock contract ownership#46
nceglia merged 1 commit into
mainfrom
contract/source-of-truth

Conversation

@nceglia

@nceglia nceglia commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Reorders the authority: the manuscript is ground truth, the contract is downstream.
Where they disagree the contract is wrong, and an ambiguity is a question for the
authors — not something to infer from what makes the code or a benchmark look right.

Source documents are now in the repo

Both live in docs/contract/source/, with their SHA-256 prefixes recorded in the
metrics manifest and checked by a test. A silent revision becomes a failing build rather
than something a human has to spot.

They are separate documents with colliding equation numbers:

owns
metrics_2026-08-05.docx eqs 2–7 joint entropy, clonotypic/phenotypic entropy, MI, NMI, KL
supplementary_note_1_SS_2026-08-03.pdf eqs 1–12 generative model, variational family, ELBO, perturbation

"eq 3" is the clonotypic entropy in one and the VampPrior in the other. Every note_eq
now names its document, and a test refuses a bare reference. Note 1 carries no entropy
or MI definitions at all
— its only mention of the metric is the benchmark estimand
MI(C,φ) = I(C;φ) — so a metric citing it fails the suite.

The eq 3–4 erratum is closed

The 2026-08-05 document corrects both: eq 3 weights by the conditional, eq 4's left side
reads H(p(φ|c)). They now agree with the code, which was never changed. SOURCE_ERRATA
is retired and replaced by RESOLVED_ERRATA, kept because it records how the
disagreement was settled — by the MI decomposition identity producing a negative mutual
information under the literal equations, not by authority. That is the precedent for the
next one.

Manifest gaps closed

  • phenotypic_flux was implemented but entirely unspecified. Now in METRIC_SPECS.
  • Joint entropy (eq 2) is defined in the document but not implemented — recorded under
    UNIMPLEMENTED rather than left silently absent.

New: OPEN_QUESTIONS

Live disagreements with the document, deliberately kept separate from
SANCTIONED_EXTENSIONS so a pending decision cannot be quietly filed as a feature. A
test asserts no key appears in both.

  • normalize_mode default — eq 6 specifies the mean denominator; the package
    defaults to min. Every number produced with the default therefore does not follow eq 6.
  • phenotypic_flux default — eq 7 defines flux as D_KL; the code defaults to l1.
    The kernels already exist (kl/dkl, l1, js/jsd); only the default differs.
  • Posterior summary of a nonlinear metricE[NMI(J)] vs NMI(E[J]). These differ
    materially (0.267 vs 0.128 on a benchmark cell). Note 1's benchmark prose reads as the
    current behaviour but is ambiguous; needs an author's answer rather than a guess.

Ownership

.github/CODEOWNERS restricts contracts, conformance tests, prose twins and source
documents to @nceglia and @salehis.

⚠️ Advisory until you enable "Require review from Code Owners" on the main branch
protection rule — that is a repository setting I can't change. Without it, CODEOWNERS
only auto-requests reviewers and blocks nothing.

Tests

169 passed, 3 skipped (up from 166 — four new guards, one replaced).

🤖 Generated with Claude Code

@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

…rship

Rebuilt on current main -- the previous attempt was branched from a stale base and would
have clobbered #44's literal eq 2-6 transcriptions and its marginal-weighting guard. Those
are kept untouched; this adds only what is new.

- Precedence: the manuscript is upstream, the contract downstream, and an ambiguity is a
  question for the authors rather than something to infer from what makes a benchmark
  come out right.
- SOURCES: both documents archived under docs/contract/source/ with sha256 prefixes,
  checked by a test, so a revision fails the build instead of going unnoticed.
- Equation numbers COLLIDE between the two documents (eq 3 is the clonotypic entropy in
  one, the VampPrior in the other). Every note_eq now names its document, a test rejects a
  bare reference, and citing Note 1 for a metric is a failure -- it has no entropy or MI
  definitions at all.
- phenotypic_flux added to METRIC_SPECS: implemented and previously unspecified.
- UNIMPLEMENTED records joint entropy (eq 2) as defined-but-not-exposed.
- OPEN_QUESTIONS for live disagreements, with a test asserting no key is also filed under
  SANCTIONED_EXTENSIONS: the flux distance default (eq 7 says D_KL, code says l1) and
  E[NMI(J)] vs NMI(E[J]) for a nonlinear metric.
- CODEOWNERS restricts contracts, conformance tests, prose twins and source documents to
  @nceglia and @salehis. Advisory until branch protection requires Code Owner review.
- Note references repointed to the archived Aug-3 PDF; deviation [I] recorded (guide
  concentration pinned to a scalar where eq 6 specifies a free vector), settled against
  the April note as a clear divergence rather than an ambiguity.
- CLAUDE.md gains branching rules; a stale base is what produced three separate PRs for
  the same erratum.

174 passed, 3 skipped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@nceglia
nceglia force-pushed the contract/source-of-truth branch from cbcf9be to 8741f28 Compare August 5, 2026 19:08
@nceglia
nceglia merged commit cd33dd7 into main Aug 5, 2026
2 checks passed
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