feat(client): get_layer and find_layer for snapshot export and owner lookup (0.11.0) #82
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.41) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.41 · 193 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.315
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #82"
general
weight: 0.35
gurnben
Summary
Adds two
LedgerClientreads that the harness needs to treat the Ledger database as the authority and keep LLM sessions on files. Release 0.11.0.get_layer(layer_id)returns the complete, schema-valid layer document (events, review queue, signed metadata) through the existingload_layerhandler, and raisesLedgerErrorwhen the layer is missing. Engine uses it to export a read-only snapshot of the authoritative DB layer before a session, so the LLM reads a file and never holds ledger credentials.find_layer(product_repo_id)returns the layer owned by aproduct_repo, orNone(there is at most one per owner). In-process callers resolve the layer by owner instead of deriving it from a path; it matchesGET /v1/ledger/layers?product_repo_id=.Context
The harness reads and writes its local
*-findings-layer.json, so countersigns written to the DB (for example from SCI) never reach the next run, and harness writes never reach the DB. The planned Engine change makes scripts the only Ledger writers: they pull a snapshot, the LLM works on files and reports, then the scripts append to the DB and refresh the snapshot. This PR is the Ledger half of that.Validation
corpus:layer:…DB layer:find_layerwith an owned and an unownedproduct_repo, a countersign, thenget_layerreturns the same document as the backend with the new event and Merkle size; a missing layer raisesLedgerError.make lint-fix,make test(1038 passed),make check-release.