Files
The-transit-Project/.github/agents/azure-deploy/scaffold/references/self-healing.md
T
Sven laptop 635a130f0b
Build and Push Docker Images / detect-changes (push) Successful in 11s
Build and Push Docker Images / build-auth-api (push) Successful in 1m0s
Build and Push Docker Images / build-employee-api (push) Successful in 1m2s
Build and Push Docker Images / build-transit-api (push) Successful in 1m1s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m5s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m13s
Build and Push Docker Images / build-monitoring-ui (push) Successful in 1m15s
Build and Push Docker Images / deploy-test-node (push) Successful in 3s
──────
### Summary of Changes
  1. Documentation Consolidation:
      • Relocated the docs/ folder and all repository .md files (README.md, DEPLOYMENT.md, DOCKER_README.md,
      DOMAINS_README.md, GETTING_STARTED.md, CI_CD_PORTAINER_GUIDE.md, ADMIN_DEPLOYMENT_SUMMARY.md,
      SECURITY_PRIVATE_FILES.md, handoff.md, azure-project-plan.md, plus service-specific READMEs) into .
      • Updated document links in README.md.
  2. AI Agent Project Map:
      • Created PROJECT_MAP.md in the project root containing complete architecture diagrams, service specs, ports, DB
      schemas, environment variables, and developer workflows.
      • Added PROJECT_MAP.md to .gitignore.
  3. Monitoring UI & Infrastructure Integration:
      • Added monitoring_ui service to docker-compose.yml (port 5175).
      • Configured Gitea workflow docker-build.yml for monitoring_ui builds.
      • Added CORS middleware headers in index.js.
      • Added nginx.conf copy step in Dockerfile.

  ──────
  ### Recommended Commit Message

    docs: consolidate project documentation into monitoring_ui and add agent project map

    - Move all markdown documentation files and docs/ folder into monitoring_ui/docs/
    - Update documentation hub index (monitoring_ui/docs/README.md) with relative paths
    - Generate comprehensive AI agent reference map (PROJECT_MAP.md) in repository root
    - Add PROJECT_MAP.md and monitoring_ui build output/env overrides to .gitignore
    - Integrate monitoring_ui service into docker-compose.yml and Gitea CI workflow
    - Configure CORS handling in employee_api for monitoring dashboard access
    ──────
  ### Alternative Short Commit Message

    refactor(docs): move docs to monitoring_ui and create AI agent PROJECT_MAP.md
2026-09-20 23:33:55 +02:00

2.8 KiB

Important: This skill provides guidance and recommended instructions to assist the AI system. Outputs are not guaranteed to be complete, correct, secure, or applicable to every scenario. Results should be reviewed and validated by a human before being applied. The AI model may choose not to follow all instructions exactly, and additional verification may be required.

Self-Healing Loop — Error Classification & Auto-Fix

Step 11 runs validation against the generated IaC via CLI commands (az bicep build + az deployment sub what-if). On failure, classify each error and apply the strategy below. Max 3 attempts before pausing to present a diagnosis (explain pattern → propose fix → ask user). After user approves, 5 more attempts before asking again — then every 5 thereafter. See scaffold instructions.md § Self-Healing Loop for the full escalation protocol.

Error Type Class Auto-Fix Strategy
Invalid property name FIXABLE Replace with correct property from schema summary
Syntax error (HCL/Bicep) FIXABLE Re-generate affected module from reference patterns
Missing required property FIXABLE Add with default value from MCP best practices
Wrong API version FIXABLE Update to version from schema result
Provider version conflict FIXABLE Update required_providers block
Undeclared variable FIXABLE Add declaration to variables.tf
Policy-blocked SKU FIXABLE Substitute with next-best from rejectedAlternatives[]
Circular dependency FIXABLE Refactor module references — break cycle
Permission/RBAC insufficient BLOCKING Surface required role + az role assignment create command
State backend inaccessible BLOCKING Surface az storage account create instructions
Region unsupported for resource BLOCKING Suggest alternate regions — requires user decision
Quota exhaustion (ALL tiers in ALL regions) PLAN_LEVEL_CHANGE ⛔ Service type pivot required — see scaffold instructions.md § Self-Healing Loop. Update prepare-plan.json → present re-approval gate → regenerate IaC. Counts as 1 healing attempt
Quota exhaustion (single region) PLAN_LEVEL_CHANGE ⛔ Region pivot required — read prepare-plan.json.quotaValidation.checkedRegions and failedResources to skip already-failed regions. After checking new regions, append results back to these fields. See scaffold instructions.md § Self-Healing Loop. Update plan region → present re-approval → regenerate IaC
Policy blocks planned service entirely PLAN_LEVEL_CHANGE ⛔ Alternative service required — see scaffold instructions.md § Self-Healing Loop. Map to next-best from rejectedAlternatives[] → present re-approval → regenerate IaC