{
  "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": "44b0aa09-eac0-47a8-a450-4c9d42212ceb",
      "key": "CKV",
      "title": "A crash-consistent local key-value store",
      "field": "Storage systems",
      "summary": "Implement bounded log, index and compaction behavior in a dedicated fixture directory.",
      "context": "Fictional desktop cache Pebble needs a small embedded key-value engine. Build against generated keys and bytes using an ordinary filesystem adapter; no production database replacement is implied.",
      "stack": [
        "TypeScript",
        "Filesystem adapter",
        "Vitest"
      ],
      "prerequisites": [
        "Create a disposable local fixture directory.",
        "Implement fault injection for partial writes, sync failure and process restart."
      ],
      "developerValue": "Practice storage formats, durability boundaries and corruption handling.",
      "companyValue": "Inspect whether an engineer can state and test persistence guarantees.",
      "delivery": "Each ticket adds one narrow engine behavior; publish measured local limits, not database performance claims.",
      "phases": [
        {
          "id": "records",
          "title": "Specify records",
          "goal": "Define bounded encoding and reads."
        },
        {
          "id": "durability",
          "title": "Recover durable writes",
          "goal": "Handle torn records and atomic updates."
        },
        {
          "id": "compaction",
          "title": "Reclaim old storage",
          "goal": "Compact safely and inspect damage."
        }
      ],
      "tickets": [
        {
          "id": "daf3225e-137d-4bc7-8182-34c352037514",
          "key": "CKV-101",
          "title": "Encode local key-value records with explicit length limits",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 90,
          "phaseId": "records",
          "dependsOn": [],
          "scenario": "Delimiter-based records fail when values contain newlines. Add a length-prefixed binary record format.",
          "acceptanceCriteria": [
            "Arbitrary bytes round-trip",
            "Key and value limits are enforced",
            "Version is encoded explicitly"
          ],
          "implementationNotes": [
            "Specify byte order in the format note."
          ],
          "verification": [
            "Round-trip binary fixture",
            "Reject oversized declared length"
          ],
          "deliverables": [
            "Encoder decoder and format document"
          ],
          "rollout": "Keep old files read-only until conversion is explicit.",
          "skills": [
            "Binary formats",
            "Validation"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 70
            },
            {
              "field": "Database engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "a01af955-b426-434f-9acc-a21d44485062",
          "key": "CKV-102",
          "title": "Distinguish missing local keys from empty values",
          "type": "BUG",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 60,
          "phaseId": "records",
          "dependsOn": [
            "CKV-101"
          ],
          "scenario": "Empty buffers are interpreted as Not found. Return explicit presence separate from byte length.",
          "acceptanceCriteria": [
            "Empty stored value is found",
            "Absent key is missing",
            "Deletion yields missing"
          ],
          "implementationNotes": [
            "Avoid truthiness checks on encoded values."
          ],
          "verification": [
            "Read empty value",
            "Read deleted key"
          ],
          "deliverables": [
            "Read result contract and cases"
          ],
          "rollout": "Revert callers to explicit result checking.",
          "skills": [
            "API design",
            "Data contracts"
          ],
          "fieldMix": [
            {
              "field": "API design",
              "percentage": 60
            },
            {
              "field": "Storage systems",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "3d1f87ee-1660-428b-8bd1-fd26efcc5268",
          "key": "CKV-103",
          "title": "Build a local key-value index from validated log records",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 135,
          "phaseId": "records",
          "dependsOn": [
            "CKV-101",
            "CKV-102"
          ],
          "scenario": "Startup trusts offsets without reading record boundaries. Rebuild the index only from validated records.",
          "acceptanceCriteria": [
            "Latest valid record wins",
            "Offsets stay within file bounds",
            "Invalid record reports its position"
          ],
          "implementationNotes": [
            "Do not allocate from untrusted length fields before bounds checks."
          ],
          "verification": [
            "Rebuild repeated keys",
            "Use record extending past EOF"
          ],
          "deliverables": [
            "Startup index and malformed-file cases"
          ],
          "rollout": "Refuse writes to logs that cannot be validated.",
          "skills": [
            "Indexing",
            "Parsing"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 60
            },
            {
              "field": "Database engineering",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "cbca80da-8644-4ab4-a503-e9e38c163942",
          "key": "CKV-104",
          "title": "Declare local write acknowledgement after the durability barrier",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "durability",
          "dependsOn": [
            "CKV-103"
          ],
          "scenario": "Put returns success before the log flush completes. Define durable acknowledgement using the filesystem adapter.",
          "acceptanceCriteria": [
            "Success follows required sync",
            "Sync failure reports uncertain outcome",
            "Failed acknowledgement is not silently retried as new write"
          ],
          "implementationNotes": [
            "Document the adapter's actual durability assumptions."
          ],
          "verification": [
            "Put with successful sync",
            "Inject sync failure after write"
          ],
          "deliverables": [
            "Acknowledgement contract and fault cases"
          ],
          "rollout": "Switch to read-only if durability barriers fail repeatedly.",
          "skills": [
            "Durability",
            "Filesystem"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 70
            },
            {
              "field": "Database engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "ed92f3fc-6774-4f5a-ae3e-ccc151879c25",
          "key": "CKV-105",
          "title": "Recover a torn key-value record at the end of the log",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "durability",
          "dependsOn": [
            "CKV-103",
            "CKV-104"
          ],
          "scenario": "A crash leaves a partial final record and startup refuses every key. Recover the valid prefix conservatively.",
          "acceptanceCriteria": [
            "Valid prefix remains readable",
            "Incomplete tail is identified",
            "Middle corruption fails closed"
          ],
          "implementationNotes": [
            "Tail truncation requires an explicit recovery mode."
          ],
          "verification": [
            "Recover partial final record",
            "Corrupt middle record"
          ],
          "deliverables": [
            "Tail recovery and corruption cases"
          ],
          "rollout": "Preserve original log before applying tail repair.",
          "skills": [
            "Crash recovery",
            "Integrity"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 80
            },
            {
              "field": "Database engineering",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "98c02751-686e-4111-be42-5942dbc0030b",
          "key": "CKV-106",
          "title": "Represent key deletion as an ordered tombstone",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 120,
          "phaseId": "durability",
          "dependsOn": [
            "CKV-104",
            "CKV-105"
          ],
          "scenario": "Rebuilding the index resurrects deleted keys because deletion only changed memory. Append durable tombstones.",
          "acceptanceCriteria": [
            "Deleted keys stay missing after restart",
            "Later puts can recreate key",
            "Tombstones obey acknowledgement rules"
          ],
          "implementationNotes": [
            "Keep record ordering authoritative."
          ],
          "verification": [
            "Delete and restart",
            "Fail tombstone sync"
          ],
          "deliverables": [
            "Tombstone format and restart cases"
          ],
          "rollout": "Disable deletion if durable ordering is uncertain.",
          "skills": [
            "Log structure",
            "State transitions"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 60
            },
            {
              "field": "Database engineering",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "00b72a1b-d035-44b4-b4c0-bcce25ce1856",
          "key": "CKV-107",
          "title": "Reject key-value batches that cannot commit atomically",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 240,
          "phaseId": "durability",
          "dependsOn": [
            "CKV-104",
            "CKV-106"
          ],
          "scenario": "A multi-key update survives restart with only half its changes. Add one bounded batch commit marker protocol.",
          "acceptanceCriteria": [
            "Complete batch applies all records",
            "Uncommitted batch applies none",
            "Batch size is capped"
          ],
          "implementationNotes": [
            "Do not claim filesystem transaction support that the adapter lacks."
          ],
          "verification": [
            "Restart after committed batch",
            "Crash before commit marker"
          ],
          "deliverables": [
            "Batch protocol and fault schedule"
          ],
          "rollout": "Disable batch writes while preserving single-key operations.",
          "skills": [
            "Atomicity",
            "Storage engines"
          ],
          "fieldMix": [
            {
              "field": "Database engineering",
              "percentage": 60
            },
            {
              "field": "Storage systems",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "ac17014d-7abc-48aa-86ba-12316d934641",
          "key": "CKV-108",
          "title": "Compact the local log without changing visible key values",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 210,
          "phaseId": "compaction",
          "dependsOn": [
            "CKV-106",
            "CKV-107"
          ],
          "scenario": "Repeated updates grow the log. Write a compacted generation from one consistent logical view.",
          "acceptanceCriteria": [
            "Latest live values survive",
            "Deleted keys stay absent",
            "Compaction output validates before activation"
          ],
          "implementationNotes": [
            "Bound memory by documented fixture limits or streaming plan."
          ],
          "verification": [
            "Compare reads before and after",
            "Inject corrupted output record"
          ],
          "deliverables": [
            "Compaction writer and equivalence cases"
          ],
          "rollout": "Discard unactivated compacted generation on failure.",
          "skills": [
            "Compaction",
            "Data integrity"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 50
            },
            {
              "field": "Database engineering",
              "percentage": 30
            },
            {
              "field": "Performance engineering",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "88cbf4e0-5570-489a-ab70-d1e8b50cd685",
          "key": "CKV-109",
          "title": "Activate a compacted key-value generation recoverably",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 240,
          "phaseId": "compaction",
          "dependsOn": [
            "CKV-108"
          ],
          "scenario": "Crashing during compacted-file replacement leaves no selected log. Add a recoverable generation manifest.",
          "acceptanceCriteria": [
            "One valid generation is selected",
            "Interrupted switch retains fallback",
            "Repeated recovery makes same choice"
          ],
          "implementationNotes": [
            "Keep previous generation until activation is durable."
          ],
          "verification": [
            "Crash at switch boundaries",
            "Remove incomplete new generation"
          ],
          "deliverables": [
            "Generation activation and crash tests"
          ],
          "rollout": "Restore the last validated manifest and retain both files.",
          "skills": [
            "Crash consistency",
            "Manifests"
          ],
          "fieldMix": [
            {
              "field": "Storage systems",
              "percentage": 70
            },
            {
              "field": "Database engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "101d5111-9ef0-4e1d-b849-50e5fa7f92a8",
          "key": "CKV-110",
          "title": "Inspect local key-value corruption without modifying files",
          "type": "CHORE",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 120,
          "phaseId": "compaction",
          "dependsOn": [
            "CKV-105",
            "CKV-109"
          ],
          "scenario": "Support has no way to identify damaged record offsets safely. Add a read-only inspection command.",
          "acceptanceCriteria": [
            "Reports format and valid prefix",
            "Never rewrites bytes",
            "Output omits values by default"
          ],
          "implementationNotes": [
            "Restrict command to an explicitly supplied fixture path."
          ],
          "verification": [
            "Inspect healthy log",
            "Inspect malformed length and checksum"
          ],
          "deliverables": [
            "Inspector and immutable-input checks"
          ],
          "rollout": "Remove repair suggestions if they imply automatic destructive changes.",
          "skills": [
            "Diagnostics",
            "CLI"
          ],
          "fieldMix": [
            {
              "field": "Developer tooling",
              "percentage": 50
            },
            {
              "field": "Storage systems",
              "percentage": 50
            }
          ],
          "patterns": []
        }
      ]
    }
  ]
}
