Skip to content

feat: infra_deployment collection and CM-007 evaluation#3

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

feat: infra_deployment collection and CM-007 evaluation#3
keyskey merged 9 commits into
mainfrom
feat/infra-deployment

Conversation

@keyskey

@keyskey keyskey commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Terraform infra apply 証跡(infra_deployment)の収集と CM-007 評価を追加する。GHA matrix apply を前提に、共有 reusable workflow の固定 job 名から workspace を抽出する。

  • Evidence / Config: InfraDeployment 型、evidence.infra_deploymentapply_workflows, apply_job_names, workspace_job_name_pattern)、controls.infra_deployment.traceability
  • Storage: PutInfraDeployment / QueryInfraDeployment(postgres + filesystem)
  • Join: repository + commit_sha で過去 code_change を結合(lookback_days、最新 merged_at 優先)
  • Collect: kao collect infra-deployment — workflow run → apply job(prefix マッチ)→ job 名 regex で workspace 抽出
  • Evaluate: CM-007 Required Chain(infra → code_change → author → approvals → execution.url
  • Daily: kao run daily に infra_deployment 収集(step 4)を追加

Commit 順(実装手順)

  1. feat: add InfraDeployment evidence type and workspace scope helper
  2. feat: add infra_deployment evidence and control config
  3. feat: add infra_deployment storage Put and Query
  4. feat: add code_change join helper for deployment traceability
  5. feat: implement CM-007 infra_deployment evaluation
  6. feat: add github provider for infra_deployment collection
  7. feat: add collect infra-deployment command and daily step
  8. test: add infra_deployment fixture data
  9. docs: document matrix job name workspace extraction in §14

Test plan

  • go test ./...
  • kao collect infra-deployment --config kao.yaml --date YYYY-MM-DD(platform-infra 等の実 repo)
  • kao evaluate --input files --infra-deployment testdata/infra_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 9 commits June 9, 2026 22:43
Define infra_deployment JSON shape (Execution block, applied_at) and
scope.Matches for workspace include/exclude glob filtering.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add evidence.infra_deployment settings (apply_workflows, apply_job_names,
workspace_job_name_pattern) and controls.infra_deployment.traceability
with design-doc defaults.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
Join deployments to code_change by repository + commit_sha, picking the
newest merged_at when multiple candidates exist (CM-006/007).

Co-authored-by: Cursor <cursoragent@cursor.com>
Evaluate Required Chain (infra_deployment → code_change → author →
approvals → execution.url) using QueryCodeChangeForJoin and the shared
join helper. Wire into evaluate runner and --infra-deployment files flag.

Co-authored-by: Cursor <cursoragent@cursor.com>
Detect Terraform apply runs via apply_workflows and apply_job_names prefix
match, extract workspace from matrix job names, and emit infra_deployment
evidence per successful apply job.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expose kao collect infra-deployment and run it as step 4 in kao run daily
before evaluate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add sample matrix-apply evidence for files-mode evaluate testing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify that workspace is parsed from GHA matrix job name suffix, not
workflow_dispatch inputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keyskey keyskey self-assigned this Jun 9, 2026
@keyskey keyskey merged commit 0649191 into main Jun 9, 2026
1 check passed
@keyskey keyskey deleted the feat/infra-deployment branch June 9, 2026 13:56
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