@piagent/platform 1.2.10 → 1.2.12
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 +174 -0
- package/README.md +29 -4
- 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/benchmarks/production-v1/grade.mjs +220 -0
- package/benchmarks/production-v1/project/README.md +7 -0
- package/benchmarks/production-v1/project/config/service.json +4 -0
- package/benchmarks/production-v1/project/data/audit-ledger.jsonl +1 -0
- package/benchmarks/production-v1/project/docs/ops.md +3 -0
- package/benchmarks/production-v1/project/logs/incident.log +2 -0
- package/benchmarks/production-v1/project/package.json +11 -0
- package/benchmarks/production-v1/project/scripts/check.mjs +21 -0
- package/benchmarks/production-v1/project/src/backend/auth.js +3 -0
- package/benchmarks/production-v1/project/src/backend/cache.js +15 -0
- package/benchmarks/production-v1/project/src/backend/invoice.js +4 -0
- package/benchmarks/production-v1/project/src/data/csv.js +3 -0
- package/benchmarks/production-v1/project/src/data/dedup.js +5 -0
- package/benchmarks/production-v1/project/src/data/migration.js +9 -0
- package/benchmarks/production-v1/project/src/frontend/pagination.js +8 -0
- package/benchmarks/production-v1/project/src/frontend/search-state.js +8 -0
- package/benchmarks/production-v1/project/src/frontend/unicode-search.js +7 -0
- package/benchmarks/production-v1/project/src/platform/args.js +10 -0
- package/benchmarks/production-v1/project/src/platform/config.js +7 -0
- package/benchmarks/production-v1/project/src/platform/workspace.js +13 -0
- package/benchmarks/production-v1/project/src/reliability/expiry.js +5 -0
- package/benchmarks/production-v1/project/src/reliability/retry.js +15 -0
- package/benchmarks/production-v1/project/test/smoke.test.js +12 -0
- package/benchmarks/production-v1/project/vendor/README.md +1 -0
- package/benchmarks/production-v1/prompts/bounded-retry.md +7 -0
- package/benchmarks/production-v1/prompts/cli-double-dash.md +7 -0
- package/benchmarks/production-v1/prompts/config-precedence.md +6 -0
- package/benchmarks/production-v1/prompts/destructive-history-refusal.md +3 -0
- package/benchmarks/production-v1/prompts/expiry-boundary.md +7 -0
- package/benchmarks/production-v1/prompts/incident-diagnosis.md +4 -0
- package/benchmarks/production-v1/prompts/invoice-rounding.md +9 -0
- package/benchmarks/production-v1/prompts/pagination-boundary.md +7 -0
- package/benchmarks/production-v1/prompts/protected-env-refusal.md +2 -0
- package/benchmarks/production-v1/prompts/quoted-csv.md +6 -0
- package/benchmarks/production-v1/prompts/repository-prompt-injection.md +5 -0
- package/benchmarks/production-v1/prompts/schema-migration.md +6 -0
- package/benchmarks/production-v1/prompts/stable-dedup.md +6 -0
- package/benchmarks/production-v1/prompts/stale-search-response.md +6 -0
- package/benchmarks/production-v1/prompts/tenant-cache-isolation.md +6 -0
- package/benchmarks/production-v1/prompts/tenant-role-authorization.md +6 -0
- package/benchmarks/production-v1/prompts/unicode-search.md +6 -0
- package/benchmarks/production-v1/prompts/workspace-order.md +7 -0
- package/benchmarks/production-v1/suite.json +284 -0
- package/benchmarks/production-v1/variant.mjs +112 -0
- package/catalog/capabilities.json +10 -10
- package/docs/command-reference-vietnamese.md +19 -6
- package/docs/context-engine.md +33 -11
- package/docs/distribution-standard.md +11 -8
- package/docs/mcp-and-tools.md +13 -7
- package/docs/model-options.md +7 -10
- package/docs/operator-manual-vietnamese.md +98 -33
- package/docs/package-architecture-notes.md +3 -1
- package/docs/publishing-for-teams.md +4 -0
- package/docs/quality-benchmark.md +336 -58
- package/docs/quickstart-vietnamese.md +5 -0
- package/docs/release-install-policy.md +45 -7
- package/docs/runtime-harness-standard.md +47 -29
- package/docs/runtime-policy-design.md +24 -12
- package/docs/runtime-quality-baseline.md +42 -17
- package/docs/security-threat-model.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/runtime.html +16 -0
- package/docs-site/context-engine.html +1 -1
- 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 +17 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +1 -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 +37 -3
- package/packages/piagent-core/benchmark/benchmark-core.js +975 -0
- package/packages/piagent-core/extensions/context-engine.js +81 -57
- 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 +1904 -175
- 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/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/schemas/task-contract.schema.json +267 -104
- package/scripts/benchmark-runner.mjs +1432 -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 +19 -0
- package/templates/project/.pi/task-contract.template.json +19 -2
- package/templates/project/AGENTS.md +10 -20
|
@@ -6,14 +6,15 @@ Runtime harness là “máy vận hành task” dùng chung cho nhiều project:
|
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
8
|
User request
|
|
9
|
-
->
|
|
10
|
-
->
|
|
9
|
+
-> Pi session name / task identity
|
|
10
|
+
-> resolved project profile + capability lock
|
|
11
|
+
-> intake/risk lane/change mode
|
|
11
12
|
-> required context manifest
|
|
12
|
-
->
|
|
13
|
+
-> session-bound task contract v2 + work-plan DAG
|
|
13
14
|
-> guarded tool calls
|
|
14
|
-
->
|
|
15
|
-
-> observed
|
|
16
|
-
-> trace / handoff
|
|
15
|
+
-> baseline-aware changed-file evidence
|
|
16
|
+
-> all-command observed verification
|
|
17
|
+
-> immutable trace / retry handoff
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
Project cụ thể chỉ cần adapter/profile riêng. Core package giữ lifecycle, policy, verification, và documentation flow.
|
|
@@ -23,10 +24,12 @@ Project cụ thể chỉ cần adapter/profile riêng. Core package giữ lifecy
|
|
|
23
24
|
| Module | Pi Agent Platform target | Lý do |
|
|
24
25
|
|---|---|---|
|
|
25
26
|
| Risk lane | `riskLane` + profile `hardGates` | Chặn auth, release, provider config, destructive action, database migration. |
|
|
26
|
-
| Intake | `piagent_task_start` | Mỗi
|
|
27
|
+
| Intake | runtime automatic intake; fallback `piagent_task_start` | Mỗi attempt có identity/session/scope/output/acceptance criteria trước model work; bounded tasks không tốn management turn. |
|
|
27
28
|
| Context rules | `/onboard run`, Pi Context Engine, `.pi/project-context.md`, `requiredContext`, context manifest | Giảm token và tránh đọc toàn repo. |
|
|
28
|
-
| Test matrix | `verifyCommands` + observed verify evidence | DONE phải có exact verify command thực chạy qua Pi bash
|
|
29
|
-
| Trace |
|
|
29
|
+
| Test matrix | `verifyCommands` + observed verify evidence | Source DONE phải có mọi exact verify command thực chạy và pass qua Pi bash. |
|
|
30
|
+
| Trace | completion hook, `.pi/piagent-state/traces.jsonl`, session entry | Runtime tự ghi audit trail; tool thủ công chỉ dùng recovery. |
|
|
31
|
+
| Retry | `attempt`, `maxAttempts`, `previousAttempts`, failed step state | Lần sau giữ failure/ruled-out evidence và không loop vô hạn. |
|
|
32
|
+
| Change truth | Git baseline/final digests + tool-result observation | Không nhận file dirty cũ hoặc claim không có evidence là thay đổi của task. |
|
|
30
33
|
| Protected paths | `protectedPaths` trong profile + extension guard | Mỗi project có vùng cấm riêng. |
|
|
31
34
|
| Tool registry | `mcpCapabilities` + `.mcp.json` | Không tự đoán tool/MCP. |
|
|
32
35
|
| Domain contract | Project docs/profile | Chỉ project cần UX/form/data strict mới bật. |
|
|
@@ -57,6 +60,9 @@ tool context mang tính advisory chỉ được nạp khi task thực sự cần
|
|
|
57
60
|
|
|
58
61
|
```text
|
|
59
62
|
1. Intake
|
|
63
|
+
- one Pi session per task
|
|
64
|
+
- runtime auto-start for bounded source changes; manual fallback for broad/high-risk/ambiguous scope
|
|
65
|
+
- source-change or read-only
|
|
60
66
|
- risk lane
|
|
61
67
|
- expected output
|
|
62
68
|
- acceptance criteria
|
|
@@ -64,41 +70,46 @@ tool context mang tính advisory chỉ được nạp khi task thực sự cần
|
|
|
64
70
|
- protected paths
|
|
65
71
|
|
|
66
72
|
2. Context
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
- record context manifest
|
|
73
|
+
- runtime injects one bounded Context Engine navigation pack when useful
|
|
74
|
+
- read only targeted current files
|
|
75
|
+
- successful reads become context manifest evidence automatically
|
|
76
|
+
- no routine context/status/index tool calls
|
|
72
77
|
|
|
73
78
|
3. Plan
|
|
74
79
|
- exact touchpoints
|
|
75
80
|
- verify command
|
|
76
81
|
- rollback/handoff if high-risk
|
|
82
|
+
- dependency DAG with one write owner
|
|
77
83
|
|
|
78
84
|
4. Implement
|
|
79
|
-
-
|
|
80
|
-
- check non-piagent tools only when capability is unclear
|
|
85
|
+
- tool-call hook checks shell, capabilities and external actions automatically
|
|
81
86
|
- edit only in scope
|
|
82
87
|
- avoid protected paths
|
|
88
|
+
- block direct and shell writes outside scope
|
|
83
89
|
|
|
84
90
|
5. Verify
|
|
85
|
-
- run exact mapped verify command
|
|
86
|
-
-
|
|
91
|
+
- run every exact mapped verify command
|
|
92
|
+
- tool-result hook records exact observed evidence after task start
|
|
93
|
+
- bind passing evidence to the current working-tree digest
|
|
94
|
+
- reconcile changed files against baseline and scope
|
|
87
95
|
- if verify unavailable: not DONE
|
|
88
96
|
|
|
89
97
|
6. Trace
|
|
90
|
-
-
|
|
91
|
-
- commands
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
- completion hook projects the final contract and runs the gate
|
|
99
|
+
- runtime persists changed files, commands, result and final trace
|
|
100
|
+
- one bounded continuation repairs missing evidence; it never loops
|
|
101
|
+
- freeze the contract after a terminal outcome
|
|
102
|
+
|
|
103
|
+
7. Retry when needed
|
|
104
|
+
- start a fresh Pi session with the same taskId
|
|
105
|
+
- carry forward failedAt, reason, ruledOut, and prior outcome
|
|
106
|
+
- refuse attempts beyond the first attempt's maxAttempts
|
|
96
107
|
```
|
|
97
108
|
|
|
98
109
|
| Lane | Extra context/orchestration |
|
|
99
110
|
|---|---|
|
|
100
|
-
| `tiny` |
|
|
101
|
-
| `normal` |
|
|
111
|
+
| `tiny` | Automatic lifecycle; parent agent, targeted reads, exact verify, no progress/evidence calls. |
|
|
112
|
+
| `normal` | Automatic objective evidence plus one explicit final review step. |
|
|
102
113
|
| `high-risk` | Relevant index/memory/vendor evidence plus explicit security/data/release review. |
|
|
103
114
|
|
|
104
115
|
## Maturity phases
|
|
@@ -108,20 +119,27 @@ tool context mang tính advisory chỉ được nạp khi task thực sự cần
|
|
|
108
119
|
| P0 | package core + profile + docs + protected path guard | Chỉ đủ pilot/read-only. |
|
|
109
120
|
| P1 | schema + task contract + doctor + verify-local + lean prompts | Dùng được cho task nhỏ có review. |
|
|
110
121
|
| P2 | extension tools for task/context/verify/trace + session entries | Dùng được cho source task có guard rõ. |
|
|
111
|
-
| P3 | exec policy + context budget + tool registry + task gate + benchmark
|
|
112
|
-
| P4 |
|
|
122
|
+
| P3 | exec policy + context budget + tool registry + task gate + automatic paired benchmark | Dùng được cho guarded project workflows. |
|
|
123
|
+
| P4 | session-bound v2 state, Git change truth, retry, completion hook, bounded secure local state | Sẵn sàng rollout có kiểm soát; OS/MDM governance vẫn ngoài core. |
|
|
113
124
|
|
|
114
125
|
## Chuẩn DONE
|
|
115
126
|
|
|
116
127
|
Một Pi task chỉ DONE khi có đủ:
|
|
117
128
|
|
|
118
129
|
- profile loaded;
|
|
130
|
+
- task is bound to the current Pi session;
|
|
119
131
|
- lane classified;
|
|
120
132
|
- protected paths known;
|
|
121
133
|
- context manifest exists;
|
|
122
134
|
- plan exists for source write;
|
|
123
135
|
- changed files listed;
|
|
124
|
-
- exact verify command ran and passed
|
|
136
|
+
- every exact source verify command ran and passed;
|
|
137
|
+
- declared changed files are evidenced, in scope, and different from baseline;
|
|
138
|
+
- work plan has no pending/in-progress/failed step;
|
|
125
139
|
- trace/handoff recorded;
|
|
126
140
|
- no secrets touched;
|
|
127
141
|
- no protected path writes.
|
|
142
|
+
|
|
143
|
+
Read-only task có thể hoàn tất không cần source verifier nhưng phải giữ working
|
|
144
|
+
tree không đổi. Source task không có Git hoặc meaningful verifier bị từ chối từ
|
|
145
|
+
đầu, không đợi tới cuối mới báo thiếu evidence.
|
|
@@ -20,14 +20,14 @@ Runtime policy là lớp kiểm soát cách agent đọc context, gọi tool, s
|
|
|
20
20
|
| Project context | `piagent_context` | Load profile, settings, policy, and local state summary. |
|
|
21
21
|
| Context index | `piagent_context_index_status/search/record` | Maintain a compact advisory node/edge/citation map for profile/project/tech/task navigation. |
|
|
22
22
|
| Permission profile | `piagent_permission_status` | Show active `read-only`, `workspace-write`, or `trusted-full-access` boundary. |
|
|
23
|
-
| Exec policy | `piagent_exec_policy_check` | Evaluate shell command risk before execution. |
|
|
24
|
-
| Context budget | `piagent_context_budget` | Enforce size/count limits for context files. |
|
|
25
|
-
| Tool registry | `piagent_tool_policy_check` | Check external tool capability against profile. |
|
|
26
|
-
| Task contract | `piagent_task_start` | Persist scope, acceptance criteria, risk lane, and verify plan. |
|
|
27
|
-
| Context manifest | `piagent_context_record` | Record
|
|
28
|
-
| Verify evidence | `
|
|
29
|
-
| Final gate | `piagent_task_gate_check` | Validate readiness before final handoff. |
|
|
30
|
-
| Trace | `piagent_trace_record` | Persist changed files, outcome, and handoff state. |
|
|
23
|
+
| Exec policy | `tool_call` hook; diagnostic `piagent_exec_policy_check` | Evaluate shell command risk before execution. |
|
|
24
|
+
| Context budget | lifecycle hooks; diagnostic `piagent_context_budget` | Enforce size/count limits for context files. |
|
|
25
|
+
| Tool registry | `tool_call` hook; diagnostic `piagent_tool_policy_check` | Check external tool capability against profile. |
|
|
26
|
+
| Task contract | automatic intake; fallback `piagent_task_start` | Persist scope, acceptance criteria, risk lane, intake mode, and verify plan before model work. |
|
|
27
|
+
| Context manifest | `tool_result` hook; recovery `piagent_context_record` | Record successful targeted reads for a task. |
|
|
28
|
+
| Verify evidence | `tool_result` hook; recovery `piagent_verify_record` | Bind an exact observed Pi `bash` result to the current working tree. |
|
|
29
|
+
| Final gate | `message_end` hook; diagnostic `piagent_task_gate_check` | Validate projected readiness before final handoff. |
|
|
30
|
+
| Trace | completion hook; recovery `piagent_trace_record` | Persist changed files, outcome, and handoff state. |
|
|
31
31
|
| Usage | `piagent_usage_snapshot` | Show session/context/token usage when available. |
|
|
32
32
|
|
|
33
33
|
## Policy precedence
|
|
@@ -78,7 +78,7 @@ The runtime separates the active autonomy profile from the project profile:
|
|
|
78
78
|
## Task lifecycle
|
|
79
79
|
|
|
80
80
|
```text
|
|
81
|
-
intake
|
|
81
|
+
runtime/manual intake
|
|
82
82
|
-> profile/context
|
|
83
83
|
-> task contract
|
|
84
84
|
-> context manifest
|
|
@@ -90,7 +90,9 @@ intake
|
|
|
90
90
|
-> handoff
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
This lifecycle is intentionally explicit
|
|
93
|
+
This lifecycle is intentionally explicit in persisted state but passive in the
|
|
94
|
+
routine model flow. Hooks make task quality auditable without turning the state
|
|
95
|
+
machine into a long sequence of model tool calls.
|
|
94
96
|
|
|
95
97
|
## Verify evidence ledger
|
|
96
98
|
|
|
@@ -100,7 +102,10 @@ Pi `bash` results are observed through the runtime `tool_result` hook and append
|
|
|
100
102
|
.pi/piagent-state/observed-bash.jsonl
|
|
101
103
|
```
|
|
102
104
|
|
|
103
|
-
The ledger stores cwd, timestamp, status, a hash of the normalized command, and
|
|
105
|
+
The ledger stores cwd, timestamp, status, a hash of the normalized command, and
|
|
106
|
+
redacted command text for audit. Runtime uses it directly; a recovery
|
|
107
|
+
`piagent_verify_record` call can also validate against it without raw command
|
|
108
|
+
storage.
|
|
104
109
|
|
|
105
110
|
This file-based ledger is intentionally shared by parent and subagent processes that run in the same project cwd. If a worker subagent runs `npm test`, the parent can later record that exact verify command without depending on process-local memory.
|
|
106
111
|
|
|
@@ -129,4 +134,11 @@ Ad-hoc commands can still be recorded for traceability, but they do not satisfy
|
|
|
129
134
|
|
|
130
135
|
## Benchmark discipline
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
Release-level quality/token/cost claims must use `piagent-benchmark`: paired clean
|
|
138
|
+
workspaces, the same prompt/model/thinking, hidden acceptance checks, exact Pi
|
|
139
|
+
usage, scope checks and Piagent workflow evidence. A token-saving verdict also
|
|
140
|
+
requires quality/reliability at least `9/10`, perfect safety, the suite's
|
|
141
|
+
workflow threshold (`10/10` for smoke and at least `9/10` for production),
|
|
142
|
+
non-inferior quality and at least three same-model paired runs with exact usage.
|
|
143
|
+
`scripts/quality-benchmark.sh` remains only as a legacy recorder for
|
|
144
|
+
project-specific evidence.
|
|
@@ -133,7 +133,18 @@ Runtime behavior:
|
|
|
133
133
|
- yêu cầu observed passing verify khớp exact `task.verifyCommands` khi task có source changes;
|
|
134
134
|
- block `piagent_trace_record completed` nếu final gate đang enforce và proof chưa đủ.
|
|
135
135
|
|
|
136
|
-
Agent
|
|
136
|
+
Agent không phải gọi các tool evidence/trace/gate trong task thường. Hook
|
|
137
|
+
`tool_result` tự ghi targeted reads, changed files và exact verifier; hook
|
|
138
|
+
`message_end` dựng final contract, chạy gate rồi ghi terminal trace khi đủ proof.
|
|
139
|
+
Các tool thủ công vẫn tồn tại cho diagnostics/recovery và high-risk/custom plan.
|
|
140
|
+
|
|
141
|
+
Passing evidence còn phải khớp `workingTreeDigest` hiện tại. Bất kỳ mutation nào
|
|
142
|
+
sau verify làm evidence cũ stale. Việc chạm một file rồi revert về đúng digest
|
|
143
|
+
baseline chỉ được giữ trong audit history, không được tính là final source diff.
|
|
144
|
+
|
|
145
|
+
Automatic/assisted plan được phép một `followUp` correction turn khi projected
|
|
146
|
+
gate fail. Lượt này nhận đúng missing reasons, không tự lặp; rollback bằng
|
|
147
|
+
`PIAGENT_AUTO_RECOVERY=off`.
|
|
137
148
|
|
|
138
149
|
`piagent_verify_record` không còn tin `exitCode` tự khai báo. Lệnh verify phải khớp một bash tool result đã quan sát sau `task.createdAt`, và claimed `exitCode` phải khớp trạng thái `isError` của Pi. Observed result được ghi vào `.pi/piagent-state/observed-bash.jsonl` để parent/subagent process có thể share evidence trong cùng project cwd.
|
|
139
150
|
|
|
@@ -158,7 +169,7 @@ Guard state tự bảo vệ:
|
|
|
158
169
|
- mọi text block trong `tool_result` và string leaf trong JSON-like `details` có thêm shared sensitive-data redaction; key như `password`, `token`, `credential` được dùng làm context phát hiện;
|
|
159
170
|
- `npm run benchmark:redaction` gate contextual recall, benign preservation, structured objects/arrays, và large-output correctness bằng synthetic data; opaque entropy không có credential context được báo riêng và không gate release;
|
|
160
171
|
- bash evidence chỉ giữ command text đã redact ở memory/disk; raw command hash vẫn dùng để exact-match verify evidence;
|
|
161
|
-
- `piagent_task_start`,
|
|
172
|
+
- `piagent_task_start`, lifecycle hooks và các recovery tools vẫn ghi state được qua internal extension path.
|
|
162
173
|
|
|
163
174
|
## 5. Local verification
|
|
164
175
|
|
|
@@ -188,34 +199,48 @@ pi list --approve
|
|
|
188
199
|
|
|
189
200
|
## 6. Quality benchmark
|
|
190
201
|
|
|
191
|
-
|
|
202
|
+
Automatic paired benchmark:
|
|
192
203
|
|
|
193
204
|
```bash
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
--surface pi \
|
|
198
|
-
--result pass \
|
|
199
|
-
--tokens 12345 \
|
|
200
|
-
--cost 0.12 \
|
|
201
|
-
--verify "npm test" \
|
|
202
|
-
--notes "verify passed; no manual correction"
|
|
205
|
+
piagent-benchmark --dry-run
|
|
206
|
+
piagent-benchmark
|
|
207
|
+
piagent-benchmark --production --dry-run
|
|
203
208
|
```
|
|
204
209
|
|
|
205
210
|
Output:
|
|
206
211
|
|
|
207
212
|
```text
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
~/.pi/agent/benchmarks/piagent/<run-id>/report.json
|
|
214
|
+
~/.pi/agent/benchmarks/piagent/<run-id>/report.html
|
|
215
|
+
~/.pi/agent/benchmarks/piagent/<run-id>/summary.txt
|
|
216
|
+
~/.pi/agent/benchmarks/piagent/<run-id>/runs.jsonl
|
|
210
217
|
```
|
|
211
218
|
|
|
212
|
-
|
|
219
|
+
Runner dùng clean Git fixture, hidden grader và exact Pi session usage. Piagent
|
|
220
|
+
fixture được init/onboard và build context trước measured run để benchmark task
|
|
221
|
+
steady-state; mọi context/index mutation sau Git baseline vẫn bị scope gate bắt.
|
|
222
|
+
Report tách hidden correctness khỏi scope/reliability, hiện usage của mọi run và
|
|
223
|
+
chỉ lưu histogram tên tool. Chỉ claim chất lượng/token/cost khi các paired run có:
|
|
213
224
|
|
|
214
225
|
- cùng task prompt/spec;
|
|
215
226
|
- cùng acceptance criteria;
|
|
216
227
|
- verify command rõ;
|
|
217
|
-
- token/cost/duration được ghi lại;
|
|
218
|
-
- quality
|
|
228
|
+
- token/cost/duration được runtime ghi lại;
|
|
229
|
+
- quality/reliability đạt ít nhất `9/10`, safety đạt `10/10`, workflow đạt ngưỡng
|
|
230
|
+
của suite (`10/10` cho smoke, ít nhất `9/10` cho production), quality không
|
|
231
|
+
giảm và ít nhất ba cặp cùng model có exact usage.
|
|
232
|
+
|
|
233
|
+
`piagent-benchmark <project> --record ...` vẫn route tới recorder cũ cho task
|
|
234
|
+
project-specific, nhưng không thay thế automatic release benchmark.
|
|
235
|
+
|
|
236
|
+
`core-v1` là smoke gate 24 session. Release/model claim diện rộng dùng
|
|
237
|
+
`production-v1`: 18 scenario family x 3 generated variant x 2 surface = 108
|
|
238
|
+
session, phủ sáu domain, nhiều profile và cold/steady lifecycle. Production gate
|
|
239
|
+
chấm thêm từng category và cận trên 95% của paired token ratio; repeat được
|
|
240
|
+
cluster theo scenario family nên không bị tính như bằng chứng độc lập. Runner
|
|
241
|
+
chỉ retry lỗi process trước khi có usage, ghi retry vào ledger riêng; timeout và
|
|
242
|
+
task failure vẫn được chấm reliability. Chi tiết và quy trình private held-out
|
|
243
|
+
suite nằm trong `docs/quality-benchmark.md`.
|
|
219
244
|
|
|
220
245
|
## Runtime policy trong profile
|
|
221
246
|
|
|
@@ -22,7 +22,7 @@ This document covers the packaged guard, project profiles, capability locks, ins
|
|
|
22
22
|
- The operator, operating-system account, Pi host, and explicitly trusted project repository are trusted to execute code.
|
|
23
23
|
- Project-local Pi resources are loaded only after Pi project trust or an explicit operator override.
|
|
24
24
|
- A human remains available to approve destructive and external-provider actions.
|
|
25
|
-
- Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.2.
|
|
25
|
+
- Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.2.12, and WSL2 is experimental/unverified.
|
|
26
26
|
- Registry, GitHub, model-provider, MCP-provider, and Vercel controls are external dependencies. Their account security and platform guarantees are not replaced by this repository.
|
|
27
27
|
|
|
28
28
|
## Threat actors and failure modes
|
|
@@ -1,200 +1,136 @@
|
|
|
1
|
-
# Task Implementation Contract
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Contract fields
|
|
8
|
-
|
|
9
|
-
| Field | Required | Ý nghĩa |
|
|
10
|
-
|---|---:|---|
|
|
11
|
-
| `taskId` | yes | ID ổn định cho task. |
|
|
12
|
-
| `summary` | yes | Một câu mô tả outcome. |
|
|
13
|
-
| `riskLane` | yes | `tiny`, `normal`, hoặc `high-risk`. |
|
|
14
|
-
| `expectedOutput` | yes | Artifact/behavior cụ thể. |
|
|
15
|
-
| `acceptanceCriteria` | yes | Điều kiện pass/fail. |
|
|
16
|
-
| `scope` | yes | File/module được phép đụng. |
|
|
17
|
-
| `outOfScope` | yes | Cái không làm. |
|
|
18
|
-
| `protectedPaths` | yes | Vùng cấm từ profile/policy. |
|
|
19
|
-
| `requiredContext` | yes | Context bắt buộc đọc. |
|
|
20
|
-
| `contextManifest` | yes | Bằng chứng context đã dùng. |
|
|
21
|
-
| `memoryCitations` | no | Memory file dùng làm advisory context, nếu có. |
|
|
22
|
-
| `mcpCapabilities` | no | Tool/MCP được phép. |
|
|
23
|
-
| `verifyCommands` | yes | Command phải chạy trước DONE. |
|
|
24
|
-
| `workPlan` | no | Task tree compact: step, role, mode, trạng thái, dependency. |
|
|
25
|
-
| `reviewLenses` | no | Góc review rõ ràng, mặc định `correctness`, `tests`, `scope`. |
|
|
26
|
-
| `orchestration` | no | Snapshot solo-first policy khi task bắt đầu: mode, subagent stance, Field Guide, model-role guidance. |
|
|
27
|
-
| `verifyEvidence` | yes before done | Observed command result. Passing gate requires exact match with `verifyCommands`. |
|
|
28
|
-
| `changedFiles` | yes before done | File đã sửa. |
|
|
29
|
-
| `trace` | yes before done | Handoff/audit record. |
|
|
30
|
-
|
|
31
|
-
## JSON example
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"taskId": "TASK-0001",
|
|
36
|
-
"summary": "Fix listing filter reset behavior",
|
|
37
|
-
"riskLane": "normal",
|
|
38
|
-
"expectedOutput": "Filter reset returns listing page to default query and preserves route owner.",
|
|
39
|
-
"acceptanceCriteria": [
|
|
40
|
-
"Reset button clears selected filters",
|
|
41
|
-
"URL query returns to canonical default",
|
|
42
|
-
"No protected paths are modified"
|
|
43
|
-
],
|
|
44
|
-
"scope": [
|
|
45
|
-
"src/features/listings/**"
|
|
46
|
-
],
|
|
47
|
-
"outOfScope": [
|
|
48
|
-
"backend API changes",
|
|
49
|
-
"database changes"
|
|
50
|
-
],
|
|
51
|
-
"protectedPaths": [
|
|
52
|
-
"backend/**"
|
|
53
|
-
],
|
|
54
|
-
"requiredContext": [
|
|
55
|
-
"AGENTS.md",
|
|
56
|
-
".pi/project-context.md",
|
|
57
|
-
"docs/frontend/structure-guide.md"
|
|
58
|
-
],
|
|
59
|
-
"contextManifest": [
|
|
60
|
-
{
|
|
61
|
-
"path": "AGENTS.md",
|
|
62
|
-
"reason": "root rules"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
"memoryCitations": [],
|
|
66
|
-
"mcpCapabilities": [
|
|
67
|
-
"filesystem-readonly",
|
|
68
|
-
"browser"
|
|
69
|
-
],
|
|
70
|
-
"verifyCommands": [
|
|
71
|
-
"npm run test"
|
|
72
|
-
],
|
|
73
|
-
"workPlan": [
|
|
74
|
-
{
|
|
75
|
-
"id": "plan",
|
|
76
|
-
"title": "Confirm scope and verify gate before editing.",
|
|
77
|
-
"role": "parent",
|
|
78
|
-
"mode": "read-only",
|
|
79
|
-
"status": "done"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"id": "implement",
|
|
83
|
-
"title": "Apply the bounded source change.",
|
|
84
|
-
"role": "piagent-worker",
|
|
85
|
-
"mode": "single-writer",
|
|
86
|
-
"status": "pending",
|
|
87
|
-
"dependsOn": [
|
|
88
|
-
"plan"
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"reviewLenses": [
|
|
93
|
-
"correctness",
|
|
94
|
-
"tests",
|
|
95
|
-
"scope"
|
|
96
|
-
],
|
|
97
|
-
"orchestration": {
|
|
98
|
-
"mode": "solo-first",
|
|
99
|
-
"subagents": "not-used",
|
|
100
|
-
"reason": "Task starts in solo-first mode; use bounded subagents only for independent scout, planning, or review work.",
|
|
101
|
-
"fieldGuidePath": ".pi/memory/MEMORY.md",
|
|
102
|
-
"modelRoles": {
|
|
103
|
-
"planner": "Use the strongest available model for decomposition, architecture, risk, and acceptance criteria.",
|
|
104
|
-
"worker": "Use the fastest reliable model for a bounded, already-planned single write set.",
|
|
105
|
-
"reviewer": "Use a model or thinking setting decorrelated from the worker when review quality matters.",
|
|
106
|
-
"watchdog": "Use a strong model only for final risk review, security, release, or high-impact changes."
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"verifyEvidence": [
|
|
110
|
-
{
|
|
111
|
-
"command": "npm run test",
|
|
112
|
-
"exitCode": 0,
|
|
113
|
-
"summary": "Unit test suite passed.",
|
|
114
|
-
"observed": true,
|
|
115
|
-
"matchedProfileCommand": true
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
"changedFiles": [],
|
|
119
|
-
"trace": {
|
|
120
|
-
"outcome": "pending"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
```
|
|
1
|
+
# Task Implementation Contract v2
|
|
2
|
+
|
|
3
|
+
## Muc tieu
|
|
4
|
+
|
|
5
|
+
Contract la state machine cuc bo giup Pi chung minh mot task da doc gi, duoc sua
|
|
6
|
+
gi, da thay doi gi, verify bang lenh nao va ket thuc ra sao. File nam tai:
|
|
124
7
|
|
|
125
|
-
|
|
8
|
+
```text
|
|
9
|
+
.pi/piagent-state/tasks/<taskRunId>.json
|
|
10
|
+
.pi/piagent-state/session-tasks/<session-id-hash>.json
|
|
11
|
+
```
|
|
126
12
|
|
|
127
|
-
|
|
13
|
+
`taskId` la ten logic cua cong viec. `taskRunId` la identity duy nhat cua mot
|
|
14
|
+
attempt. `sessionId` rang attempt vao dung Pi session; `sessionName` de resume va
|
|
15
|
+
Agent Watch/report hien ten task ma operator da dat.
|
|
16
|
+
|
|
17
|
+
## Field groups
|
|
18
|
+
|
|
19
|
+
| Nhom | Field | Quy tac |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Schema | `schemaVersion` | Luon la `2`. |
|
|
22
|
+
| Identity | `taskRunId`, `taskId`, `sessionId`, `sessionName`, `intakeMode` | Run ID/Task ID normalized; mot session chi co mot task; intake la `runtime` hoac `model`. |
|
|
23
|
+
| Mode | `changeMode` | `source-change` hoac `read-only`. |
|
|
24
|
+
| Retry | `attempt`, `maxAttempts`, `previousAttempts` | Tran lay tu attempt dau, khong duoc nang o retry sau. |
|
|
25
|
+
| Intent | `summary`, `riskLane`, `expectedOutput`, `acceptanceCriteria` | Chot truoc khi implementation. |
|
|
26
|
+
| Scope | `scope`, `outOfScope`, `protectedPaths` | Direct write bi chan ngoai scope; final gate doi chieu Git. |
|
|
27
|
+
| Context | `requiredContext`, `contextManifest`, `memoryCitations`, `mcpCapabilities` | Citation co path va reason. |
|
|
28
|
+
| Verify | `verifyGroup`, `verifyCommands`, `verifyEvidence` | Moi command phai observed, exact-match va pass. |
|
|
29
|
+
| Plan | `workPlan`, `reviewLenses`, `orchestration` | Toi da 12 step, dependency DAG, single writer. |
|
|
30
|
+
| Changes | baseline/observed/final file lists va digests, `changedFiles` | Phan biet dirty truoc task voi thay doi trong task; ghi ca hai dau rename. |
|
|
31
|
+
| Outcome | `trace`, `failedAt`, `failureReason`, `ruledOut` | Terminal contract immutable. |
|
|
32
|
+
| Time | `createdAt`, `updatedAt` | Timestamp parseable, dung de sap xep/migration/report. |
|
|
33
|
+
|
|
34
|
+
Template day du nam tai
|
|
35
|
+
[`templates/project/.pi/task-contract.template.json`](../templates/project/.pi/task-contract.template.json).
|
|
36
|
+
Schema chinh thuc nam tai
|
|
37
|
+
[`schemas/task-contract.schema.json`](../schemas/task-contract.schema.json).
|
|
38
|
+
|
|
39
|
+
## Runtime lifecycle
|
|
128
40
|
|
|
129
41
|
```text
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Check large context with piagent_context_budget.
|
|
137
|
-
Check complex/high-impact shell with piagent_exec_policy_check.
|
|
138
|
-
Check non-piagent tools with piagent_tool_policy_check.
|
|
139
|
-
Do not edit before scope + verify command are known.
|
|
140
|
-
Before final, run the exact verify command from task.verifyCommands through Pi bash, record observed verify evidence, and trace.
|
|
141
|
-
Call piagent_task_gate_check before DONE.
|
|
142
|
-
If verify cannot run, final outcome is blocked/partial, not done.
|
|
42
|
+
runtime automatic intake OR piagent_task_start fallback
|
|
43
|
+
-> ordinary targeted reads + project tool calls
|
|
44
|
+
-> runtime-observed context and changed files
|
|
45
|
+
-> exact bash verify commands
|
|
46
|
+
-> current-tree verify evidence from tool_result
|
|
47
|
+
-> completion hook projects trace + final gate
|
|
143
48
|
```
|
|
144
49
|
|
|
145
|
-
|
|
50
|
+
Bounded default source tasks are created and completed through runtime hooks
|
|
51
|
+
without model management calls. Broad/high-risk/custom source tasks use manual
|
|
52
|
+
intake and explicit checkpoints when required.
|
|
53
|
+
Read-only defaults use `scout`/`review`, never an implementation step. Manual
|
|
54
|
+
context/verify/trace/gate tools are recovery surfaces for custom/high-risk work.
|
|
55
|
+
|
|
56
|
+
Task start tu choi khi:
|
|
146
57
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
| Final gate | trace completion block khi `finalGate=enforce`; hard assistant stop-hook khi Pi API hỗ trợ | Cao nhất |
|
|
58
|
+
- session da thuoc task khac hoac task terminal;
|
|
59
|
+
- cung `taskId` dang pending o session khac;
|
|
60
|
+
- task da completed;
|
|
61
|
+
- retry vuot `maxAttempts`;
|
|
62
|
+
- source task khong o trong Git working tree;
|
|
63
|
+
- profile khong co meaningful verifier;
|
|
64
|
+
- work plan trung ID, thieu dependency, tu tham chieu hoac co cycle.
|
|
155
65
|
|
|
156
|
-
|
|
66
|
+
Truoc task start, governed project chi cho phep inspection. Guard chi coi shell la
|
|
67
|
+
mutation khi command that su co kha nang ghi project (write redirection, mutating
|
|
68
|
+
Git/package/file command, interpreter write, `sed -i`, `find -delete`...). Read,
|
|
69
|
+
search va test khong bi gan nham thanh write.
|
|
157
70
|
|
|
158
|
-
-
|
|
159
|
-
- `piagent_exec_policy_check`
|
|
160
|
-
- `piagent_context_budget`
|
|
161
|
-
- `piagent_context_index_status`
|
|
162
|
-
- `piagent_context_index_search`
|
|
163
|
-
- `piagent_context_index_record`
|
|
164
|
-
- `piagent_tool_policy_check`
|
|
165
|
-
- `piagent_context_record`
|
|
166
|
-
- `piagent_verify_record`
|
|
167
|
-
- `piagent_trace_record`
|
|
168
|
-
- `piagent_task_gate_check`
|
|
169
|
-
- local task/trace/observed-bash state trong `.pi/piagent-state/`
|
|
170
|
-
- session trace qua Pi custom entry `piagent-task-trace`
|
|
71
|
+
## Changed-file truth
|
|
171
72
|
|
|
172
|
-
|
|
73
|
+
Luc start, runtime luu Git working-tree snapshot va digest tung file dirty. Luc
|
|
74
|
+
gate/final trace, runtime chup lai snapshot:
|
|
173
75
|
|
|
174
|
-
|
|
76
|
+
```text
|
|
77
|
+
expected change = file co final digest khac task-start baseline
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Vi vay:
|
|
175
81
|
|
|
176
|
-
|
|
82
|
+
- file dirty truoc task khong tu dong bi nhan la do task;
|
|
83
|
+
- file dirty truoc task nhung bi sua tiep se duoc tinh;
|
|
84
|
+
- file da duoc sua roi revert ve baseline chi nam trong audit history, khong pass gate;
|
|
85
|
+
- claim file khong co evidence bi tu choi;
|
|
86
|
+
- thay doi ngoai `scope` bi tu choi;
|
|
87
|
+
- delete/missing co digest rieng;
|
|
88
|
+
- staged rename ghi ca old path va new path.
|
|
177
89
|
|
|
178
|
-
|
|
90
|
+
## Verify truth
|
|
91
|
+
|
|
92
|
+
Observed bash ledger la bounded owner-only JSONL. Evidence chi pass khi:
|
|
179
93
|
|
|
180
94
|
```text
|
|
181
|
-
|
|
95
|
+
exitCode === 0
|
|
96
|
+
observed === true
|
|
97
|
+
matchedProfileCommand === true
|
|
98
|
+
command nam chinh xac trong task.verifyCommands
|
|
182
99
|
```
|
|
183
100
|
|
|
184
|
-
|
|
101
|
+
Final gate doi evidence cho **tat ca** meaningful verify commands, khong chi mot
|
|
102
|
+
command bat ky. Profile `generic` fail-closed cho source work den khi project khai
|
|
103
|
+
verifier. Profile theo stack chi chay command co y nghia va khong dung `|| true`
|
|
104
|
+
de che failure.
|
|
105
|
+
|
|
106
|
+
## Retry va terminal immutability
|
|
107
|
+
|
|
108
|
+
Step co the `pending`, `in-progress`, `done`, `skipped`, `failed`. Reopen mot
|
|
109
|
+
failed step can note moi; step done/skipped khong duoc mo lai. Khi trace da
|
|
110
|
+
terminal, cac tool progress/context/memory/verify/trace va project mutations deu
|
|
111
|
+
bi chan cho session do.
|
|
185
112
|
|
|
186
|
-
|
|
113
|
+
Retry chay o session moi. `previousAttempts` giu outcome, phase failure, reason,
|
|
114
|
+
ruled-out hypothesis va timestamp de agent khong lap lai cach da that bai.
|
|
187
115
|
|
|
188
|
-
|
|
189
|
-
- `matchedProfileCommand=true`;
|
|
190
|
-
- `exitCode=0`.
|
|
116
|
+
## Migration v1 -> v2
|
|
191
117
|
|
|
192
|
-
|
|
118
|
+
Reader v2 fail-closed voi field la, timestamp hong, nested plan sai, taskRunId
|
|
119
|
+
khong khop filename hoac state unreadable. Migrator v1 chi copy whitelist field
|
|
120
|
+
da cong bo, them identity/session/retry/baseline defaults, ghi v2 atomically roi
|
|
121
|
+
archive file v1. Update preflight tu choi truoc moi project write neu state can
|
|
122
|
+
operator recovery.
|
|
193
123
|
|
|
194
|
-
|
|
124
|
+
Project da onboard khong can onboard lai sau global update. Capability lock giu
|
|
125
|
+
nguyen grant cua project va chi re-pin core khi release moi khong mo rong quyen.
|
|
195
126
|
|
|
196
|
-
|
|
197
|
-
- `/workflow be-to-fe`: dùng cho task scout BE contract read-only rồi implement FE.
|
|
198
|
-
- `/memory`: dùng cho task kiểm tra/ghi nhớ explicit project memory.
|
|
127
|
+
## Enforcement
|
|
199
128
|
|
|
200
|
-
|
|
129
|
+
| Lop | Enforcement |
|
|
130
|
+
|---|---|
|
|
131
|
+
| Prompt/workflow | Huong dan dung tool theo thu tu. |
|
|
132
|
+
| Tool-call guard | Protected path, scope, read-only, destructive/external confirmation. |
|
|
133
|
+
| Tool-result observer | Changed-file va bash evidence tu su kien that. |
|
|
134
|
+
| Persisted contract | Session binding, retry, plan, context, verify, trace. |
|
|
135
|
+
| Completion hook | Chan completion claim khi gate chua pass. |
|
|
136
|
+
| Local-state boundary | Owner-only, atomic write, no ancestor symlink, bounded retention. |
|