{
  "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": "SMEM",
      "title": "Repair a packet arena before it becomes shared infrastructure",
      "field": "Systems programming",
      "summary": "Build a bounded arena with explicit alignment, lifetime and corruption behavior.",
      "context": "A fictional telemetry collector copies decoded packet fields into a small native arena. The prototype misaligns wide values and reuses memory while readers still hold views. Create a local Rust crate or C library with generated byte fixtures; no device traffic or production allocator replacement is supplied.",
      "stack": [
        "Rust or C",
        "Property tests",
        "AddressSanitizer or Miri"
      ],
      "prerequisites": [
        "Pointers and slices",
        "Integer overflow",
        "Memory alignment"
      ],
      "developerValue": "Practice representation invariants, lifetimes, unsafe-boundary review and memory diagnostics.",
      "companyValue": "Review a component whose allocation failures and corruption cases are explicit before reuse in latency-sensitive code.",
      "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": "fda2eb6f-d3ed-4893-872f-42640a99f50f",
          "key": "SMEM-101",
          "title": "Specify aligned arena offsets without relying on host luck",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "model",
          "dependsOn": [],
          "scenario": "Eight-byte fields happen to work on one machine because the backing buffer begins aligned; a sliced buffer starts at an odd address.",
          "acceptanceCriteria": [
            "Round every allocation to its declared power-of-two alignment",
            "Reject zero and unsupported alignments",
            "Report requested size and remaining capacity without exposing addresses"
          ],
          "implementationNotes": [
            "Use checked integer arithmetic before changing the cursor."
          ],
          "verification": [
            "Allocate mixed one-, four-, and eight-byte records and verify every offset.",
            "Start near the numeric limit and confirm overflow leaves the cursor unchanged."
          ],
          "deliverables": [
            "Arena layout contract and boundary tests"
          ],
          "rollout": "Keep the current copy path until the layout suite passes on two target architectures.",
          "skills": [
            "Alignment",
            "Checked arithmetic"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 80
            },
            {
              "field": "Embedded and edge",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "35311dcc-1cc7-4b71-925b-589c340e88f8",
          "key": "SMEM-102",
          "title": "Return exhaustion without handing out a partial slice",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "model",
          "dependsOn": [],
          "scenario": "A capacity miss advances the arena cursor before returning an error, so the following small allocation also fails.",
          "acceptanceCriteria": [
            "An exhausted allocation returns a typed capacity error",
            "Cursor and prior bytes remain unchanged after failure",
            "A later fitting allocation can still succeed"
          ],
          "implementationNotes": [
            "Do not grow the backing region or panic on caller-controlled sizes."
          ],
          "verification": [
            "Fill the arena exactly and inspect the final valid allocation.",
            "Request one byte too many, then allocate a smaller record and verify state."
          ],
          "deliverables": [
            "Atomic allocation update and exhaustion regression"
          ],
          "rollout": "Treat exhaustion as backpressure in the local collector; never retry without changing capacity or workload.",
          "skills": [
            "Failure atomicity",
            "Resource bounds"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Performance engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "504c08c1-bc84-404a-8ee2-80301eeddda6",
          "key": "SMEM-103",
          "title": "Invalidate borrowed packet views when the arena resets",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "model",
          "dependsOn": [
            "SMEM-101",
            "SMEM-102"
          ],
          "scenario": "A decoder stores a view into the arena across reset and later reads bytes belonging to a different packet.",
          "acceptanceCriteria": [
            "Views carry the generation in which they were created",
            "Reset advances generation before storage is reused",
            "Stale view access fails deterministically in the safe API"
          ],
          "implementationNotes": [
            "Keep unsafe reads inside one reviewed boundary; do not claim runtime checks prove arbitrary raw pointers safe."
          ],
          "verification": [
            "Read several current-generation views before reset.",
            "Reset, reuse the same offset, and reject the older view."
          ],
          "deliverables": [
            "Generation-bound view API and stale-view reproduction"
          ],
          "rollout": "Migrate the decoder through the checked view API before enabling reset reuse.",
          "skills": [
            "Lifetimes",
            "Memory safety",
            "Generations"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Security",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "27b222b2-948b-4771-85aa-14fdc1ed778a",
          "key": "SMEM-104",
          "title": "Free large spill blocks without double-releasing arena pages",
          "type": "CHORE",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "control",
          "dependsOn": [
            "SMEM-102"
          ],
          "scenario": "Oversized records spill to separate blocks. Error cleanup releases a spill block, then arena teardown releases the same block again.",
          "acceptanceCriteria": [
            "Each spill block has one recorded owner",
            "Cleanup is safe when invoked repeatedly",
            "Arena teardown releases only blocks still attached"
          ],
          "implementationNotes": [
            "Model ownership explicitly; a boolean freed flag cannot authorize access after release."
          ],
          "verification": [
            "Allocate and release several spill blocks in different orders.",
            "Inject a decode error after spill allocation and run teardown twice under a memory checker."
          ],
          "deliverables": [
            "Spill ownership model and double-free regression"
          ],
          "rollout": "Disable spill allocation if the checker reports any invalid release.",
          "skills": [
            "Ownership",
            "Cleanup",
            "Memory diagnostics"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Quality engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "da3ab846-6a35-4a5c-bc1e-956374a3de95",
          "key": "SMEM-105",
          "title": "Coalesce adjacent free spans without corrupting the index",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "control",
          "dependsOn": [
            "SMEM-101",
            "SMEM-104"
          ],
          "scenario": "The free-span list merges with the previous range but forgets the next range, leaving overlapping entries that can be allocated twice.",
          "acceptanceCriteria": [
            "Free spans remain ordered, nonoverlapping, and maximal",
            "Freeing in any order yields the same canonical span set",
            "Double-free and out-of-range spans are rejected"
          ],
          "implementationNotes": [
            "Update the span index under one mutation boundary and preserve the arena on validation failure."
          ],
          "verification": [
            "Free three adjacent blocks in all six orders and compare the final index.",
            "Attempt an overlapping release and prove no index entry changes."
          ],
          "deliverables": [
            "Canonical coalescing algorithm and permutation tests"
          ],
          "rollout": "Run shadow invariant checks in the local benchmark before using reclaimed spans.",
          "skills": [
            "Data structures",
            "Invariants",
            "Property testing"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 75
            },
            {
              "field": "Quality engineering",
              "percentage": 25
            }
          ],
          "patterns": []
        },
        {
          "id": "08274454-1425-4d2a-ad93-c6452c131f7d",
          "key": "SMEM-106",
          "title": "Bound fragmentation before adding a more complex allocator",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "control",
          "dependsOn": [
            "SMEM-105"
          ],
          "scenario": "The team proposes size classes after one trace shows poor reuse, but the trace mixes long-lived metadata with short-lived packet records.",
          "acceptanceCriteria": [
            "Measure internal and external fragmentation separately",
            "Replay at least three declared lifetime distributions",
            "Compare reset-only, free-list, and size-class approaches with correctness held constant"
          ],
          "implementationNotes": [
            "Do not select an allocator from mean throughput alone; retain raw workload seeds and peak memory."
          ],
          "verification": [
            "Reproduce each workload and its fragmentation measurements.",
            "Change the seed and show the report identifies noncomparable runs."
          ],
          "deliverables": [
            "Allocator comparison with workload manifest"
          ],
          "rollout": "Adopt additional complexity only if the declared workload crosses an agreed bound.",
          "skills": [
            "Benchmarking",
            "Allocator design",
            "Experimental design"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 60
            },
            {
              "field": "Performance engineering",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "5a906b2f-9d95-48d7-8a5b-dcc610e1b236",
          "key": "SMEM-107",
          "title": "Contain unsafe decoding behind a length-checked cursor",
          "type": "STORY",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 360,
          "phaseId": "control",
          "dependsOn": [
            "SMEM-103"
          ],
          "scenario": "Several parsers perform pointer arithmetic independently; one reads a declared payload length before confirming those bytes remain.",
          "acceptanceCriteria": [
            "One cursor owns offset advancement and remaining-length checks",
            "Primitive reads define endianness and alignment behavior",
            "A failed read returns no partially initialized value"
          ],
          "implementationNotes": [
            "Fuzz only the local parser process and cap input length, nesting, and execution time."
          ],
          "verification": [
            "Decode a complete packet containing every primitive type.",
            "Truncate at every byte boundary and run the corpus under sanitizer or Miri."
          ],
          "deliverables": [
            "Checked decode cursor, fuzz corpus, and unsafe-boundary note"
          ],
          "rollout": "Route one packet family at a time through the cursor and retain the prior decoder for comparison.",
          "skills": [
            "Unsafe code review",
            "Binary parsing",
            "Fuzzing"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 65
            },
            {
              "field": "Security",
              "percentage": 35
            }
          ],
          "patterns": []
        },
        {
          "id": "808bc159-f44e-44f3-b2cb-17fd30f14616",
          "key": "SMEM-108",
          "title": "Expose arena pressure without logging packet contents",
          "type": "CHORE",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 240,
          "phaseId": "operate",
          "dependsOn": [
            "SMEM-102",
            "SMEM-106"
          ],
          "scenario": "Operators can see allocation failures only in verbose decoder logs that include synthetic payload bytes and unbounded record labels.",
          "acceptanceCriteria": [
            "Publish bounded counters for allocations, spills, resets, and exhaustion",
            "Record capacity and high-water mark without payload content",
            "Reject unbounded caller-provided metric dimensions"
          ],
          "implementationNotes": [
            "Metrics are diagnostic observations for this component, not proof of production capacity."
          ],
          "verification": [
            "Drive allocations and reconcile counters with the deterministic workload.",
            "Supply a unique record label per request and confirm it cannot become a dimension."
          ],
          "deliverables": [
            "Bounded arena telemetry and reconciliation test"
          ],
          "rollout": "Enable metrics before changing allocation policy; remove verbose payload logging.",
          "skills": [
            "Observability",
            "Privacy",
            "Cardinality control"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Site reliability",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "6b2eedee-57ee-4ae5-a811-778eab500fbd",
          "key": "SMEM-109",
          "title": "Recover a persisted arena snapshot only when its layout matches",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 360,
          "phaseId": "operate",
          "dependsOn": [
            "SMEM-105",
            "SMEM-107"
          ],
          "scenario": "A warm-start experiment maps a snapshot written by an older layout and interprets its free-list metadata as current records.",
          "acceptanceCriteria": [
            "Snapshot header binds format version, byte order, size, and checksum",
            "Recovery validates every offset before exposing records",
            "Unknown versions fail closed without modifying the snapshot"
          ],
          "implementationNotes": [
            "Use generated snapshots only; memory mapping does not make untrusted offsets safe."
          ],
          "verification": [
            "Write and restore a current snapshot with identical logical records.",
            "Corrupt each header field and one nested offset, then confirm rejection."
          ],
          "deliverables": [
            "Versioned snapshot reader and corruption matrix"
          ],
          "rollout": "Keep cold reconstruction as the default until compatible recovery is repeatable.",
          "skills": [
            "Persistence formats",
            "Validation",
            "Recovery"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 65
            },
            {
              "field": "Storage systems",
              "percentage": 35
            }
          ],
          "patterns": []
        },
        {
          "id": "f587f003-d80b-4966-9f94-2178df30a59d",
          "key": "SMEM-110",
          "title": "Hand off the arena with explicit reasons not to use it",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 150,
          "phaseId": "operate",
          "dependsOn": [
            "SMEM-106",
            "SMEM-108",
            "SMEM-109"
          ],
          "scenario": "A second team wants the arena for long-lived session objects even though reset semantics and spill behavior were designed for packet batches.",
          "acceptanceCriteria": [
            "Document supported lifetimes, alignment, capacity, thread-safety, and reset rules",
            "List measured bounds and unresolved risks with reproduction commands",
            "Include rejection examples for workloads better served by standard allocation"
          ],
          "implementationNotes": [
            "Do not present local benchmark results as universal performance claims."
          ],
          "verification": [
            "Have a reviewer reproduce one supported workload from a clean checkout.",
            "Apply the documented long-lived workload and confirm the guide recommends against adoption."
          ],
          "deliverables": [
            "Usage contract, decision record, and reproducible handoff"
          ],
          "rollout": "Require a separate review before any new workload adopts the component.",
          "skills": [
            "Technical writing",
            "API contracts",
            "Operational handoff"
          ],
          "fieldMix": [
            {
              "field": "Systems programming",
              "percentage": 70
            },
            {
              "field": "Developer tooling",
              "percentage": 30
            }
          ],
          "patterns": []
        }
      ],
      "id": "2a56d313-8b40-49e7-83a7-21d05effd695"
    }
  ]
}
