Skip to content

feat: app_deployment collection and CM-006 evaluation#4

Merged
keyskey merged 9 commits into
mainfrom
feat/app-deployment
Jun 9, 2026
Merged

feat: app_deployment collection and CM-006 evaluation#4
keyskey merged 9 commits into
mainfrom
feat/app-deployment

Conversation

@keyskey

@keyskey keyskey commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Argo CD の本番 Application デプロイ証跡(app_deployment)の収集と CM-006 評価を追加する。これで 4 種類すべての証跡の収集・評価をサポートする。

  • Evidence / Config: AppDeployment 型、providers.argocdevidence.app_deploymentscope.applications 必須)、controls.app_deployment.traceability
  • Storage: PutAppDeployment / QueryAppDeployment(postgres + filesystem)
  • Join: repository + revision で過去 code_change を結合(lookback_days、最新 merged_at 優先)
  • Collect: kao collect app-deployment — 公式 argoproj/argo-cd/v2 apiclient で status.history を収集
  • Evaluate: CM-006 Required Chain(app → code_change → author → approvals → ci.runs[].url
  • Traceability: CM-006/007 で evaluateTraceabilityCore を共有、terminal は各 evaluator で inline
  • Daily: app_deployment / infra_deployment は設定がある場合のみ collect(Argo CD や Terraform apply 未設定の組織ではスキップ)。設計 doc §7/§8 を更新

Commit 順(実装手順)

  1. feat: add AppDeployment evidence type and git URL repository helper
  2. feat: add app_deployment evidence, argocd provider, and control config
  3. feat: add app_deployment storage Put and Query
  4. feat: implement CM-006 app_deployment evaluation using traceability core
  5. refactor: migrate CM-007 to evaluateTraceabilityCore
  6. feat: add argocd provider using official apiclient for app_deployment collection
  7. feat: add collect app-deployment command and daily step
  8. test: add app_deployment fixture data and storage round-trip test
  9. feat: skip infra_deployment collect when not configured

Test plan

  • go test ./...
  • kao collect app-deployment --config kao.yaml --date YYYY-MM-DD(実 Argo CD 環境、ARGOCD_SERVER / ARGOCD_TOKEN 要)
  • kao evaluate --config kao.local.yaml --input files --app-deployment testdata/app_deployment.jsonl --code-change testdata/code_change.jsonl
  • kao run daily --config kao.yaml --date YYYY-MM-DD

Made with Cursor

keyskey and others added 8 commits June 9, 2026 23:48
Define app_deployment JSON shape per design doc §13 and extract
repository short names from Git remote URLs for join with code_change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add providers.argocd, evidence.app_deployment scope, CM-006 controls,
and helpers for server normalization and daily skip detection.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extend storage backend with app_deployment_evidence upsert and date/repo
filtering for postgres and filesystem backends.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extract evaluateTraceabilityCore for join through approvals, add CM-006
with CI URL terminal check, and wire app_deployment into evaluate runner.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse shared join/author/approvals logic for infra_deployment and keep
execution.url as the CM-007 inline terminal check.

Co-authored-by: Cursor <cursoragent@cursor.com>
… collection

Collect deployment history via ApplicationService.Get, map status.history
to evidence, and pin argoproj/argo-cd/v2 for API compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expose kao collect app-deployment, run it as step 3 in kao run daily
before infra_deployment, and skip when Argo CD is not configured.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add sample matrix-style app deployment evidence for files-mode evaluate
and verify filesystem Put/Query for app_deployment.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keyskey keyskey self-assigned this Jun 9, 2026
Align daily and explicit collect with optional infra evidence: Terraform-less
orgs need not configure apply_workflows. Update design doc §7/§8 accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keyskey

keyskey commented Jun 9, 2026

Copy link
Copy Markdown
Owner Author

追記: infra_deployment の optional collect

734f79e で app と対称に infra も設定時のみ collect するようにした。

  • InfraDeploymentEnabled(): evidence.infra_deployment.provider + (apply_workflows または apply_job_names)
  • kao run daily: 未設定時は infra collect をスキップ(CM-007 も評価対象外)
  • kao collect infra-deployment: 未設定時は明示エラー
  • 設計 doc §7/§8: deployment evidence は設定がある場合のみ収集と明記

@keyskey keyskey merged commit 0a0300b into main Jun 9, 2026
1 check passed
@keyskey keyskey deleted the feat/app-deployment branch June 9, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant