feat: surface Gemara bundle metadata in list and get commands Body:#711
Open
yvonnedevlinrh wants to merge 2 commits into
Open
feat: surface Gemara bundle metadata in list and get commands Body:#711yvonnedevlinrh wants to merge 2 commits into
yvonnedevlinrh wants to merge 2 commits into
Conversation
d01a665 to
4cad011
Compare
trevor-vaughan
requested changes
Jul 10, 2026
yvonnedevlinrh
added a commit
to yvonnedevlinrh/complyctl
that referenced
this pull request
Jul 13, 2026
…te flush Address PR complytime#711 review feedback from @trevor-vaughan: - Use ps.Version (concrete persisted version) instead of the config tag for ExtractPolicyMetadata. A ":latest" pin is stored under the resolved version, so extracting by "latest" would fail store.Resolve() and silently drop all metadata. - Move cache.SaveState() from per-policy (syncSinglePolicy) to after the loop (syncAllPolicies) for batch flush instead of repeated disk writes. - Remove redundant cacheDir parameter from syncAllPolicies and syncSinglePolicy; use cacheMgr.Dir() instead. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
yvonnedevlinrh
added a commit
to yvonnedevlinrh/complyctl
that referenced
this pull request
Jul 13, 2026
…rtion Address PR complytime#711 review feedback from @trevor-vaughan: - Replace truncated SHA-256 digests (16 hex chars) with valid-length hashes (64 hex chars) in test fixtures for realistic test data. - Add missing dash assertion in TestListOptions_Run_MultiEvaluatorShowsDash to verify the evaluator column actually shows "-" for multi-evaluator policies. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
yvonnedevlinrh
added a commit
to yvonnedevlinrh/complyctl
that referenced
this pull request
Jul 13, 2026
- Use ps.Version (concrete persisted version) instead of the config tag for ExtractPolicyMetadata. A ":latest" pin is stored under the resolved version, so extracting by "latest" would fail store.Resolve() and silently drop all metadata. - Move cache.SaveState() from per-policy (syncSinglePolicy) to after the loop (syncAllPolicies) for a single batch flush. - Remove redundant cacheDir parameter from syncAllPolicies and syncSinglePolicy; use cacheMgr.Dir() instead. - Replace truncated SHA-256 digests with valid-length 64 hex char hashes in test fixtures. - Add missing dash assertion in TestListOptions_Run_MultiEvaluatorShowsDash. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
c6e58f3 to
b889433
Compare
yvonnedevlinrh
added a commit
to yvonnedevlinrh/complyctl
that referenced
this pull request
Jul 13, 2026
- Use ps.Version (concrete persisted version) instead of the config tag for ExtractPolicyMetadata. A ":latest" pin is stored under the resolved version, so extracting by "latest" would fail store.Resolve() and silently drop all metadata. - Move cache.SaveState() from per-policy (syncSinglePolicy) to after the loop (syncAllPolicies) for a single batch flush. - Remove redundant cacheDir parameter from syncAllPolicies and syncSinglePolicy; use cacheMgr.Dir() instead. - Remove omitempty from ControlCount and AssessmentCount JSON tags so zero values survive round-trips and "metadata extracted with 0 controls" is distinguishable from "metadata never extracted". - Replace truncated SHA-256 digests with valid-length 64 hex char hashes in test fixtures. - Add missing dash assertion in TestListOptions_Run_MultiEvaluatorShowsDash. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
b889433 to
b6cdfcb
Compare
Contributor
Author
|
@trevor-vaughan Thanks for the thorough review. All five items addressed in b6cdfcb:
|
- Add EVALUATOR and CONTROLS columns to `complyctl list` sourced from PolicyState metadata cached in state.json - Print post-sync summary to stderr after `complyctl get` showing policy title, evaluator, control count, and assessment count - Add PolicyTitle, PolicyEvaluator, ControlCount, AssessmentCount fields to PolicyState with omitempty tags for backward compat - Add ExtractPolicyMetadata() to policy.Resolver for lightweight metadata extraction without building full DependencyGraph - Add upgrade backfill for pre-existing caches without metadata - Add formatPolicySummary() helper for testable stderr output - Include OpenSpec artifacts (proposal, design, spec, tasks) Closes complytime#506 Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
- Use ps.Version (concrete persisted version) instead of the config tag for ExtractPolicyMetadata. A ":latest" pin is stored under the resolved version, so extracting by "latest" would fail store.Resolve() and silently drop all metadata. - Move cache.SaveState() from per-policy (syncSinglePolicy) to after the loop (syncAllPolicies) for a single batch flush. - Remove redundant cacheDir parameter from syncAllPolicies and syncSinglePolicy; use cacheMgr.Dir() instead. - Remove omitempty from ControlCount and AssessmentCount JSON tags so zero values survive round-trips and "metadata extracted with 0 controls" is distinguishable from "metadata never extracted". - Replace truncated SHA-256 digests with valid-length 64 hex char hashes in test fixtures. - Add missing dash assertion in TestListOptions_Run_MultiEvaluatorShowsDash. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
b6cdfcb to
cc36c06
Compare
trevor-vaughan
approved these changes
Jul 13, 2026
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
Implements #506 (Options B + C) -- surface Gemara bundle metadata via CLI for informed configuration.
Changes
complyctl listgains EVALUATOR and CONTROLS columns showing the evaluator type and control count for each cached policycomplyctl getprints a post-sync summary to stderr after fetching a policy, showing title, evaluator, control count, and assessment countPolicyStateinstate.jsongainspolicy_title,policy_evaluator,control_count, andassessment_countfields (backward compatible viaomitempty)policy.Resolver.ExtractPolicyMetadata()provides lightweight metadata extraction without building a fullDependencyGraphcomplyctl getrunformatPolicySummary()helper for testable stderr outputFiles Changed
cmd/complyctl/cli/get.go,cmd/complyctl/cli/list.gointernal/cache/state.gointernal/policy/resolver.gocli_test.go,get_verify_test.go,state_test.go,resolver_test.goCHANGELOG.md,AGENTS.mdopenspec/changes/bundle-metadata-cli/(proposal, design, spec, tasks)Option A (deferred)
complyctl inspect <url>for pre-pull discovery was evaluated and deferred -- the gap is minimal now thatgetprints a summary andlistshows metadata.Closes #506