@piagent/platform 1.2.9 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +179 -0
- package/README.md +29 -6
- package/adapters/backend-api/profile.json +1 -1
- package/adapters/be-readonly-fe/profile.json +2 -2
- package/adapters/data/profile.json +1 -1
- package/adapters/devops/profile.json +1 -3
- package/adapters/docs/profile.json +1 -1
- package/adapters/fullstack/profile.json +2 -4
- package/adapters/generic/profile.json +1 -1
- package/adapters/mobile/profile.json +1 -2
- package/adapters/node-typescript/profile.json +1 -3
- package/benchmarks/core-v1/suite.json +51 -0
- package/benchmarks/core-v1/tasks/discount-order/grade.mjs +17 -0
- package/benchmarks/core-v1/tasks/discount-order/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/discount-order/project/src/discount.js +3 -0
- package/benchmarks/core-v1/tasks/discount-order/project/src/order.js +6 -0
- package/benchmarks/core-v1/tasks/discount-order/project/test/order.test.js +7 -0
- package/benchmarks/core-v1/tasks/discount-order/prompt.md +4 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/grade.mjs +17 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/project/src/invoice.js +3 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/project/test/invoice.test.js +7 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/prompt.md +3 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/grade.mjs +11 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/project/README.md +4 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/project/test/smoke.test.js +4 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/prompt.md +4 -0
- package/benchmarks/core-v1/tasks/targeted-session/grade.mjs +14 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/auth/session.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/billing/currency.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/catalog/search.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/notifications/channel.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/search/tokenize.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/test/session.test.js +7 -0
- package/benchmarks/core-v1/tasks/targeted-session/prompt.md +4 -0
- package/catalog/capabilities.json +12 -12
- package/docs/command-reference-vietnamese.md +15 -8
- package/docs/context-engine.md +56 -15
- package/docs/distribution-standard.md +11 -8
- package/docs/mcp-and-tools.md +20 -7
- package/docs/model-options.md +7 -10
- package/docs/operator-manual-vietnamese.md +102 -37
- package/docs/package-architecture-notes.md +3 -1
- package/docs/publishing-for-teams.md +5 -0
- package/docs/quality-benchmark.md +225 -58
- package/docs/quickstart-vietnamese.md +5 -0
- package/docs/release-install-policy.md +41 -7
- package/docs/runtime-harness-standard.md +47 -29
- package/docs/runtime-policy-design.md +23 -12
- package/docs/runtime-quality-baseline.md +31 -17
- package/docs/security-threat-model.md +7 -2
- package/docs/subagents-and-multiagent.md +1 -1
- package/docs/task-implementation-contract.md +113 -177
- package/docs/task-lifecycle-vietnamese.md +129 -125
- package/docs/team-onboarding.md +12 -4
- package/docs/usage-observability.md +15 -8
- package/docs-site/architecture.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/content/context-engine.html +8 -1
- package/docs-site/content/runtime.html +10 -0
- package/docs-site/content/security.html +1 -0
- package/docs-site/context-engine.html +9 -2
- package/docs-site/index.html +1 -1
- package/docs-site/mcp-approval.html +1 -1
- package/docs-site/mcp-auth.html +1 -1
- package/docs-site/mcp-servers.html +1 -1
- package/docs-site/mcp.html +1 -1
- package/docs-site/permissions.html +1 -1
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +1 -1
- package/docs-site/runtime.html +11 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +2 -1
- package/docs-site/team.html +1 -1
- package/docs-site/workflows.html +1 -1
- package/evals/fixtures/task-contract.invalid.json +15 -1
- package/evals/fixtures/task-contract.valid.json +18 -2
- package/package.json +3 -2
- package/packages/piagent-core/README.md +43 -4
- package/packages/piagent-core/benchmark/benchmark-core.js +691 -0
- package/packages/piagent-core/extensions/context-engine.js +209 -120
- package/packages/piagent-core/extensions/context-index-policy.js +1 -1
- package/packages/piagent-core/extensions/guard-types.ts +35 -3
- package/packages/piagent-core/extensions/local-state-path.js +59 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +2073 -222
- package/packages/piagent-core/extensions/policy-core.js +11 -1
- package/packages/piagent-core/extensions/runtime-evidence.js +39 -19
- package/packages/piagent-core/extensions/state-retention.js +218 -0
- package/packages/piagent-core/extensions/task-lifecycle.js +138 -0
- package/packages/piagent-core/extensions/task-state.js +630 -0
- package/packages/piagent-core/mcp/mcp-config-layers.js +52 -6
- package/packages/piagent-core/mcp/mcp-tool-naming.js +12 -1
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/policies/base-policy.json +1 -0
- package/packages/piagent-core/prompts/be-to-fe.md +14 -22
- package/packages/piagent-core/prompts/platform-improve.md +12 -17
- package/packages/piagent-core/prompts/review.md +7 -11
- package/packages/piagent-core/prompts/scout.md +6 -10
- package/packages/piagent-core/prompts/task.md +11 -17
- package/packages/piagent-core/skills/piagent-ops/SKILL.md +12 -15
- package/packages/piagent-core/subagents/piagent-reviewer.md +3 -3
- package/schemas/task-contract.schema.json +267 -104
- package/scripts/benchmark-runner.mjs +1172 -0
- package/scripts/install-global.sh +1 -1
- package/scripts/migrate-project-state.mjs +94 -3
- package/scripts/piagent-cli.mjs +1 -1
- package/scripts/update-global.mjs +36 -3
- package/scripts/verify-local.sh +15 -0
- package/templates/project/.pi/task-contract.template.json +19 -2
- package/templates/project/AGENTS.md +10 -20
|
@@ -131,6 +131,11 @@ Hoặc đổi tên phiên đang mở trong Pi:
|
|
|
131
131
|
|
|
132
132
|
Alias ngắn `/setname ABC-123 Short task name` vẫn chạy. Nếu tắt nhầm terminal/app, vào lại project rồi dùng `pi --continue` cho phiên gần nhất, hoặc `pi --resume` để chọn theo session name/id. Trong Pi có thể gõ `/resume` để xem reminder ngắn.
|
|
133
133
|
|
|
134
|
+
Task Contract v2 lưu cả `sessionId`, `sessionName`, `taskId` và `taskRunId`, nên
|
|
135
|
+
Agent Watch/report có thể map usage vào đúng attempt kể cả session đã resume hoặc
|
|
136
|
+
được đổi tên sau khi bắt đầu. Một session không được tái sử dụng cho task khác;
|
|
137
|
+
retry dùng session mới và giữ liên kết qua cùng `taskId`.
|
|
138
|
+
|
|
134
139
|
Mặc định history mode **bao gồm subagent session files** vì đó là usage thật của máy. Dùng `--no-subagents` khi chỉ muốn parent/main sessions.
|
|
135
140
|
|
|
136
141
|
Format hỗ trợ:
|
|
@@ -169,18 +174,20 @@ Nếu user paste full mandatory-flow boilerplate, platform input guard sẽ coll
|
|
|
169
174
|
|
|
170
175
|
Tool output dài cũng bị compact theo cùng triết lý: chat giữ preview, audit/report giữ capture local. Nếu verify fail và preview chưa đủ, chạy lại command targeted hơn thay vì đổ full log vào session.
|
|
171
176
|
|
|
177
|
+
Trace, observed-bash, telemetry và capture đều bounded và owner-only. Rotation
|
|
178
|
+
không cần UI polling realtime, dùng lock liên process để nhiều Pi session/subagent
|
|
179
|
+
không ghi đè nhau. Capture mặc định giữ tối đa 500 file, 128 MiB và 30 ngày.
|
|
180
|
+
|
|
172
181
|
## Khi nào ghi benchmark
|
|
173
182
|
|
|
174
183
|
Sau một task cần so sánh workflow/model bằng số liệu:
|
|
175
184
|
|
|
176
185
|
```bash
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
--surface pi \
|
|
180
|
-
--result pass \
|
|
181
|
-
--tokens <total-from-piagent-usage> \
|
|
182
|
-
--cost <cost-from-piagent-usage> \
|
|
183
|
-
--verify "<verify-command>"
|
|
186
|
+
piagent-benchmark --dry-run
|
|
187
|
+
piagent-benchmark --model <provider/model> --thinking high
|
|
184
188
|
```
|
|
185
189
|
|
|
186
|
-
|
|
190
|
+
Automatic runner lấy exact usage từ session JSONL và so median trên các cặp cùng
|
|
191
|
+
pass. Không dùng ước lượng ký tự để claim tiết kiệm token. Với một task ngoài
|
|
192
|
+
suite, vẫn dùng `/session`, RPC `get_session_stats`, `piagent-usage`, hoặc legacy
|
|
193
|
+
`piagent-benchmark <project> --record ...`.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/commands.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</article>
|
|
7
7
|
<article class="card">
|
|
8
8
|
<h3 id="local-index">Index local</h3>
|
|
9
|
-
<p>FTS5, symbol và import graph nằm trong <span class="inline-code">.pi/piagent-state/context-engine/</span>.
|
|
9
|
+
<p>FTS5, symbol và import graph nằm trong <span class="inline-code">.pi/piagent-state/context-engine/</span>. Storage chỉ cho OS account hiện tại; policy đổi sẽ retry FTS rebuild và VACUUM đến khi purge xong.</p>
|
|
10
10
|
</article>
|
|
11
11
|
<article class="card">
|
|
12
12
|
<h3 id="ranked-context">Context có xếp hạng</h3>
|
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</section>
|
|
29
29
|
|
|
30
|
+
<section class="section">
|
|
31
|
+
<div class="callout">
|
|
32
|
+
<strong>Index có chứa source body</strong>
|
|
33
|
+
<p>Protected paths và secret files không được index. Directory dùng mode <span class="inline-code">0700</span>; database, WAL và SHM dùng <span class="inline-code">0600</span>. Refresh bình thường dùng SQLite core + FTS5 secure-delete. Full FTS rebuild và VACUUM chỉ chạy khi exclusion policy đổi hoặc một purge trước bị gián đoạn, không chạy trên mỗi prompt hay mỗi refresh.</p>
|
|
34
|
+
</div>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
30
37
|
<section class="section">
|
|
31
38
|
<div class="command-grid">
|
|
32
39
|
<article class="command-card">
|
|
@@ -25,6 +25,16 @@ piagent-install --version vX.Y.Z --resolve-tag</code></pre>
|
|
|
25
25
|
<header><span>Doctor</span><button class="clip-btn" data-clip="piagent-doctor /path/to/project">Lấy lệnh</button></header>
|
|
26
26
|
<pre><code>piagent-doctor /path/to/project</code></pre>
|
|
27
27
|
</article>
|
|
28
|
+
<article class="command-card">
|
|
29
|
+
<header><span>Automatic benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --dry-run piagent-benchmark">Lấy lệnh</button></header>
|
|
30
|
+
<pre><code>piagent-benchmark --dry-run
|
|
31
|
+
piagent-benchmark</code></pre>
|
|
32
|
+
</article>
|
|
33
|
+
<article class="command-card">
|
|
34
|
+
<header><span>Compare codex-cli</span><button class="clip-btn" data-clip="piagent-benchmark --surfaces piagent,codex-cli --model openai-codex/gpt-5.6-sol --thinking xhigh">Lấy lệnh</button></header>
|
|
35
|
+
<pre><code>piagent-benchmark --surfaces piagent,codex-cli \
|
|
36
|
+
--model openai-codex/gpt-5.6-sol --thinking xhigh</code></pre>
|
|
37
|
+
</article>
|
|
28
38
|
<article class="command-card">
|
|
29
39
|
<header><span>Trusted run</span><button class="clip-btn" data-clip="piagent-auto --full-access -p "Run the trusted local benchmark suite."">Lấy lệnh</button></header>
|
|
30
40
|
<pre><code>piagent-auto --read-only -p "Scout payment mapping. Do not edit source."
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
<ul>
|
|
34
34
|
<li>Có thể bị ảnh hưởng bởi symlink, encoding, nested payload, shell expansion hoặc tool mới chưa được policy hoá.</li>
|
|
35
35
|
<li>Redaction là backstop giảm rò rỉ, không phải giấy phép để đưa secret thật vào prompt/output.</li>
|
|
36
|
+
<li>Context index là local cache có source body: mode owner-only giảm cross-account access, nhưng process chạy cùng OS account vẫn cần được tin cậy.</li>
|
|
36
37
|
<li>Workload không tin cậy cần container/VM với giới hạn filesystem, process, network và credential.</li>
|
|
37
38
|
</ul>
|
|
38
39
|
</div>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
</article>
|
|
102
102
|
<article class="card">
|
|
103
103
|
<h3 id="local-index">Index local</h3>
|
|
104
|
-
<p>FTS5, symbol và import graph nằm trong <span class="inline-code">.pi/piagent-state/context-engine/</span>.
|
|
104
|
+
<p>FTS5, symbol và import graph nằm trong <span class="inline-code">.pi/piagent-state/context-engine/</span>. Storage chỉ cho OS account hiện tại; policy đổi sẽ retry FTS rebuild và VACUUM đến khi purge xong.</p>
|
|
105
105
|
</article>
|
|
106
106
|
<article class="card">
|
|
107
107
|
<h3 id="ranked-context">Context có xếp hạng</h3>
|
|
@@ -122,6 +122,13 @@
|
|
|
122
122
|
</div>
|
|
123
123
|
</section>
|
|
124
124
|
|
|
125
|
+
<section class="section">
|
|
126
|
+
<div class="callout">
|
|
127
|
+
<strong>Index có chứa source body</strong>
|
|
128
|
+
<p>Protected paths và secret files không được index. Directory dùng mode <span class="inline-code">0700</span>; database, WAL và SHM dùng <span class="inline-code">0600</span>. Refresh bình thường dùng SQLite core + FTS5 secure-delete. Full FTS rebuild và VACUUM chỉ chạy khi exclusion policy đổi hoặc một purge trước bị gián đoạn, không chạy trên mỗi prompt hay mỗi refresh.</p>
|
|
129
|
+
</div>
|
|
130
|
+
</section>
|
|
131
|
+
|
|
125
132
|
<section class="section">
|
|
126
133
|
<div class="command-grid">
|
|
127
134
|
<article class="command-card">
|
package/docs-site/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/mcp-auth.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/mcp.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/profiles.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/runtime.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -120,6 +120,16 @@ piagent-install --version vX.Y.Z --resolve-tag</code></pre>
|
|
|
120
120
|
<header><span>Doctor</span><button class="clip-btn" data-clip="piagent-doctor /path/to/project">Lấy lệnh</button></header>
|
|
121
121
|
<pre><code>piagent-doctor /path/to/project</code></pre>
|
|
122
122
|
</article>
|
|
123
|
+
<article class="command-card">
|
|
124
|
+
<header><span>Automatic benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --dry-run piagent-benchmark">Lấy lệnh</button></header>
|
|
125
|
+
<pre><code>piagent-benchmark --dry-run
|
|
126
|
+
piagent-benchmark</code></pre>
|
|
127
|
+
</article>
|
|
128
|
+
<article class="command-card">
|
|
129
|
+
<header><span>Compare codex-cli</span><button class="clip-btn" data-clip="piagent-benchmark --surfaces piagent,codex-cli --model openai-codex/gpt-5.6-sol --thinking xhigh">Lấy lệnh</button></header>
|
|
130
|
+
<pre><code>piagent-benchmark --surfaces piagent,codex-cli \
|
|
131
|
+
--model openai-codex/gpt-5.6-sol --thinking xhigh</code></pre>
|
|
132
|
+
</article>
|
|
123
133
|
<article class="command-card">
|
|
124
134
|
<header><span>Trusted run</span><button class="clip-btn" data-clip="piagent-auto --full-access -p "Run the trusted local benchmark suite."">Lấy lệnh</button></header>
|
|
125
135
|
<pre><code>piagent-auto --read-only -p "Scout payment mapping. Do not edit source."
|
package/docs-site/scope.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/security.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -128,6 +128,7 @@
|
|
|
128
128
|
<ul>
|
|
129
129
|
<li>Có thể bị ảnh hưởng bởi symlink, encoding, nested payload, shell expansion hoặc tool mới chưa được policy hoá.</li>
|
|
130
130
|
<li>Redaction là backstop giảm rò rỉ, không phải giấy phép để đưa secret thật vào prompt/output.</li>
|
|
131
|
+
<li>Context index là local cache có source body: mode owner-only giảm cross-account access, nhưng process chạy cùng OS account vẫn cần được tin cậy.</li>
|
|
131
132
|
<li>Workload không tin cậy cần container/VM với giới hạn filesystem, process, network và credential.</li>
|
|
132
133
|
</ul>
|
|
133
134
|
</div>
|
package/docs-site/team.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
package/docs-site/workflows.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
|
|
31
31
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
33
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"taskRunId": "task-0001-20260731120000-a1b2c3d4e5",
|
|
4
|
+
"changeMode": "source-change",
|
|
5
|
+
"attempt": 4,
|
|
6
|
+
"maxAttempts": 3,
|
|
7
|
+
"previousAttempts": [],
|
|
2
8
|
"summary": "Replace with one-sentence task outcome.",
|
|
3
9
|
"riskLane": "normal",
|
|
4
10
|
"expectedOutput": "Replace with exact artifact or behavior expected.",
|
|
@@ -16,6 +22,7 @@
|
|
|
16
22
|
"contextManifest": [],
|
|
17
23
|
"memoryCitations": [],
|
|
18
24
|
"mcpCapabilities": [],
|
|
25
|
+
"verifyGroup": "source",
|
|
19
26
|
"verifyCommands": [
|
|
20
27
|
"Replace with verify command."
|
|
21
28
|
],
|
|
@@ -65,9 +72,16 @@
|
|
|
65
72
|
"watchdog": "Use a strong model only for final risk review, security, release, or high-impact changes."
|
|
66
73
|
}
|
|
67
74
|
},
|
|
75
|
+
"baselineChangedFiles": [],
|
|
76
|
+
"baselineFileDigests": {},
|
|
77
|
+
"observedChangedFiles": [],
|
|
78
|
+
"finalWorkingTreeFiles": [],
|
|
79
|
+
"finalFileDigests": {},
|
|
68
80
|
"changedFiles": [],
|
|
69
81
|
"verifyEvidence": [],
|
|
70
82
|
"trace": {
|
|
71
83
|
"outcome": "pending"
|
|
72
|
-
}
|
|
84
|
+
},
|
|
85
|
+
"createdAt": "2026-07-31T12:00:00.000Z",
|
|
86
|
+
"updatedAt": "2026-07-31T12:00:00.000Z"
|
|
73
87
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"taskRunId": "task-0001-20260731120000-a1b2c3d4e5",
|
|
4
|
+
"taskId": "task-0001",
|
|
5
|
+
"sessionId": "pi-session-example",
|
|
6
|
+
"sessionName": "TASK-0001 Example task",
|
|
7
|
+
"changeMode": "source-change",
|
|
8
|
+
"attempt": 1,
|
|
9
|
+
"maxAttempts": 3,
|
|
10
|
+
"previousAttempts": [],
|
|
3
11
|
"summary": "Replace with one-sentence task outcome.",
|
|
4
12
|
"riskLane": "normal",
|
|
5
13
|
"expectedOutput": "Replace with exact artifact or behavior expected.",
|
|
@@ -17,6 +25,7 @@
|
|
|
17
25
|
"contextManifest": [],
|
|
18
26
|
"memoryCitations": [],
|
|
19
27
|
"mcpCapabilities": [],
|
|
28
|
+
"verifyGroup": "source",
|
|
20
29
|
"verifyCommands": [
|
|
21
30
|
"Replace with verify command."
|
|
22
31
|
],
|
|
@@ -66,9 +75,16 @@
|
|
|
66
75
|
"watchdog": "Use a strong model only for final risk review, security, release, or high-impact changes."
|
|
67
76
|
}
|
|
68
77
|
},
|
|
78
|
+
"baselineChangedFiles": [],
|
|
79
|
+
"baselineFileDigests": {},
|
|
80
|
+
"observedChangedFiles": [],
|
|
81
|
+
"finalWorkingTreeFiles": [],
|
|
82
|
+
"finalFileDigests": {},
|
|
69
83
|
"changedFiles": [],
|
|
70
84
|
"verifyEvidence": [],
|
|
71
85
|
"trace": {
|
|
72
86
|
"outcome": "pending"
|
|
73
|
-
}
|
|
87
|
+
},
|
|
88
|
+
"createdAt": "2026-07-31T12:00:00.000Z",
|
|
89
|
+
"updatedAt": "2026-07-31T12:00:00.000Z"
|
|
74
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piagent/platform",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"SECURITY.md",
|
|
31
31
|
".gitattributes",
|
|
32
32
|
"adapters/",
|
|
33
|
+
"benchmarks/",
|
|
33
34
|
"catalog/",
|
|
34
35
|
"docs/",
|
|
35
36
|
"!docs/journals/",
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
"install-global": "bash scripts/install-global.sh",
|
|
114
115
|
"init-project": "bash scripts/init-project.sh",
|
|
115
116
|
"doctor": "bash scripts/team-doctor.sh",
|
|
116
|
-
"benchmark": "
|
|
117
|
+
"benchmark": "node scripts/benchmark-runner.mjs",
|
|
117
118
|
"benchmark:redaction": "node scripts/redaction-benchmark.mjs",
|
|
118
119
|
"audit:runtime": "bash scripts/audit-runtime-host.sh",
|
|
119
120
|
"release:identity": "node scripts/verify-release-identity.mjs",
|
|
@@ -6,13 +6,23 @@ Shared Pi package for reusable project workflows.
|
|
|
6
6
|
|
|
7
7
|
- `extensions/piagent-guard.ts`: runtime guard tools and policy hooks.
|
|
8
8
|
- `prompts/*.md`: workflow aliases that intentionally launch an agent turn.
|
|
9
|
-
- `skills/piagent-ops/SKILL.md`:
|
|
9
|
+
- `skills/piagent-ops/SKILL.md`: operator-invoked reference for manual intake, recovery, and high-risk controls; routine runtime-managed tasks do not advertise or load it.
|
|
10
10
|
- `skills/piagent-source-cache/`: local cache for user-provided external source repositories.
|
|
11
11
|
- `subagents/*.md`: piagent roles for `pi-subagents`.
|
|
12
|
+
- `benchmark/benchmark-core.js`: deterministic suite validation, evidence scoring, usage comparison, and report rendering for `piagent-benchmark`.
|
|
12
13
|
- `policies/base-policy.json`: default runtime policy, including protected path and shell protected path defaults.
|
|
13
14
|
- input hook support for local screenshot/image paths pasted into chat; supported images are attached as `[image1]`, `[image2]`, ...
|
|
14
15
|
- compact tool-result rendering: oversized redacted output is previewed in Pi and captured under `.pi/piagent-state/tool-results/` for offline audit/reporting.
|
|
15
|
-
- local Context Engine v2: incremental FTS5/symbol/import index, hybrid retrieval, token-budgeted packs, test-impact mapping, dynamic Piagent tools, and Agent Watch compatible telemetry.
|
|
16
|
+
- local Context Engine v2: incremental FTS5/symbol/import index, hybrid retrieval, token-budgeted packs, bounded current-turn source/test snapshots, test-impact mapping, dynamic Piagent tools, and Agent Watch compatible telemetry.
|
|
17
|
+
|
|
18
|
+
The root package exposes `piagent-benchmark` for an automatic paired Piagent
|
|
19
|
+
steady-state benchmark against Raw Pi or the `codex-cli` surface. Treatment
|
|
20
|
+
onboarding/context preparation happens before measured model usage;
|
|
21
|
+
post-baseline mutations remain scope violations. Codex runs through a strict
|
|
22
|
+
streaming JSONL adapter and defaults to controlled ephemeral execution with an
|
|
23
|
+
isolated temporary Codex home. Run
|
|
24
|
+
`piagent-benchmark --dry-run` before starting billed model sessions; see
|
|
25
|
+
`docs/quality-benchmark.md` for score and verdict rules.
|
|
16
26
|
|
|
17
27
|
## Trusted run wrapper
|
|
18
28
|
|
|
@@ -70,12 +80,20 @@ Legacy aliases still work: `/permission-status`, `/read-only`, `/workspace-write
|
|
|
70
80
|
- `piagent_profile_tech_context_record`
|
|
71
81
|
- `piagent_project_onboarding_record`
|
|
72
82
|
- `piagent_task_start`
|
|
83
|
+
- `piagent_task_progress`
|
|
73
84
|
- `piagent_source_checkout`
|
|
74
85
|
- `piagent_document_read` — reads `.md`/`.txt`/`.csv`/`.json`/`.yaml`/`.pdf`/`.docx` from the project or a granted `additionalReadRoots` directory; read-only, and `protectedPaths` still wins
|
|
75
86
|
- `piagent_context_record`
|
|
76
87
|
- `piagent_verify_record` — records verify evidence only after matching an observed bash tool result after task start
|
|
77
88
|
- `piagent_trace_record`
|
|
78
89
|
|
|
90
|
+
These tools are registered capabilities, not a per-task call sequence. Runtime
|
|
91
|
+
starts bounded source tasks directly and exposes no Piagent management schema
|
|
92
|
+
to the model. Broad, high-risk, or ambiguous intake activates
|
|
93
|
+
`piagent_task_start`; lifecycle hooks still collect context, changes,
|
|
94
|
+
current-tree verification, trace and final-gate evidence. Diagnostic/recovery
|
|
95
|
+
groups load only when requested.
|
|
96
|
+
|
|
79
97
|
## Runtime commands and workflow recipes
|
|
80
98
|
|
|
81
99
|
- `/commands`: runtime menu/help for terminal, Pi, MCP, model, memory, session, context, permission, and subagent commands.
|
|
@@ -132,6 +150,7 @@ If no trusted profile is available, the extension still applies baseline secret
|
|
|
132
150
|
Runtime task tools write local state to:
|
|
133
151
|
|
|
134
152
|
- `.pi/piagent-state/tasks/*.json`
|
|
153
|
+
- `.pi/piagent-state/session-tasks/*.json`
|
|
135
154
|
- `.pi/project-context.md`
|
|
136
155
|
- `.pi/tech-stack.json`
|
|
137
156
|
- `.pi/tech-context/*.json`
|
|
@@ -147,10 +166,30 @@ Runtime task tools write local state to:
|
|
|
147
166
|
|
|
148
167
|
Project-local state belongs in `.pi/.gitignore`.
|
|
149
168
|
|
|
150
|
-
|
|
169
|
+
Task files use schema v2 and bind one unique `taskRunId` to one Pi `sessionId`.
|
|
170
|
+
They record attempt/max-attempt history, dependency-safe work-plan progress,
|
|
171
|
+
Git baseline/final digests, observed changes, all exact verify results and final
|
|
172
|
+
trace. A terminal task is immutable; retry starts in a fresh session and carries
|
|
173
|
+
the prior failure/ruled-out evidence. Legacy v1 state is migrated and archived
|
|
174
|
+
without requiring project onboarding again.
|
|
175
|
+
|
|
176
|
+
Local state directories are owner-only. Task state, context telemetry, trace,
|
|
177
|
+
bash evidence and captures refuse ancestor symlinks out of the project. JSONL
|
|
178
|
+
files rotate under a cross-process lock; compacted tool captures are pruned by
|
|
179
|
+
age, count and aggregate bytes.
|
|
180
|
+
|
|
181
|
+
The Context Engine SQLite index contains allowed source bodies. Its directory is
|
|
182
|
+
kept at mode `0700`, with database/WAL/SHM at `0600`; core and FTS5 secure-delete
|
|
183
|
+
cover normal refreshes, while exclusion-policy changes trigger a retryable FTS
|
|
184
|
+
rebuild and database vacuum before the new policy is considered clean.
|
|
185
|
+
|
|
186
|
+
Passing source final gates require an observed exit `0` result for every
|
|
187
|
+
meaningful entry in `task.verifyCommands`. Other observed commands are traceable
|
|
188
|
+
but advisory. Declared changed files must also differ from the task baseline,
|
|
189
|
+
match observed tool results and remain inside `task.scope`.
|
|
151
190
|
|
|
152
191
|
Raw path-like tool access to protected paths is blocked before execution. This includes Pi built-ins (`read`, `write`, `edit`, `grep`, `find`, `ls`) and custom/MCP tools with nested path-like strings, arrays, or `file://` URIs. Path-like strings are percent-decoded once, and input nesting above `MAX_TOOL_INPUT_INSPECTION_DEPTH=32` fails closed. Known content fields such as `content`, `query`, `pattern`, `text`, and `command` are excluded from generic extraction. `grep.glob` and `find.pattern` are checked when they explicitly target protected paths, while broad `grep`, `find`, and `ls` results are filtered so protected content lines or path metadata are redacted before reaching the model.
|
|
153
192
|
|
|
154
193
|
Raw `bash` access to protected paths is blocked through shell path extraction. `.pi/piagent-state/**` and `.pi/piagent-profile.json` are self-protected; use `piagent_context` and piagent task tools for governed access.
|
|
155
194
|
|
|
156
|
-
The input hook also detects local image paths in chat prompts. Supported formats are `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, and `.bmp
|
|
195
|
+
The input hook also detects local image paths in chat prompts. Supported formats are `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, and `.bmp`. The canonical target must be inside the project or a directory granted through `additionalReadRoots`/`PIAGENT_ADDITIONAL_READ_ROOTS`; protected paths and project files outside the resolved filesystem read scope remain blocked. File bytes are sniffed before attachment, and the checked file identity must still match when opened. Up to 4 images are attached per input, with an 8 MB per-image cap. Oversized images should be read through Pi's `read` tool so Pi can resize them.
|