Repository navigation
Conversation
|
@mohsen1 can i review this and other open pr ? |
This branch has not been deployed
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.
Problem
openapi.public.jsonalready exposesget_finding(GET /api/v1/organizations/{org_id}/findings/{finding_id}->CustomerFinding), andproofline reviewprints finding IDs for follow-up commands, but the CLI had noproofline finding <FINDING_ID> [--json]command to inspect an individual finding directly.Approach
build.rs: Registered("get", "get_finding", &["finding_id"])inOPERATIONSsoroutes.rsgeneratesurl_get_finding.src/model.rs: AddedCustomerFindingand its typed OpenAPI sub-models (CustomerEvidenceRef,CustomerFindingValidation,FindingCausalGraphView,FindingCausalNodeView,FindingCausalEdgeView,FindingRuleRefView,FindingSupport,UntrustedText).src/api.rs: AddedApi::finding(&self, finding_id: Uuid) -> Result<(serde_json::Value, CustomerFinding), ApiError>, matchingApi::reviewby returning both the rawserde_json::Value(preserving unknown/future server fields for--json) and the typedCustomerFinding(for text rendering).src/render.rs: Addedrender::finding_detail(withformat_evidence_ref) usingone_lineterminal-escape sanitization for all untrusted server strings, plus a unit testfinding_detail_renders_evidence_validation_and_causal_graph.src/lib.rs: AddedCommand::Finding(FindingArgs)(finding_id: Uuid,--json: bool) and wired it inrun().tests/contract.rs: AddedCustomerFindingandCustomerEvidenceReftotypes_match_the_public_contractand("get", "/api/v1/organizations/{org_id}/findings/{finding_id}")tooperations_the_cli_calls_exist.tests/http.rs: Addedfinding_command_renders_text_and_json_safelyusing an axum mock server to verifyAuthorization: Bearer ...header, terminal-escape stripping in text mode, rendered metadata/evidence/causal-graph fields, and verbatim raw JSON preservation in--jsonmode.Proofline Review & Evaluation
Tested on our fork PR (
Quantum-Club-Inc/cli#1, Proofline review):JSON test misses altered claims and dropped fields) intests/http.rs: our--jsontest assertions only checkedparsed["id"]andparsed["future_server_field"]["kept_in_json"], so mutations toclaimor dropped fields likeimpactwould have gone undetected.(serde_json::Value, CustomerFinding)inApi::findingis to preserve the raw server document verbatim for--json. In commit98cac86, we replaced the partial assertions withassert_eq!(parsed, payload);.End-to-End Verification & Reproducible Steps
Run in
/Users/colf/Desktop/proofline-cli(Rust 1.95):Observed results after the final edit (
98cac86):cargo fmt --check: passed (exit 0)cargo clippy --locked --all-targets -- -D warnings: passed (exit 0)cargo test --locked --lib:63 passed; 0 failed; 0 ignored(includesrender::tests::finding_detail_renders_evidence_validation_and_causal_graph)cargo test --locked --test contract:2 passed; 0 failed; 0 ignored(operations_the_cli_calls_exist,types_match_the_public_contract)cargo test --locked --test http:41 passed; 0 failed; 0 ignored(includesfinding_command_renders_text_and_json_safely)