Skip to content

feat(ring-sr-alg-00): GOLD II arena-types Β· closes #450#475

Merged
gHashTag merged 1 commit intomainfrom
ring-446-sr-alg-00-arena-types
May 2, 2026
Merged

feat(ring-sr-alg-00): GOLD II arena-types Β· closes #450#475
gHashTag merged 1 commit intomainfrom
ring-446-sr-alg-00-arena-types

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

@gHashTag gHashTag commented May 2, 2026

SR-ALG-00 β€” Arena Types (algorithm-spec metadata)

Closes #450 Β· Part of #446 Β· No blockers (independent GOLD II thread)

Soul-name: Arena Architect Β· Codename: LEAD Β· Tier: πŸ₯‰ Bronze Β· Kingdom: Rust

What landed

Dependency-free typed metadata for one algorithm submitted to the TRIOS IGLA arena. SR-ALG-00 is the bottom of the GOLD II graph β€” SR-ALG-01..03 + BR-OUTPUT all import their manifest types from here.

6 public types

Type Wire-format role
AlgorithmId(Uuid) unique submission id
EntryHash([u8; 32]) SHA-256 of the entry script (lowercase-hex JSON, length 64)
GoldenState([u8; 32]) SHA-256 of the convergence checkpoint (optional)
EnvVar(String), EnvValue(String) env-pair newtypes
AlgorithmSpec full manifest (algorithm_id, name, entry_path, entry_hash, env, golden_state_hash?, theorem?)

Critical: no Python in crates/

AlgorithmSpec::entry_path points outside crates/ (typically into parameter-golf/records/...). Real Python spawn is the job of SR-02 trainer-runner β€” never this crate. R-L6-PURE-007.

Tests (12/12 GREEN)

Test Asserts
algorithm_id_unique_per_instance newtype freshness
entry_hash_32_bytes_serialises_as_hex64 32 bytes β†’ 64 hex chars
entry_hash_rejects_wrong_length 31-byte hex string fails
golden_state_serialises_as_hex64 hex roundtrip
env_empty_vec_valid empty env compiles + roundtrips
entry_path_from_str_round_trips PathBuf parity
theorem_optional / golden_state_hash_optional absent fields omitted
verify_hash_correct / verify_hash_wrong_fails hash compare
serde_roundtrip_full_spec every field roundtrips
schema_field_names_stable JSON keys frozen for downstream rings

Compliance

L1 βœ“ Β· L3 βœ“ Β· L4 βœ“ Β· L6 βœ“ Β· L13 βœ“ Β· L14 βœ“ Β· R-RING-DEP-002 βœ“ Β· R-RING-FACADE-001 βœ“ Β· R-L6-PURE-007 βœ“ Β· I5 βœ“

🌻 φ² + φ⁻² = 3 Β· GOLD II bottom

Agent: Arena-Architect

Adds trios-algorithm-arena/SR-ALG-00 β€” dependency-free typed metadata
for one algorithm submitted to the IGLA arena. Bottom of the GOLD II
dependency graph; SR-ALG-01..03 + BR-OUTPUT all import their wire
format from here.

## Critical: no Python in crates/

AlgorithmSpec::entry_path points OUTSIDE crates/ (typically into
parameter-golf/records/...). Real Python spawn is the job of SR-02
trainer-runner β€” NEVER this crate. R-L6-PURE-007.

## Public surface

- AlgorithmId(Uuid)              v4 newtype
- EntryHash([u8; 32])            SHA-256, lowercase-hex JSON (length 64)
- GoldenState([u8; 32])          SHA-256, optional in spec
- EnvVar(String) / EnvValue(String)
- AlgorithmSpec {
    algorithm_id, name, entry_path: PathBuf,
    entry_hash, env: Vec<(EnvVar, EnvValue)>,
    golden_state_hash: Option<...>,
    theorem: Option<String>,    // e.g. 'Coq.Reals Theorem 3.1 SAC-1'
  }
- AlgorithmSpec::new(name, path, hash) cheap constructor
- AlgorithmSpec::verify_hash(actual: &[u8; 32]) -> bool

## Tests (12/12 GREEN)

- algorithm_id_unique_per_instance
- entry_hash_32_bytes_serialises_as_hex64
- entry_hash_rejects_wrong_length          31-byte hex string fails
- golden_state_serialises_as_hex64
- env_empty_vec_valid
- entry_path_from_str_round_trips
- theorem_optional                         absent field omitted from JSON
- golden_state_hash_optional               same
- verify_hash_correct
- verify_hash_wrong_fails
- serde_roundtrip_full_spec                every field roundtrips
- schema_field_names_stable                JSON keys frozen for downstream

## Compliance

- L1 βœ“ no .sh
- L3 βœ“ clippy clean
- L4 βœ“ tests before merge
- L6 βœ“ no I/O, no async
- L13 βœ“ I-SCOPE: only crates/trios-algorithm-arena/
- L14 βœ“ Agent: trailer
- R-RING-DEP-002 βœ“ deps = serde + uuid + hex (+ serde_json dev)
- R-RING-FACADE-001 βœ“ outer src/lib.rs is re-exports only
- R-L6-PURE-007 βœ“ no .py in this crate; entry_path is a *reference*
- I5 βœ“ ring has README.md, TASK.md, AGENTS.md, RING.md, Cargo.toml, src/lib.rs

🌻 phi^2 + phi^-2 = 3 · TRINITY · GOLD II bottom

Soul-name: Arena Architect
Closes #450
Part of #446

Agent: Arena-Architect
@gHashTag gHashTag force-pushed the ring-446-sr-alg-00-arena-types branch from 2e185a5 to 4a3ac34 Compare May 2, 2026 09:33
@gHashTag gHashTag merged commit 5128056 into main May 2, 2026
4 of 7 checks passed
@gHashTag gHashTag deleted the ring-446-sr-alg-00-arena-types branch May 2, 2026 09:33
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.

πŸ₯‰ [SR-ALG-00] arena-types β€” algorithm spec metadata (GOLD II bottom)

1 participant