{
  "policy": {
    "version": 5,
    "patterns": {
      "version": 1,
      "method": "CURATED_PRACTICE_TOPIC",
      "notice": "Pattern topics identify design choices to practice. Read the ticket's acceptance criteria and justify the simplest suitable approach. Tags are not capability or ownership evidence; an untagged ticket has no curated pattern topic assigned."
    },
    "fieldMix": {
      "version": 1,
      "method": "CURATED_ESTIMATE",
      "notice": "Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence."
    },
    "contentStatus": "PRACTICE_BRIEF",
    "assessmentStatus": "NOT_QUALIFIED",
    "evidenceUse": "NONE",
    "aiPolicy": "AI tools are welcome during implementation. Record assumptions, review the result, and verify its behavior.",
    "notice": "Fictional engineering practice briefs. Starter repositories, fixtures, automated grading, and verified ownership are not included.",
    "outcomeEvidence": "Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.",
    "ownershipEvidence": "Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence."
  },
  "patternTopics": [
    {
      "id": "factory-method",
      "label": "Factory Method",
      "group": "Creational"
    },
    {
      "id": "abstract-factory",
      "label": "Abstract Factory",
      "group": "Creational"
    },
    {
      "id": "builder",
      "label": "Builder",
      "group": "Creational"
    },
    {
      "id": "prototype",
      "label": "Prototype",
      "group": "Creational"
    },
    {
      "id": "singleton",
      "label": "Singleton",
      "group": "Creational"
    },
    {
      "id": "adapter",
      "label": "Adapter",
      "group": "Structural"
    },
    {
      "id": "bridge",
      "label": "Bridge",
      "group": "Structural"
    },
    {
      "id": "composite",
      "label": "Composite",
      "group": "Structural"
    },
    {
      "id": "decorator",
      "label": "Decorator",
      "group": "Structural"
    },
    {
      "id": "facade",
      "label": "Facade",
      "group": "Structural"
    },
    {
      "id": "flyweight",
      "label": "Flyweight",
      "group": "Structural"
    },
    {
      "id": "proxy",
      "label": "Proxy",
      "group": "Structural"
    },
    {
      "id": "chain-of-responsibility",
      "label": "Chain of Responsibility",
      "group": "Behavioral"
    },
    {
      "id": "command",
      "label": "Command",
      "group": "Behavioral"
    },
    {
      "id": "interpreter",
      "label": "Interpreter",
      "group": "Behavioral"
    },
    {
      "id": "iterator",
      "label": "Iterator",
      "group": "Behavioral"
    },
    {
      "id": "mediator",
      "label": "Mediator",
      "group": "Behavioral"
    },
    {
      "id": "memento",
      "label": "Memento",
      "group": "Behavioral"
    },
    {
      "id": "observer",
      "label": "Observer",
      "group": "Behavioral"
    },
    {
      "id": "state",
      "label": "State",
      "group": "Behavioral"
    },
    {
      "id": "strategy",
      "label": "Strategy",
      "group": "Behavioral"
    },
    {
      "id": "template-method",
      "label": "Template Method",
      "group": "Behavioral"
    },
    {
      "id": "visitor",
      "label": "Visitor",
      "group": "Behavioral"
    },
    {
      "id": "ports-and-adapters",
      "label": "Ports and Adapters",
      "group": "Architectural"
    },
    {
      "id": "cqrs",
      "label": "CQRS",
      "group": "Architectural"
    },
    {
      "id": "strangler-fig",
      "label": "Strangler Fig",
      "group": "Architectural"
    },
    {
      "id": "saga",
      "label": "Saga",
      "group": "Distributed and reliability"
    },
    {
      "id": "transactional-outbox",
      "label": "Transactional Outbox",
      "group": "Distributed and reliability"
    },
    {
      "id": "circuit-breaker",
      "label": "Circuit Breaker",
      "group": "Distributed and reliability"
    },
    {
      "id": "bulkhead",
      "label": "Bulkhead",
      "group": "Distributed and reliability"
    }
  ],
  "projects": [
    {
      "id": "f49f5c6f-281b-49af-bdbe-2df03be272fe",
      "key": "AENV",
      "title": "Make ephemeral review environments predictable",
      "field": "Platform engineering",
      "summary": "Provision bounded review environments with explicit ownership and cleanup.",
      "context": "A fictional team creates preview stacks for pull requests. Orphan databases consume resources and previews sometimes inherit settings intended for another branch.",
      "stack": [
        "TypeScript",
        "Compose specification",
        "PostgreSQL"
      ],
      "prerequisites": [
        "Create a local provisioning adapter with synthetic repository events.",
        "Use isolated disposable resources and no production credentials."
      ],
      "developerValue": "Practice resource lifecycle, reconciliation and least-privilege setup.",
      "companyValue": "Review reliable preview workflows and accountable resource cleanup.",
      "delivery": "Ten scoped tickets across three phases. Build a synthetic local service or select a ticket after recreating its prerequisites; estimates exclude setup.",
      "phases": [
        {
          "id": "plan",
          "title": "Plan isolated previews",
          "goal": "Validate requests and resource boundaries."
        },
        {
          "id": "provision",
          "title": "Reconcile environment state",
          "goal": "Make setup and updates repeatable."
        },
        {
          "id": "cleanup",
          "title": "Retire environments safely",
          "goal": "Detect expiration and recover incomplete cleanup."
        }
      ],
      "tickets": [
        {
          "id": "953e6f06-63a6-4eaa-8d46-3d5d560acff0",
          "key": "AENV-101",
          "title": "Validate preview requests before allocating resources",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "plan",
          "dependsOn": [],
          "scenario": "A branch name containing slashes and punctuation becomes an invalid database name after resources are already created.",
          "acceptanceCriteria": [
            "Use an opaque environment ID for resource names.",
            "Validate repository scope, revision and requested lifetime.",
            "Reject malformed requests before any provider call."
          ],
          "implementationNotes": [
            "Treat branch labels as display data only."
          ],
          "verification": [
            "Accept a valid synthetic revision with a complex branch label.",
            "Reject missing scope and excessive lifetime with zero allocation calls."
          ],
          "deliverables": [
            "Preview request schema"
          ],
          "rollout": "Enable request validation first; leave rejected previews unallocated.",
          "skills": [
            "Validation",
            "Resource naming"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 60
            },
            {
              "field": "API design",
              "percentage": 20
            },
            {
              "field": "Security",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "dee5aba0-d21c-4383-9397-332349c9c519",
          "key": "AENV-102",
          "title": "Create a review-environment resource plan with an explicit quota",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "plan",
          "dependsOn": [
            "AENV-101"
          ],
          "scenario": "One preview requests every optional dependency and exhausts the local resource budget.",
          "acceptanceCriteria": [
            "List CPU, memory, storage and lifetime requirements.",
            "Reject plans exceeding per-environment or aggregate quotas.",
            "Keep optional dependencies explicit rather than provisioned by default."
          ],
          "implementationNotes": [
            "Use documented synthetic quotas and a dry-run planner."
          ],
          "verification": [
            "Plan a minimal API and database preview.",
            "Exceed storage and concurrent-environment quotas and reject allocation."
          ],
          "deliverables": [
            "Quota-aware plan command"
          ],
          "rollout": "Expose dry-run plans first; reduce admitted previews if available resources shrink.",
          "skills": [
            "Capacity planning",
            "Resource limits"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 60
            },
            {
              "field": "Cloud infrastructure",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "1a918916-8e70-4558-9471-eca1503e002d",
          "key": "AENV-103",
          "title": "Keep preview connection material out of build output",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 75,
          "phaseId": "plan",
          "dependsOn": [
            "AENV-101"
          ],
          "scenario": "Provisioning logs print database URLs that contain temporary credentials.",
          "acceptanceCriteria": [
            "Redact passwords, tokens and credential-bearing URLs.",
            "Return secret references separately from public preview metadata.",
            "Keep synthetic credentials out of generated manifests."
          ],
          "implementationNotes": [
            "Use allowlisted structured logging fields."
          ],
          "verification": [
            "Inspect successful provisioning logs for safe identifiers.",
            "Inject a credential into provider errors and assert redaction."
          ],
          "deliverables": [
            "Log redaction and metadata projection"
          ],
          "rollout": "Deploy redaction before provisioning; rotate any affected disposable credentials.",
          "skills": [
            "Secrets handling",
            "Logging"
          ],
          "fieldMix": [
            {
              "field": "Security",
              "percentage": 60
            },
            {
              "field": "Platform engineering",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "6830cffe-aea2-4eae-b57e-ef5a167ddcef",
          "key": "AENV-104",
          "title": "Make preview creation resumable after a partial provider failure",
          "type": "STORY",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "provision",
          "dependsOn": [
            "AENV-102",
            "AENV-103"
          ],
          "scenario": "The database is created but the API startup fails; retry creates a second database and loses track of the first.",
          "acceptanceCriteria": [
            "Assign deterministic resource identities per environment generation.",
            "Record each completed allocation before moving to the next.",
            "Resume from observed resources instead of blindly recreating them."
          ],
          "implementationNotes": [
            "Use a provider interface with injected failure points."
          ],
          "verification": [
            "Fail after database creation and resume to one database.",
            "Return an unexpected existing resource owner and halt without adoption."
          ],
          "deliverables": [
            "Reconciliation loop and partial-failure probe"
          ],
          "rollout": "Canary local environments; pause allocation while retaining resource records on inconsistency.",
          "skills": [
            "Idempotency",
            "Reconciliation"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 50
            },
            {
              "field": "Cloud infrastructure",
              "percentage": 30
            },
            {
              "field": "Distributed systems",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "be78fd2b-31d4-4611-adfb-d37f2020e243",
          "key": "AENV-105",
          "title": "Bind preview updates to the exact requested source revision",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "ADVANCED",
          "estimateMinutes": 210,
          "phaseId": "provision",
          "dependsOn": [
            "AENV-104"
          ],
          "scenario": "A slow build for an older commit finishes after a newer build and replaces the current preview.",
          "acceptanceCriteria": [
            "Track requested generation and source revision.",
            "Only the current generation may become active.",
            "Keep stale build artifacts visible for cleanup but never route traffic to them."
          ],
          "implementationNotes": [
            "Do not treat completion time as revision order."
          ],
          "verification": [
            "Complete two builds in reverse order and activate only the latest requested one.",
            "Retry stale activation and preserve the selected generation."
          ],
          "deliverables": [
            "Generation guard and completion-order tests"
          ],
          "rollout": "Enable guarded routing; restore the prior valid generation if the new one fails readiness.",
          "skills": [
            "Concurrency",
            "Deployment state"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 60
            },
            {
              "field": "Distributed systems",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "054114d8-2c94-4f24-a4ff-1600b97e324d",
          "key": "AENV-106",
          "title": "Initialize preview data from a synthetic schema contract",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 180,
          "phaseId": "provision",
          "dependsOn": [
            "AENV-104",
            "AENV-105"
          ],
          "scenario": "Preview startup depends on a copy of production data, making reviews slow and difficult to share safely.",
          "acceptanceCriteria": [
            "Create deterministic synthetic records covering declared UI states.",
            "Apply migrations before seeding the environment.",
            "Fail readiness when the seed contract is incomplete."
          ],
          "implementationNotes": [
            "Do not import real customer data or production secrets."
          ],
          "verification": [
            "Create two previews and compare declared synthetic identities and states.",
            "Fail a migration and verify the seed does not mark the environment ready."
          ],
          "deliverables": [
            "Synthetic seed command and readiness checks"
          ],
          "rollout": "Enable the seed on new previews; recreate disposable data if the contract changes.",
          "skills": [
            "Test data",
            "Migrations"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 40
            },
            {
              "field": "Quality engineering",
              "percentage": 30
            },
            {
              "field": "Database engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "8dc28f46-13f6-410f-84a8-24ddd7306813",
          "key": "AENV-107",
          "title": "Probe readiness without accidentally validating only process liveness",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "provision",
          "dependsOn": [
            "AENV-105",
            "AENV-106"
          ],
          "scenario": "The preview link is published while migrations are still running, so reviewers immediately hit missing-table errors.",
          "acceptanceCriteria": [
            "Readiness checks required dependencies and schema version.",
            "Liveness remains independent of external dependency availability.",
            "Publish the link only after the current generation passes readiness."
          ],
          "implementationNotes": [
            "Bound probe time and omit secret diagnostics."
          ],
          "verification": [
            "Start a complete preview and publish its link.",
            "Delay migration completion and assert no ready link is announced."
          ],
          "deliverables": [
            "Readiness contract and startup timeline"
          ],
          "rollout": "Canary readiness gating; suppress links and inspect the generation on repeated failures.",
          "skills": [
            "Health checks",
            "Deployment readiness"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 60
            },
            {
              "field": "Site reliability",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "4534a466-40f0-46b3-b7a6-bee06dac05bc",
          "key": "AENV-108",
          "title": "Expire review environments with a grace period and owner visibility",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "cleanup",
          "dependsOn": [
            "AENV-104",
            "AENV-107"
          ],
          "scenario": "A preview remains allocated after its pull request closes because nobody owns the cleanup schedule.",
          "acceptanceCriteria": [
            "Persist owner token, expiry instant and grace deadline.",
            "List expiring environments without exposing credentials.",
            "Allow authorized extension within the declared maximum lifetime."
          ],
          "implementationNotes": [
            "Use an injectable clock and synthetic ownership."
          ],
          "verification": [
            "Advance through expiry and grace states.",
            "Attempt extension by another owner and reject it."
          ],
          "deliverables": [
            "Expiry state model and owner view"
          ],
          "rollout": "Enable expiry reporting before cleanup; extend only reviewed environments during adoption.",
          "skills": [
            "Lifecycle design",
            "Authorization"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 60
            },
            {
              "field": "Cloud infrastructure",
              "percentage": 20
            },
            {
              "field": "Security",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "577102ed-8617-4710-9670-bc2c63077019",
          "key": "AENV-109",
          "title": "Delete only resources owned by the retired preview generation",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 300,
          "phaseId": "cleanup",
          "dependsOn": [
            "AENV-105",
            "AENV-108"
          ],
          "scenario": "A cleanup job matches resource names by prefix and can remove a newer generation sharing the same branch label.",
          "acceptanceCriteria": [
            "Match exact environment, generation and ownership tags.",
            "Refuse deletion for missing or contradictory ownership.",
            "Make retries converge after partial deletion."
          ],
          "implementationNotes": [
            "Provider deletion receives exact resource IDs, never wildcard names."
          ],
          "verification": [
            "Retire an old generation while keeping the new one usable.",
            "Alter an ownership tag and verify cleanup stops before deletion."
          ],
          "deliverables": [
            "Ownership-checked cleanup and isolation tests"
          ],
          "rollout": "Dry-run deletion plans first; pause cleanup and preserve unresolved resources on ownership conflicts.",
          "skills": [
            "Resource safety",
            "Recovery"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 50
            },
            {
              "field": "Cloud infrastructure",
              "percentage": 30
            },
            {
              "field": "Security",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "8b1f3d4d-4853-4c16-a657-e86849592ec2",
          "key": "AENV-110",
          "title": "Reconcile orphan preview resources into an auditable cleanup queue",
          "type": "CHORE",
          "priority": "MEDIUM",
          "difficulty": "EXPERT",
          "estimateMinutes": 300,
          "phaseId": "cleanup",
          "dependsOn": [
            "AENV-104",
            "AENV-109"
          ],
          "scenario": "A process crashed before saving its final resource record; local storage now contains an environment no active preview references.",
          "acceptanceCriteria": [
            "Compare provider inventory to durable environment generations.",
            "Classify owned orphan, active and unknown resources.",
            "Require review of unknown ownership before any deletion."
          ],
          "implementationNotes": [
            "Bound inventory scans and retain an immutable reconciliation report."
          ],
          "verification": [
            "Discover an owned orphan and propose exact cleanup identities.",
            "Present an untagged resource and verify it is never automatically removed."
          ],
          "deliverables": [
            "Orphan inventory command and cleanup report"
          ],
          "rollout": "Run read-only first; execute only reviewed owned-orphan plans and stop on inventory drift.",
          "skills": [
            "Inventory reconciliation",
            "Operational safety"
          ],
          "fieldMix": [
            {
              "field": "Platform engineering",
              "percentage": 50
            },
            {
              "field": "Cloud infrastructure",
              "percentage": 30
            },
            {
              "field": "Site reliability",
              "percentage": 20
            }
          ],
          "patterns": []
        }
      ]
    }
  ]
}
