Skip to main content

Implementation Plan: Refactor Quick Sanity Integration Workflows

Branch: 096-refactor-quick-sanity-setup-caipe | Date: 2026-03-20 | Spec: spec.md Input: Feature specification from /specs/096-refactor-quick-sanity-setup-caipe/spec.md

Summary​

Refactor the CI quick sanity integration testing into two distinct workflows: (1) a release-tag workflow that uses setup-caipe.sh to deploy a specific Helm chart version into a Kind cluster with minimal agents (supervisor, weather, netutils) and validates using built-in sanity tests, and (2) a dev workflow that uses docker-compose.dev.yaml with all agents + RAG (no GraphRAG) and runs make quick-sanity. Remove the stable-tag workflow, the stable git tag, and the create-stable-tag-and-test job from the latest-tag workflow.

Technical Context​

Language/Version: YAML (GitHub Actions workflows), Bash (setup-caipe.sh invocation) Primary Dependencies: GitHub Actions, setup-caipe.sh, docker-compose, Kind, Helm, kubectl Storage: N/A Testing: setup-caipe.sh validate (release-tag workflow), make quick-sanity (dev workflow) Target Platform: GitHub Actions self-hosted runner (caipe-integration-tests, Ubuntu) Project Type: CI/CD workflow configuration Performance Goals: Total workflow execution within 150% of current approach Constraints: Single self-hosted runner; workflows must not run concurrently Scale/Scope: 3 workflow files modified/created, 1 deleted, 1 git tag deleted

Constitution Check​

GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.

GateStatusNotes
Branching convention (prebuild/<type>/<desc>)PASSBranch is 096-refactor-quick-sanity-setup-caipe, will use prebuild/ci/refactor-quick-sanity-setup-caipe for PR
Conventional CommitsPASSWill use ci(workflows): ... type
DCO sign-offPASSgit commit -s
Quality gates (make lint, make test)PASSNo Python/TS code changes; workflow YAML validated by GitHub Actions
Test-first (VII)PASSAcceptance criteria from spec become workflow validation steps
No secrets in source (IX)PASSCredentials injected via GitHub Secrets → .env file
Simplicity (X)PASSReusing existing setup-caipe.sh and make quick-sanity; no new abstractions
Spec-driven workflowPASSFull specify → plan → tasks → implement pipeline

Post-Phase 1 re-check: No violations introduced. The design reuses existing tools (setup-caipe.sh, docker-compose profiles, make quick-sanity) without new abstractions.

Project Structure​

Documentation (this feature)​

specs/096-refactor-quick-sanity-setup-caipe/
├── spec.md # Feature specification
├── plan.md # This file
├── research.md # Phase 0 research output
├── data-model.md # Phase 1 output (minimal - no data entities)
├── quickstart.md # Phase 1 output (testing guide)
├── checklists/
│ └── requirements.md # Spec quality checklist
└── tasks.md # Phase 2 output (/speckit.tasks)

Source Code (repository root)​

.github/workflows/
├── tests-quick-sanity-integration-dev.yml # MODIFY: refactor to docker-compose.dev.yaml + all-agents + rag
├── tests-quick-sanity-integration-on-latest-tag.yml # MODIFY: replace with release-tag workflow using setup-caipe.sh + Kind
└── tests-quick-sanity-integration-on-stable-tag.yml # DELETE: removed entirely

Structure Decision: This feature modifies only GitHub Actions workflow YAML files in .github/workflows/. No source code, Helm charts, or test files are changed.

Phase 0: Research Findings​

All research is documented in research.md. Key decisions:

IDTopicDecisionReference
R1Docker Compose profilesUse caipe-supervisor, caipe-mongodb, deps, caipe-ui, all-agents, netutils-agent, rag profilesR1
R2Chart version pinningPass CAIPE_CHART_VERSION env var to setup-caipe.shR2
R3Test suite for minimal agentsUse setup-caipe.sh validate for release-tag (no GitHub agent), make quick-sanity for devR3
R4Port-forwardingsetup-caipe.sh validate handles it; docker-compose binds directlyR4
R5ConcurrencySeparate concurrency groups per workflow; cancel-in-progress for dev onlyR5
R6Tag resolutiongit tag --sort=-version:refname with semver grepR6
R7Leftover cleanupPre-step kind delete cluster + post-step setup-caipe.sh nukeR7

Phase 1: Design​

Workflow 1: Release-Tag Integration Test (tests-quick-sanity-integration-on-latest-tag.yml — rewritten)​

File: .github/workflows/tests-quick-sanity-integration-on-latest-tag.yml Name: [Tests][Release Tag] Quick Sanity Integration

Triggers:

  • push.tags: ['[0-9]+.[0-9]+.[0-9]+'] (semver tags only)
  • workflow_dispatch with optional chart_version input

Concurrency: group: caipe-integration-release, cancel-in-progress: false

Job: quick-sanity-release (runs-on: caipe-integration-tests)

StepNameAction
1Cleanup previous artifactsRemove __pycache__, .pyc, .pyo files
2Ensure workspace directorymkdir -p + chown
3Checkoutactions/checkout@v6 with fetch-tags: true, fetch-depth: 0
4Pre-clean Kind clusterkind delete cluster --name caipe 2>/dev/null || true
5Resolve chart versionIf workflow_dispatch input provided, use it. Otherwise resolve latest semver tag via git tag --sort=-version:refname
6Create .env from SecretsSame credential injection as current workflows
7Run setup-caipe.shCAIPE_CHART_VERSION=$CHART_VERSION ./setup-caipe.sh --non-interactive --create-cluster setup
8Run validation & sanity./setup-caipe.sh validate (includes port-forward, agent card check, A2A test, UI health, sub-agent health)
9On failure: show logskubectl logs from caipe namespace
10Upload logs artifactUpload pod logs as artifact
11Cleanup (always)./setup-caipe.sh nuke then kind delete cluster --name caipe 2>/dev/null || true

Workflow 2: Dev Integration Test (tests-quick-sanity-integration-dev.yml — rewritten)​

File: .github/workflows/tests-quick-sanity-integration-dev.yml Name: [Tests][Dev] Quick Sanity Integration

Triggers:

  • push.branches: [main]
  • workflow_dispatch

Concurrency: group: caipe-integration-dev, cancel-in-progress: true

Job: quick-sanity-dev (runs-on: caipe-integration-tests)

StepNameAction
1Cleanup previous artifactsRemove __pycache__, .pyc, .pyo files
2Ensure workspace directorymkdir -p + chown
3Checkoutactions/checkout@v6
4Create .env from SecretsSame credential injection, plus ENABLE_RAG=true, ENABLE_TRACING=false
5Show Docker versiondocker version / docker compose version
6Setup Pythonactions/setup-python@v6 (3.13)
7Install uvcurl install
8Start servicesdocker compose -f docker-compose.dev.yaml --profile caipe-supervisor --profile caipe-mongodb --profile deps --profile caipe-ui --profile all-agents --profile netutils-agent --profile rag up -d --build
9Stream logs (background)docker compose ... logs -f --no-color --timestamps | tee compose-live.log
10Wait for readinessPoll localhost:8000/.well-known/agent.json up to 36x (5s each, ~3min)
11Install GNU Makesudo apt-get install -y make
12Run Quick Sanity Testsmake quick-sanity
13On failure: show logstail -n 300 compose-live.log
14Upload logs artifactUpload compose-live.log
15Cleanup (always)docker compose -f docker-compose.dev.yaml ... down -v --remove-orphans, docker rmi -f $(docker images -aq)

Workflow 3: Delete Stable-Tag Workflow​

Action: Delete .github/workflows/tests-quick-sanity-integration-on-stable-tag.yml

Git Tag Cleanup​

Action: Delete the stable and latest tags from remote:

  • git push origin :refs/tags/stable
  • git push origin :refs/tags/latest

Changes to Existing Files Summary​

FileActionKey Changes
tests-quick-sanity-integration-dev.ymlRewriteReplace --profile=p2p with multi-profile docker-compose.dev.yaml; add concurrency group
tests-quick-sanity-integration-on-latest-tag.ymlRewriteReplace docker-compose approach + stable-tag job with setup-caipe.sh + Kind; add concurrency group; remove create-stable-tag-and-test job
tests-quick-sanity-integration-on-stable-tag.ymlDeleteEntire file removed

Git Tags to Delete: stable, latest (both from remote)

Complexity Tracking​

No constitution violations. All changes reuse existing infrastructure (setup-caipe.sh, docker-compose profiles, make quick-sanity). No new abstractions, scripts, or patterns introduced.