Repository navigation
feat(proofs): introduce fail-closed cross-kernel reconciliation receipts #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
63c99d9
b14ccc9
bb8e80a
493290c
34f856a
0a1dbcf
cd620e4
87ae9a9
7b4b05f
20b84fd
b203cc0
0d96e94
96699a9
6fb19fd
0ae5a75
68795ac
c35d419
f12f532
3e6173e
2184f27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,10 @@ | |
| //! given a goal, return ranked candidate "homes". | ||
|
|
||
| use anyhow::Result; | ||
| use burrower_core::{parse_goal, rank, Corpus, Ledger, ProverConfig, Swarm}; | ||
| use burrower_core::{ | ||
| parse_goal, rank, record_reconciliation, Corpus, Ledger, ProofReconciliation, ProverConfig, | ||
| Swarm, | ||
| }; | ||
| use clap::{Parser, Subcommand}; | ||
| use std::path::PathBuf; | ||
|
|
||
|
|
@@ -122,6 +125,18 @@ enum Cmd { | |
| #[arg(long, default_value = "julia")] | ||
| oracle_julia: PathBuf, | ||
| }, | ||
| /// Record a reconciliation receipt as UNVERIFIED evidence, not a proof. | ||
| Reconcile { | ||
| /// JSON file with the proof.reconciliation/1 receipt. | ||
| #[arg(long)] | ||
| receipt: PathBuf, | ||
| /// Original theorem statement for ledger identity. | ||
| #[arg(long)] | ||
| goal: String, | ||
| /// Existing interim Burrow Ledger (JSONL). | ||
| #[arg(long)] | ||
| ledger: PathBuf, | ||
| }, | ||
| /// Burrow Ledger inspection. | ||
| Ledger { | ||
| #[command(subcommand)] | ||
|
|
@@ -371,6 +386,9 @@ fn handle_attempt( | |
| Ok(()) | ||
| } | ||
|
|
||
| /// Dispatch the requested command. Reconciliation reads a JSON receipt and | ||
| /// records it as proposed evidence, propagating read, parse, validation and | ||
| /// ledger errors. | ||
| fn main() -> Result<()> { | ||
| let cli = Cli::parse(); | ||
| match cli.cmd { | ||
|
|
@@ -401,6 +419,18 @@ fn main() -> Result<()> { | |
| oracle_julia, | ||
| ) | ||
| } | ||
| Cmd::Reconcile { | ||
| receipt, | ||
| goal, | ||
| ledger, | ||
| } => { | ||
| let body = std::fs::read_to_string(&receipt)?; | ||
| let evidence: ProofReconciliation = serde_json::from_str(&body)?; | ||
| let ledger = Ledger::open(&ledger)?; | ||
| record_reconciliation(&ledger, &goal, &evidence)?; | ||
|
Comment on lines
+429
to
+430
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the JSON deserializes successfully but fails semantic validation, such as for an unsupported schema or an invalid leg, this call has already touched the ledger file and created any missing parent directories because Useful? React with 👍 / 👎. |
||
| eprintln!("reconciliation evidence recorded as proposed, NOT verified"); | ||
| return Ok(()); | ||
| } | ||
| Cmd::Ledger { sub } => return handle_ledger(sub), | ||
| Cmd::Serve { socket } => return burrower_core::serve::run(socket), | ||
| Cmd::Index { root, output } => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
--ledgerresolves to the same file as--receipt, including through a symlink alias, the command first parses the receipt successfully and then appends a ledger record to that same file while reporting success. This turns the receipt JSON into a mixed JSON/JSONL file that cannot be parsed as a receipt again, and whose original content is skipped as malformed by the ledger reader; reject aliased input and output paths before opening the ledger.Useful? React with 👍 / 👎.