Repository navigation
Conversation
The policy decision log needs the RPC ListPolicyDecisions of PolicyService. The API build 20261104174030-9113dd6a8ea6 adds it. The regenerated PolicyServiceClient mock gets the new method. The same build moves GitRef to safedep.messages.scm.v1. The CLI does not use GitRef, so no other code changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MhRi597EX9odoSDXbVBsxz
audit event list turned --since and --until into a time range in its own code. policy decision list needs the same flags with the same checks. The logic now lives in duration.Window, so both commands refuse the same input with the same message. The audit behavior does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MhRi597EX9odoSDXbVBsxz
An admin who changes a rule, or who sees a blocked install, could not ask which decisions a revision, an override or a rule made, and where. The new command reads ListPolicyDecisions and lists the decisions of pmg and the pull request check, newest first. Each filter of the RPC has a flag: --since, --until, --tool, --outcome, --revision, --rule, --override, --path, --package, --project and --endpoint. --override takes a name or an id and resolves it in the policy at --revision, or at head. --package takes a PURL with no version. Each row shows the time, the tool, the package version, the outcome, the rule or field with its layer or override, the revision, and the place. The revision cell adds the default policy revision when the default policy decided, so a cooldown block shows both. A pmg place is the hostname and the user, with one hint: the CI repository, else the Kubernetes workload, else the agent. A check shows the repository, the pull request number and the link. A scan shows the repository and the ref. The JSON output writes the messages of the server in protojson. The errors map to a missing entitlement, a role that cannot read the policy, a bad page token or filter, and a server without the RPC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MhRi597EX9odoSDXbVBsxz
…lengths
A review of policy decision list found these problems:
- --override with the id of a deleted override failed with "no policy
override is named". A stored decision keeps that id, and the server
matches it. The command now sends a value with the shape of an
override id ("ov_" and 8 to 64 Crockford base32 characters) as is when
the policy does not have it. Other unknown values still fail.
- --package let the PURL parser change the name. The parser lowercases
a PyPI name and drops the vendor of a Composer package, but the server
compares the stored name exactly. The command now takes only the
ecosystem from the parser and builds the name from the PURL as
written: npm @scope/name, Maven group:artifact, the Go module path,
Composer vendor/name. It refuses qualifiers and a subpath.
- The command did not check the length limits of the filters. It now
refuses a --rule or --override over 64 characters, a --path over 256,
a --project over 128, an --endpoint over 100 and a package name over
255, with the flag name in the message.
- duration.Window changed the help of audit event list from "for the
events" to "for the time". The caller now gives the noun, so the
audit text is the same as before.
- The command built the filters three times. It now checks the flags
once in Args and passes the result to the run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MhRi597EX9odoSDXbVBsxz
SafeDep Report SummaryPackage Details
This report is generated by SafeDep GitHub App |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The author asked for one PR. The four commits of this PR are now on the branch of #67, with a fast-forward to ddaa59a, so #67 carries Generated by Claude Code |




Summary
This is the CLI part of safedep/control-tower#1636.
safedep policy decision listlists the decisions that pmg and the pull request check made with the cloud policy: which rule or field decided, at which revision, and where. It readsPolicyService.ListPolicyDecisionsfrom safedep/api#260. The server is in safedep/control-tower#1644.This PR is stacked on #67, which adds the
safedep policytree. Merge #67 first. GitHub then moves the base of this PR tomain.Changes
20261104174030-9113dd6a8ea6), with thePolicyServiceClientmock made again by mockery. The move ofGitReftoscm.v1breaks nothing here, because the CLI does not use it.duration.Window:audit event listand the new command share the--sinceand--untilcheck. The audit messages and help text do not change, and a test asserts the help text.safedep policy decision list:--since,--untilaudit event list--toolpmg,pull-request-checkorvet--outcomeblocked,failedorallowed--revision,--rule,--path--override--revision, or at head. The id of a deleted override goes to the server as it is.--packagepkg:npm/@acme/uiorpkg:maven/org.acme/core. The CLI takes the ecosystem from the PURL and keeps the name as the ecosystem stores it.--project,--endpoint--limit,--page-tokenThe CLI checks the length limits of the proto locally and names the flag in the error.
Output
eco/name@versionoverride NAME,default policyorbase47 · default 12.repo#number. Scan:repo@ref.Plain output keeps exact values. JSON output gives the server messages as they are, with every field of the contract. The table and the plain output escape all server text.
Until safedep/control-tower#1644 is deployed, the server answers Unimplemented, and the command says that SafeDep Cloud does not have the decision log yet.
Review
A Fable review checked the branch three ways: adversarially, against the contract, and for clean code. It found one blocking defect: the CLI refused
--overridewith the id of a deleted override. The last commit fixes it. The same commit also:Testing
Filters;make lint-conventions,make lint,make testandmake buildpass. The lint reports0 issues.Generated by Claude Code