Skip to content

feat(certification): state binding phase 4 — live head binding (Tier-3) - #208

Draft
IanFrelinger wants to merge 3 commits into
masterfrom
cursor/state-log-head-binding-1b05
Draft

feat(certification): state binding phase 4 — live head binding (Tier-3)#208
IanFrelinger wants to merge 3 commits into
masterfrom
cursor/state-log-head-binding-1b05

Conversation

@IanFrelinger

Copy link
Copy Markdown
Owner

Summary

Implements Phase 4 of attested state log binding: Tier-3 live head binding — compare the attested log head against the live mutable store hash.

This branch stacks Phase 2–4 commits if earlier PRs (#206, #207) are not yet merged.

Tier-3 seam

  • ILiveStateHashReader — reads current live state hash from mutable storage
  • StateLogVerifier.Verify(..., liveStateReader: ...) — after Tier-1/Tier-2 pass, binds AttestedStateLog.CurrentStateHash to live store
  • InMemoryLiveStateHashReader — test/deterministic host double

Failure codes (Tier-3)

Code Meaning
live-state-head-missing Empty log has no head to bind
live-state-unavailable Live store returned no hash
live-state-schema-violation Live hash fails schema format check
live-state-mismatch Log head ≠ live store (R10)

Tests (cert-gate: 66)

Test Tier Verdict
R10_LiveStateHeadMismatch_Refuses Tier-3 REFUSE — valid log passes Tier-1 but live store diverges
A4_FullyValidLogWithLiveHeadBinding_IsTrusted Tier-3 TRUSTED — matching live head
TrustGate_FromDi_TrustsBundledSampleLogWithLiveHeadBinding Tier-3 TRUSTED — DI trust gate

Test plan

  • bash scripts/run-cert-gate.sh — 66/66 passed locally
  • R10 proves Tier-1 alone does not catch live-store divergence
  • Trust gate accepts bundled sample when live head matches log
Open in Web Open in Cursor 

cursoragent and others added 3 commits June 28, 2026 05:58
…format, project C

- ICertifiedBehaviorCatalog with in-memory and file-backed catalogs
- CertifiedBehaviorCertificateResolver and AttestedStateLogTrustGate + DI
- AttestedStateLogWireFormat JSON round-trip
- Project C cross-project reuse sample with bundled phase-witness artifacts
- A2 Tier-2 admission, catalog/wire/cross-project/trust-gate tests
- cert-gate count 60; evidence ledger section added

Co-authored-by: IanFrelinger <IanFrelinger@users.noreply.github.com>
…r + R9

Implement production Tier-2 replay via BrickTransitionReplayer: Roslyn-compiles
certified brick source, executes deterministically, and compares resulting state
hashes. Add compilable phase witness bricks, path-safe behavior catalog dirs,
IBrickTransitionReplayerFactory DI registration, R9 out-of-band tamper test,
A3 brick replay admission, and trust gate Tier-2 coverage. cert-gate: 63 tests.

Co-authored-by: IanFrelinger <IanFrelinger@users.noreply.github.com>
Add ILiveStateHashReader seam and optional Tier-3 verification in
StateLogVerifier: compare attested log head against live store hash.
Includes InMemoryLiveStateHashReader, R10 live-state-mismatch refusal,
A4 admission, trust gate coverage. cert-gate: 66 tests.

Co-authored-by: IanFrelinger <IanFrelinger@users.noreply.github.com>
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