Piagent Platform v1.51.2

Kiến trúc repo

Core chỉ giữ policy, prompt, guard, skill và script dùng lại được; business logic ở lại project của nó.

Chiều dependency được enforce bằng code.

architecture/layers.json là rule máy đọc; npm run architecture:check chặn dependency ngược và file vượt budget.

Composition

piagent-guard.ts chỉ giữ wiring, registration order và shared runtime state. File này không được tiếp tục chứa feature algorithm.

Runtime adapters

packages/piagent-core/runtime quản lý Pi hook, command, tool, session UI, usage, log compaction và workflow input routing.

Core services

Policy, task, context và state trả về structured decision. Core service không import runtime adapter hay Pi composition root.

Integrations

mcp/, capabilities/ và security/ có ownership riêng; không nhúng task workflow vào integration.

Entrypoints

scripts/ parse CLI argument rồi gọi use case. Metric, policy và state transition không được duplicate trong CLI.

Product assets

prompts/, skills/, subagents/, adapters/, packs/ và schemas/ là declarative assets.

Adaptive runtime

Piagent tách runtime decision khỏi Pi wiring

Harness giữ nguyên model người dùng chọn, nhưng mỗi task có context plan nhỏ hơn, có citation, có task journal bền vững và recovery decision rõ ràng.

Context planner

runtime/context/adaptive-planner.ts chọn budget, retrieval lane, code inclusion và plan receipt theo phase, context pressure, model capability và thinking level.

Lịch sử task cũ

extensions/task-journal.js vẫn đọc checkpoint của các task tạo trước bản 1.9.0 để xem lại; session mới không ghi task nữa.

Repository memory

extensions/repository-memory.js chỉ lưu fact có citation và expiry; từ chối raw prompt/output, OAuth material, API key và secret. Hint chỉ dùng token budget còn dư.

Model capability

runtime/model/capabilities.ts đọc model family, context window và thinking level làm tín hiệu budget, không đổi provider và không cần API key.

Verification intelligence

extensions/verification-intelligence.js phân loại lỗi và chọn verify group theo task scope; scope chạm cả frontend/backend dùng full source verifier.

Execution backend

extensions/execution-backend.js giữ Pi OAuth local làm owner; mutation bị block nếu experimental adapter được yêu cầu nhưng chưa có.

Ownership

Một state chỉ có một source of truth

Project profile và lock có thể commit. Task evidence, telemetry, trace, capture và session history là local state. Derived index phải có policy digest và rebuild được.

StateOwnerVị tríCommit
Project profile + lockProject.pi/piagent-profile*.jsonCó
Task, trace, telemetry, captureRuntime.pi/piagent-state/Không
Task journal + checkpointRuntime.pi/piagent-state/task-journal/Không
Repository memory factRuntime.pi/piagent-state/repository-memory/Không
Session historyPiPi session storeKhông
Shared instructionsProjectAGENTS.md, project docsCó