- Slice 1: Enable
EnableDotGitCommonDiringitview.New()so HEAD resolves in worktrees- Test:
New()succeeds when called from a git worktree path - Test:
BranchName()returns correct branch when called from a worktree - Test:
GetCommitInfoFromCommitSHA("HEAD", ...)works from a worktree
- Test:
- Slice 1: Skeleton
evaluateparent +evaluate trailfetches trail JSON - Slice 2:
--policyflag + OPA Rego evaluation - Slice 3: JSON audit result output +
--formatflag - Slice 4:
--show-inputflag - Slice 5:
--attestationsflag + attestation enrichment- Slice 5a: Array-to-map transform for
attestations_statuses - Slice 5b: Rehydration
- Slice 5c:
--attestationsfiltering
- Slice 5a: Array-to-map transform for
- Slice 6: Replace
--formatwith--outputflag - Slice 7:
kosli evaluate trails(collection mode) - Slice 8: Make
--policyrequired, remove no-policy code path - Slice 9: Extract shared enrichment pipeline
- Slice 10: Extract shared options struct
- Slice 11: Use
output.FormattedPrintfor output dispatch - Slice 12: Debug logging for swallowed errors during attestation detail fetching
- Slice 13: Standardise
assertvsrequireintransform_test.go - Slice 14: Make
--output tableproduce actual tabular output - Slice 15: DRY up command flag registration
- Slice 16: Extract tree-traversal duplication in transform.go
- Slice 17: Align test method naming
- Slice 18: Fail evaluation when rehydration errors occur (instead of silently swallowing them)
- Slice 19: Add Long descriptions, Example blocks, and docs feedback (policy contract hint, snyk trail example)
- Slice 1:
evaluate input --input-filewith a file path - Slice 2: stdin support (omit --input-file to read stdin;
-not supported by cobra) - Slice 3: help text and examples
- Slice 4: PR review feedback
- Remove "using OPA" from all evaluate command long descriptions
- Add test cases for policy validation errors (missing package policy, missing allow rule, deny without violations)
- Update help text examples with fixture-capture workflow
- Refactor: use
cmd.InOrStdin()for testable stdin - Refactor: embed
commonEvaluateOptionsto remove flag duplication
- Slice 5: Detect terminal stdin and error when no input is piped
- Slice 1:
evaluate.Evaluate()accepts params, passes via OPA data store - Slice 2: Add
--paramsflag across all three commands - Slice 3: Show params in
--show-inputoutput - Slice 4: Update help text and examples
Goal: make evaluate commands a policy decision point — print the verdict but let callers choose whether a deny becomes a non-zero exit. Today's default stays "assert" (non-zero on deny); the next major release flips the default to "no-assert" by changing one line.
- Slice 1: Plumb
assertOnDenybool throughevaluateAndPrintResultand the two printers (always passedtrue)- Existing
wantError: truedeny-all cases stay green
- Existing
- Slice 2: Add
--assert/--no-assertflags tocommonEvaluateOptions, mark mutually exclusive, default = assert-
evaluate input --policy deny-all --no-assertexits 0, printsRESULT: DENIED -
evaluate input --policy deny-all --assertexits non-zero -
evaluate input --policy deny-all(neither flag) exits non-zero (default unchanged) -
evaluate input --assert --no-assert ...fails with cobra mutual-exclusion error -
evaluate input --policy deny-all --no-assert --output jsonemits"allow": false, exits 0 - Smoke test in
evaluate trailandevaluate trailssuites (--no-assertexit 0 + mutual exclusion); deferred run pending local Kosli server
-
- Slice 3: Help text and examples
- Update
evaluateLongDescandevaluateInputLongDescexit-code section - Add
--no-assertexample to each command'sExampleblock - Verify
kosli evaluate trail --helpshows new flags
- Update
-
TestGitHubContract_Fake: V2 returns PRs for commit with PRs -
TestGitHubContract_Fake: V2 returns empty for commit with no PRs -
TestGitHubContract_Fake: V2 returns error when Err is injected -
TestGitHubContract_Fake: V1 returns PRs for commit with PRs -
TestGitHubContract_Fake: V1 returns empty for commit with no PRs -
TestGitHubContract_Fake: V1 returns error when Err is injected -
TestGitHubContract_RealGitHub: same contract, env-gated onKOSLI_GITHUB_TOKEN
- Add
ProviderAndLabel() (string, string)totypes.PRRetrieverinterface - Implement on
GithubConfig→("github", "pull request") - Implement on
GitlabConfig→("gitlab", "merge request") - Implement on
AzureConfig→("azure", "pull request") - Implement on bitbucket
Config→("bitbucket", "pull request") - Implement on
FakeGitHubClient→("github", "pull request") - Replace reflection in
getGitProviderAndLabelwithretriever.ProviderAndLabel() - Inject fake in
assertPRGithub_test.go - Inject fake in
attestPRGithub_test.go
- Test: non-multipart JSON request body is compact (no indentation)
- Fix: change
json.MarshalIndent→json.Marshalon line 122 of requests.go - Fix: update
PayloadOutputto pretty-print non-multipart body for debug/dry-run logging - Verify: all request tests pass
- Slice 1: Define
LambdaAPIinterface and refactor signatures - Slice 2: Contract test suite against real AWS
- Slice 3: Build
FakeLambdaClientthat passes the contract - Slice 4: Fake-backed unit tests for filtering and pagination
- Slice 5: Fake-backed unit tests for orchestration
- Slice 6: Trim existing integration tests
- Slice 7: Package-level factory + fake-backed command tests
- Define
ECSAPIinterface (ListClusters,DescribeClusters,ListServices,ListTasks,DescribeTasks) and refactor signatures - Contract test suite against real AWS (env-gated)
- Build
FakeECSClientthat passes the contract (nested pagination: clusters → services → tasks) - Fake-backed unit tests for filtering (cluster names, service names, regex, exclude patterns)
- Fake-backed unit tests for orchestration (concurrent cluster/service/task fetching, error propagation)
-
NewECSClientFuncfactory + inject fake intosnapshotECS_test.gocommand tests - Trim existing ECS integration tests to smoke tests
- Add ECS to
make test_contract_aws
- Define
S3APIinterface (decide: fake at paginator level or rawListObjectsV2level) - Contract test suite against real AWS (env-gated)
- Build
FakeS3Clientthat passes the contract - Fake-backed unit tests for path include/exclude filtering and digest computation
-
NewS3ClientFuncfactory + inject fake intosnapshotS3_test.gocommand tests - Trim existing S3 integration tests to smoke tests
- Add S3 to
make test_contract_aws
- Define interfaces for ARM AppService + Azure Container Registry clients
- Contract test suite against real Azure (env-gated)
- Build fakes that pass the contracts
- Fake-backed unit tests for app listing, image fingerprinting, error propagation
- Factory + inject fakes into
snapshotAzureApps_test.gocommand tests - Trim existing Azure integration tests to smoke tests
- Define
DockerAPIinterface (Pull, Push, Tag, Remove, Run, container operations) - Contract test suite against real Docker daemon
- Build
FakeDockerClientthat passes the contract - Fake-backed unit tests
- Factory + inject fake into
snapshotDocker_test.gocommand tests - Trim existing Docker integration tests to smoke tests
- Define interface for Kubernetes clientset operations (pod listing, namespace listing)
- Contract test suite against real cluster (KIND, env-gated)
- Build fake that passes the contract (semaphore pattern, namespace filtering)
- Fake-backed unit tests for filtering, large-scale concurrency, error propagation
- Factory + inject fake into
snapshotK8S_test.gocommand tests - Trim existing Kube integration tests to smoke tests