Skip to content

Phase D: claim ledger and scientific provenance - #9

Merged
EmergentMonk merged 159 commits into
mainfrom
phase-d-claim-ledger-provenance
Sep 27, 2026
Merged

EmergentMonk merged 159 commits into
mainfrom
phase-d-claim-ledger-provenance

Conversation

@EmergentMonk

@EmergentMonk EmergentMonk commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements Roadmap Phase D — claim ledger and scientific provenance.

Phase D turns COSMO's existing evidence-class language into a machine-validated repository contract and corrects the historical source text so FORMAL / COMPUTATIONAL / SCIENTIFIC / HYPOTHESIS / SYMBOLIC claims cannot silently collapse into one another.

Canonical claim ledger

Adds:

  • claims/claim-ledger.json — machine-readable authority, schema COSMO-CLAIMS-D-1;
  • CLAIM-LEDGER.md — canonical human-readable rendering generated from the JSON ledger;
  • stable COSMO-D-### claim IDs;
  • external source IDs and accession/article identifiers;
  • exact repository provenance anchors;
  • explicit evidence boundaries;
  • mandatory falsification criteria for hypotheses.

The initial ledger contains 14 claims across all five required evidence classes and 6 external source records.

Evidence classes enforced

The validator fixes the exact class set and order:

  1. FORMAL
  2. COMPUTATIONAL
  3. SCIENTIFIC
  4. HYPOTHESIS
  5. SYMBOLIC

scripts/validate-claim-ledger.py fails closed on:

  • duplicate/malformed/out-of-order claim IDs;
  • evidence-class drift;
  • missing/stale repository provenance paths/anchors or provenance paths that are absolute, contain .., or resolve outside the repository;
  • duplicate/unknown source IDs;
  • malformed or authority-less source URLs, non-HTTPS source records, or URLs containing credentials;
  • malformed accession/article identifiers or canonical NCBI identifier/URL contradictions;
  • source kinds outside the scholarly / peer-reviewed / official-database allowlist;
  • SCIENTIFIC claims without an external source;
  • HYPOTHESIS claims that are not exactly PROPOSED or lack structured protocol, rejection-condition, and control criteria;
  • SYMBOLIC claims without structured empirical_status = NON_EMPIRICAL;
  • evidence-class-inappropriate repository provenance roles;
  • duplicate JSON object keys;
  • multiline/control-character or raw-HTML rendering attacks in human-readable ledger fields;
  • any byte-level divergence between CLAIM-LEDGER.md and the canonical JSON rendering.

Scientific provenance recorded

The first Phase D source set records:

  • E8 root-polytope context;
  • Spin(8) triality context;
  • SiS2 crystallography — PMID 25590815, DOI 10.1021/ic501825r;
  • HPV16 reference genome — NCBI RefSeq NC_001526.4;
  • high-risk HPV E6/E7 mechanism review — PMID 17645777, PMCID PMC11158331;
  • scoped p16-marker context — PMCID PMC8409095.

Source presence does not transfer authority across domains: a real fact about Spin(8), SiS2 or HPV does not validate a COSMO bridge between them.

Corrected claim strength

The historical cosmovirus.tex is retained, but its epistemic status is corrected:

  • removes the unsupported SEER 8085/3 statement;
  • stops describing triality as an SO(8) -> Spin(8) map;
  • states Spin(8) triality as the S3 outer-automorphism symmetry of the three 8-dimensional representations;
  • classifies the triality↔HPV capsid association as SYMBOLIC, with any future predictive bridge only HYPOTHESIS;
  • records ambient-pressure SiS2 structure as sourced context while keeping “substrate/life-code” language symbolic;
  • records HPV16 RefSeq NC_001526.4, sourced E6/E7 context, and scoped p16 language without equating p16 with active HPV16 transcription;
  • corrects the Dragon Seed to exactly 8 bytes / 64 bits and treats “101” only as a legacy mnemonic;
  • removes the false 1621 checksum language and keeps it as the declared symbolic invariant;
  • explicitly treats cuneiform labels as project-defined annotations, not decipherment/transliteration;
  • keeps cosmology/Ouroboros language as symbolic interpretation;
  • updates the machine-checked-fragment boundary toward current Phase C authority.

Category-theory boundary

cosmovirus_cattheory.tex is tightened so:

  • the Phase C six-state cycle is the object-level authority;
  • category construction is a Phase E design target;
  • retract, natural-transformation, coherence, endofunctor and categorical-equivalence claims are not presented as current Lean theorems;
  • SiS2 / Triality / HPV state arrows are project transitions, not material/biological mechanisms.

Audit resolution

audit/AUDIT-RESOLUTION.md now records Phase D resolution of the previously deferred items for:

  • canonical claim/source dataset generation;
  • external scientific bibliography boundaries;
  • falsification governance.

PDF regeneration remains Phase F.

CI

Routine CI now runs:

  • full existing Python discovery;
  • direct Phase D tests;
  • the standalone claim-ledger validator;
  • strict mypy on the validator and Phase D tests;
  • bytecode compilation;
  • the unchanged protected Lean integrity pipeline.

Phase D tests verify:

  • all five evidence classes are represented;
  • scientific claims have sources;
  • hypotheses remain falsifiable and unpromoted;
  • symbolic claims retain structured NON_EMPIRICAL status;
  • FORMAL/COMPUTATIONAL claims retain class-appropriate theorem/implementation/regression provenance;
  • provenance path traversal/absolute-path attempts are rejected;
  • malformed URLs, identifier/URL mismatches, non-scholarly source kinds, duplicate JSON keys, raw HTML, and Markdown-structure injection are rejected;
  • Markdown exactly equals the canonical JSON rendering;
  • HPV16 RefSeq identity is versioned;
  • SiS2 PMID/DOI provenance is stable.

Evidence boundary

A green Phase D validator means the repository obeys the encoded evidence/provenance contract.

It does not mean COSMO independently replicated the external literature, and it does not convert symbolic or hypothetical cross-domain mappings into scientific mechanisms.

Optimization governance

No performance optimization is introduced in Phase D. The invariant is epistemic separation itself.

Rollback triggers include:

  • loss of evidence-class separation;
  • scientific claims without provenance;
  • symbolic material promoted to mechanism;
  • unfalsifiable hypotheses;
  • stale claim anchors;
  • accession/version identity drift without reviewed ledger update;
  • regression in existing formal/computational CI.

Summary by Sourcery

Establish a machine-validated claim and scientific-provenance contract that separates COSMO’s formal, computational, scientific, hypothetical, and symbolic claims.

New Features:

  • Introduce a canonical claim ledger covering formal, computational, scientific, hypothesis, and symbolic evidence with stable claim IDs and scientific source records.
  • Add a machine-readable provenance contract and generated human-readable claim index for repository claims.

Bug Fixes:

  • Correct historical scientific and epistemic statements covering Spin(8) triality, SiS2, HPV16, p16, Dragon Seed size, checksum language, cuneiform interpretation, and categorical claims.
  • Prevent unsupported cross-domain associations from being presented as established mechanisms or theorem-level results.

Enhancements:

  • Add fail-closed validation for claim classification, provenance anchors, source identities and URLs, hypothesis falsifiability, symbolic boundaries, rendering safety, and public cross-domain assertions.
  • Clarify the category-theory document as a Phase E design target while retaining Phase C as the authoritative state-machine semantics.

CI:

  • Run claim-ledger validation, Phase D tests, strict mypy, and bytecode checks in routine CI while preserving the protected Lean integrity pipeline.

Documentation:

  • Document the Phase D evidence and provenance contract, scientific boundaries, audit resolution, and updated repository usage.

Tests:

  • Add comprehensive Phase D tests for ledger governance, provenance safety, source identity, rendering integrity, falsification criteria, and public-claim enforcement.

Chores:

  • Expose the protected Lean project source inventory for validation of formal provenance.

@sourcery-ai sourcery-ai 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.

Sorry @EmergentMonk, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 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-27T17:28:26.304757Z a3deeec Manual request
🔒 Security Review ✅ Completed 2026-09-23T22:54:36.615111Z c2aac76 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.

@sourcery-ai

sourcery-ai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Reviewer's Guide

Phase D establishes an enforced claim ledger and provenance contract, adds CI validation and tests, and revises historical and category-theory documentation so formal, computational, scientific, hypothetical, and symbolic content remain explicitly separated.

Entity-relationship diagram for the Phase D claim ledger

erDiagram
    CLAIM {
        string id PK
        string evidence_class
        string status
        string statement
        string boundary
    }
    SOURCE {
        string id PK
        string kind
        string title
        string url
    }
    PROVENANCE {
        string claim_id FK
        string path
        string anchor
        string role
    }
    CLAIM_SOURCE {
        string claim_id FK
        string source_id FK
    }

    CLAIM ||--|{ PROVENANCE : has
    CLAIM ||--o{ CLAIM_SOURCE : cites
    SOURCE ||--o{ CLAIM_SOURCE : referenced_by
Loading

Flow diagram for Phase D claim validation

flowchart TD
    Start[Load JSON ledger] --> Schema{Schema and class order valid?}
    Schema -->|No| Fail[Fail validation]
    Schema -->|Yes| Sources{Sources valid and HTTPS?}
    Sources -->|No| Fail
    Sources -->|Yes| Claims[Validate ordered claim IDs]
    Claims --> Provenance{Repository paths and anchors valid?}
    Provenance -->|No| Fail
    Provenance --> Rules{Evidence-class rules satisfied?}
    Rules -->|No| Fail
    Rules -->|Yes| Markdown{Markdown claim IDs match JSON?}
    Markdown -->|No| Fail
    Markdown -->|Yes| Pass[Ledger valid]
Loading

File-Level Changes

Change Details Files
Introduces a canonical, machine-validated claim ledger and synchronized human-readable index for evidence classification and provenance governance.
  • Adds the COSMO-CLAIMS-D-1 JSON ledger with 14 stable claims, five ordered evidence classes, six external sources, repository anchors, boundaries, and hypothesis falsification requirements.
  • Adds validation for claim/source identifiers, class ordering, provenance anchors, HTTPS and identifier metadata, source references, class-specific requirements, and JSON/Markdown consistency.
  • Adds Phase D tests covering class representation, provenance requirements, hypothesis status, symbolic boundaries, and key HPV16/SiS2 identifiers.
claims/claim-ledger.json
CLAIM-LEDGER.md
scripts/validate-claim-ledger.py
tests/test_phase_d.py
Corrects historical scientific and epistemic language while preserving the source as explicitly bounded historical, symbolic, or hypothetical material.
  • Reclassifies Spin(8) triality, SiS2 structure, HPV16 provenance, E6/E7 biology, and p16 usage as scoped scientific context without asserting COSMO cross-domain mechanisms.
  • Removes unsupported SEER morphology, incorrect SO(8) to Spin(8) wording, false checksum claims, and the 101-bit Dragon Seed framing; clarifies the 64-bit payload and symbolic annotations.
  • Marks triality-to-capsid associations as symbolic and future predictive mappings as falsifiable hypotheses; keeps cuneiform and cosmological interpretations non-empirical.
cosmovirus.tex
KNOWN_LIMITATIONS.md
README.md
Tightens the category-theory document around the Phase C finite-state model and defers categorical semantics to Phase E.
  • Treats the six-state cycle as the current object-level authority and project transitions as labels rather than material or biological mechanisms.
  • Recasts retract, coherence, natural-transformation, endofunctor, and categorical-equivalence statements as unformalized Phase E design targets.
cosmovirus_cattheory.tex
Resolves Phase D audit findings and integrates the new governance checks into CI.
  • Records canonical claim/source generation, scientific bibliography boundaries, falsification governance, and corrected historical-language decisions.
  • Runs Phase D tests, the standalone ledger validator, strict mypy for the new validator/tests, and existing integrity checks in CI; leaves PDF regeneration for Phase F.
audit/AUDIT-RESOLUTION.md
.github/workflows/ci.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@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: c2aac76cda

ℹ️ 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 claims/claim-ledger.json Outdated
Comment thread scripts/validate-claim-ledger.py Outdated
Comment thread scripts/validate-claim-ledger.py Outdated
Comment thread scripts/validate-claim-ledger.py Outdated
Comment thread scripts/validate-claim-ledger.py Outdated
@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@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: cc69f9c6ba

ℹ️ 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 +5606 to +5608
command_re = re.compile(
r"\\(?:newcommand|renewcommand|providecommand)\*?"
)

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 Expand primitive TeX macro definitions before scanning

Executed minimal reproduction: validate_public_claim_text("sample.tex", r"\def\bridge#1{Spin(8) triality causes #1.}\n\n\bridge{HPV16 capsid assembly}", {}) returned successfully. Standard TeX macro expansion was statically inferred. Expected behavior is rejection because the rendered document contains an unledgered causal assertion; actual behavior is acceptance because macro extraction recognizes only newcommand/renewcommand/providecommand, leaving the \def invocation opaque while its non-rendered definition is isolated in another paragraph. This is a new failing macro form beyond the fixed newcommand and package cases.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +5296 to +5297
def _close_implied_by_start(self, normalized: str) -> None:
if normalized == "option":

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 Honor implied end tags for ruby annotations

Executed minimal reproduction: validate_public_claim_text("sample.html", "<ruby><rt hidden>draft<rt>Spin(8) triality causes HPV16 capsid assembly.</ruby>", {}) returned successfully. Browser rendering was statically inferred from the HTML optional-end-tag rule: the second <rt> implicitly closes the hidden first annotation, so the assertion is visible and should be rejected; the custom parser instead retains hidden_depth because _close_implied_by_start has no rt/rp case. This is a new failing element beyond the fixed paragraph, table, and option cases.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +643 to +644
r"\b(?:causes?|caused|drives?|driven|produces?|produced|"
r"creates?|created|creating|underlies?|underlay|underlying|"

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 Recognize generation as a causal predicate

Executed minimal reproduction: validate_public_claim_text("sample.md", "Spin(8) triality generates HPV16 capsid assembly.", {}) returned successfully. Expected behavior is rejection because “generates” directly asserts a positive cross-domain causal bridge; actual behavior is acceptance because PUBLIC_ASSERTION_RE recognizes nearby creation predicates such as produces and creates but omits generate and its inflections. This is a new failing verb beyond the fixed creates case.

Useful? React with 👍 / 👎.

Comment on lines +5386 to +5396
if normalized in self.VOID_TAGS:
if (
not hidden_here
and self.raw_text_depth == 0
and self.hidden_depth == 0
):
if normalized == "br":
self.parts.append(" ")
elif normalized in self.BLOCK_TAGS:
self._append_block_boundary()
return

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 Scan visible values of HTML form controls

Executed minimal reproduction: validate_public_claim_text("sample.html", "<input type=\"button\" value=\"Spin(8) triality causes HPV16 capsid assembly.\">", {}) returned successfully. Browser rendering of the button value was statically inferred. Expected behavior is rejection because the control visibly presents an unledgered causal assertion; actual behavior is acceptance because the void-element branch discards every input attribute and contributes no rendered text.

Useful? React with 👍 / 👎.

Comment on lines +5951 to +5955
)
text = re.sub(
r"\\(?:textbf|textit|emph|textrm|textsf|texttt|textnormal|underline|mbox)"
r"(?![A-Za-z])\s*",
"",

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 Normalize LaTeX math-font wrappers before entity matching

Executed minimal reproduction: validate_public_claim_text("sample.tex", r"\(\mathrm{Spin}(8)\) causes HPV16 capsid assembly.", {}) returned successfully. Standard LaTeX rendering was statically inferred. Expected behavior is rejection because the rendered sentence names Spin(8) and asserts a biomedical causal bridge; actual behavior is acceptance because normalization removes the braces but leaves \mathrm joined to Spin, preventing the mathematics-domain pattern from recognizing the entity. The executed \operatorname{Spin} and \mathit{E}_{8} forms fail similarly.

Useful? React with 👍 / 👎.

Comment on lines +5560 to +5563
token_re = re.compile(
r"\\ifnum\s*([+-]?\d+)\s*(=|<|>)\s*([+-]?\d+)|"
r"\\(?:iftrue|iffalse|else|fi)\b"
)

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 Evaluate ifdefined branches before binding claim IDs

Executed minimal reproduction with the reviewed claim classes: validate_public_claim_text("sample.tex", r"\ifdefined\notdefined COSMO-D-011 symbolic \fi Spin(8) triality causes HPV16 capsid assembly.", claim_classes) returned successfully. Standard TeX conditional behavior was statically inferred: because \notdefined is undefined, the claim ID and qualifier are not rendered, so the visible assertion should be rejected; actual behavior accepts it because branch stripping recognizes only literal ifnum, iftrue, and iffalse, leaving the hidden ID available to govern the assertion.

Useful? React with 👍 / 👎.

Comment on lines +4284 to +4288
protected_instance_names = (
"run",
"_callTestMethod",
"assertEqual",
"assertTrue",

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 Protect per-instance equality dispatch tables

Executed a full-validator reproduction that also passed strict mypy: the D-003 implementation returned zero for every numeric report field and "wrong" for the digest, while the claimed test obtained self.__dict__["_type_equality_funcs"], installed no-op handlers for int and str, and retained all required assertEqual statements; validation still reported claim ledger valid. Expected behavior is rejection because the reviewed report properties are false; actual behavior is acceptance because only named assertion methods are protected, while TestCase.assertEqual delegates same-type comparisons through this mutable per-instance table. This is fresh beyond the fixed class and instance method overrides because the protected methods themselves remain unchanged.

Useful? React with 👍 / 👎.

@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: b63773f89f

ℹ️ 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 +6093 to +6095
user_macros = latex_user_macro_definitions(text)
text = strip_latex_macro_definitions(text)
text = expand_latex_user_macros(text, user_macros)

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 Evaluate conditionals before collecting macro definitions

Executed reproduction: validate_public_claim_text("sample.tex", r"\iftrue\newcommand{\bridge}{Spin(8) triality causes HPV16 capsid assembly.}\else\renewcommand{\bridge}{background}\fi \bridge", {}) returns successfully. Standard TeX branch behavior was statically inferred: the true branch defines the assertion-bearing macro while the \renewcommand in the skipped branch is never executed, so the rendered assertion should be rejected. Actual behavior globally collects the last definition before evaluating conditionals, expands \bridge as background, and accepts the document. This is a new failing case beyond the fixed \ifdefined case because a definition inside an inactive branch overrides the active definition during validation.

Useful? React with 👍 / 👎.

Comment on lines +5323 to +5329
P_IMPLIED_END_STARTS = frozenset(
{
"address", "article", "aside", "blockquote", "div", "dl",
"fieldset", "footer", "form", "h1", "h2", "h3", "h4", "h5",
"h6", "header", "hgroup", "hr", "main", "menu", "nav", "ol",
"p", "pre", "section", "table", "ul",
}

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 Close hidden paragraphs before all block starts

Executed reproduction: validate_public_claim_text("sample.html", "<p hidden>draft<figure>Spin(8) triality causes HPV16 capsid assembly.</figure>", {}) returns successfully. Browser parsing was statically inferred: starting figure implicitly closes the hidden p, making the assertion visible, so rejection is expected; the custom parser's implied-end set omits figure, retains hidden_depth, and discards the assertion. The same executed bypass occurs with figcaption, details, and search.

Useful? React with 👍 / 👎.

else:
fail(f"too many nested LaTeX packages from {path_text!r}")

pattern = re.compile(r"\\(?:input|include)\s*\{([^{}\n]+)\}")

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 Parse primitive unbraced input filenames

Executed two-file validator reproduction: main.tex contained \newcommand{\bridge}{Spin(8) triality causes HPV16 capsid assembly.}\input child, while child.tex contained \bridge; snapshot_public_documents() followed by validate_public_documents({}, documents) accepted both files. Primitive TeX \input child rendering was statically inferred: the child executes in the caller's macro environment and renders the unledgered assertion, so rejection is expected. Actual behavior recognizes only braced transclusions, then scans the definition and invocation in isolation, allowing neither file to expose the complete assertion.

Useful? React with 👍 / 👎.

Comment on lines +5550 to +5554
text = re.sub(
r"(?m)^ {0,3}>[ \t]*$",
"",
text,
)

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 Separate Markdown block quotes from preceding prose

Executed reproduction: validate_public_claim_text("sample.md", "COSMO-D-011 symbolic\n> Spin(8) triality causes HPV16 capsid assembly.", {"COSMO-D-011": "SYMBOLIC"}) returns successfully. Markdown rendering was statically inferred: the ID is in a normal paragraph and the assertion is in a separate block quote, so the quoted assertion should be rejected for lacking its own governing ID. Actual behavior introduces a boundary only for an empty quote-marker line, combines these two rendered blocks, and lets the preceding ID govern the assertion.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +6084 to +6087
text = re.sub(
r"<!--[\s\S]*?(?:-->|$)",
"",
text,

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 Preserve inline code before stripping HTML comments

Executed reproduction: validate_public_claim_text("sample.md", "", {}) returns successfully. Markdown rendering was statically inferred: HTML comment markers inside a code span are rendered literally with their contents, so the visible unledgered assertion should be rejected. Actual behavior removes the apparent comment before normalize_markdown_code_spans() can protect the code-span contents, leaving only two backticks and accepting the document.

Useful? React with 👍 / 👎.

@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@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: a01695cdd0

ℹ️ 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 +1761 to +1762
def _is_instance(self, node: ast.expr) -> bool:
return isinstance(node, ast.Name) and node.id in self.instance_names

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 Track local aliases of the unittest instance

Executed a full-validator reproduction, which also passed strict mypy: after making validate_e8_root_system return an all-zero/incorrect report, the claimed test used alias = self, installed a no-op assertion with setattr(alias, "assertEqual", lambda *_: None), retained every required self.assertEqual(...), and deleted alias.__dict__["assertEqual"] afterward; validation still reported claim ledger valid. Expected behavior is rejection because the reviewed result is false; actual behavior occurs because _is_instance recognizes only the original name and does not propagate local aliases, while the runtime check sees a restored instance. This is a new failing case beyond the fixed direct-self and helper-parameter cases.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +6040 to +6042
r"\\(?:textbf|textit|emph|textrm|textsf|texttt|textnormal|"
r"underline|mbox|mathrm|mathbf|mathit|mathsf|mathtt|mathnormal|"
r"operatorname|mathcal|mathbb|mathfrak)"

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 Normalize the LaTeX text wrapper

Executed validate_public_claim_text("sample.tex", r"\(\text{Spin}(8)\) causes HPV16 capsid assembly.", {}); it returned successfully, while the equivalent fixed \mathrm form was rejected. LaTeX rendering semantics were statically inferred: \text{Spin} renders as Spin, so the expected behavior is rejection of the visible unledgered cross-domain assertion; actual normalization removes the braces but leaves \text attached to Spin, preventing entity recognition. This is a fresh failing case beyond the fixed math-font wrappers because the common amsmath \text wrapper remains omitted.

Useful? React with 👍 / 👎.

Comment on lines +42 to +46
PUBLIC_SYMBOLIC_PROMOTION_RE = re.compile(
r"\b(?:goes?\s+beyond|more\s+than|not\s+(?:merely|just|only))"
r"\s+(?:(?:an?|the)\s+)?symbolic(?:\s+association)?\b|"
r"\b(?:is|constitutes?)\s+(?:(?:an?|the)\s+)?"
r"(?:actual|real|established)\s+(?:biological\s+)?mechanism\b",

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 Reject plain denials of symbolic classification

Executed the full validator after adding a governed Markdown file containing COSMO-D-011 is not a symbolic association: Spin(8) triality causes HPV16 capsid assembly.; it still reported claim ledger valid. Expected behavior is rejection because the sentence explicitly denies the evidence class that permits D-011 to govern the positive bridge; actual behavior occurs because symbolic satisfies the qualifier check while the promotion pattern rejects only forms such as not merely/just/only symbolic, not a plain not ... symbolic denial.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +6084 to +6087
text = re.sub(
r"<!--[\s\S]*?(?:-->|$)",
"",
text,

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 Handle HTML's alternate comment terminator

Executed the full validator with a governed HTML file containing <!-- hidden --!>Spin(8) triality causes HPV16 capsid assembly.; it reported claim ledger valid, and an executed HTMLParser check exposed the assertion as data after the comment. Browser rendering was statically inferred. Expected behavior is rejection because --!> closes the HTML comment and leaves the assertion visible; actual behavior strips everything from <!-- to EOF because the preliminary regex recognizes only -->, bypassing the later HTML parser and claim scan.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +4601 to +4604
anchor_text = text
suffix = Path(path_text).suffix.lower()
if suffix in {".md", ".markdown", ".tex"}:
anchor_text = strip_public_nonrendered_comments(path_text, text)

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 Reject hidden LaTeX provenance anchors

Executed the full validator after replacing both visible COSMO-D-004 tags in cosmovirus.tex with \phantom{COSMO-D-004}; it still reported claim ledger valid. LaTeX rendering was statically inferred. Expected behavior is rejection because the documented_context provenance anchor is no longer rendered beside either supporting statement; actual behavior occurs because provenance validation applies only comment/macro preprocessing and then performs a substring search, without the visible-text normalization that removes \phantom content. This is a fresh failing case beyond the fixed commented-anchor case because the anchor remains active TeX source while producing no visible text.

Useful? React with 👍 / 👎.

@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 0cdd4b6 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@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: 0cdd4b6e1f

ℹ️ 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 scripts/validate-claim-ledger.py Outdated

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 260305e against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@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: 260305ead4

ℹ️ 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 scripts/validate-claim-ledger.py Outdated
Comment on lines +4645 to +4649
anchor_text = strip_inline_html_tags(
strip_public_nonrendered_comments(
path_text,
text,
)

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 Strip CSS comments before checking hidden styles

Executed validate_provenance for the existing COSMO-D-006 claim with the snapshot {"CLAIM-LEDGER.md": "<span style=\"display: none /* comment */\">NC_001526.4</span>"}; it succeeds. The browser-rendering portion is statically inferred: CSS comments are removed during CSS tokenization, so this declaration hides the span. Expected behavior is rejection because the provenance anchor is not visible; actual behavior accepts it because the newly applied HTML visibility parser's style regex does not normalize CSS comments before looking for display:none (the equivalent display:/* comment */none bypass was also executed successfully).

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +4645 to +4650
anchor_text = strip_inline_html_tags(
strip_public_nonrendered_comments(
path_text,
text,
)
)

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 Normalize Markdown formatting before matching anchors

Executed validate_provenance for COSMO-D-006 with {"CLAIM-LEDGER.md": "NC_**001526**.4"}; it rejects the provenance because the literal source does not contain NC_001526.4. Markdown rendering was statically inferred: the emphasis delimiters disappear and the visible text is exactly NC_001526.4. Expected behavior is acceptance of this visible anchor; actual behavior is rejection because the new Markdown path strips HTML but does not apply the existing Markdown-visible-text normalization before performing the substring match.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +4645 to +4649
anchor_text = strip_inline_html_tags(
strip_public_nonrendered_comments(
path_text,
text,
)

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 Exclude non-rendered SVG subtrees from anchor text

Executed validate_provenance for COSMO-D-006 with {"CLAIM-LEDGER.md": "<svg><defs><text>NC_001526.4</text></defs></svg>"}; it succeeds. SVG rendering was statically inferred: content under defs defines reusable resources and is not directly rendered, so the page exposes no visible provenance anchor. Expected behavior is rejection; actual behavior is acceptance because the newly used HTML text parser treats all SVG descendant text as visible and returns the anchor from the non-rendered defs subtree.

Useful? React with 👍 / 👎.

@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA f2ffbdc against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@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: f2ffbdc1aa

ℹ️ 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 +5611 to +5614
text = re.sub(
r"\\([\\`*_{}\[\]()#+\-.!|>~])",
r"\1",
text,

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 Preserve escaped delimiters during emphasis parsing

Executed validate_provenance for COSMO-D-009 with the unchanged cosmovirus.lean snapshot and KNOWN_LIMITATIONS.md set to \*Cu*neiform strings are project-defined symbolic annotations; validation succeeds. Markdown rendering was statically inferred: the escaped first asterisk is literal and the second is unmatched, so the rendered text is *Cu*neiform... and does not contain the exact provenance anchor. Expected behavior is rejection, while actual behavior accepts it because backslash escapes are removed before the emphasis regex, which then incorrectly treats both asterisks as formatting delimiters.

Useful? React with 👍 / 👎.

Comment thread scripts/validate-claim-ledger.py Outdated
Comment on lines +5500 to +5503
hidden_attribute
or css_hidden
or normalized == "template"
or normalized in self.NON_RENDERED_SVG_CONTAINERS

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 Restrict SVG container hiding to SVG context

Executed validate_provenance for COSMO-D-006 with CLAIM-LEDGER.md set to <defs>NC_001526.4</defs>; it rejects the visible anchor. HTML rendering was statically inferred: outside an <svg> element, defs is an ordinary unknown HTML element whose text remains visible, so acceptance is expected. Actual behavior hides it solely by tag name without tracking whether the parser is inside SVG; this is a fresh case beyond the previously reported non-rendered <svg><defs>...</defs></svg> subtree.

Useful? React with 👍 / 👎.

Comment on lines +5487 to +5490
style_value = re.sub(
r"/\*[\s\S]*?\*/",
"",
style_value,

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 Preserve token boundaries when removing CSS comments

Executed validate_provenance for COSMO-D-006 with CLAIM-LEDGER.md set to <span style="dis/**/play:none">NC_001526.4</span>; it rejects the anchor. CSS rendering was statically inferred: a comment cannot join the surrounding fragments into one identifier, so dis/**/play is not the display property and the span remains visible; expected behavior is acceptance. Actual behavior deletes the comment without whitespace, synthesizes display:none, and hides the anchor. This is a fresh failing case beyond the fixed comments placed between a colon and none; replace comments with a token boundary rather than concatenating their neighbors.

Useful? React with 👍 / 👎.

@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA a3deeec against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: a3deeecd21

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

@EmergentMonk
EmergentMonk merged commit 51bdc92 into main Sep 27, 2026
4 checks passed
@EmergentMonk
EmergentMonk deleted the phase-d-claim-ledger-provenance branch September 27, 2026 17:51
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