Skip to content

feat(number): runtime-value Echo bridge + ADR-0010 (number-system stratification)#45

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-albattani-ubS9r
Jun 18, 2026
Merged

feat(number): runtime-value Echo bridge + ADR-0010 (number-system stratification)#45
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-albattani-ubS9r

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

The bridge slice of number-system stratification — the runtime-value classifier + the ADR — following #44 (which merged the proofs SECTION 5/6 and the type-level carrier-aware echo). One concern: completes the value-level + documentation layer of the stratification. cargo fmt/clippy clean; 124 lib tests (2 new); no unwrap/unwrap_or.

number.rs — runtime-value Echo bridge

  • Value::number_system(&self) -> Option<BasicType> — a runtime value's number system (None for the non-numeric carriers bool/string/list/tuple/token/unit, which have no additive algebra).
  • Value::reversal_echo(&self) -> Echo — the reversal tier forced by that value's additive algebra, delegating to echo::carrier_echo so the algebra→tier map has a single source of truth (mirrors JtvEcho.lean SECTION 6 and the type-level echo.rs classifier).

ADR-0010 — number-system stratification

Records the realized design and, importantly, reconciles honestly with ADR-0007 D6:

  • The 3-level tower abelianGroup / approxGroup / nonGroup, 1:1 with the Echo lattice; the seven systems' classification (hex/binary = ℤ-encodings → int's tier; float = approxGroupNeutral).
  • D6's vocabulary is group / cancellative / idempotent (for exact algebras). float is an approximate group, not a D6-cancellative monoid — so among the seven systems D6's cancellative (Neutral) and idempotent (Breaking) routes are anticipated but uninhabited; the towers meet at Safe/Neutral/Breaking.
  • The carrier-aware += grading (shape ⊔ carrier), the default-carrier=Int soundness argument, and the one-algebra/three-surfaces (proof / type / value) mirror.
  • Flags the float-locals soundness slice as required next: locals carry no annotation, so a float local typed only by inference currently grades Safe — a reverse { z += v } over it would be wrongly admitted under Safe-only. Closing it needs the typechecker's inferred types threaded into the CarrierEnv.

STATE.a2ml

Registers ADR-0010; records the Echo-arc + stratification milestone; marks (b) and the stratification classification landed; gap-005 → partial (value-level type_preservation beyond τ=int still open); queues the float-locals slice as the next rung.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BJmfoz1ZS1Pejy9LLMY742


Generated by Claude Code

…atification)

The runtime-value half of the number-system stratification (ADR-0010,
realizing ADR-0007 D6), complementing the type-level carrier_echo merged in #44.

number.rs:
  * Value::number_system(&self) -> Option<BasicType> — a runtime value's number
    system (None for the non-numeric carriers bool/string/list/tuple/token/unit).
  * Value::reversal_echo(&self) -> Echo — the reversal tier forced by that
    value's additive algebra, delegating to echo::carrier_echo so the
    algebra->tier map has a single source of truth (mirrors JtvEcho.lean
    SECTION 6).

docs/design-decisions/0010-number-system-stratification.adoc:
  * Records the 3-level additive-algebra tower (abelianGroup/approxGroup/nonGroup)
    1:1 with the Echo lattice, the seven systems' classification (hex/binary =
    Z-encodings; float = approxGroup -> Neutral), the carrier-aware += grading
    (shape join carrier) + default-carrier=Int soundness, and the
    one-algebra/three-surfaces (proof/type/value) mirror.
  * Honestly reconciles with ADR-0007 D6: float is an approximate group, not a
    D6-cancellative monoid, so among the seven systems D6's cancellative
    (Neutral) and idempotent (Breaking) routes are anticipated-but-uninhabited;
    the towers meet at Safe/Neutral/Breaking.

STATE.a2ml: register ADR-0010; record the Echo-arc + stratification milestone;
mark (b) and the stratification classification landed; gap-005 partial (value-
level type_preservation beyond tau=int still open); flag the float-locals
CarrierEnv-inference soundness slice as next.

cargo fmt + clippy clean; 124 lib tests pass (2 new). No unwrap/unwrap_or.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJmfoz1ZS1Pejy9LLMY742
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 51 issues detected

Severity Count
🔴 Critical 0
🟠 High 25
🟡 Medium 26
View findings
[
  {
    "reason": "No test directory or test files found",
    "type": "no_tests",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper",
    "action": "flag",
    "rule_module": "honest_completion",
    "severity": "high",
    "deduction": 20
  },
  {
    "reason": "Issue in secret-scanner.yml",
    "type": "missing_workflow",
    "file": "secret-scanner.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in scorecard.yml",
    "type": "scorecard_wrapper_missing_job_permissions",
    "file": "scorecard.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (10 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/crates/jtv-core/benches/interpreter_bench.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (6 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/crates/jtv-core/benches/parser_bench.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Js.Array2 deprecated -- use Array (3 occurrences)",
    "type": "deprecated_api",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/vscode-extension/src/Extension.res",
    "action": "search_replace",
    "rule_module": "migration_rules",
    "severity": "high"
  },
  {
    "reason": "Js.Promise deprecated -- use Promise (2 occurrences)",
    "type": "deprecated_api",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/vscode-extension/src/Extension.res",
    "action": "module_replace",
    "rule_module": "migration_rules",
    "severity": "medium"
  },
  {
    "reason": "Belt.Array deprecated -- use Array (30 occurrences)",
    "type": "deprecated_api",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/packages/jtv-analyzer/src/Main.res",
    "action": "module_replace",
    "rule_module": "migration_rules",
    "severity": "high"
  },
  {
    "reason": "Belt.Option deprecated -- use Option (2 occurrences)",
    "type": "deprecated_api",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/packages/jtv-analyzer/src/Main.res",
    "action": "module_replace",
    "rule_module": "migration_rules",
    "severity": "medium"
  },
  {
    "reason": "Js.Array2 deprecated -- use Array (7 occurrences)",
    "type": "deprecated_api",
    "file": "/home/runner/work/julia-the-viper/julia-the-viper/packages/jtv-analyzer/src/Main.res",
    "action": "search_replace",
    "rule_module": "migration_rules",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath marked this pull request as ready for review June 18, 2026 06:26
@hyperpolymath
hyperpolymath merged commit 88db785 into main Jun 18, 2026
32 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-albattani-ubS9r branch June 18, 2026 06:26
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.

2 participants