{
  "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": "c3d7d229-4f2e-4563-8d9c-867a2ec3412a",
      "key": "CPRES",
      "title": "Presence that remains honest during disconnection",
      "field": "Real-time systems",
      "summary": "Model ephemeral team presence with expiry, reconnects and scoped fan-out.",
      "context": "Fictional document team Pine shows collaboration presence for synthetic accounts. Build a loopback WebSocket server and injected clocks; no message content or activity surveillance is required.",
      "stack": [
        "TypeScript",
        "WebSocket",
        "Redis adapter",
        "Vitest"
      ],
      "prerequisites": [
        "Create synthetic memberships and session identifiers.",
        "Implement controllable sockets and an in-memory TTL adapter."
      ],
      "developerValue": "Practice ephemeral state, ordering and reconnect semantics.",
      "companyValue": "Inspect whether online indicators avoid stale or unauthorized claims.",
      "delivery": "Presence means an active connection lease only; it does not infer attention or productivity.",
      "phases": [
        {
          "id": "leases",
          "title": "Define presence meaning",
          "goal": "Specify scopes and expiry."
        },
        {
          "id": "fanout",
          "title": "Distribute state safely",
          "goal": "Handle identity and reconnect races."
        },
        {
          "id": "operations",
          "title": "Bound operating behavior",
          "goal": "Limit work and diagnose stale indicators."
        }
      ],
      "tickets": [
        {
          "id": "0e5e9b70-dd06-4b27-ac48-b35f427c20eb",
          "key": "CPRES-101",
          "title": "Define online presence as an unexpired connection lease",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 75,
          "phaseId": "leases",
          "dependsOn": [],
          "scenario": "A green dot remains after the browser closes. Replace the permanent flag with explicitly expiring presence.",
          "acceptanceCriteria": [
            "Active lease shows connected",
            "Expiry removes connected state",
            "UI explains connection meaning"
          ],
          "implementationNotes": [
            "Do not infer human attention from a socket."
          ],
          "verification": [
            "Advance clock before expiry",
            "Advance beyond expiry without disconnect"
          ],
          "deliverables": [
            "Lease contract and clock cases"
          ],
          "rollout": "Hide presence if lease freshness cannot be established.",
          "skills": [
            "TTL",
            "State modeling"
          ],
          "fieldMix": [
            {
              "field": "Real-time systems",
              "percentage": 60
            },
            {
              "field": "Distributed systems",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "c61f0c42-ba2a-4cb8-bc3d-e40757c6bac8",
          "key": "CPRES-102",
          "title": "Validate presence room identifiers before subscribing",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "FOUNDATIONAL",
          "estimateMinutes": 75,
          "phaseId": "leases",
          "dependsOn": [],
          "scenario": "Malformed room names reach the broker and create unbounded keys. Parse a bounded typed room identifier.",
          "acceptanceCriteria": [
            "Valid room IDs subscribe",
            "Malformed IDs fail before broker access",
            "Error omits raw oversized input"
          ],
          "implementationNotes": [
            "Room parsing does not replace membership checks."
          ],
          "verification": [
            "Subscribe valid fixture room",
            "Send oversized room identifier"
          ],
          "deliverables": [
            "Room parser and rejection tests"
          ],
          "rollout": "Reject new subscriptions if parsing fails.",
          "skills": [
            "Input validation",
            "Pub-sub"
          ],
          "fieldMix": [
            {
              "field": "Security",
              "percentage": 50
            },
            {
              "field": "Real-time systems",
              "percentage": 50
            }
          ],
          "patterns": []
        },
        {
          "id": "3615cb97-e65d-49b0-8f84-a63f91672070",
          "key": "CPRES-103",
          "title": "Scope presence membership checks to each room subscription",
          "type": "TASK",
          "priority": "HIGH",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 135,
          "phaseId": "leases",
          "dependsOn": [
            "CPRES-101",
            "CPRES-102"
          ],
          "scenario": "Authentication alone currently permits joining any document room. Require current membership in the room boundary.",
          "acceptanceCriteria": [
            "Member can join",
            "Foreign member is denied",
            "Revoked membership cannot renew lease"
          ],
          "implementationNotes": [
            "Recheck authority at renewal using local stub."
          ],
          "verification": [
            "Join authorized room",
            "Revoke membership before renewal"
          ],
          "deliverables": [
            "Subscription authorization and denial cases"
          ],
          "rollout": "Stop renewals while membership adapter is unavailable.",
          "skills": [
            "Authorization",
            "Tenancy"
          ],
          "fieldMix": [
            {
              "field": "Security",
              "percentage": 70
            },
            {
              "field": "Real-time systems",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "aae20ce3-3f0b-475f-aff3-bf73ab346b38",
          "key": "CPRES-104",
          "title": "Count multiple presence connections without duplicating people",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 120,
          "phaseId": "fanout",
          "dependsOn": [
            "CPRES-103"
          ],
          "scenario": "Two tabs display the same teammate twice. Aggregate active connection leases under a scoped synthetic account.",
          "acceptanceCriteria": [
            "One person entry per room",
            "Closing one tab preserves other lease",
            "Last expiry removes person"
          ],
          "implementationNotes": [
            "Do not merge identities across organizations."
          ],
          "verification": [
            "Open two tabs",
            "Expire last connection"
          ],
          "deliverables": [
            "Presence aggregation and cases"
          ],
          "rollout": "Display connection counts only if person aggregation is incorrect.",
          "skills": [
            "Aggregation",
            "Identity"
          ],
          "fieldMix": [
            {
              "field": "Real-time systems",
              "percentage": 70
            },
            {
              "field": "Data engineering",
              "percentage": 30
            }
          ],
          "patterns": []
        },
        {
          "id": "12b600c2-1d58-4ba9-a9bb-ce9a97266c1e",
          "key": "CPRES-105",
          "title": "Reject stale presence heartbeats after reconnect",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "fanout",
          "dependsOn": [
            "CPRES-103",
            "CPRES-104"
          ],
          "scenario": "Delayed heartbeat from a replaced socket prolongs a dead session. Bind renewal to session generation.",
          "acceptanceCriteria": [
            "New generation supersedes old",
            "Old heartbeat cannot renew",
            "Current heartbeat extends its own lease"
          ],
          "implementationNotes": [
            "Generation changes must be atomic in the adapter."
          ],
          "verification": [
            "Renew current session",
            "Deliver old heartbeat after reconnect"
          ],
          "deliverables": [
            "Generation guard and race tests"
          ],
          "rollout": "Close superseded sessions and require fresh joins.",
          "skills": [
            "Concurrency",
            "Fencing"
          ],
          "fieldMix": [
            {
              "field": "Distributed systems",
              "percentage": 60
            },
            {
              "field": "Real-time systems",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "1493c756-a2ef-4649-adc5-d4a98f2700c7",
          "key": "CPRES-106",
          "title": "Send a presence snapshot before incremental updates",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "fanout",
          "dependsOn": [
            "CPRES-104",
            "CPRES-105"
          ],
          "scenario": "A new client applies deltas to an empty list and misses existing teammates. Add snapshot sequencing at subscription.",
          "acceptanceCriteria": [
            "Snapshot establishes sequence",
            "Later deltas follow its watermark",
            "Detected gaps trigger resnapshot"
          ],
          "implementationNotes": [
            "Buffer during snapshot only within a documented limit."
          ],
          "verification": [
            "Join populated room",
            "Drop one delta and detect gap"
          ],
          "deliverables": [
            "Snapshot handshake and gap cases"
          ],
          "rollout": "Resend full snapshots while delta path is repaired.",
          "skills": [
            "Ordering",
            "State synchronization"
          ],
          "fieldMix": [
            {
              "field": "Real-time systems",
              "percentage": 50
            },
            {
              "field": "Distributed systems",
              "percentage": 50
            }
          ],
          "patterns": []
        },
        {
          "id": "e2bf9730-d315-444e-afac-538f8929b1f1",
          "key": "CPRES-107",
          "title": "Expire presence independently of disconnect delivery",
          "type": "BUG",
          "priority": "HIGH",
          "difficulty": "EXPERT",
          "estimateMinutes": 240,
          "phaseId": "fanout",
          "dependsOn": [
            "CPRES-101",
            "CPRES-105",
            "CPRES-106"
          ],
          "scenario": "A server restart loses disconnect events and rooms retain ghosts. Make lease expiry authoritative across process recovery.",
          "acceptanceCriteria": [
            "Restart cannot preserve expired entries",
            "Cleanup repeats safely",
            "Concurrent renewal cannot delete fresh lease"
          ],
          "implementationNotes": [
            "Compare stored lease identity before removal."
          ],
          "verification": [
            "Restart with expired leases",
            "Renew during cleanup"
          ],
          "deliverables": [
            "Expiry reconciliation and interleaving cases"
          ],
          "rollout": "Disable cleanup writes if lease identity cannot be checked.",
          "skills": [
            "Recovery",
            "Concurrency"
          ],
          "fieldMix": [
            {
              "field": "Distributed systems",
              "percentage": 50
            },
            {
              "field": "Real-time systems",
              "percentage": 30
            },
            {
              "field": "Site reliability",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "74712b3c-239c-4c07-a17e-fb5266b0641a",
          "key": "CPRES-108",
          "title": "Cap presence fan-out per room without silently losing state",
          "type": "TASK",
          "priority": "MEDIUM",
          "difficulty": "ADVANCED",
          "estimateMinutes": 180,
          "phaseId": "operations",
          "dependsOn": [
            "CPRES-106"
          ],
          "scenario": "A synthetic busy room causes unbounded socket buffers. Introduce a per-client queue cap and resync fallback.",
          "acceptanceCriteria": [
            "Buffer count is bounded",
            "Overflow requests resnapshot",
            "Healthy peers continue receiving"
          ],
          "implementationNotes": [
            "Do not drop arbitrary deltas and claim synchronization."
          ],
          "verification": [
            "Exercise normal fan-out",
            "Stall one client to capacity"
          ],
          "deliverables": [
            "Bounded broadcaster and overflow cases"
          ],
          "rollout": "Disconnect slow clients with a clear resync reason.",
          "skills": [
            "Backpressure",
            "Resource limits"
          ],
          "fieldMix": [
            {
              "field": "Performance engineering",
              "percentage": 50
            },
            {
              "field": "Real-time systems",
              "percentage": 30
            },
            {
              "field": "Site reliability",
              "percentage": 20
            }
          ],
          "patterns": []
        },
        {
          "id": "96146c8d-8185-444a-8fdf-b49e87410f84",
          "key": "CPRES-109",
          "title": "Distinguish disconnected and stale presence in the client",
          "type": "STORY",
          "priority": "MEDIUM",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 105,
          "phaseId": "operations",
          "dependsOn": [
            "CPRES-107",
            "CPRES-108"
          ],
          "scenario": "Network loss freezes green dots and suggests teammates remain connected. Mark stale state during transport uncertainty.",
          "acceptanceCriteria": [
            "Local disconnect marks snapshot stale",
            "Reconnect waits for fresh snapshot",
            "Stale entries are not labeled online"
          ],
          "implementationNotes": [
            "Preserve names only while room access remains valid."
          ],
          "verification": [
            "Disconnect then reconnect",
            "Lose authorization during reconnect"
          ],
          "deliverables": [
            "Presence freshness UI"
          ],
          "rollout": "Hide entries during uncertainty if freshness labeling fails.",
          "skills": [
            "UX",
            "State projection"
          ],
          "fieldMix": [
            {
              "field": "Frontend",
              "percentage": 60
            },
            {
              "field": "Real-time systems",
              "percentage": 40
            }
          ],
          "patterns": []
        },
        {
          "id": "e4a92b23-ca34-4c54-b330-b63cf085f028",
          "key": "CPRES-110",
          "title": "Expose presence lease diagnostics without activity histories",
          "type": "CHORE",
          "priority": "LOW",
          "difficulty": "INTERMEDIATE",
          "estimateMinutes": 90,
          "phaseId": "operations",
          "dependsOn": [
            "CPRES-109"
          ],
          "scenario": "Operators need to locate ghost indicators without collecting behavioral timelines. Add current aggregate lease counters.",
          "acceptanceCriteria": [
            "Counters include active and expired totals",
            "No per-person activity history is stored",
            "Room labels use bounded safe identifiers"
          ],
          "implementationNotes": [
            "Use synthetic rooms in samples."
          ],
          "verification": [
            "Inspect healthy counters",
            "Create expired lease and verify aggregation"
          ],
          "deliverables": [
            "Diagnostic contract and samples"
          ],
          "rollout": "Disable diagnostics if person-level histories appear.",
          "skills": [
            "Observability",
            "Privacy"
          ],
          "fieldMix": [
            {
              "field": "Privacy engineering",
              "percentage": 50
            },
            {
              "field": "Site reliability",
              "percentage": 30
            },
            {
              "field": "Real-time systems",
              "percentage": 20
            }
          ],
          "patterns": []
        }
      ]
    }
  ]
}
