rdev/cookbooks/trees/slackpath-4-microservice-constellation.yaml
jordan d69da6d627 feat: add structured logging infrastructure and SDLC extensions
Major changes:
- Add internal/logging package with field constants, context propagation,
  sensitive data auto-redaction, and per-component log levels
- Add worker timeout constants (TimeoutQuickOp, TimeoutHealthCheck, etc.)
- Extend SDLC with callback handlers, generate endpoints, and executor
- Add new cookbook trees for aeries and slackpath progression
- Add skeleton templates for queue, realtime, and microservices
- Add worker component template with async job processing
- Refactor services and handlers to use new logging infrastructure
- Split component.go into component_infra.go and component_listing.go

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:56:04 -07:00

93 lines
2.9 KiB
YAML

name: microservice-constellation
description: "Slack Path 4: Distributed System. Orchestrates communication between Auth, Chat, and Worker services."
version: 1
vars:
project_name: ""
feature_slug: "mesh-interop"
steps:
# --- Infrastructure ---
create-project:
action: api
method: POST
endpoint: /project
body:
name: "{{ .vars.project_name }}"
description: "Slack Path 4: Microservices"
outputs:
- project_id: .data.name
- domain: .data.domain
add-auth:
action: api
method: POST
endpoint: "/projects/{{ .outputs.create-project.project_id }}/components"
body: { type: service, name: "auth-svc" }
add-chat:
action: api
method: POST
endpoint: "/projects/{{ .outputs.create-project.project_id }}/components"
body: { type: service, name: "chat-svc" }
add-worker:
action: api
method: POST
endpoint: "/projects/{{ .outputs.create-project.project_id }}/components"
body: { type: worker, name: "worker-svc" }
wait-infra:
action: wait_pipeline
project_id: "{{ .outputs.create-project.project_id }}"
# --- Implementation ---
implement-mesh:
description: "Agent implements Service-to-Service calls (Chat calls Auth, Chat queues to Worker)"
depends_on: [wait-infra]
action: api
method: POST
endpoint: "/projects/{{ .outputs.create-project.project_id }}/builds"
body:
prompt: "/implement-feature {{ .vars.feature_slug }} --requirements 'Chat Service must call http://auth-svc/validate to check tokens. Chat Service must push to Redis queue for Worker. Worker must process tasks.'"
auto_commit: true
auto_push: true
git_clone_url: "https://git.threesix.ai/jordan/{{ .outputs.create-project.project_id }}.git"
outputs:
- build_id: .data.task_id
wait-build:
action: shell
command: |
for i in {1..120}; do
STATUS=$(curl -s "$RDEV_API_URL/builds/{{ .outputs.implement-mesh.build_id }}" -H "X-API-Key: $RDEV_API_KEY" | jq -r '.data.status // .status')
if [ "$STATUS" == "completed" ]; then exit 0; fi
if [ "$STATUS" == "failed" ]; then exit 1; fi
sleep 5
done
exit 1
wait-deploy:
action: wait_pipeline
project_id: "{{ .outputs.create-project.project_id }}"
# --- Verification ---
verify-e2e:
description: "Call Chat Service (which calls Auth internally)"
depends_on: [wait-deploy]
action: shell
command: |
DOMAIN="{{ .outputs.create-project.domain }}"
# We mock a token (assuming auth service has a backdoor or we register first)
# This test verifies that the Chat service didn't crash trying to reach Auth
# and that it successfully handed off work.
RESP=$(curl -s "https://$DOMAIN/api/chat/status")
if echo "$RESP" | grep "Services Connected"; then exit 0; else exit 1; fi
teardown:
- action: api
method: DELETE
endpoint: "/project/{{ .outputs.create-project.project_id }}"