Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Define explicit cache ownership contracts through Phase 6

Abierto
#598 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

  • #599 de @anth-volk — cerrado sin fusionar

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

Start by reading the cache and parameter implementations in PolicyEngine Core, then map each cache to the Type A–E ownership and lifecycle requirements in the issue. Break the work into the listed cache, tracing, parameter, and branch behaviors, with deterministic unit and integration tests for the specified cases. Done means the acceptance criteria are met, including downstream migrations without cache-internal changes; Phase 7 remains deferred.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Context

PolicyEngine Core currently uses several caches with different ownership,
isolation, invalidation, and lifetime requirements. Some callers have modified
private cache fields directly because Core did not expose operations for the
required behavior. Parameter tracing also allowed request-specific tracer state
to become associated with reusable parameter views.

Scope

Define and implement the cache architecture through Phase 6:

  • Document Type A model-definition state, Type B policy-system caching, Type C
    parameter-at-date caching, Type D simulation input and result caching, and
    Type E YAML-case execution reuse.
  • Add generic cache contracts for lifecycle, construction, bounded retention,
    revision validation, and branch behavior.
  • Bound YAML policy-system retention and isolate each YAML case's execution
    state.
  • Keep tracer state local to the active calculation and out of cached parameter
    views.
  • Give parameter trees monotonic revisions, retain eager materialization as the
    default, and provide an explicit lazy strategy.
  • Centralize supplied-input provenance and calculated-result invalidation.
  • Allow branches to share immutable array values while retaining independent
    indexes.
  • Expose public parameter replacement, sharing, materialization, and cache
    clearing operations for country packages.

Phase 7, which would separate imported model definitions from policy and
execution state, remains outside this issue.

Downstream migrations

  • PolicyEngine/policyengine-us#9978
  • PolicyEngine/policyengine-uk#2175

Acceptance criteria

  • AI-facing documentation specifies each cache type's owner, key, value,
    lifetime, mutation rules, invalidation, concurrency, and uncached behavior.
  • Generic cache bases use typed key and value parameters and concrete caches
    implement subsystem-specific behavior.
  • Every production commit adds at least 40 deterministic unit cases covering
    standard behavior, rejected behavior, failure cleanup, copying, serialization,
    concurrency, and edge cases.
  • Integration tests compare cached and uncached YAML execution and exercise
    parameter mutation, tracing, simulation cloning, and branch isolation.
  • PolicyEngine US and PolicyEngine UK can migrate without modifying cache
    internals.
  • Phase 7 remains deferred.
Lenguaje dominante
Python
Estrellas
22
Forks
30
Merge medio
2 d 21 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PolicyEngine/policyengine-core

Todos los issues de PolicyEngine/policyengine-core

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.