Repository navigation
Use authorized remote backends from Rust without Git or Node - #113
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Reviewer's GuideAdds a transport-neutral, strictly bounded native adapter ABI for authorized Rust consumers, with typed read and ownership operations, canonical receipt/refusal preservation, explicit uncertain-outcome handling, offline compatibility validation, a read-only example, and extensive protocol/concurrency evidence without introducing a backend or authorization system. Sequence diagram for native adapter preflight and single exchangesequenceDiagram
participant Caller
participant Client as NativeAdapterClient
participant Adapter as NativeAdapter
participant Backend as AuthorizedBackend
Caller->>Client: call(request)
Client->>Client: prepare_adapter_request()
alt unsupported capability or invalid ABI/frame
Client-->>Caller: AdapterRefusal(dispatched: false)
else preflight passes
Client->>Adapter: exchange(encoded_request, response_limit)
Adapter->>Backend: authorized SDK operation
Backend-->>Adapter: canonical output or refusal
Adapter-->>Client: encoded reply
Client->>Client: check_adapter_reply()
Client-->>Caller: AdapterReply or dispatched refusal
end
Flow diagram for uncertain native mutation outcomesflowchart TD
A[Caller submits claim or release] --> B["prepare_adapter_request()"]
B -->|Capability or validation failure| C[Refusal: dispatched false]
B -->|Preflight passes| D["exchange() starts"]
D --> E{Reply received and correlated?}
E -->|Yes| F[Preserve canonical receipt or backend refusal]
E -->|No| G[Refusal: dispatched true]
G --> H[Reconcile authoritative receipts before retrying]
F --> I[Caller interprets ownership, skip, or peer-success receipt]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
unbraind
left a comment
There was a problem hiding this comment.
Orchestrator review (built-in Claude review agent, verified by the orchestrator; bots are not waited for since 2026-10-22):
Pre-merge review (codex gpt-6.1-sol read-only review agent; merged by the orchestrator's pipeline after a MERGE verdict and a private-data scan of the added lines).
VERDICT: MERGE
FINDINGS:
- none
SUMMARY: The PR adds a bounded native adapter ABI, tracker-free validation CLI, and recursive duplicate-key rejection. Tests thoroughly cover admission, receipt preservation, uncertain outcomes, and non-git ownership interleavings; I reviewed them without rerunning them.
Rust consumers need a portable contract for authorized SDK backends. This PR adds the bounded
pm-native-adapter/1JSON byte ABI, explicitNativeAdapterClient, tracker-free offlineadapter-checkCLI, and a read-only example. The integrating application owns transport and authorization; core owns schema and authoritative mutation/locking semantics. Requests are admitted before one exchange, canonical backend outcomes remain intact, and uncertain mutations are never retried.The shared
check_adapter_replyvalidates the original reply bytes for both offline and live admission. Transcripts retainreply_bytes; wire-size checks precede parsing. A separate bounded transcript envelope preserves the full 1 MiB frame ceiling.The recursive strict reader closes the duplicate-key class: before,
{"skipped":true,"skipped":false}inside output/details silently becameskipped:false. Now duplicate decoded object keys refuse at every depth, including escaped-equal keys and objects inside arrays.strict_json::from_slice/from_strbuilds one validated value, requires end-of-input, then deserializes typed structs withserde_json::from_value. Even ignored typed fields must pass admission. All 34 JSON value/typed decode sites in 16 production source/example files use this reader: requests, transcripts, settings/schema/config, journals, history, sessions, provenance and cursors/receipts. The decode audit documents each site, existing optional-input fallback behavior and output-only raw-fragment serialization.Validation at pushed head
6664a9f6cf55ff2a1b99d1dddb9771f8e5d16d6b:strict_json_duplicate_corpus_matches_live_client: 392 added frames, 196 accepted / 196 refused. Shared-validator, offline and live verdicts match independent expectations. Includes envelope depths 0/1, payload depths 0..5, escaped-equal ASCII/Unicode keys, arrays of objects, success output and refusal details, and late duplicates after 16,384 fields. Accepted envelopes remain intact; live refusals retain dispatched uncertainty and reconciliation guidance.raw_frame_seeded_corpus_matches_live_client: unchanged 768 frames, 240 accepted / 528 refused, seed 0x05eed113. Combined differential corpus: 1,160 frames, 436 accepted / 724 refused.strict_json_transcripts_and_requests_reject_escaped_duplicates: four transcript/manifest/request/operation cases checked through SDK and CLI.strict_json_preserves_values_and_rejects_invalid_documents,strict_json_validates_before_typed_fields_are_ignored, andstrict_json_tracker_decodes_refuse_duplicates_without_git: valid values/order/integer precision, malformed input and ignored-field admission, plus real non-git settings/history/registry refusals without source rewrites.node scripts/native-adapter-revert.mts: 9/9 independent behavioral proofs, recorded in the PM comment. The three new cases revert only the strict reader to serde's raw default, retaining tests and routed sites; rebuilt tests fail by assertion for recursive receipts, ignored typed fields and tracker input. Exact source bytes are restored. The six earlier proofs also pass. The serial PM-linked rerun completed all nine proofs; its timeout allowance accommodates compilation.cargo +1.90.0 test --locked --test native_adapter_contract --test strict_json_contract: 13 + 3 passed.cargo +1.90.0 test --locked --lib strict_json: 1 passed. Native CLI selection: 2 passed; CLI dispatch: 17 passed. Real shared-tracker tests retain all 12 deterministic ownership interleavings.Full gates passed for this exact pushed head in CI run 40114062328: 10/10 jobs successful, including all three platform suites, all three latency gates and all four release aggregates. CodeQL run 40114062346 also passed.
Every Rust count has zero failures and zero ignored tests. Harnesses have zero failures and zero cancellations; platform skips are explicit above. The unchanged aggregate gates also passed formatting, deny-warning clippy, documentation, TypeScript/ESLint, security audit, regenerated changelog and tracked-project health.
Measured source coverage totals (all covered): Linux 14,769 lines / 1,540 functions / 24,571 regions / 3,416 branches; macOS 14,679 / 1,526 / 24,410 / 3,376; Windows 14,675 / 1,525 / 24,408 / 3,378. Skipped optional workflows and unavailable automated reviews are not approval.
PM: pm-rust-portable-native-adapter-abi, remains in progress with the claim released for orchestrator verification. Code, docs and append-only history are committed together.
Public-data evidence retains the prior read-only snapshot measurements: 83 certified items, 172 files, 4,234,972 bytes, 9 pages, 92 adapter calls, 184 JSON/TOON checks and unchanged authoritative SHA-256. No hosted services or private data were used. Production transport acceptance belongs to the integrating backend. No merge or release is requested.