feat(cgs): support read-only actions - #34
Closed
neithanmo wants to merge 1 commit into
Closed
Conversation
CGS could not distinguish RPC-shaped reads from effectful actions, so safe POST-style queries were forced through mutation review. Add an explicit, validated effect: read attestation for kind: action while keeping unannotated actions fail-closed. Propagate the derived semantic effect through discovery, plan lowering, flow checks, presentation, hydration safety, and execution. Mark Grafana datasource_query_run as a reviewed read action and document the authoring contract.
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
effect: readauthor attestation for narrowly proven RPC-shapedkind: actioncapabilitiesside_effectoutputs, mutation sinks, or non-action kinds)Why
kind: actionis the catch-all for operations that do not fit the normal REST-oriented capability kinds. Most actions are effectful, but some APIs expose narrowly provable read-only RPCs as actions. Previously CGS could not express that distinction.This remains opt-in and fail-closed: operation names, HTTP methods, idempotence, and response shape do not infer safety. The attestation must cover complete downstream behavior. Broad dispatchers whose behavior depends on arbitrary providers or plugins remain unannotated.
Semantics
query,search, andgetremain reads without an annotation.create,update, anddeleteremain writes.Validation
cargo check -p plasm-core -p plasm-runtime -p plasm-agent-corecargo test -p plasm-core validates_read_effect_trust_boundary --libcargo test -p plasm-agent-core read_action_effect_and_output_matrix_lower_without_ack_shape --libcargo run -p plasm-cli --bin plasm-cgs -- schema validate apis/grafanacargo fmt --allgit diff --check