Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Define explicit cache ownership contracts through Phase 6

オープン
#598 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

  • #599 @anth-volk による — マージされずにクローズ

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
22
フォーク
30
平均マージ
2日 19時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/policyengine-core のほかの issue

PolicyEngine/policyengine-core の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。