@piagent/platform 1.5.5 → 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 +117 -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 +5 -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 +2 -0
- package/packages/piagent-core/extensions/javascript-regex-evidence.js +32 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +233 -41
- 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 +2 -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 +4 -2
- package/packages/piagent-core/runtime/inspection/activity-recovery.ts +104 -0
- 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 -124
- 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/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,10 @@
|
|
|
1
|
+
// Classification only: callers keep the original Unicode text unchanged.
|
|
2
|
+
// A response needs at least one rendering code point; whitespace, controls and
|
|
3
|
+
// Unicode default-ignorables alone cannot form a visible assistant answer.
|
|
4
|
+
const NON_RENDERING_CODE_POINT = /^(?:\p{White_Space}|\p{Cc}|\p{Default_Ignorable_Code_Point})$/u;
|
|
5
|
+
const ANSI_ESCAPE = /\u001b(?:\[[0-?]*[ -/]*[@-~]|[@-_])/g;
|
|
6
|
+
|
|
7
|
+
export function hasVisibleText(value: string): boolean {
|
|
8
|
+
for (const codePoint of value.replace(ANSI_ESCAPE, "")) if (!NON_RENDERING_CODE_POINT.test(codePoint)) return true;
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
@@ -218,6 +218,15 @@
|
|
|
218
218
|
"supported": true,
|
|
219
219
|
"current": true
|
|
220
220
|
},
|
|
221
|
+
{
|
|
222
|
+
"name": "session-live-state-v1",
|
|
223
|
+
"file": "session-live-state-v1.schema.json",
|
|
224
|
+
"id": "https://piagent.io.vn/schemas/piagent-webui/session-live-state-v1.schema.json",
|
|
225
|
+
"documentVersion": 1,
|
|
226
|
+
"role": "read-model",
|
|
227
|
+
"supported": true,
|
|
228
|
+
"current": true
|
|
229
|
+
},
|
|
221
230
|
{
|
|
222
231
|
"name": "session-command-v1",
|
|
223
232
|
"file": "session-command-v1.schema.json",
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
"sequence": { "$ref": "#/$defs/stateVersion" },
|
|
270
270
|
"stateVersion": { "$ref": "#/$defs/stateVersion" },
|
|
271
271
|
"generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
272
|
-
"kind": { "enum": ["catalog.changed", "session.changed", "runtime.changed", "resync.required", "message.delta", "message.completed", "tool.started", "tool.completed"] },
|
|
272
|
+
"kind": { "enum": ["catalog.changed", "session.changed", "runtime.changed", "resync.required", "message.delta", "message.completed", "operation.settled", "tool.started", "tool.completed"] },
|
|
273
273
|
"payload": { "type": "object" }
|
|
274
274
|
}
|
|
275
275
|
},
|
|
@@ -411,6 +411,54 @@
|
|
|
411
411
|
}
|
|
412
412
|
]
|
|
413
413
|
},
|
|
414
|
+
"operationCompletedPayload": {
|
|
415
|
+
"type": "object",
|
|
416
|
+
"additionalProperties": false,
|
|
417
|
+
"required": ["sessionRef", "operationRef", "messageRef", "sessionRevision", "settlement", "reasonCode"],
|
|
418
|
+
"properties": {
|
|
419
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
420
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
421
|
+
"messageRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
422
|
+
"sessionRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
423
|
+
"settlement": { "const": "completed" },
|
|
424
|
+
"reasonCode": { "type": "null" }
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
"operationIncompletePayload": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"additionalProperties": false,
|
|
430
|
+
"required": ["sessionRef", "operationRef", "messageRef", "sessionRevision", "settlement", "reasonCode"],
|
|
431
|
+
"properties": {
|
|
432
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
433
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
434
|
+
"messageRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
|
|
435
|
+
"sessionRevision": {
|
|
436
|
+
"anyOf": [
|
|
437
|
+
{ "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
438
|
+
{ "type": "null" }
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
"settlement": { "enum": ["blocked", "aborted", "error", "unknown"] },
|
|
442
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"operationSettledEvent": {
|
|
446
|
+
"allOf": [
|
|
447
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
448
|
+
{
|
|
449
|
+
"type": "object",
|
|
450
|
+
"properties": {
|
|
451
|
+
"kind": { "const": "operation.settled" },
|
|
452
|
+
"payload": {
|
|
453
|
+
"oneOf": [
|
|
454
|
+
{ "$ref": "#/$defs/operationCompletedPayload" },
|
|
455
|
+
{ "$ref": "#/$defs/operationIncompletePayload" }
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
},
|
|
414
462
|
"toolEvent": {
|
|
415
463
|
"allOf": [
|
|
416
464
|
{ "$ref": "#/$defs/eventBase" },
|
|
@@ -421,13 +469,14 @@
|
|
|
421
469
|
"payload": {
|
|
422
470
|
"type": "object",
|
|
423
471
|
"additionalProperties": false,
|
|
424
|
-
"required": ["sessionRef", "operationRef", "toolCallRef", "toolLabel", "isError"],
|
|
472
|
+
"required": ["sessionRef", "operationRef", "toolCallRef", "toolLabel", "isError", "reasonCode"],
|
|
425
473
|
"properties": {
|
|
426
474
|
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
427
475
|
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
428
476
|
"toolCallRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
429
477
|
"toolLabel": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[^\\u0000-\\u001F\\u007F]+$" },
|
|
430
|
-
"isError": { "type": ["boolean", "null"] }
|
|
478
|
+
"isError": { "type": ["boolean", "null"] },
|
|
479
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
|
|
431
480
|
}
|
|
432
481
|
}
|
|
433
482
|
},
|
|
@@ -449,6 +498,7 @@
|
|
|
449
498
|
{ "$ref": "#/$defs/resyncRequiredEvent" },
|
|
450
499
|
{ "$ref": "#/$defs/messageDeltaEvent" },
|
|
451
500
|
{ "$ref": "#/$defs/messageCompletedEvent" },
|
|
501
|
+
{ "$ref": "#/$defs/operationSettledEvent" },
|
|
452
502
|
{ "$ref": "#/$defs/toolEvent" }
|
|
453
503
|
]
|
|
454
504
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/session-live-state-v1.schema.json",
|
|
4
|
+
"title": "Piagent WebUI canonical volatile session operation state v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "version", "generatedAt", "gatewayInstanceRef", "eventSequence", "state", "operations", "settlements", "reasonCode"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"version": { "const": "piagent-session-live-state-v1" },
|
|
11
|
+
"generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
12
|
+
"gatewayInstanceRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
13
|
+
"eventSequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
|
|
14
|
+
"state": { "enum": ["ready", "unavailable"] },
|
|
15
|
+
"operations": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"maxItems": 100,
|
|
18
|
+
"uniqueItems": true,
|
|
19
|
+
"items": { "$ref": "#/$defs/currentOperation" }
|
|
20
|
+
},
|
|
21
|
+
"settlements": {
|
|
22
|
+
"description": "Bounded, Gateway-epoch-local non-success terminal operation outcomes retained for Activity reconciliation.",
|
|
23
|
+
"type": "array",
|
|
24
|
+
"maxItems": 100,
|
|
25
|
+
"uniqueItems": true,
|
|
26
|
+
"items": { "$ref": "#/$defs/terminalSettlement" }
|
|
27
|
+
},
|
|
28
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
|
|
29
|
+
},
|
|
30
|
+
"allOf": [
|
|
31
|
+
{
|
|
32
|
+
"if": { "properties": { "state": { "const": "ready" } }, "required": ["state"] },
|
|
33
|
+
"then": { "properties": { "reasonCode": { "type": "null" } } },
|
|
34
|
+
"else": {
|
|
35
|
+
"properties": {
|
|
36
|
+
"operations": { "type": "array", "maxItems": 0 },
|
|
37
|
+
"settlements": { "type": "array", "maxItems": 0 },
|
|
38
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"$defs": {
|
|
44
|
+
"currentOperation": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["sessionRef", "operationRef", "state", "abortable"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
50
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
51
|
+
"state": { "enum": ["running", "waiting-approval", "settling"] },
|
|
52
|
+
"abortable": { "type": "boolean" }
|
|
53
|
+
},
|
|
54
|
+
"allOf": [
|
|
55
|
+
{
|
|
56
|
+
"if": { "properties": { "state": { "const": "settling" } }, "required": ["state"] },
|
|
57
|
+
"then": { "properties": { "abortable": { "const": false } } },
|
|
58
|
+
"else": { "properties": { "abortable": { "const": true } } }
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"terminalSettlement": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": ["sessionRef", "operationRef", "settlement", "reasonCode", "settledAt", "sequence"],
|
|
66
|
+
"properties": {
|
|
67
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
68
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
69
|
+
"settlement": { "enum": ["blocked", "aborted", "error", "unknown"] },
|
|
70
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
71
|
+
"settledAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
72
|
+
"sequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -469,6 +469,12 @@
|
|
|
469
469
|
"read-only"
|
|
470
470
|
]
|
|
471
471
|
},
|
|
472
|
+
"mutationPolicy": {
|
|
473
|
+
"enum": [
|
|
474
|
+
"required",
|
|
475
|
+
"forbidden"
|
|
476
|
+
]
|
|
477
|
+
},
|
|
472
478
|
"attempt": {
|
|
473
479
|
"type": "integer",
|
|
474
480
|
"minimum": 1,
|
|
@@ -570,7 +576,8 @@
|
|
|
570
576
|
"$ref": "#/$defs/stringList"
|
|
571
577
|
},
|
|
572
578
|
{
|
|
573
|
-
"minItems": 1
|
|
579
|
+
"minItems": 1,
|
|
580
|
+
"maxItems": 2000
|
|
574
581
|
}
|
|
575
582
|
]
|
|
576
583
|
},
|
|
@@ -863,6 +870,10 @@
|
|
|
863
870
|
}
|
|
864
871
|
},
|
|
865
872
|
"allOf": [
|
|
873
|
+
{
|
|
874
|
+
"if": { "properties": { "changeMode": { "const": "read-only" } }, "required": ["changeMode"] },
|
|
875
|
+
"then": { "properties": { "mutationPolicy": { "const": "forbidden" } } }
|
|
876
|
+
},
|
|
866
877
|
{
|
|
867
878
|
"if": { "properties": { "workingTreeDigestAlgorithm": { "const": "legacy-untrusted" } }, "required": ["workingTreeDigestAlgorithm"] },
|
|
868
879
|
"then": {
|