{
  "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": [
    {
      "key": "SCONCUR",
      "title": "Make a native work queue survive real thread interleavings",
      "field": "Systems programming",
      "summary": "Implement bounded scheduling, cancellation and shutdown without hidden liveness failures.",
      "context": "A fictional image-indexing utility runs CPU-only synthetic jobs through a Rust worker pool. Its prototype loses wakeups, blocks shutdown, and treats cancellation as completion. Build a local library and deterministic concurrency harness; image content, GPU work, and production deployment are excluded.",
      "stack": [
        "Rust",
        "Threads",
        "Loom or deterministic scheduler",
        "Criterion"
      ],
      "prerequisites": [
        "Mutexes and condition variables",
        "Atomics",
        "Thread lifecycle"
      ],
      "developerValue": "Practice happens-before reasoning, ownership transfer, cancellation and liveness testing.",
      "companyValue": "Review a worker primitive whose overload and shutdown behavior are predictable before it supports build or media workloads.",
      "delivery": "Ten linked tickets across three phases. Use synthetic inputs and a local harness; provide source, focused tests, measurements where requested, and a recovery note.",
      "phases": [
        {
          "id": "model",
          "title": "Establish the machine contract",
          "goal": "Make representation, ownership and failure boundaries explicit."
        },
        {
          "id": "control",
          "title": "Control resources and concurrency",
          "goal": "Implement bounded behavior under realistic interleavings."
        },
        {
          "id": "operate",
          "title": "Prove recovery and handoff",
          "goal": "Measure, diagnose and safely replace the component."
        }
      ],
      "tickets": [
        {
          "id": "f7ca3509-29b6-4f65-99e1-3d7576662142",
          "key": "SCONCUR-101",
          "title": "Define queue ownership before starting worker threads",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "model",
          "dependsOn": [],
          "scenario": "Workers borrow configuration from a stack-owned builder that disappears after start, while the queue handle can outlive the pool.",
          "acceptanceCriteria": [
            "Pool-owned state outlives every worker",
            "Queue handles cannot submit after terminal shutdown",
            "Dropping the final handle has documented behavior"
          ],
          "implementationNotes": [
            "Avoid leaked static references and process-wide mutable state."
          ],
          "verification": [
            "Create, submit, join, and drop a pool repeatedly under a leak checker.",
            "Drop external handles in different orders and verify workers cannot access released state."
          ],
          "deliverables": [
            "Ownership diagram and lifecycle tests"
          ],
          "rollout": "Keep the single-thread runner until lifecycle checks pass.",
          "skills": [
            "Ownership",
            "Thread lifecycle"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Developer tooling",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "6643c73d-d80b-4f64-85fd-86aaeb056e16",
          "key": "SCONCUR-102",
          "title": "Reject work when the bounded queue is full",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "model",
          "dependsOn": [],
          "scenario": "Producers append without limit while workers are paused, and the process consumes all available memory.",
          "acceptanceCriteria": [
            "Capacity is explicit and positive",
            "Submission returns accepted, timed out, or closed",
            "A rejected job remains caller-owned"
          ],
          "implementationNotes": [
            "Do not hide backpressure behind an unbounded overflow list."
          ],
          "verification": [
            "Fill the queue, release one slot, and submit the next job.",
            "Keep workers paused and confirm memory and queue length remain bounded."
          ],
          "deliverables": [
            "Bounded submission API and overload tests"
          ],
          "rollout": "Start with conservative capacity and surface rejections to the local caller.",
          "skills": [
            "Backpressure",
            "API design"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Performance engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "c19d2098-1bff-474d-bd87-1de398309af2",
          "key": "SCONCUR-103",
          "title": "Close the lost-wakeup gap between predicate and sleep",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "model",
          "dependsOn": [
            "SCONCUR-101",
            "SCONCUR-102"
          ],
          "scenario": "A producer signals just before a worker begins waiting; queued work then sleeps until another submission arrives.",
          "acceptanceCriteria": [
            "Workers test the queue predicate under the same synchronization boundary as waiting",
            "Spurious wakeups preserve correctness",
            "One job is claimed by one worker"
          ],
          "implementationNotes": [
            "Document the predicate, mutex, and notification order in code comments beside the wait loop."
          ],
          "verification": [
            "Exercise enqueue before, during, and after worker wait.",
            "Force the historical interleaving and prove the queued job completes without a second signal."
          ],
          "deliverables": [
            "Correct wait loop and deterministic lost-wakeup test"
          ],
          "rollout": "Run the old and new pools against the same scheduler trace before switching.",
          "skills": [
            "Condition variables",
            "Happens-before",
            "Concurrency testing"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 65
            },
            {
              "field": "Quality engineering",
              "percentage": 35
            }
          ],
          "patterns": []
        },
        {
          "id": "f3824461-238d-4078-b064-2ab8f7ce08aa",
          "key": "SCONCUR-104",
          "title": "Keep cancellation distinct from successful completion",
          "type": "CHORE",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "control",
          "dependsOn": [
            "SCONCUR-103"
          ],
          "scenario": "A cancelled indexing job resolves the same completion channel as a finished job, so callers publish an empty index.",
          "acceptanceCriteria": [
            "Result distinguishes success, cancellation, job failure, and pool shutdown",
            "Cancellation before claim prevents execution",
            "Cancellation after claim is cooperative and observable"
          ],
          "implementationNotes": [
            "Do not terminate worker threads asynchronously while they own locks or memory."
          ],
          "verification": [
            "Cancel queued and running cooperative jobs and inspect distinct outcomes.",
            "Use a job that ignores cancellation and verify shutdown reports the unresolved work."
          ],
          "deliverables": [
            "Cancellation state model and race tests"
          ],
          "rollout": "Callers must handle cancellation explicitly before adopting the new result type.",
          "skills": [
            "Cancellation",
            "State modeling"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Real-time systems",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "151ac8b4-f24b-452e-a4c5-1fb309e47eda",
          "key": "SCONCUR-105",
          "title": "Prevent priority work from starving maintenance forever",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "control",
          "dependsOn": [
            "SCONCUR-102",
            "SCONCUR-104"
          ],
          "scenario": "A continuous stream of interactive jobs keeps cache-maintenance tasks queued indefinitely.",
          "acceptanceCriteria": [
            "Scheduling policy defines a bounded wait for every admitted class",
            "Interactive latency remains measured under mixed load",
            "Class selection is deterministic for a declared seed"
          ],
          "implementationNotes": [
            "Do not claim fairness from average completion time; report per-class tail wait."
          ],
          "verification": [
            "Replay a mixed workload and verify the declared service ratio.",
            "Saturate the interactive class and confirm maintenance still advances."
          ],
          "deliverables": [
            "Fair scheduler policy, simulator, and latency report"
          ],
          "rollout": "Canary the policy in the synthetic workload and retain FIFO fallback.",
          "skills": [
            "Scheduling",
            "Fairness",
            "Performance analysis"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 60
            },
            {
              "field": "Performance engineering",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "ed040569-ec1e-4543-92d6-a7a6e43d8ea1",
          "key": "SCONCUR-106",
          "title": "Remove a lock-order inversion in completion reporting",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "control",
          "dependsOn": [
            "SCONCUR-103",
            "SCONCUR-104"
          ],
          "scenario": "The worker holds the queue lock while acquiring a result lock; the joining thread holds the result lock while closing the queue.",
          "acceptanceCriteria": [
            "Declare a single lock order or remove nested acquisition",
            "Completion remains visible before join returns",
            "Shutdown cannot wait while holding a lock needed by workers"
          ],
          "implementationNotes": [
            "Keep callbacks outside internal locks because caller code is untrusted by the synchronization design."
          ],
          "verification": [
            "Complete and join jobs from several workers under the deterministic scheduler.",
            "Force the prior opposing acquisition order and verify progress."
          ],
          "deliverables": [
            "Lock graph, refactor, and deadlock regression"
          ],
          "rollout": "Enable lock-wait diagnostics during the local transition.",
          "skills": [
            "Deadlock analysis",
            "Lock ordering"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Quality engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "797d56ef-bcbb-4353-be8d-6623e8c56f68",
          "key": "SCONCUR-107",
          "title": "Prove the atomic queue fast path has a safe memory order",
          "type": "STORY",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 360,
          "phaseId": "control",
          "dependsOn": [
            "SCONCUR-102",
            "SCONCUR-103"
          ],
          "scenario": "A lock-free experiment publishes a slot index before all job fields are visible, producing rare partially initialized reads on a weakly ordered target.",
          "acceptanceCriteria": [
            "Every atomic operation has a stated synchronization role",
            "Publication makes complete job data visible before claim",
            "Wraparound cannot confuse a reused slot with an older generation"
          ],
          "implementationNotes": [
            "Prefer the mutex implementation unless measured need and model checking justify the atomic path."
          ],
          "verification": [
            "Model-check bounded producers, consumers, and slot reuse.",
            "Weaken the publication ordering in a mutation and ensure the model detects an invalid read."
          ],
          "deliverables": [
            "Memory-order argument, model, and comparison with mutex path"
          ],
          "rollout": "Keep the atomic implementation disabled unless correctness and workload benefit are both demonstrated.",
          "skills": [
            "Atomics",
            "Memory models",
            "Model checking"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 65
            },
            {
              "field": "Performance engineering",
              "percentage": 35
            }
          ],
          "patterns": []
        },
        {
          "id": "4095442e-43f4-4c14-b085-d1f24c90f716",
          "key": "SCONCUR-108",
          "title": "Drain accepted jobs without hanging process shutdown",
          "type": "CHORE",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "operate",
          "dependsOn": [
            "SCONCUR-104",
            "SCONCUR-106"
          ],
          "scenario": "Shutdown closes submissions but waits forever for a worker blocked on an external test double that never returns.",
          "acceptanceCriteria": [
            "Shutdown defines stop-accepting, drain, cancel, and terminal states",
            "A deadline reports unfinished job identities without detaching live threads",
            "Repeated shutdown calls return the same terminal outcome"
          ],
          "implementationNotes": [
            "Use controlled local jobs; do not kill threads or the host process to simulate recovery."
          ],
          "verification": [
            "Drain a pool whose jobs complete before the deadline.",
            "Block one job past the deadline and confirm bounded return with an unresolved record."
          ],
          "deliverables": [
            "Shutdown protocol and stuck-job test"
          ],
          "rollout": "Callers keep the old process exit path until they handle unresolved shutdown results.",
          "skills": [
            "Graceful shutdown",
            "Recovery",
            "State machines"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Site reliability",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "7d717d6a-c13b-4544-9463-3bbc2e2d619e",
          "key": "SCONCUR-109",
          "title": "Capture a concurrency failure without megabytes of logs",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 360,
          "phaseId": "operate",
          "dependsOn": [
            "SCONCUR-105",
            "SCONCUR-106"
          ],
          "scenario": "A rare stall produces per-poll logs from every worker, changing timing and obscuring the last useful state transition.",
          "acceptanceCriteria": [
            "Record a bounded ring of queue and worker transitions",
            "Events use monotonic sequence and synthetic job identity",
            "Snapshot identifies dropped diagnostic events"
          ],
          "implementationNotes": [
            "Do not record job payloads, thread stack memory, or unbounded labels."
          ],
          "verification": [
            "Reconstruct a normal claim-to-completion path from the ring.",
            "Overflow the ring during the forced deadlock trace and retain an explicit loss marker."
          ],
          "deliverables": [
            "Bounded trace recorder and stall diagnostic"
          ],
          "rollout": "Enable the recorder only for the local harness until overhead is measured.",
          "skills": [
            "Diagnostics",
            "Ring buffers",
            "Privacy"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 65
            },
            {
              "field": "Site reliability",
              "percentage": 35
            }
          ],
          "patterns": []
        },
        {
          "id": "b40b5dbb-c01e-46b6-ab37-04516954d6b6",
          "key": "SCONCUR-110",
          "title": "Publish the worker-pool contract and benchmark limits",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "operate",
          "dependsOn": [
            "SCONCUR-105",
            "SCONCUR-108",
            "SCONCUR-109"
          ],
          "scenario": "A build tool and a request server both plan to reuse the pool despite different fairness, blocking, and shutdown requirements.",
          "acceptanceCriteria": [
            "Document supported job behavior and prohibited blocking assumptions",
            "Report throughput, queue wait, memory, and shutdown duration for declared workloads",
            "List cases where a runtime-native executor is preferable"
          ],
          "implementationNotes": [
            "Do not generalize results beyond the recorded machine and workload profiles."
          ],
          "verification": [
            "Reproduce one CPU-bound and one mixed-duration benchmark from a clean checkout.",
            "Run the unsupported permanently blocking job and confirm the guide predicts the outcome."
          ],
          "deliverables": [
            "Contract, benchmark manifest, and adoption checklist"
          ],
          "rollout": "Require each adopter to select and verify a workload profile.",
          "skills": [
            "Benchmarking",
            "Documentation",
            "Capacity planning"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Developer tooling",
              "percentage": 30
            }
          ],
          "patterns": []
        }
      ],
      "id": "26536d74-4837-4bde-ab64-3f13e1b2f2f8"
    }
  ]
}
