8000 Phase 2: implement append-only hash-chained run events · Issue #7 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content

Phase 2: implement append-only hash-chained run events #7

Closed

Description

@Mnehmos

Product outcome

Implement durable typed runs and append-only hash-chained events without treating execution history as mathematical authority.

Acceptance criteria

  • Every run kind in section 8.8 of SPEC.md is an exhaustive Rust enum.
  • Run creation is actor-attributed, canonical-budgeted, UUIDv7 identified, transactional, and idempotent.
  • Appended events have contiguous sequences and bind their predecessor hash.
  • Event hashes follow the documented canonical envelope and SHA-256 formula.
  • Event rows are immutable and cannot be deleted.
  • Concurrent appends produce deterministic serialization or a structured conflict without corruption.
  • Chain verification detects missing, reordered, forged, or inconsistent events.
  • Process restart preserves and verifies the chain.
  • Run state remains execution metadata and cannot become proof authority.
  • Unit and adversarial tests exercise the real SQLite store.

Trust checks

  • A run has no proved or disproved field.
  • Event payloads are canonical JSON.
  • Retrying an append cannot duplicate an event.
  • Timestamps and local machine data do not enter event identity.
  • Failed appends leave the chain head unchanged.

Out of scope

Research action semantics, leases, evidence authority, Lean verification, replayed subprocess execution, and claim truth derivation remain later deliverables.

Activity

  1. Mnehmos commented on Jul 19, 2026

    @Mnehmos
    OwnerAuthor

    Local implementation evidence for issue #7 is complete in commit 30d6d66 on feat/spec-driven-rust-rebuild.

    Implemented:

    • exhaustive Rust enums for all 11 specified run kinds and typed event kinds;
    • UUIDv7, actor-attributed, RFC 8785 canonical-budgeted, transactional, idempotent run creation;
    • origin events plus expected-head compare-and-swap append;
    • documented SHA-256 event envelope in ADR-0003;
    • SQLite sequence, predecessor, immutability, deletion, origin, and anchored-head controls;
    • verification for forged payloads, reordered events, missing final events, and restart persistence;
    • structured conflict behavior for concurrent appends;
    • explicit separation between trace integrity and mathematical authority.

    Local validation:

    • cargo fmt --check: passed
    • warnings-denied Clippy: passed
    • Rust unit tests: 32 passed
    • Rust CLI integration tests: 4 passed
    • run-history tests against real SQLite: 8 passed
    • legacy Python regression tests: 39 passed
    • manual mcl init: migration 5, WAL, exit 0
    • manual mcl health: healthy, exit 0

    The issue remains open because the branch cannot be pushed from this managed environment without authenticated Git transport, so remote CI has not run. No 1.0 or proof-authority claim is made.

  2. Mnehmos commented on Jul 19, 2026

    @Mnehmos
    OwnerAuthor

    Remote preservation update: local commit 30d6d66 was replayed as remote commit b65333b on draft PR #11. CI is now running against the durable GitHub branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0