{
  "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": "c549f895-50c8-4622-87e1-7b83d8fe6dec",
      "key": "BTEST",
      "title": "Flaky test containment and repair",
      "field": "Quality engineering",
      "summary": "Turn intermittent CI failures into reproducible defects with accountable quarantine.",
      "context": "A fictional web team reruns red builds until they pass. Shared clocks, leaked state, and unawaited work make failures hard to trust.",
      "stack": [
        "TypeScript",
        "Vitest",
        "Playwright"
      ],
      "prerequisites": [
        "Create a small local application with three deliberately flaky tests using synthetic data and local endpoints."
      ],
      "developerValue": "Practice controlled diagnosis, isolation, and test reliability measurement.",
      "companyValue": "Recover useful failure signals and reduce blind reruns without hiding product defects.",
      "delivery": "Deliver repaired tests, deterministic reproductions, and a bounded quarantine policy.",
      "phases": [
        {
          "id": "diagnose",
          "title": "Find failure causes",
          "goal": "Capture reproducible conditions and classify failures."
        },
        {
          "id": "repair",
          "title": "Remove nondeterminism",
          "goal": "Repair isolation, time, and asynchronous behavior."
        },
        {
          "id": "govern",
          "title": "Keep signals useful",
          "goal": "Make retries and quarantine visible and temporary."
        }
      ],
      "tickets": [
        {
          "id": "560aa2c9-6f0f-47fb-b121-c3d31b222eca",
          "key": "BTEST-101",
          "title": "Record first-attempt results separately from rerun results",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 60,
          "phaseId": "diagnose",
          "dependsOn": [],
          "scenario": "A green rerun erases the original failure from the summary.",
          "acceptanceCriteria": [
            "Persist attempt number and original outcome.",
            "Link retries to the same test identity.",
            "Show initial failure counts separately from final status."
          ],
          "implementationNotes": [
            "Exclude screenshots or payloads containing real user data."
          ],
          "verification": [
            "Record fail-then-pass history.",
            "Ensure duplicate reporter delivery does not double-count attempts."
          ],
          "deliverables": [
            "Attempt-aware result report."
          ],
          "rollout": "Introduce reporting before changing retry policy; retain original raw fixture results.",
          "skills": [
            "Test reporting"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 100
            }
          ],
          "patterns": []
        },
        {
          "id": "7de25d59-3bcb-4bbb-bb7a-2c58d2f64ab1",
          "key": "BTEST-102",
          "title": "Reproduce order-dependent failures with a saved shuffle seed",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 120,
          "phaseId": "diagnose",
          "dependsOn": [
            "BTEST-101"
          ],
          "scenario": "One test fails only after a preference-setting test runs first.",
          "acceptanceCriteria": [
            "Shuffle tests using a recorded seed.",
            "Replay the identical ordering from that seed.",
            "Emit a minimal command including environment assumptions."
          ],
          "implementationNotes": [
            "Keep the experiment inside the synthetic suite."
          ],
          "verification": [
            "Replay a known failing order.",
            "Verify a different seed and missing seed are reported accurately."
          ],
          "deliverables": [
            "Seeded order runner."
          ],
          "rollout": "Use in diagnostic jobs; preserve the normal suite order until the defect is fixed.",
          "skills": [
            "Reproducibility",
            "Testing"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 100
            }
          ],
          "patterns": []
        },
        {
          "id": "59205b94-8040-4524-9ac1-2f38d960329f",
          "key": "BTEST-103",
          "title": "Trace leaked database rows between test cases",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "repair",
          "dependsOn": [
            "BTEST-102"
          ],
          "scenario": "An integration test reads records inserted by an earlier test and passes for the wrong reason.",
          "acceptanceCriteria": [
            "Assign isolated fixture ownership to each test.",
            "Clean only rows owned by that test.",
            "Fail when a test observes another fixture namespace."
          ],
          "implementationNotes": [
            "Do not use an unrestricted table truncation against shared databases."
          ],
          "verification": [
            "Run the tests independently and in reversed order.",
            "Inject foreign fixture rows and verify isolation."
          ],
          "deliverables": [
            "Fixture isolation repair."
          ],
          "rollout": "Adopt per-suite first; preserve failed fixture IDs for diagnosis without row contents.",
          "skills": [
            "Test isolation",
            "Databases"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 60
            },
            {
              "field": "Database engineering",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "1c273bc8-9d37-476e-b688-553a9fdc9c9a",
          "key": "BTEST-104",
          "title": "Replace wall-clock races with explicit clock control",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 120,
          "phaseId": "repair",
          "dependsOn": [
            "BTEST-102"
          ],
          "scenario": "A trial-expiry test fails around UTC midnight and daylight-saving changes.",
          "acceptanceCriteria": [
            "Inject a clock into expiry calculations.",
            "Cover before, at, and after expiry boundaries.",
            "Restore real timers after each test."
          ],
          "implementationNotes": [
            "Business timestamps remain UTC; local zones are test inputs."
          ],
          "verification": [
            "Replay midnight and offset-boundary cases.",
            "Verify leaked fake timers are detected by teardown."
          ],
          "deliverables": [
            "Clock-based expiry tests."
          ],
          "rollout": "Land with the date behavior unchanged except for the documented boundary correction.",
          "skills": [
            "Time handling",
            "Unit testing"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 100
            }
          ],
          "patterns": []
        },
        {
          "id": "ed45deac-1146-41f7-ac90-1595f3ce8a9e",
          "key": "BTEST-105",
          "title": "Remove readiness sleeps from browser tests",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "repair",
          "dependsOn": [
            "BTEST-101"
          ],
          "scenario": "A fixed delay is either too short on CI or unnecessarily long locally.",
          "acceptanceCriteria": [
            "Wait for a specific observable ready state.",
            "Bound the wait and report the missing condition.",
            "Handle a failed request without waiting indefinitely."
          ],
          "implementationNotes": [
            "Do not increase global timeouts to mask failures."
          ],
          "verification": [
            "Run with fast and delayed local responses.",
            "Return an error and verify a useful bounded failure."
          ],
          "deliverables": [
            "Condition-based browser waits."
          ],
          "rollout": "Replace sleeps incrementally; keep traces for failures during adoption.",
          "skills": [
            "Browser testing",
            "Asynchronous behavior"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 100
            }
          ],
          "patterns": []
        },
        {
          "id": "ba3863e6-9582-42a7-b466-ab027a410bbb",
          "key": "BTEST-106",
          "title": "Find async work that escapes test teardown",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 210,
          "phaseId": "repair",
          "dependsOn": [
            "BTEST-103",
            "BTEST-104"
          ],
          "scenario": "Background polling continues after a test completes and changes the next test's state.",
          "acceptanceCriteria": [
            "Track owned timers, subscriptions, and requests.",
            "Cancel owned work during teardown.",
            "Fail the test on unhandled late rejections."
          ],
          "implementationNotes": [
            "Do not suppress process-level rejection reporting."
          ],
          "verification": [
            "Complete a polling test with clean teardown.",
            "Inject an ignored cancellation and detect the leaked work."
          ],
          "deliverables": [
            "Async lifecycle repair."
          ],
          "rollout": "Enable leak detection for the affected suite before expanding coverage.",
          "skills": [
            "Resource lifecycle",
            "Testing"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 80
            },
            {
              "field": "Developer tooling",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "b75f5cda-1701-4892-8a45-2d4c88cd91c0",
          "key": "BTEST-107",
          "title": "Separate product defects from environmental test failures",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "govern",
          "dependsOn": [
            "BTEST-101",
            "BTEST-106"
          ],
          "scenario": "An unavailable local dependency and an incorrect application response currently look identical.",
          "acceptanceCriteria": [
            "Define explicit failure categories with supporting observations.",
            "Keep unknown causes marked unknown.",
            "Prevent infrastructure classification from silently turning failures green."
          ],
          "implementationNotes": [
            "Classification rules must be auditable and versioned."
          ],
          "verification": [
            "Classify a refused connection and an assertion mismatch.",
            "Verify ambiguous evidence remains unclassified."
          ],
          "deliverables": [
            "Failure triage rules."
          ],
          "rollout": "Use categories for routing; retain the underlying failed status.",
          "skills": [
            "Failure analysis",
            "Quality engineering"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 70
            },
            {
              "field": "Site reliability",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "10459380-09d6-4b1a-9249-50a8d182ce89",
          "key": "BTEST-108",
          "title": "Add expiring quarantine entries with accountable owners",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "govern",
          "dependsOn": [
            "BTEST-107"
          ],
          "scenario": "Quarantined tests have accumulated without owners or a return date.",
          "acceptanceCriteria": [
            "Require owner, reason, linked reproduction, and expiry.",
            "Continue executing quarantined tests in a visible lane.",
            "Fail policy checks on expired or unmatched entries."
          ],
          "implementationNotes": [
            "Quarantine cannot remove coverage silently."
          ],
          "verification": [
            "Accept a complete short-lived entry.",
            "Reject expired, wildcard-only, and ownerless entries."
          ],
          "deliverables": [
            "Quarantine policy validator."
          ],
          "rollout": "Start with a reviewed inventory; restore tests automatically only after policy conditions are met.",
          "skills": [
            "CI governance",
            "Testing"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 80
            },
            {
              "field": "Platform engineering",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "531cb644-5af2-4314-a707-b9baf8b17823",
          "key": "BTEST-109",
          "title": "Evaluate flake repairs with controlled repeated runs",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 300,
          "phaseId": "govern",
          "dependsOn": [
            "BTEST-103",
            "BTEST-104",
            "BTEST-105",
            "BTEST-106"
          ],
          "scenario": "Twenty green reruns are being presented as proof that a defect is gone.",
          "acceptanceCriteria": [
            "Declare seeds, repetitions, environment, and remaining uncertainty.",
            "Compare repaired and deliberately unfixed cases under matching conditions.",
            "Report first-attempt failures and confidence limits without universal reliability claims."
          ],
          "implementationNotes": [
            "Keep the run budget bounded and retain failed seeds."
          ],
          "verification": [
            "Recover the injected failure in the unfixed variant.",
            "Verify repaired runs and explicitly report any inconclusive result."
          ],
          "deliverables": [
            "Repair evaluation report."
          ],
          "rollout": "Remove quarantine only with the reproduction fixed and policy review complete.",
          "skills": [
            "Experimental design",
            "Reliability analysis"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 80
            },
            {
              "field": "Site reliability",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "018d5f42-75e6-42ff-a200-f95d2037b07e",
          "key": "BTEST-110",
          "title": "Add a contributor guide for a trustworthy regression test",
          "type": "CHORE",
          "priority": "LOW",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 60,
          "phaseId": "govern",
          "dependsOn": [
            "BTEST-108",
            "BTEST-109"
          ],
          "scenario": "New contributors copy retry-heavy tests and perpetuate the same failure patterns.",
          "acceptanceCriteria": [
            "Show one deterministic fixture, clock, and cleanup example.",
            "State when a rerun is diagnostic rather than acceptance.",
            "Document how to submit a reproducible failure."
          ],
          "implementationNotes": [
            "Use actual repaired examples from this project."
          ],
          "verification": [
            "Follow the guide to add a passing boundary test.",
            "Check that an intentionally leaked resource fails review checks."
          ],
          "deliverables": [
            "Contributor testing guide."
          ],
          "rollout": "Link the guide from quarantine failures and the test command.",
          "skills": [
            "Technical writing",
            "Testing"
          ],
          "fieldMix": [
            {
              "field": "Quality engineering",
              "percentage": 100
            }
          ],
          "patterns": []
        }
      ]
    }
  ]
}
