Wrapper context/artifact_store.py re-implements core SDK FileSystemArtifactStore
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Compare the two FileSystemArtifactStore classes in src/praisonai/praisonai/context/artifact_store.py and src/praisonai-agents/praisonaiagents/context/artifact_store.py, focusing on the shared store, tail, grep, chunk, delete and list methods. First decide whether core can take a configurable base_dir and layout, since the wrapper cannot subclass it otherwise. Done means the wrapper keeps only the run-scoped layout, get_run_dir and cleanup_run, and the praisonai context CLI tests still pass unchanged.
索引モデルが issue の本文から書いたものです。
説明
Summary
The praisonai wrapper ships a second FileSystemArtifactStore (~17.6 KB) that re-implements the same ArtifactStoreProtocol the core SDK already implements, against the same core helper primitives. The two stores differ only in on-disk layout. This is duplicated logic the wrapper could obtain by parametrising/subclassing the core store. This is a DRY/wrapper-health finding — not a request to remove the praisonai context artifact capability.
Current behaviour
Wrapper: src/praisonai/praisonai/context/artifact_store.py:31 class FileSystemArtifactStore
- Methods:
store(150),tail(251),grep(319),chunk(371),delete(403),list_artifacts(425),get_run_dir(499),cleanup_run(503) - Layout:
~/.praison/runs/{run_id}/artifacts/{agent_id}/ - Imports the same primitives from core:
from praisonaiagents.context.artifacts import ArtifactRef, ArtifactMetadata, GrepMatch, QueueConfig, compute_checksum, generate_summary(lines 19-26)
Core SDK: src/praisonai-agents/praisonaiagents/context/artifact_store.py:28 class FileSystemArtifactStore
- Implements
ArtifactStoreProtocol; methodsstore(70),tail(198),grep(244),chunk(292),delete(322),list_artifacts(345),cleanup_old_artifacts(426) - Layout:
~/.praisonai/artifacts/{agent_id}/{run_id}/ - Imports the same primitives from
.artifacts
Live wrapper consumers (so this is a consolidation candidate, not dead code): cli/commands/context.py:284/337/368/393, context/setup.py:12, context/queue.py:33.
Why it matters
~17 KB of near-identical filesystem store/tail/grep/chunk/delete/list logic maintained twice, against the same protocol and the same core helper functions. Behavioural fixes (secret redaction, checksum verification, grep/tail/chunk edge cases) must be applied in both copies or they drift.
Category
Duplicate
Capability preserved
- The
praisonai contextCLI commands keep working byte-for-byte. - The wrapper's distinct run-scoped on-disk layout (
~/.praison/runs/{run_id}/artifacts/{agent_id}/) and itsbase_dirparameter are preserved — the layout difference is the whole reason a separate class exists today. get_run_dir/cleanup_run(run-scoped helpers the core store does not expose) remain available.
Proposed approach
Make the core FileSystemArtifactStore parametrisable on base directory and path layout (it already accepts helpers it shares with the wrapper), then have the wrapper subclass it to inject the run-scoped layout and the get_run_dir/cleanup_run helpers — removing the duplicated store/tail/grep/chunk/delete/list bodies. Non-breaking; the wrapper symbol praisonai.context.FileSystemArtifactStore and its base_dir= constructor keep the same signature.
Resolution sketch
# Before: wrapper carries a full second copy of store/tail/grep/chunk/delete/list.
class FileSystemArtifactStore:
def store(self, ...): ... # ~17KB duplicated against the same protocol/primitives
# After: subclass core; keep only the layout + run-scoped extras.
from praisonaiagents.context.artifact_store import FileSystemArtifactStore as _CoreStore
class FileSystemArtifactStore(_CoreStore):
def __init__(self, base_dir="~/.praison/runs"):
super().__init__(base_dir=base_dir, layout="{run_id}/artifacts/{agent_id}")
def get_run_dir(self, run_id): ...
def cleanup_run(self, run_id): ...
(Requires the small core change of accepting a configurable base_dir/layout; if core cannot take that in this cycle, keep the wrapper copy and track the consolidation.)
Layer placement
- Primary layer: wrapper (consume core instead of re-implementing)
- Touches core: small, additive — make core store's base dir / layout configurable
- 3-way surface (CLI + YAML + Python): preserved
Severity
Medium — maintenance duplication of ~17 KB against an existing core protocol; no user-facing change intended.
Validation
Confirmed the wrapper class is live (consumers listed above), implements the same protocol as core, and imports the identical core primitives — i.e. genuine parallel re-implementation, not an independent concern. The only material difference is on-disk layout, which the proposed approach preserves.
Keep unchanged
- The run-scoped storage layout and
base_dirdefault. - Secret redaction, checksum verification, and tail/grep/chunk behaviour as currently observed by
praisonai context. context/queue.pyandcontext/setup.pywiring and their public call sites.
- 主要言語
- Python
- スター
- 9.3k
- フォーク
- 1.5k
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 520
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MervinPraison/PraisonAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
MervinPraison/PraisonAI#6710 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
claude
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MervinPraison/PraisonAI#6707 ·
メンテナーはふだん 1 日以内に返信
-
bug claude
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
MervinPraison/PraisonAI#6671 ·
メンテナーはふだん 1 日以内に返信
-
Compaction budget regression fixture remains below budget with accurate tokenization再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MervinPraison/PraisonAI#5418 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug claude documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
MervinPraison/PraisonAI#5341 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
MervinPraison/PraisonAI の issue をすべて見る
似ている issue
-
cognition
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
collabnix/awesome-mcp-lists#433 ·
メンテナーはふだん 4 日以内に返信
-
CrossEntropyFilter raises on zero probabilities and single-class results対応中かも @NopeCharon が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
datajoint/datajoint-python#1703 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Archmonger/ServeStatic#129 ·