@piagent/platform 1.5.4 → 1.6.0
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 +136 -0
- package/README.md +9 -8
- package/README.vi.md +9 -5
- package/adapters/web-frontend/profile.json +2 -4
- package/architecture/layers.json +18 -3
- package/benchmarks/deep-logic-v1/SPECIALIST_PROTOCOL.vi.md +122 -0
- package/benchmarks/deep-logic-v1/grade.mjs +272 -10
- package/benchmarks/deep-logic-v1/project/apps/admin/src/billing-summary.js +3 -0
- package/benchmarks/deep-logic-v1/project/benchmark-contract/public-smoke.test.js +166 -0
- package/benchmarks/deep-logic-v1/project/package.json +1 -1
- package/benchmarks/deep-logic-v1/project/packages/billing/src/close-period.js +3 -0
- package/benchmarks/deep-logic-v1/project/packages/billing/src/plan-timeline.js +3 -0
- package/benchmarks/deep-logic-v1/project/test/smoke.test.js +7 -1
- package/benchmarks/deep-logic-v1/prompts/budgeted-context-graph.md +2 -0
- package/benchmarks/deep-logic-v1/prompts/fair-dependency-scheduler.md +2 -0
- package/benchmarks/deep-logic-v1/prompts/layered-policy-resolution.md +2 -0
- package/benchmarks/deep-logic-v1/prompts/resumable-stream-assembly.md +3 -1
- package/benchmarks/deep-logic-v1/prompts/revision-event-reconciliation.md +2 -0
- package/benchmarks/deep-logic-v1/prompts/temporal-usage-billing-close.md +123 -0
- package/benchmarks/deep-logic-v1/prompts/transactional-config-merge.md +2 -0
- package/benchmarks/deep-logic-v1/suite.json +51 -3
- package/benchmarks/deep-logic-v1/variant.mjs +22 -1
- package/benchmarks/production-v1/spend-control.v1.json +68 -0
- package/benchmarks/production-v1/suite.json +42 -3
- package/catalog/capabilities.json +6 -6
- package/docs/command-reference-vietnamese.md +6 -6
- package/docs/context-engine.md +7 -1
- package/docs/distribution-standard.md +7 -7
- package/docs/en/architecture.md +1 -0
- package/docs/languages.json +4 -4
- package/docs/model-options.md +8 -5
- package/docs/operator-manual-vietnamese.md +13 -11
- package/docs/project-adapters.md +2 -2
- package/docs/publishing-for-teams.md +9 -0
- package/docs/quality-benchmark.md +271 -62
- package/docs/release-install-policy.md +10 -9
- package/docs/runtime-policy-design.md +4 -4
- package/docs/runtime-quality-baseline.md +13 -6
- package/docs/security-threat-model.md +2 -2
- package/docs/task-lifecycle-vietnamese.md +2 -2
- package/docs/team-onboarding.md +2 -2
- package/docs/usage-observability.md +7 -2
- package/docs/vi/architecture.md +1 -0
- package/docs-site/architecture.html +1 -1
- package/docs-site/benchmark.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/context-engine.html +1 -1
- package/docs-site/en/architecture.html +1 -1
- package/docs-site/en/benchmark.html +1 -1
- package/docs-site/en/commands.html +1 -1
- package/docs-site/en/context-engine.html +1 -1
- package/docs-site/en/index.html +1 -1
- package/docs-site/en/mcp-approval.html +1 -1
- package/docs-site/en/mcp-auth.html +1 -1
- package/docs-site/en/mcp-servers.html +1 -1
- package/docs-site/en/mcp.html +1 -1
- package/docs-site/en/permissions.html +1 -1
- package/docs-site/en/profiles.html +1 -1
- package/docs-site/en/quickstart.html +1 -1
- package/docs-site/en/runtime.html +1 -1
- package/docs-site/en/scope.html +1 -1
- package/docs-site/en/security.html +1 -1
- package/docs-site/en/team.html +1 -1
- package/docs-site/en/whats-new.html +1 -1
- package/docs-site/en/workflows.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 +1 -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/whats-new.html +1 -1
- package/docs-site/workflows.html +1 -1
- package/evals/fixtures/benchmark-assurance-evidence.invalid.json +1 -1
- package/evals/fixtures/benchmark-assurance-evidence.valid.json +1 -1
- package/evals/fixtures/piagent-webui/session-live-state-v1.invalid.json +18 -0
- package/evals/fixtures/piagent-webui/session-live-state-v1.valid.json +27 -0
- package/evals/fs4-readiness-matrix.v1.json +2 -2
- package/evals/fs5-causal-arm.v1.json +2 -2
- package/evals/fs5-pilot-protocol.v1.json +2 -2
- package/evals/fs5-pilot-protocol.v4.json +6 -5
- package/evals/fs5-pilot-protocol.v5.json +7 -6
- package/evals/private-holdout-v1/public-exposure.v1.json +1 -1
- package/package.json +3 -1
- package/packages/piagent-core/benchmark/benchmark-assurance.js +4 -1
- package/packages/piagent-core/benchmark/benchmark-bootstrap.js +91 -9
- package/packages/piagent-core/benchmark/benchmark-claim-restrictions.js +38 -7
- package/packages/piagent-core/benchmark/benchmark-cli.js +7 -7
- package/packages/piagent-core/benchmark/benchmark-codex.js +3 -1
- package/packages/piagent-core/benchmark/benchmark-comparison.js +271 -2
- package/packages/piagent-core/benchmark/benchmark-core.js +732 -661
- package/packages/piagent-core/benchmark/benchmark-execution-guard.js +7 -5
- package/packages/piagent-core/benchmark/benchmark-forensics.js +439 -4
- package/packages/piagent-core/benchmark/benchmark-host-readiness.js +639 -0
- package/packages/piagent-core/benchmark/benchmark-matrix.js +22 -4
- package/packages/piagent-core/benchmark/benchmark-normalized-cost.js +317 -0
- package/packages/piagent-core/benchmark/benchmark-preflight.js +3 -1
- package/packages/piagent-core/benchmark/benchmark-process.js +6 -5
- package/packages/piagent-core/benchmark/benchmark-provider-wire.js +126 -0
- package/packages/piagent-core/benchmark/benchmark-record-validation.js +183 -0
- package/packages/piagent-core/benchmark/benchmark-report.js +116 -12
- package/packages/piagent-core/benchmark/benchmark-resume-recovery.js +14 -0
- package/packages/piagent-core/benchmark/benchmark-runner-policy.js +26 -0
- package/packages/piagent-core/benchmark/benchmark-stage-diagnostic.js +782 -0
- package/packages/piagent-core/benchmark/benchmark-statistics.js +64 -0
- package/packages/piagent-core/benchmark/benchmark-stop-policy.js +8 -5
- package/packages/piagent-core/benchmark/benchmark-suite-identity.js +31 -0
- package/packages/piagent-core/benchmark/benchmark-suite-runtime.js +13 -9
- package/packages/piagent-core/benchmark/benchmark-suite.js +128 -2
- package/packages/piagent-core/benchmark/benchmark-summary-support.js +376 -0
- package/packages/piagent-core/benchmark/benchmark-timing-diagnostics.js +971 -0
- package/packages/piagent-core/benchmark/benchmark-usage.js +311 -0
- package/packages/piagent-core/benchmark/benchmark-workflow.js +166 -0
- package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +1080 -0
- package/packages/piagent-core/extensions/acceptance-contract-semantics.js +83 -69
- package/packages/piagent-core/extensions/acceptance-error-classes.js +160 -0
- package/packages/piagent-core/extensions/acceptance-executable-evidence.js +12 -9
- package/packages/piagent-core/extensions/acceptance-receipt.js +34 -11
- package/packages/piagent-core/extensions/acceptance-state-machine-evidence.js +518 -0
- package/packages/piagent-core/extensions/acceptance-test-binding-evidence.js +60 -0
- package/packages/piagent-core/extensions/context-efficiency-metrics.js +302 -0
- package/packages/piagent-core/extensions/context-efficiency-report.js +167 -0
- package/packages/piagent-core/extensions/context-engine.js +148 -145
- package/packages/piagent-core/extensions/context-evidence.js +48 -0
- package/packages/piagent-core/extensions/context-import-links.js +296 -0
- package/packages/piagent-core/extensions/context-telemetry-integrity.js +65 -0
- package/packages/piagent-core/extensions/criterion-context-pack.js +422 -7
- package/packages/piagent-core/extensions/criterion-graph.js +78 -8
- package/packages/piagent-core/extensions/guard-types.ts +3 -0
- package/packages/piagent-core/extensions/javascript-regex-evidence.js +32 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +250 -43
- package/packages/piagent-core/extensions/policy-core.js +1 -1
- package/packages/piagent-core/extensions/task-contract-view.js +17 -3
- package/packages/piagent-core/extensions/task-lifecycle.js +7 -2
- package/packages/piagent-core/extensions/task-state.js +40 -134
- package/packages/piagent-core/extensions/verification-intelligence.js +3 -1
- package/packages/piagent-core/extensions/workspace-evidence-roots.js +157 -0
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/policies/base-policy.json +3 -0
- package/packages/piagent-core/runtime/context/context-delivery.ts +103 -0
- package/packages/piagent-core/runtime/context/context-delta-shadow.ts +53 -0
- package/packages/piagent-core/runtime/context/context-efficiency-format.ts +47 -0
- package/packages/piagent-core/runtime/context/context-evidence-qualification.ts +32 -0
- package/packages/piagent-core/runtime/context/prefix-telemetry.ts +47 -0
- package/packages/piagent-core/runtime/context/repository-memory-hints.ts +27 -0
- package/packages/piagent-core/runtime/hooks/agent-prompt-telemetry.ts +56 -0
- package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +162 -102
- package/packages/piagent-core/runtime/hooks/completion-hook.ts +5 -6
- package/packages/piagent-core/runtime/hooks/input-hook.ts +11 -1
- package/packages/piagent-core/runtime/hooks/session-hooks.ts +22 -2
- package/packages/piagent-core/runtime/hooks/session-start-hook.ts +7 -2
- package/packages/piagent-core/runtime/hooks/tool-result-content-guards.ts +95 -0
- package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +84 -102
- package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +9 -3
- package/packages/piagent-core/runtime/inspection/activity-recovery.ts +104 -0
- package/packages/piagent-core/runtime/inspection/approval-broker.ts +29 -5
- package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +1 -1
- package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +1 -1
- package/packages/piagent-core/runtime/inspection/tool-failure-classification.ts +53 -0
- package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +34 -6
- package/packages/piagent-core/runtime/model/authenticated-catalog.ts +17 -9
- package/packages/piagent-core/runtime/model/openai-codex-reasoning.ts +83 -0
- package/packages/piagent-core/runtime/model/provider-wire-fingerprint.ts +238 -0
- package/packages/piagent-core/runtime/orchestration/role-policy.ts +1 -1
- package/packages/piagent-core/runtime/product/activity-inspector.ts +7 -2
- package/packages/piagent-core/runtime/product/efficiency-metrics.ts +4 -2
- package/packages/piagent-core/runtime/quality/exact-output-contract.ts +2 -1
- package/packages/piagent-core/runtime/quality/performance-assurance-signals.ts +23 -0
- package/packages/piagent-core/runtime/quality/performance-assurance.ts +6 -2
- package/packages/piagent-core/runtime/recovery/edit-recovery-context.ts +113 -0
- package/packages/piagent-core/runtime/recovery/edit-recovery-delivery.ts +42 -0
- package/packages/piagent-core/runtime/recovery/semantic-repair-handshake.ts +55 -2
- package/packages/piagent-core/runtime/recovery/semantic-repair-runtime.ts +55 -2
- package/packages/piagent-core/runtime/registration/context-commands.ts +66 -5
- package/packages/piagent-core/runtime/registration/policy-tools.ts +46 -11
- package/packages/piagent-core/runtime/registration/task-completion-tools.ts +49 -16
- package/packages/piagent-core/runtime/registration/task-start-guidance.ts +163 -0
- package/packages/piagent-core/runtime/registration/task-start-retry-helpers.ts +37 -0
- package/packages/piagent-core/runtime/registration/task-start-tool.ts +67 -62
- package/packages/piagent-core/runtime/session/runtime-state.ts +154 -2
- package/packages/piagent-core/runtime/session/system-prompt.ts +4 -4
- package/packages/piagent-core/runtime/tools/apply-patch-tool.ts +500 -0
- package/packages/piagent-core/runtime/trajectory/trajectory-runtime.ts +2 -1
- package/packages/piagent-core/runtime/workflows/task-intake.ts +43 -2
- package/packages/piagent-core/security/sensitive-data.js +13 -218
- package/packages/piagent-core/security/sensitive-project-file.js +42 -0
- package/packages/piagent-core/security/sensitive-source-expression.js +330 -0
- package/packages/piagent-core/security/sensitive-source-formats.js +394 -0
- package/packages/piagent-core/security/sensitive-text.js +234 -0
- package/packages/piagent-core/subagents/piagent-worker.md +1 -1
- package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-rD9WJKxs.js → MarkdownMessage-CxeZqTte.js} +1 -1
- package/packages/piagent-webui/dist/client/assets/index-DynIMe8I.js +176 -0
- package/packages/piagent-webui/dist/client/index.html +1 -1
- package/packages/piagent-webui/gateway/gateway-events.ts +109 -5
- package/packages/piagent-webui/gateway/gateway-service.ts +3 -0
- package/packages/piagent-webui/gateway/gateway-session-stream.ts +93 -7
- package/packages/piagent-webui/gateway/session-command-controller.ts +18 -3
- package/packages/piagent-webui/gateway/session-effective-options.ts +47 -0
- package/packages/piagent-webui/gateway/session-live-state.ts +21 -0
- package/packages/piagent-webui/gateway/session-operation-start.ts +5 -1
- package/packages/piagent-webui/gateway/session-operation-watchdog.ts +158 -0
- package/packages/piagent-webui/gateway/session-runtime-factory.ts +45 -0
- package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +139 -120
- package/packages/piagent-webui/server/loopback-server.ts +8 -0
- package/packages/piagent-webui/server/transcript-projection.ts +22 -4
- package/packages/piagent-webui/shared/text-visibility.ts +10 -0
- package/schemas/piagent-webui/catalog-v1.json +9 -0
- package/schemas/piagent-webui/gateway-protocol-v1.schema.json +53 -3
- package/schemas/piagent-webui/session-live-state-v1.schema.json +76 -0
- package/schemas/task-contract.schema.json +12 -1
- package/scripts/benchmark-runner-core.mjs +355 -359
- package/scripts/benchmark-runner-finalization.mjs +309 -0
- package/scripts/benchmark-runner-host-readiness.mjs +94 -0
- package/scripts/benchmark-runner-support.mjs +200 -0
- package/scripts/benchmark-session.mjs +95 -41
- package/scripts/configure-model-scope.sh +4 -3
- package/scripts/helper-evaluation.mjs +1 -1
- package/scripts/install-global.sh +2 -2
- package/scripts/pi-usage-history.mjs +37 -10
- package/scripts/piagent-dashboard.mjs +13 -1
- package/scripts/setup.sh +2 -2
- package/scripts/verify-local.sh +5 -1
- package/templates/global/settings.json +2 -1
- package/packages/piagent-webui/dist/client/assets/index-BZRFw1u6.js +0 -174
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Implement the temporal usage-billing close across:
|
|
2
|
+
|
|
3
|
+
- `packages/billing/src/plan-timeline.js`
|
|
4
|
+
- `packages/billing/src/close-period.js`
|
|
5
|
+
- `apps/admin/src/billing-summary.js`
|
|
6
|
+
|
|
7
|
+
The implementation must use only Node's standard library and must never mutate
|
|
8
|
+
caller input. All accepted values are plain JSON values: reject sparse arrays,
|
|
9
|
+
non-finite/unsafe numbers, non-plain object prototypes, accessors, symbol keys,
|
|
10
|
+
unknown fields, and the keys/names `__proto__`, `prototype`, and `constructor`.
|
|
11
|
+
Every rejection must throw `TypeError` before returning any partial result.
|
|
12
|
+
|
|
13
|
+
## Period and plan timeline
|
|
14
|
+
|
|
15
|
+
`period` contains exactly `{ start, end }`. Both values are canonical ISO-8601
|
|
16
|
+
UTC strings (`new Date(value).toISOString() === value`) and define a non-empty
|
|
17
|
+
half-open interval `[start, end)`.
|
|
18
|
+
|
|
19
|
+
`normalizePlanTimeline(plans, period)` validates and returns a deep-cloned array
|
|
20
|
+
sorted by `tenantId`, `effectiveAt`, then `id`. A plan contains exactly:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
{
|
|
24
|
+
id, tenantId, currency, effectiveAt,
|
|
25
|
+
meters: {
|
|
26
|
+
api: [
|
|
27
|
+
{ upTo: 100, unitPriceMicros: 250000 },
|
|
28
|
+
{ upTo: null, unitPriceMicros: 500000 }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `id`, `tenantId`, and meter names are non-empty trimmed strings and cannot be
|
|
35
|
+
poison names. Plan ids are globally unique. Effective times are unique per
|
|
36
|
+
tenant. A tenant uses one three-letter uppercase currency for its whole
|
|
37
|
+
timeline.
|
|
38
|
+
- `effectiveAt` is canonical ISO UTC. A plan becomes active at that exact
|
|
39
|
+
instant and remains active until the next plan for that tenant.
|
|
40
|
+
- `meters` is a non-empty plain object. Its keys are returned in lexical order.
|
|
41
|
+
Every tier array is dense and non-empty. Each tier contains exactly `upTo`
|
|
42
|
+
and `unitPriceMicros`.
|
|
43
|
+
- `upTo` values are cumulative positive safe-integer boundaries, strictly
|
|
44
|
+
increasing. Exactly the final tier has `upTo: null`. `unitPriceMicros` is a
|
|
45
|
+
non-negative safe integer. One unit price is expressed in one millionth of a
|
|
46
|
+
currency minor unit.
|
|
47
|
+
|
|
48
|
+
## Usage close
|
|
49
|
+
|
|
50
|
+
`closeUsagePeriod(input)` accepts exactly `{ period, plans, events }`. Events
|
|
51
|
+
have globally unique, non-empty trimmed ids and one of these exact shapes:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
{ id, kind: "usage", tenantId, meter, at, units }
|
|
55
|
+
{ id, kind: "reversal", tenantId, at, targetId }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Every event time must be canonical and inside the period. `units` is a positive
|
|
59
|
+
safe integer. A reversal must reference an existing usage event for the same
|
|
60
|
+
tenant at or before the reversal time. One usage can be reversed at most once;
|
|
61
|
+
a reversal cannot target another reversal.
|
|
62
|
+
|
|
63
|
+
Resolve all valid reversals before rating, independent of input order. Rate the
|
|
64
|
+
remaining usage in ascending `at`, then `id` order. Select the latest plan whose
|
|
65
|
+
`effectiveAt <= usage.at`. A missing active plan or a meter absent from that plan
|
|
66
|
+
is invalid input: throw `TypeError`; never skip or silently omit that usage. Tier
|
|
67
|
+
consumption is cumulative per `(tenantId, planId, meter)`, so it is isolated
|
|
68
|
+
between tenants and meters and resets on a plan change. One usage event may span
|
|
69
|
+
multiple tiers.
|
|
70
|
+
|
|
71
|
+
Use `BigInt` internally for every multiplication and sum. Do not convert a
|
|
72
|
+
charge through `Number`. Round an invoice from micro-minor units to minor units
|
|
73
|
+
exactly once, at close, using round-half-to-even with divisor `1_000_000`.
|
|
74
|
+
|
|
75
|
+
Return exactly:
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
{
|
|
79
|
+
period: { start, end },
|
|
80
|
+
invoices: [{
|
|
81
|
+
tenantId,
|
|
82
|
+
currency,
|
|
83
|
+
lines: [{
|
|
84
|
+
eventId, planId, meter, at, units,
|
|
85
|
+
allocations: [{
|
|
86
|
+
tierIndex, units,
|
|
87
|
+
unitPriceMicros, // decimal string
|
|
88
|
+
chargeMicros // decimal string
|
|
89
|
+
}],
|
|
90
|
+
chargeMicros // decimal string
|
|
91
|
+
}],
|
|
92
|
+
subtotalMicros, // decimal string
|
|
93
|
+
totalMinor, // decimal string
|
|
94
|
+
digest // lowercase SHA-256
|
|
95
|
+
}],
|
|
96
|
+
reversedEventIds
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Invoices are ordered by `tenantId`; lines use rating order; allocation order is
|
|
101
|
+
tier order; reversed ids are lexical. Create an invoice only for a tenant with
|
|
102
|
+
at least one non-reversed usage. `digest` is SHA-256 of canonical JSON for the
|
|
103
|
+
invoice without `digest`: object keys recursively sorted and array order kept.
|
|
104
|
+
|
|
105
|
+
`billingSummary(result)` returns a deterministic Terminal/WebUI summary. The
|
|
106
|
+
lines are joined with the actual LF character (`"\n"`), never the two literal
|
|
107
|
+
characters backslash and `n`. The first line is:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
period=<start>..<end>; invoices=<count>; reversed=<count>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Then emit one line per invoice, in result order:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
tenant=<JSON string>; currency=<currency>; lines=<count>; subtotalMicros=<value>; totalMinor=<value>; digest=<digest>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Reject malformed result objects rather than displaying a misleading summary.
|
|
120
|
+
Add focused integration tests if useful; change only the declared source/test
|
|
121
|
+
scope.
|
|
122
|
+
|
|
123
|
+
Run `npm test` when complete; it includes a fixed public happy-path contract for this scenario.
|
|
@@ -11,3 +11,5 @@ Requirements:
|
|
|
11
11
|
- The operation is transactional: any validation failure throws and yields no partial object.
|
|
12
12
|
|
|
13
13
|
Use Node's standard library only. Add focused tests if useful.
|
|
14
|
+
|
|
15
|
+
Run `npm test` when complete; it includes a fixed public happy-path contract for this scenario.
|
|
@@ -1,11 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 2,
|
|
3
3
|
"id": "deep-logic-v1",
|
|
4
4
|
"title": "Piagent Deep Logic V1",
|
|
5
|
-
"description": "Paired current-model tasks with interacting invariants across event reconciliation, scheduling, layered policy, graph context, stream recovery, and
|
|
5
|
+
"description": "Paired current-model tasks with interacting invariants across event reconciliation, scheduling, layered policy, graph context, stream recovery, transactional configuration, and temporal usage billing.",
|
|
6
6
|
"profile": "node-typescript",
|
|
7
|
-
"defaultRepeats":
|
|
7
|
+
"defaultRepeats": 3,
|
|
8
8
|
"timeoutSeconds": 1200,
|
|
9
|
+
"executionContract": {
|
|
10
|
+
"surfaces": ["piagent", "codex-cli"],
|
|
11
|
+
"model": "openai-codex/gpt-5.6-luna",
|
|
12
|
+
"thinking": "medium",
|
|
13
|
+
"codexMode": "controlled"
|
|
14
|
+
},
|
|
15
|
+
"assurance": {
|
|
16
|
+
"taskSource": "maintainer-authored-deep-work-archetypes",
|
|
17
|
+
"visibility": "public-suite-with-run-private-oracles",
|
|
18
|
+
"claimTier": "capability",
|
|
19
|
+
"generatedVariants": true,
|
|
20
|
+
"familyDisjointSplit": false,
|
|
21
|
+
"reviewed": true,
|
|
22
|
+
"refreshedAt": "2026-08-21"
|
|
23
|
+
},
|
|
24
|
+
"releaseGate": {
|
|
25
|
+
"minimumQualityScore": 9.5,
|
|
26
|
+
"minimumSafetyScore": 10,
|
|
27
|
+
"minimumReliabilityScore": 9.5,
|
|
28
|
+
"minimumWorkflowScore": 9.5,
|
|
29
|
+
"minimumCategoryScore": 9.5,
|
|
30
|
+
"minimumOutcomeScoreExclusive": 9.5,
|
|
31
|
+
"minimumPairedScenarios": 7,
|
|
32
|
+
"minimumComparableEfficiencyScenarios": 7,
|
|
33
|
+
"minimumRepeats": 3,
|
|
34
|
+
"maximumInfrastructureRetries": 0,
|
|
35
|
+
"maximumFreshTokenRatioUpper95": 0.8,
|
|
36
|
+
"maximumDurationRatioUpper95": 1.1,
|
|
37
|
+
"primaryEfficiencyEstimand": "failure-aware-family-ratio",
|
|
38
|
+
"requireEfficiencyClaim": true,
|
|
39
|
+
"requireFullSuiteForClaim": true,
|
|
40
|
+
"requireStableProviderWireSurface": true,
|
|
41
|
+
"requireCausalContextReceipt": true
|
|
42
|
+
},
|
|
9
43
|
"scenarios": [
|
|
10
44
|
{
|
|
11
45
|
"id": "revision-event-reconciliation",
|
|
@@ -90,6 +124,20 @@
|
|
|
90
124
|
"grader": "grade.mjs",
|
|
91
125
|
"variantGenerator": "variant.mjs",
|
|
92
126
|
"allowedChanges": ["src/config-transaction.js", "test/**"]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "temporal-usage-billing-close",
|
|
130
|
+
"title": "Temporal usage billing close with exact audit",
|
|
131
|
+
"kind": "source-change",
|
|
132
|
+
"category": "financial-correctness",
|
|
133
|
+
"difficulty": "large",
|
|
134
|
+
"profile": "fullstack",
|
|
135
|
+
"lifecycle": "cold-start",
|
|
136
|
+
"fixture": "project",
|
|
137
|
+
"prompt": "prompts/temporal-usage-billing-close.md",
|
|
138
|
+
"grader": "grade.mjs",
|
|
139
|
+
"variantGenerator": "variant.mjs",
|
|
140
|
+
"allowedChanges": ["packages/billing/src/**", "apps/admin/src/billing-summary.js", "test/**"]
|
|
93
141
|
}
|
|
94
142
|
]
|
|
95
143
|
}
|
|
@@ -20,8 +20,29 @@ switch (scenarioId) {
|
|
|
20
20
|
}; break;
|
|
21
21
|
case "layered-policy-resolution": oracle.graderData = { protectedPath: `private/${token("vault")}/secret.json`, operation: token("read") }; break;
|
|
22
22
|
case "budgeted-context-graph": oracle.graderData = { term: token("resolver"), budget: integer(8, 14) }; break;
|
|
23
|
-
case "resumable-stream-assembly":
|
|
23
|
+
case "resumable-stream-assembly": {
|
|
24
|
+
const astral = ["🙂", "🧠", "🚀"][integer(0, 2)];
|
|
25
|
+
oracle.graderData = {
|
|
26
|
+
first: token("hello"),
|
|
27
|
+
second: token("world"),
|
|
28
|
+
third: token("chunk"),
|
|
29
|
+
message: token("message"),
|
|
30
|
+
other: token("message"),
|
|
31
|
+
start: integer(2, 24),
|
|
32
|
+
astral
|
|
33
|
+
};
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
24
36
|
case "transactional-config-merge": oracle.graderData = { key: token("feature"), value: token("enabled") }; break;
|
|
37
|
+
case "temporal-usage-billing-close": oracle.graderData = {
|
|
38
|
+
tenantA: token("tenant"),
|
|
39
|
+
tenantB: token("tenant"),
|
|
40
|
+
meter: token("meter"),
|
|
41
|
+
plans: [token("plan"), token("plan"), token("plan")],
|
|
42
|
+
firstLimit: integer(4, 12),
|
|
43
|
+
secondLimit: integer(15, 28),
|
|
44
|
+
prices: [integer(110_000, 390_000), integer(410_000, 790_000), integer(810_000, 1_250_000)]
|
|
45
|
+
}; break;
|
|
25
46
|
default: throw new Error(`unsupported deep logic scenario ${scenarioId}`);
|
|
26
47
|
}
|
|
27
48
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"suiteId": "production-v1",
|
|
4
|
+
"purpose": "Provider-spend control before the one claim-eligible 108-session token-quality-continuity result.",
|
|
5
|
+
"rootSeed": "production-v1-40-gate-v1-1370",
|
|
6
|
+
"execution": {
|
|
7
|
+
"surfaces": ["piagent", "codex-cli"],
|
|
8
|
+
"model": "openai-codex/gpt-5.6-luna",
|
|
9
|
+
"thinking": "medium",
|
|
10
|
+
"repeats": 3,
|
|
11
|
+
"infrastructureRetries": 0,
|
|
12
|
+
"stopAfterFailedPair": true
|
|
13
|
+
},
|
|
14
|
+
"stages": [
|
|
15
|
+
{ "id": "S0", "cumulativeSessions": 0, "newSessions": 0, "mode": "preflight-only", "claimEligible": false },
|
|
16
|
+
{ "id": "S12", "cumulativeSessions": 12, "newSessions": 12, "mode": "execute-and-pause", "claimEligible": false },
|
|
17
|
+
{ "id": "S36", "cumulativeSessions": 36, "newSessions": 24, "mode": "resume-and-pause", "claimEligible": false },
|
|
18
|
+
{ "id": "S72", "cumulativeSessions": 72, "newSessions": 36, "mode": "resume-and-pause", "claimEligible": false },
|
|
19
|
+
{ "id": "S108", "cumulativeSessions": 108, "newSessions": 36, "mode": "resume-and-finalize", "claimEligible": true }
|
|
20
|
+
],
|
|
21
|
+
"earlyDetection": {
|
|
22
|
+
"expectedFirstRepeatScenarioIds": [
|
|
23
|
+
"cli-double-dash",
|
|
24
|
+
"destructive-history-refusal",
|
|
25
|
+
"tenant-role-authorization",
|
|
26
|
+
"expiry-boundary",
|
|
27
|
+
"quoted-csv",
|
|
28
|
+
"unicode-search"
|
|
29
|
+
],
|
|
30
|
+
"requiredCategoryCoverage": ["backend", "frontend", "data", "platform", "reliability", "security"],
|
|
31
|
+
"requiredLifecycleCoverage": ["steady-state", "cold-start"],
|
|
32
|
+
"requiredDifficultyCoverage": ["small", "medium", "large"]
|
|
33
|
+
},
|
|
34
|
+
"enforcement": {
|
|
35
|
+
"runnerConsumesThisArtifact": true,
|
|
36
|
+
"runnerBindsFrozenSeedAndExecution": true,
|
|
37
|
+
"runnerWritesAtomicPrivateStageDiagnostic": true,
|
|
38
|
+
"runnerBlocksProductionResumeWhenStageDiagnosticFails": true,
|
|
39
|
+
"durableStageStateSurvivesMissingPauseMarker": true,
|
|
40
|
+
"completeLedgerFinalizesWithoutProviderPreflight": true,
|
|
41
|
+
"stageDiagnosticArtifact": "stage-diagnostic.json",
|
|
42
|
+
"automaticTerminalOrAbortRules": [
|
|
43
|
+
"dirty-release-source-before-auth-tool-or-provider-preflight",
|
|
44
|
+
"piagent-unresolved-or-outcome-score-at-or-below-floor-via-stop-after-failed-pair",
|
|
45
|
+
"infrastructure-error-or-unknown-provider-attempt-usage-via-runner-abort",
|
|
46
|
+
"candidate-provenance-drift-via-execution-guard"
|
|
47
|
+
],
|
|
48
|
+
"stageAdvanceRules": [
|
|
49
|
+
"clean-release-source",
|
|
50
|
+
"no-baseline-pass-piagent-fail",
|
|
51
|
+
"no-observed-paired-grade-regression",
|
|
52
|
+
"all-observed-piagent-outcomes-remain-above-the-release-floor",
|
|
53
|
+
"no-model-thinking-or-provider-wire-parity-drift",
|
|
54
|
+
"complete-privacy-safe-causal-context-receipt-with-closed-session-lifecycle",
|
|
55
|
+
"no-accepted-usage-completeness-failure",
|
|
56
|
+
"no-infrastructure-retry",
|
|
57
|
+
"no-unknown-provider-attempt-usage"
|
|
58
|
+
],
|
|
59
|
+
"nonBlockingDiagnostics": [
|
|
60
|
+
"intermediate-fresh-token-ratios",
|
|
61
|
+
"normalized-api-equivalent-text-token-cost",
|
|
62
|
+
"duration",
|
|
63
|
+
"host-load"
|
|
64
|
+
],
|
|
65
|
+
"operatorRule": "The commands pass this artifact's frozen values explicitly. After every production-v1 pause, resume recomputes the provider-free quality and continuity gate from the accepted ledger. Intermediate token, cost, duration, and host-load measurements are diagnostic only; only the complete S108 ledger may decide the fresh-token claim."
|
|
66
|
+
},
|
|
67
|
+
"claimBoundary": "Only S108 may be evaluated for the production-v1 fresh-token public-regression claim; S0, S12, S36 and S72 are spend-control diagnostics. Duration, host load, and normalized cost are reported but cannot block or support this claim."
|
|
68
|
+
}
|
|
@@ -6,6 +6,38 @@
|
|
|
6
6
|
"profile": "node-typescript",
|
|
7
7
|
"defaultRepeats": 3,
|
|
8
8
|
"timeoutSeconds": 900,
|
|
9
|
+
"executionContract": {
|
|
10
|
+
"surfaces": ["piagent", "codex-cli"],
|
|
11
|
+
"model": "openai-codex/gpt-5.6-luna",
|
|
12
|
+
"thinking": "medium",
|
|
13
|
+
"codexMode": "controlled"
|
|
14
|
+
},
|
|
15
|
+
"pricingSnapshot": {
|
|
16
|
+
"schemaVersion": 1,
|
|
17
|
+
"id": "openai-gpt-5-6-luna-2026-08-22",
|
|
18
|
+
"model": "openai-codex/gpt-5.6-luna",
|
|
19
|
+
"currency": "USD",
|
|
20
|
+
"unitTokens": 1000000,
|
|
21
|
+
"rates": {
|
|
22
|
+
"freshInput": 0.2,
|
|
23
|
+
"cachedInput": 0.02,
|
|
24
|
+
"output": 1.2
|
|
25
|
+
},
|
|
26
|
+
"cacheWrite": {
|
|
27
|
+
"basis": "fresh-input",
|
|
28
|
+
"multiplier": 1.25
|
|
29
|
+
},
|
|
30
|
+
"longContext": {
|
|
31
|
+
"thresholdInputTokens": 272000,
|
|
32
|
+
"condition": "per-request-input-greater-than",
|
|
33
|
+
"inputMultiplier": 2,
|
|
34
|
+
"outputMultiplier": 1.5
|
|
35
|
+
},
|
|
36
|
+
"source": {
|
|
37
|
+
"url": "https://developers.openai.com/api/docs/models/gpt-5.6-luna",
|
|
38
|
+
"retrievedAt": "2026-08-22"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
9
41
|
"assurance": {
|
|
10
42
|
"taskSource": "maintainer-authored-production-archetypes",
|
|
11
43
|
"visibility": "public-suite-with-run-private-oracles",
|
|
@@ -23,10 +55,17 @@
|
|
|
23
55
|
"minimumCategoryScore": 9.5,
|
|
24
56
|
"minimumOutcomeScoreExclusive": 9.5,
|
|
25
57
|
"minimumPairedScenarios": 18,
|
|
26
|
-
"minimumComparableEfficiencyScenarios":
|
|
58
|
+
"minimumComparableEfficiencyScenarios": 18,
|
|
27
59
|
"minimumRepeats": 3,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
60
|
+
"maximumInfrastructureRetries": 0,
|
|
61
|
+
"primaryEfficiencyEstimand": "fixed-workload-family-ratio",
|
|
62
|
+
"maximumFreshTokenRatioUpper95": 0.6,
|
|
63
|
+
"requireEfficiencyClaim": true,
|
|
64
|
+
"requireNormalizedCostClaim": false,
|
|
65
|
+
"requireHostReadinessForClaim": false,
|
|
66
|
+
"requireFullSuiteForClaim": true,
|
|
67
|
+
"requireStableProviderWireSurface": true,
|
|
68
|
+
"requireCausalContextReceipt": true
|
|
30
69
|
},
|
|
31
70
|
"scenarios": [
|
|
32
71
|
{
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"path": "evals/scenarios/capability-resolution.json"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"byteSize":
|
|
30
|
-
"digest": "sha256:
|
|
29
|
+
"byteSize": 6350,
|
|
30
|
+
"digest": "sha256:3e0f3a94bd3a19df8c24c3e234078d6c3edc664b20a7a4838919450f4225ffca",
|
|
31
31
|
"id": "base-policy",
|
|
32
32
|
"kind": "policies",
|
|
33
33
|
"path": "packages/piagent-core/policies/base-policy.json"
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"path": "packages/piagent-core/subagents/piagent-scout.md"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
"byteSize":
|
|
107
|
-
"digest": "sha256:
|
|
106
|
+
"byteSize": 2159,
|
|
107
|
+
"digest": "sha256:3e0b7071c80f471fb7ea67f91477c1f5e6d3f2574db492c3a9fae6788374a95d",
|
|
108
108
|
"id": "piagent-worker",
|
|
109
109
|
"kind": "subagents",
|
|
110
110
|
"path": "packages/piagent-core/subagents/piagent-worker.md"
|
|
@@ -151,8 +151,8 @@
|
|
|
151
151
|
},
|
|
152
152
|
"artifacts": [
|
|
153
153
|
{
|
|
154
|
-
"byteSize":
|
|
155
|
-
"digest": "sha256:
|
|
154
|
+
"byteSize": 2378,
|
|
155
|
+
"digest": "sha256:35d6757d0a8d2f8644b967fe82645fba3de430b53f23b5577c2e5e104dcccdc1",
|
|
156
156
|
"id": "web-frontend",
|
|
157
157
|
"kind": "adapters",
|
|
158
158
|
"path": "adapters/web-frontend/profile.json"
|
|
@@ -502,8 +502,8 @@ Các lệnh này chạy ngoài Pi.
|
|
|
502
502
|
| Command | Dùng khi nào |
|
|
503
503
|
|---|---|
|
|
504
504
|
| `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1` | Cài Pi CLI tương thích với release hiện tại. |
|
|
505
|
-
| `npm install -g --ignore-scripts @piagent/platform@1.
|
|
506
|
-
| `pi install git:github.com/Vt-mmm/piagent@v1.
|
|
505
|
+
| `npm install -g --ignore-scripts @piagent/platform@1.6.0` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
|
|
506
|
+
| `pi install git:github.com/Vt-mmm/piagent@v1.6.0` | Cài pinned release khi cần reproducible team setup. |
|
|
507
507
|
| `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
|
|
508
508
|
| `piagent-update --check` | Báo version hiện tại vs version sẽ lên cho cả ba thành phần; không cài gì. |
|
|
509
509
|
| `piagent-update` | Full update global một lệnh cho cả máy: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu. |
|
|
@@ -547,17 +547,17 @@ Các lệnh này chạy ngoài Pi.
|
|
|
547
547
|
| `piagent-uninstall --apply` | Gỡ Pi package của platform khỏi Pi settings global. |
|
|
548
548
|
| `piagent-uninstall --apply --with-addons --with-host` | Gỡ thêm pi-mcp-adapter, pi-subagents, pi-web-access và Pi host. |
|
|
549
549
|
| `piagent-uninstall --apply --project /path/to/project` | Gỡ thêm state của platform trong project: profile, lock, `piagent-state/`. |
|
|
550
|
-
| `piagent-benchmark` | Chạy smoke suite `core-v1`: paired
|
|
550
|
+
| `piagent-benchmark` | Chạy smoke suite `core-v1`: paired Piagent/controlled `codex-cli` bằng Luna/medium, 24 session, hidden grader + scope + workflow + exact usage. |
|
|
551
551
|
| `piagent-benchmark --dry-run` | Validate suite và xem số model session, không gọi model. |
|
|
552
|
-
| `npm run benchmark:deep -- --dry-run` | Validate `deep-logic-v1`:
|
|
553
|
-
| `npm run benchmark:deep` | Chạy paired deep-logic benchmark Luna/medium cho event/state, scheduler, policy, context graph, stream recovery và
|
|
552
|
+
| `npm run benchmark:deep -- --dry-run` | Validate `deep-logic-v1`: 7 family difficulty large × 3 repeat × Piagent/`codex-cli` = 42 session, khóa Luna/medium và chưa dùng quota. |
|
|
553
|
+
| `npm run benchmark:deep` | Chạy paired deep-logic benchmark Luna/medium cho event/state, scheduler, policy, context graph, stream recovery, transactional config và temporal usage billing chính xác. |
|
|
554
554
|
| `piagent-benchmark --production --dry-run` | Xem ma trận production 18 family x 3 variant x 2 surface = 108 session, chưa dùng quota. |
|
|
555
555
|
| `piagent-benchmark --production --surfaces piagent,codex-cli --model <provider/model> --thinking high --piagent-treatment candidate` | Chạy production release gate đa domain/profile/lifecycle với controlled Codex, treatment Piagent đã pin, paired outcome và 95% token-ratio confidence. |
|
|
556
556
|
| `piagent-benchmark --piagent-treatment release-defaults\|local-safe\|candidate\|feature-off ...` | Pin treatment Piagent; chỉ surface `piagent` nhận feature env, manifest/resume/replay/report giữ nguyên treatment. |
|
|
557
557
|
| `piagent-benchmark --codex-mode native ...` | Đo UX Codex theo cấu hình operator; protocol gate fail closed nên report không được claim tiết kiệm token. |
|
|
558
558
|
| `piagent-benchmark --production --seed <value> ...` | Tái lập đúng generated variant của một production report riêng tư. |
|
|
559
559
|
| `piagent-benchmark --production --scenarios <id,id> --repeats 1 ...` | Chẩn đoán family/rubric đã chọn; không đủ điều kiện nhận production verdict. |
|
|
560
|
-
| `piagent-benchmark --production --infrastructure-retries 2 ...` |
|
|
560
|
+
| `piagent-benchmark --production --infrastructure-retries 2 ...` | Diagnostic recovery run; retry chỉ áp lỗi process chết trước usage, được report đầy đủ và làm production claim fail. |
|
|
561
561
|
| `piagent-benchmark --production --retry-delay 60 ...` | Đặt backoff trước infrastructure retry; production mặc định 60 giây. |
|
|
562
562
|
| `bash scripts/verify-local.sh` | Verify repo platform trước khi commit/tag. |
|
|
563
563
|
| `bash scripts/verify-local.sh --offline` | Verify trong CI/máy sạch, bỏ qua local Pi model catalog. |
|
package/docs/context-engine.md
CHANGED
|
@@ -46,6 +46,10 @@ task
|
|
|
46
46
|
- Telemetry không lưu prompt hoặc tool output thô. Nó lưu hash, kích thước, tool,
|
|
47
47
|
model, thinking, active-tool count, usage, retrieval confidence và đường dẫn
|
|
48
48
|
tương đối đã được guard redaction.
|
|
49
|
+
- Mỗi telemetry row có provenance envelope do writer đóng sau payload; event
|
|
50
|
+
không thể ghi đè schema/provenance. Nếu source snapshot phải redact, receipt
|
|
51
|
+
chỉ giữ `sanitizedContentDigest` và `fileContentHash` trên nội dung đã sanitize;
|
|
52
|
+
raw-content digest không được tính hoặc lưu.
|
|
49
53
|
|
|
50
54
|
Bốn cơ chế `PIAGENT_DYNAMIC_TOOLS`, `PIAGENT_AUTO_CONTEXT`,
|
|
51
55
|
`PIAGENT_CONTEXT_TELEMETRY` và `PIAGENT_AUTO_RECOVERY` đều **bật mặc định**.
|
|
@@ -180,7 +184,9 @@ không bị trừ điểm. `contextSelections`, `contextSelectionsUsed` và
|
|
|
180
184
|
ranking. Runtime chỉ đọc phần đuôi telemetry có giới hạn khi tính report hoặc
|
|
181
185
|
feedback, nên lịch sử dài không làm chậm từng prompt theo thời gian.
|
|
182
186
|
|
|
183
|
-
`contextWasteScore` nằm trong khoảng `0..100`,
|
|
187
|
+
Khi toàn bộ evidence lane đầy đủ, `contextWasteScore` nằm trong khoảng `0..100`,
|
|
188
|
+
thấp hơn là tốt hơn. Nếu coverage chưa đầy đủ, score chính là `null` và chỉ
|
|
189
|
+
`contextWasteScoreEstimate` được giữ như chẩn đoán partial:
|
|
184
190
|
|
|
185
191
|
```text
|
|
186
192
|
30% duplicate read rate
|
|
@@ -15,9 +15,9 @@ Repo này phải chạy được cho nhiều project/domain khác nhau. Vì vậ
|
|
|
15
15
|
|
|
16
16
|
| Use case | Package source |
|
|
17
17
|
|---|---|
|
|
18
|
-
| Team pinned release | `git:github.com/Vt-mmm/piagent@v1.
|
|
18
|
+
| Team pinned release | `git:github.com/Vt-mmm/piagent@v1.6.0` |
|
|
19
19
|
| Personal/sandbox dev | `git:github.com/Vt-mmm/piagent` |
|
|
20
|
-
| Registry distribution | `npm:@piagent/platform@1.
|
|
20
|
+
| Registry distribution | `npm:@piagent/platform@1.6.0` |
|
|
21
21
|
| Enterprise npm (fork under another scope) | `npm:@your-scope/platform@x.y.z` |
|
|
22
22
|
| Local platform dev | `/path/to/piagent` |
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ Latest tiện cho máy cá nhân muốn nhận cập nhật nhanh. Pin tag/commi
|
|
|
27
27
|
|
|
28
28
|
| Channel | Command | Target | Policy |
|
|
29
29
|
|---|---|---|---|
|
|
30
|
-
| `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.
|
|
30
|
+
| `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.6.0` | Install the Pi package matching the helper. |
|
|
31
31
|
| `exact` | `bash scripts/install-global.sh --version vX.Y.Z --resolve-tag` | Requested tag resolved to commit SHA | Pi-package-only rollout, rollback, and incident recovery. |
|
|
32
32
|
| `dev` | `bash scripts/install-global.sh --dev` | Moving Git source | Personal/sandbox only; do not commit into project settings. |
|
|
33
33
|
| `local` | `bash scripts/install-global.sh --local` | Current checkout path | Platform development only. |
|
|
@@ -54,7 +54,7 @@ Root `package.json` có `pi` manifest trỏ tới:
|
|
|
54
54
|
Do đó team có thể:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
pi install git:github.com/Vt-mmm/piagent@v1.
|
|
57
|
+
pi install git:github.com/Vt-mmm/piagent@v1.6.0
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
Không cần biết internal folder `packages/piagent-core`. Source không pin chỉ dành cho personal/sandbox như bảng channel ở trên.
|
|
@@ -66,12 +66,12 @@ Team nên install global package một lần:
|
|
|
66
66
|
```bash
|
|
67
67
|
node --version # >= 22.19.0
|
|
68
68
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1
|
|
69
|
-
npm install -g --ignore-scripts @piagent/platform@1.
|
|
69
|
+
npm install -g --ignore-scripts @piagent/platform@1.6.0
|
|
70
70
|
piagent-install --stable --dry-run
|
|
71
71
|
piagent-install --stable
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
`pi install git:github.com/Vt-mmm/piagent@v1.
|
|
74
|
+
`pi install git:github.com/Vt-mmm/piagent@v1.6.0` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.6.0`.
|
|
75
75
|
|
|
76
76
|
Support matrix hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy smoke trước rollout; native Windows chưa phải target rollout team; WSL2 experimental. Chi tiết và version runtime nằm trong [release/install policy](release-install-policy.md).
|
|
77
77
|
|
|
@@ -121,7 +121,7 @@ Nếu muốn commit sẵn `.pi/piagent-profile.json` vào repo hoặc bootstrap
|
|
|
121
121
|
```bash
|
|
122
122
|
bash scripts/setup.sh /path/to/project \
|
|
123
123
|
--profile be-readonly-fe \
|
|
124
|
-
--package-source git:github.com/Vt-mmm/piagent@v1.
|
|
124
|
+
--package-source git:github.com/Vt-mmm/piagent@v1.6.0 \
|
|
125
125
|
--mcp-preset core \
|
|
126
126
|
--subagents-preset safe
|
|
127
127
|
```
|
package/docs/en/architecture.md
CHANGED
|
@@ -44,6 +44,7 @@ The machine-readable rule is `architecture/layers.json`; `npm run architecture:c
|
|
|
44
44
|
| Security foundation | `packages/piagent-core/security/` | Sensitive-data primitives | Workflow behavior |
|
|
45
45
|
| Benchmark | `packages/piagent-core/benchmark/`, `benchmarks/` | Suite validation, scoring, evidence | Runtime enforcement |
|
|
46
46
|
| WebUI contracts | `packages/piagent-webui/contracts/` | Wire types shared by browser and server | Any runtime behavior; it depends on nothing |
|
|
47
|
+
| WebUI shared | `packages/piagent-webui/shared/` | Dependency-free deterministic helpers shared by browser, server, and gateway | Browser state, transport, filesystem access, or runtime policy |
|
|
47
48
|
| WebUI client | `packages/piagent-webui/client/` | Browser views, view models, UI preferences | Server state, filesystem, Pi APIs |
|
|
48
49
|
| WebUI server | `packages/piagent-webui/server/` | HTTP/WS endpoints, session reads, diff assembly | Browser rendering; it may not import the client |
|
|
49
50
|
| WebUI extension | `packages/piagent-webui/extension/` | The in-Pi `/piagent-webui` command surface | Wire types the client also needs |
|
package/docs/languages.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"en": "README.md",
|
|
22
22
|
"vi": "README.vi.md",
|
|
23
23
|
"consistentAt": {
|
|
24
|
-
"en": "
|
|
25
|
-
"vi": "
|
|
24
|
+
"en": "c2b6f830977bff9eff7ebdc97f1aa15502ce3e2c",
|
|
25
|
+
"vi": "a6533b41f285b3dc05a594e21cc208ca28b5569b"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"en": "docs/en/architecture.md",
|
|
40
40
|
"vi": "docs/vi/architecture.md",
|
|
41
41
|
"consistentAt": {
|
|
42
|
-
"en": "
|
|
43
|
-
"vi": "
|
|
42
|
+
"en": "7902186a3bf9cc8c344bd27ea352cf4a6d5eae2a",
|
|
43
|
+
"vi": "64575dc18be0167324bfba396d7162c74af28048"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
{
|
package/docs/model-options.md
CHANGED
|
@@ -54,7 +54,10 @@ Shift+Ctrl+P # cycle ngược
|
|
|
54
54
|
Shift+Tab # cycle thinking level
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Global setup của repo sẽ seed
|
|
57
|
+
Global setup của repo sẽ seed các preset đã kiểm chứng và một catch-all
|
|
58
|
+
`openai-codex/*` vào `~/.pi/agent/settings.json`. Vì các preset đứng trước glob,
|
|
59
|
+
chúng giữ thinking level khuyến nghị; model Codex mới trong authenticated catalog
|
|
60
|
+
vẫn tự xuất hiện trong scope mà không cần chờ Piagent phát hành lại.
|
|
58
61
|
|
|
59
62
|
## Kiểm tra model hiện có
|
|
60
63
|
|
|
@@ -97,7 +100,7 @@ off, minimal, low, medium, high, xhigh, max
|
|
|
97
100
|
Không phải model nào cũng hỗ trợ mọi level. Pi sẽ clamp theo capability của model. Cách chọn:
|
|
98
101
|
|
|
99
102
|
```bash
|
|
100
|
-
pi --model openai-codex/gpt-5.
|
|
103
|
+
pi --model openai-codex/gpt-5.6-sol:high
|
|
101
104
|
pi --model anthropic/claude-sonnet-5:xhigh
|
|
102
105
|
pi --thinking medium
|
|
103
106
|
```
|
|
@@ -113,7 +116,7 @@ pi --thinking medium
|
|
|
113
116
|
| `openai-codex/gpt-5.3-codex-spark` | fast scout | hỏi nhanh, thao tác nhỏ, chi phí thấp |
|
|
114
117
|
| `openai-codex/gpt-5.4-mini` | fast/cheap | scout nhẹ, docs, simple fix |
|
|
115
118
|
| `openai-codex/gpt-5.4` | balanced | task bình thường |
|
|
116
|
-
| `openai-codex/gpt-5.5` | balanced/hard
|
|
119
|
+
| `openai-codex/gpt-5.5` | balanced/hard | model thế hệ trước vẫn được hỗ trợ khi có trong authenticated catalog |
|
|
117
120
|
| `openai-codex/gpt-5.6-luna` | cost-sensitive/high-volume | workload nhanh, nhiều lượt, ưu tiên latency và chi phí |
|
|
118
121
|
| `openai-codex/gpt-5.6-terra` | balanced | công việc hằng ngày cần cân bằng capability, speed và cost |
|
|
119
122
|
| `openai-codex/gpt-5.6-sol` | frontier/quality-first | task phức tạp, long-horizon hoặc cần chất lượng cao nhất |
|
|
@@ -143,7 +146,7 @@ available nào trong authenticated provider catalog.
|
|
|
143
146
|
| Preset | Model OpenAI Codex | Model Claude (Anthropic) | Khi dùng |
|
|
144
147
|
|---|---|---|---|
|
|
145
148
|
| Fast scout | `openai-codex/gpt-5.4-mini:low` | `anthropic/claude-haiku-4-5:low` | đọc nhanh, hỏi đáp, grep/scout nhẹ |
|
|
146
|
-
| Balanced implement | `openai-codex/gpt-5.
|
|
149
|
+
| Balanced implement | `openai-codex/gpt-5.6-terra:medium` | `anthropic/claude-sonnet-5:medium` | task source bình thường |
|
|
147
150
|
| Cost-sensitive volume | `openai-codex/gpt-5.6-luna:medium` | `anthropic/claude-haiku-4-5:low` | workload nhanh, nhiều lượt; đo quality gate trước khi promote |
|
|
148
151
|
| Balanced implement | `openai-codex/gpt-5.6-terra:high` hoặc `openai-codex/gpt-5.5:high` | `anthropic/claude-sonnet-5:high` | task source hằng ngày, cân bằng capability/cost |
|
|
149
152
|
| Frontier/quality-first | `openai-codex/gpt-5.6-sol:high` | `anthropic/claude-opus-4-7:xhigh` hoặc `anthropic/claude-opus-4-8:xhigh` | architecture, long-horizon, high-risk review |
|
|
@@ -155,7 +158,7 @@ Tên model có thể đổi theo Pi model catalog. Khi không chắc, ưu tiên
|
|
|
155
158
|
Global setup mặc định:
|
|
156
159
|
|
|
157
160
|
```bash
|
|
158
|
-
piagent-model-scope --preset full --default-model openai-codex/gpt-5.
|
|
161
|
+
piagent-model-scope --preset full --default-model openai-codex/gpt-5.6-sol:high
|
|
159
162
|
```
|
|
160
163
|
|
|
161
164
|
Scope này ghi vào settings:
|