Add logline-pocket-runtime crate (LIP-0008)#2
Draft
danvoulez wants to merge 1 commit into
Draft
Conversation
f673a88 to
b6f3c99
Compare
Packages the existing canonical 9-slot shape validator from logline-who as a Pocket Runtime guard for LLM translation drafts. Other slot crates (did, this, when, confirmed_by, if_ok, if_doubt, if_not, status) expose classifiers / parsers, not validity predicates; those are deliberately not reused here — encoding policy at the entropy guard would violate its talent boundary. Tracks LIP-0008. Does not implement the translator. Does not emit canonical receipts. Does not execute or admit runtime actions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b6f3c99 to
463bc0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Packages the existing canonical 9-slot shape validator from
logline-who(validate_shape+LogLine) as a small Pocket Runtime guard for LLM translation drafts. Sits before canon, reduces entropy, never emits canonical receipts, never admits runtime actions, never executes.The other slot crates (
did,this,when,confirmed_by,if_ok,if_doubt,if_not,status) expose classifiers / parsers, not validity predicates — they always succeed and return enum variants. Reusing them here would force the Pocket Runtime to encode policy about which variants are "good" vs "bad", and that policy belongs to canon / constitutional-runtime, not to the entropy guard. They are deliberately not reused.Tracks LIP-0008.
Public API
```rust
pub struct LogLineDraft { /* 9 Option slots + aux */ }
pub enum PocketRuntimeRuling {
AcceptCandidate { normalized, warnings },
Ghost { ghosts, partial },
Reject { errors },
}
pub fn check(draft: LogLineDraft) -> PocketRuntimeRuling
```
Decision precedence: Reject > Ghost > AcceptCandidate. Errors (malformed values) win over ghosts (missing values) because malformed signals an upstream bug, not just under-specified intent. Documented in
src/lib.rs:```rust
// Decision precedence: Reject > Ghost > AcceptCandidate.
// Errors (malformed values) win over ghosts (missing values) because
// a malformed slot signals an upstream bug, not just under-specified intent.
```
Artifact Honesty Receipt
Files changed
```
A crates/logline-pocket-runtime/Cargo.toml
A crates/logline-pocket-runtime/src/lib.rs
A crates/logline-pocket-runtime/tests/pocket_runtime.rs
M Cargo.toml (workspace.members += logline-pocket-runtime)
```
Validators reused
Only logline-who is a dependency. The Pocket Runtime crate is a leaf dependency on top of the existing canonical shape validator.
Validators NOT reused, with reason
Tests run
```
cargo fmt --check ✓ clean
cargo test -p logline-pocket-runtime ✓ 7/7 passed
cargo test --workspace ✓ 64 passed
⚠ 8 PRE-EXISTING failures (see Known ghosts)
```
The 7 Pocket Runtime tests:
```
complete_valid_draft_accepts_candidate ✓
missing_when_ghosts ✓
missing_if_doubt_ghosts ✓
missing_multiple_slots_ghosts ✓
invalid_status_rejects ✓
slot_validator_failure_rejects ✓
aux_is_preserved_but_not_required ✓
```
What is proven
What is not proven
Known ghosts
🤖 Generated with Claude Code