@piagent/platform 1.3.1 → 1.4.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 +39 -0
- package/README.md +3 -3
- package/architecture/layers.json +96 -1
- package/docs/README.md +1 -0
- package/docs/architecture.md +1 -0
- package/docs/authority-manifest.md +1 -0
- package/docs/auto-delegation-policy.md +1 -0
- package/docs/capability-packs.md +1 -0
- package/docs/command-reference-vietnamese.md +5 -4
- package/docs/context-engine.md +1 -0
- package/docs/context-window-policy.md +1 -0
- package/docs/distribution-standard.md +8 -7
- package/docs/herdr-workflow.md +1 -0
- package/docs/mcp-and-tools.md +14 -9
- package/docs/memory-policy.md +1 -0
- package/docs/model-options.md +1 -0
- package/docs/oauth-providers.md +1 -0
- package/docs/operator-manual-vietnamese.md +15 -12
- package/docs/package-architecture-notes.md +1 -0
- package/docs/project-adapters.md +1 -0
- package/docs/project-onboarding.md +1 -0
- package/docs/publishing-for-teams.md +1 -0
- package/docs/quality-benchmark.md +1 -0
- package/docs/quickstart-vietnamese.md +3 -2
- package/docs/release-install-policy.md +7 -6
- package/docs/runtime-harness-standard.md +1 -0
- package/docs/runtime-policy-design.md +1 -0
- package/docs/runtime-quality-baseline.md +1 -0
- package/docs/security-redaction-benchmark.md +1 -0
- package/docs/security-threat-model.md +2 -1
- package/docs/subagent-orchestration-capabilities.md +1 -0
- package/docs/subagents-and-multiagent.md +1 -0
- package/docs/task-implementation-contract.md +1 -0
- package/docs/task-lifecycle-vietnamese.md +1 -0
- package/docs/team-onboarding.md +3 -2
- package/docs/third-party-neutrality.md +26 -0
- package/docs/usage-observability.md +1 -0
- package/docs/vercel-docs-site.md +1 -0
- package/docs/workflow-recipes.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/mutation-provenance-record.invalid.json +17 -0
- package/evals/fixtures/mutation-provenance-record.valid.json +27 -0
- package/evals/fixtures/piagent-webui/approval-v1.invalid.json +54 -0
- package/evals/fixtures/piagent-webui/approval-v1.valid.json +58 -0
- package/evals/fixtures/piagent-webui/attachment-v1.invalid.json +25 -0
- package/evals/fixtures/piagent-webui/attachment-v1.valid.json +25 -0
- package/evals/fixtures/piagent-webui/capabilities-v1.invalid.json +51 -0
- package/evals/fixtures/piagent-webui/capabilities-v1.valid.json +122 -0
- package/evals/fixtures/piagent-webui/commit-summary-v1.invalid.json +10 -0
- package/evals/fixtures/piagent-webui/commit-summary-v1.valid.json +25 -0
- package/evals/fixtures/piagent-webui/control-command-v1.invalid.json +37 -0
- package/evals/fixtures/piagent-webui/control-command-v1.valid.json +35 -0
- package/evals/fixtures/piagent-webui/diff-v1.invalid.json +13 -0
- package/evals/fixtures/piagent-webui/diff-v1.valid.json +141 -0
- package/evals/fixtures/piagent-webui/gateway-capabilities-v1.invalid.json +35 -0
- package/evals/fixtures/piagent-webui/gateway-capabilities-v1.valid.json +35 -0
- package/evals/fixtures/piagent-webui/gateway-protocol-v1.invalid.json +14 -0
- package/evals/fixtures/piagent-webui/gateway-protocol-v1.valid.json +14 -0
- package/evals/fixtures/piagent-webui/handoff-history-v1.invalid.json +16 -0
- package/evals/fixtures/piagent-webui/handoff-history-v1.valid.json +16 -0
- package/evals/fixtures/piagent-webui/model-catalog-v1.invalid.json +31 -0
- package/evals/fixtures/piagent-webui/model-catalog-v1.valid.json +43 -0
- package/evals/fixtures/piagent-webui/queue-v1.invalid.json +29 -0
- package/evals/fixtures/piagent-webui/queue-v1.valid.json +44 -0
- package/evals/fixtures/piagent-webui/recovery-history-v1.invalid.json +17 -0
- package/evals/fixtures/piagent-webui/recovery-history-v1.valid.json +20 -0
- package/evals/fixtures/piagent-webui/release-monitor-v1.invalid.json +12 -0
- package/evals/fixtures/piagent-webui/release-monitor-v1.valid.json +29 -0
- package/evals/fixtures/piagent-webui/review-state-v1.invalid.json +25 -0
- package/evals/fixtures/piagent-webui/review-state-v1.valid.json +38 -0
- package/evals/fixtures/piagent-webui/runtime-event-v2.invalid.json +49 -0
- package/evals/fixtures/piagent-webui/runtime-event-v2.valid.json +49 -0
- package/evals/fixtures/piagent-webui/session-catalog-v1.invalid.json +17 -0
- package/evals/fixtures/piagent-webui/session-catalog-v1.valid.json +58 -0
- package/evals/fixtures/piagent-webui/session-command-v1.invalid.json +19 -0
- package/evals/fixtures/piagent-webui/session-command-v1.valid.json +19 -0
- package/evals/fixtures/piagent-webui/snapshot-v1.invalid.json +5 -0
- package/evals/fixtures/piagent-webui/snapshot-v1.valid.json +191 -0
- package/evals/fixtures/piagent-webui/source-change-v1.invalid.json +57 -0
- package/evals/fixtures/piagent-webui/source-change-v1.valid.json +98 -0
- package/evals/fixtures/piagent-webui/source-mutation-v1.invalid.json +19 -0
- package/evals/fixtures/piagent-webui/source-mutation-v1.valid.json +38 -0
- package/evals/fixtures/piagent-webui/source-revert-v1.invalid.json +20 -0
- package/evals/fixtures/piagent-webui/source-revert-v1.valid.json +62 -0
- package/evals/fixtures/piagent-webui/subagent-tree-v1.invalid.json +26 -0
- package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +39 -0
- package/evals/fixtures/piagent-webui/task-index-v1.invalid.json +15 -0
- package/evals/fixtures/piagent-webui/task-index-v1.valid.json +15 -0
- package/evals/fixtures/piagent-webui/task-timeline-v1.invalid.json +14 -0
- package/evals/fixtures/piagent-webui/task-timeline-v1.valid.json +16 -0
- package/evals/fixtures/piagent-webui/transcript-v1.invalid.json +35 -0
- package/evals/fixtures/piagent-webui/transcript-v1.valid.json +55 -0
- package/evals/fixtures/task-baseline-manifest.invalid.json +16 -0
- package/evals/fixtures/task-baseline-manifest.valid.json +41 -0
- package/evals/fixtures/verifier-file-snapshot.invalid.json +21 -0
- package/evals/fixtures/verifier-file-snapshot.valid.json +21 -0
- package/package.json +30 -3
- package/packages/piagent-core/benchmark/benchmark-candidate.d.ts +1 -0
- package/packages/piagent-core/benchmark/benchmark-forensics.d.ts +1 -0
- package/packages/piagent-core/benchmark/benchmark-ledger.d.ts +4 -0
- package/packages/piagent-core/benchmark/benchmark-record-validation.d.ts +1 -0
- package/packages/piagent-core/benchmark/benchmark-runtime.d.ts +1 -0
- package/packages/piagent-core/capabilities/capability-core.js +2 -2
- package/packages/piagent-core/capabilities/runtime-integrity.js +143 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +62 -37
- package/packages/piagent-core/extensions/redaction-core.d.ts +2 -0
- package/packages/piagent-core/extensions/task-journal.js +30 -1
- package/packages/piagent-core/extensions/task-state.js +33 -36
- package/packages/piagent-core/mcp/mcp-server-catalog.js +5 -5
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -2
- package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +5 -2
- package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +20 -19
- package/packages/piagent-core/runtime/hooks/tool-result-metadata.ts +13 -0
- package/packages/piagent-core/runtime/input/chat-images.ts +2 -2
- package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +94 -0
- package/packages/piagent-core/runtime/inspection/approval-broker.ts +318 -0
- package/packages/piagent-core/runtime/inspection/commit-summary-projection.ts +59 -0
- package/packages/piagent-core/runtime/inspection/context-telemetry-inspection.ts +37 -0
- package/packages/piagent-core/runtime/inspection/criteria-links.ts +295 -0
- package/packages/piagent-core/runtime/inspection/diff-projection.ts +499 -0
- package/packages/piagent-core/runtime/inspection/git-filter-safety.ts +38 -0
- package/packages/piagent-core/runtime/inspection/git-numstat-adapter.ts +71 -0
- package/packages/piagent-core/runtime/inspection/git-status-adapter.ts +493 -0
- package/packages/piagent-core/runtime/inspection/git-tree-adapter.ts +108 -0
- package/packages/piagent-core/runtime/inspection/mcp-control.ts +10 -0
- package/packages/piagent-core/runtime/inspection/mutation-provenance-contract.ts +131 -0
- package/packages/piagent-core/runtime/inspection/mutation-provenance-recorder.ts +48 -0
- package/packages/piagent-core/runtime/inspection/mutation-provenance-store.ts +161 -0
- package/packages/piagent-core/runtime/inspection/project-runtime-inspection.ts +36 -0
- package/packages/piagent-core/runtime/inspection/review-state-contract.ts +108 -0
- package/packages/piagent-core/runtime/inspection/review-state-projection.ts +93 -0
- package/packages/piagent-core/runtime/inspection/review-state-store.ts +112 -0
- package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +262 -0
- package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +103 -0
- package/packages/piagent-core/runtime/inspection/source-change-projection.ts +471 -0
- package/packages/piagent-core/runtime/inspection/source-evidence-contract.ts +139 -0
- package/packages/piagent-core/runtime/inspection/source-evidence-store.ts +315 -0
- package/packages/piagent-core/runtime/inspection/source-handoff-store.ts +70 -0
- package/packages/piagent-core/runtime/inspection/source-inspection-plan.ts +34 -0
- package/packages/piagent-core/runtime/inspection/source-mutation-projection.ts +164 -0
- package/packages/piagent-core/runtime/inspection/source-mutation-store.ts +168 -0
- package/packages/piagent-core/runtime/inspection/source-open-target.ts +38 -0
- package/packages/piagent-core/runtime/inspection/source-revert-projection.ts +147 -0
- package/packages/piagent-core/runtime/inspection/task-baseline-start-capture.ts +22 -0
- package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +160 -0
- package/packages/piagent-core/runtime/inspection/task-control-journal.ts +131 -0
- package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +95 -0
- package/packages/piagent-core/runtime/inspection/task-provenance-projection.ts +60 -0
- package/packages/piagent-core/runtime/inspection/task-recovery-timeline.ts +88 -0
- package/packages/piagent-core/runtime/inspection/task-run-index.ts +87 -0
- package/packages/piagent-core/runtime/inspection/task-source-projection.ts +401 -0
- package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +101 -0
- package/packages/piagent-core/runtime/inspection/text-diff.ts +60 -0
- package/packages/piagent-core/runtime/inspection/verifier-snapshot-contract.ts +114 -0
- package/packages/piagent-core/runtime/inspection/verifier-snapshot-store.ts +189 -0
- package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +320 -0
- package/packages/piagent-core/runtime/inspection/workspace-file-reader.ts +132 -0
- package/packages/piagent-core/runtime/inspection/workspace-source-projection.ts +96 -0
- package/packages/piagent-core/runtime/inspection/zero-turn-conformance.ts +175 -0
- package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +68 -4
- package/packages/piagent-core/runtime/policy/source-index-transaction.ts +173 -0
- package/packages/piagent-core/runtime/policy/source-mutation-guard-binding.ts +42 -0
- package/packages/piagent-core/runtime/policy/source-mutation-guard.ts +184 -0
- package/packages/piagent-core/runtime/policy/source-worktree-transaction.ts +105 -0
- package/packages/piagent-core/runtime/product/activity-inspector-footer.ts +5 -3
- package/packages/piagent-core/runtime/product/activity-inspector.ts +85 -343
- package/packages/piagent-core/runtime/recovery/resume-state.ts +38 -1
- package/packages/piagent-core/runtime/registration/activity-inspector-command.ts +68 -14
- package/packages/piagent-core/runtime/registration/task-start-tool.ts +13 -14
- package/packages/piagent-core/runtime/session/model-authorship-state.ts +31 -3
- package/packages/piagent-core/runtime/session/runtime-state.ts +11 -1
- package/packages/piagent-webui/dist/client/assets/index-DjMntaK5.js +172 -0
- package/packages/piagent-webui/dist/client/assets/index-DwKCWbwd.css +1 -0
- package/packages/piagent-webui/dist/client/index.html +16 -0
- package/packages/piagent-webui/extension/attachment-store.ts +323 -0
- package/packages/piagent-webui/extension/held-message-queue.ts +311 -0
- package/packages/piagent-webui/extension/lifecycle-controller.ts +408 -0
- package/packages/piagent-webui/extension/lifecycle-event-adapter.ts +23 -0
- package/packages/piagent-webui/extension/piagent-webui.ts +470 -0
- package/packages/piagent-webui/extension/review-controller.ts +160 -0
- package/packages/piagent-webui/extension/same-session-bridge.ts +500 -0
- package/packages/piagent-webui/extension/session-options-controller.ts +281 -0
- package/packages/piagent-webui/extension/session-stream-adapter.ts +249 -0
- package/packages/piagent-webui/extension/source-mutation-controller.ts +215 -0
- package/packages/piagent-webui/extension/source-open-controller.ts +136 -0
- package/packages/piagent-webui/extension/source-revert-controller.ts +189 -0
- package/packages/piagent-webui/extension/terminal-session-adapter.ts +73 -0
- package/packages/piagent-webui/extension/vscode-handoff.ts +51 -0
- package/packages/piagent-webui/gateway/control-socket.ts +92 -0
- package/packages/piagent-webui/gateway/gateway-events.ts +60 -0
- package/packages/piagent-webui/gateway/gateway-protocol-service.ts +64 -0
- package/packages/piagent-webui/gateway/gateway-service.ts +215 -0
- package/packages/piagent-webui/gateway/gateway-session-stream.ts +110 -0
- package/packages/piagent-webui/gateway/mcp-auth-broker.ts +158 -0
- package/packages/piagent-webui/gateway/native-project-picker.ts +29 -0
- package/packages/piagent-webui/gateway/pi-host.ts +41 -0
- package/packages/piagent-webui/gateway/profile-state.ts +1 -0
- package/packages/piagent-webui/gateway/project-registry.ts +108 -0
- package/packages/piagent-webui/gateway/provider-auth-broker.ts +172 -0
- package/packages/piagent-webui/gateway/session-catalog.ts +128 -0
- package/packages/piagent-webui/gateway/session-command-controller.ts +237 -0
- package/packages/piagent-webui/gateway/session-command-store.ts +224 -0
- package/packages/piagent-webui/gateway/session-inspection-registry.ts +204 -0
- package/packages/piagent-webui/gateway/session-lease-store.ts +1 -0
- package/packages/piagent-webui/gateway/session-metadata-store.ts +152 -0
- package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +485 -0
- package/packages/piagent-webui/ownership/gateway-runtime-context.ts +8 -0
- package/packages/piagent-webui/ownership/profile-state.ts +117 -0
- package/packages/piagent-webui/ownership/session-lease-store.ts +329 -0
- package/packages/piagent-webui/ownership/session-refs.ts +8 -0
- package/packages/piagent-webui/package.json +33 -0
- package/packages/piagent-webui/server/README.md +4 -0
- package/packages/piagent-webui/server/benchmark-release-monitor.ts +230 -0
- package/packages/piagent-webui/server/core-inspection-provider.ts +403 -0
- package/packages/piagent-webui/server/gateway-websocket.ts +143 -0
- package/packages/piagent-webui/server/http-security.ts +27 -0
- package/packages/piagent-webui/server/ipc-read-model-client.ts +89 -0
- package/packages/piagent-webui/server/loopback-server.ts +368 -0
- package/packages/piagent-webui/server/read-model-provider.ts +37 -0
- package/packages/piagent-webui/server/read-only-router.ts +105 -0
- package/packages/piagent-webui/server/session-auth.ts +88 -0
- package/packages/piagent-webui/server/sidecar-main.ts +86 -0
- package/packages/piagent-webui/server/sse-hub.ts +76 -0
- package/packages/piagent-webui/server/static-bundle.ts +40 -0
- package/packages/piagent-webui/server/transcript-projection.ts +110 -0
- package/schemas/mutation-provenance-record.schema.json +100 -0
- package/schemas/piagent-webui/approval-v1.schema.json +654 -0
- package/schemas/piagent-webui/attachment-v1.schema.json +267 -0
- package/schemas/piagent-webui/capabilities-v1.schema.json +729 -0
- package/schemas/piagent-webui/catalog-v1.json +240 -0
- package/schemas/piagent-webui/commit-summary-v1.schema.json +63 -0
- package/schemas/piagent-webui/common-v1.schema.json +479 -0
- package/schemas/piagent-webui/control-command-v1.schema.json +1780 -0
- package/schemas/piagent-webui/diff-v1.schema.json +826 -0
- package/schemas/piagent-webui/gateway-capabilities-v1.schema.json +136 -0
- package/schemas/piagent-webui/gateway-protocol-v1.schema.json +456 -0
- package/schemas/piagent-webui/handoff-history-v1.schema.json +92 -0
- package/schemas/piagent-webui/model-catalog-v1.schema.json +95 -0
- package/schemas/piagent-webui/queue-v1.schema.json +99 -0
- package/schemas/piagent-webui/recovery-history-v1.schema.json +144 -0
- package/schemas/piagent-webui/release-monitor-v1.schema.json +173 -0
- package/schemas/piagent-webui/review-state-v1.schema.json +206 -0
- package/schemas/piagent-webui/runtime-event-v2.schema.json +5206 -0
- package/schemas/piagent-webui/session-catalog-v1.schema.json +222 -0
- package/schemas/piagent-webui/session-command-v1.schema.json +390 -0
- package/schemas/piagent-webui/snapshot-v1.schema.json +2622 -0
- package/schemas/piagent-webui/source-change-v1.schema.json +763 -0
- package/schemas/piagent-webui/source-mutation-v1.schema.json +96 -0
- package/schemas/piagent-webui/source-revert-v1.schema.json +130 -0
- package/schemas/piagent-webui/subagent-tree-v1.schema.json +88 -0
- package/schemas/piagent-webui/task-index-v1.schema.json +74 -0
- package/schemas/piagent-webui/task-timeline-v1.schema.json +49 -0
- package/schemas/piagent-webui/transcript-v1.schema.json +243 -0
- package/schemas/task-baseline-manifest.schema.json +122 -0
- package/schemas/verifier-file-snapshot.schema.json +81 -0
- package/scripts/check-architecture.mjs +1 -0
- package/scripts/check-doc-languages.mjs +19 -2
- package/scripts/check-third-party-neutrality.mjs +43 -0
- package/scripts/install-global.sh +1 -1
- package/scripts/piagent-cli.mjs +17 -3
- package/scripts/piagent-dashboard.mjs +208 -0
- package/scripts/piagent-webui-launcher.mjs +121 -0
- package/scripts/typescript-loader.mjs +26 -1
- package/scripts/verify-local.sh +253 -0
- package/scripts/verify-release-identity.mjs +4 -1
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/approval-v1.schema.json",
|
|
4
|
+
"title": "Piagent WebUI exact-action approval wire records v1",
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{ "$ref": "#/$defs/approvalRequest" },
|
|
7
|
+
{ "$ref": "#/$defs/approvalDecision" },
|
|
8
|
+
{ "$ref": "#/$defs/approvalReceipt" }
|
|
9
|
+
],
|
|
10
|
+
"$defs": {
|
|
11
|
+
"approvalIdentity": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"required": [
|
|
15
|
+
"projectRef",
|
|
16
|
+
"runtimeInstanceId",
|
|
17
|
+
"sessionRef",
|
|
18
|
+
"taskId",
|
|
19
|
+
"taskRunId",
|
|
20
|
+
"agentOperationId",
|
|
21
|
+
"toolCallId"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"projectRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
25
|
+
"runtimeInstanceId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
26
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
27
|
+
"taskId": { "$ref": "common-v1.schema.json#/$defs/publicId" },
|
|
28
|
+
"taskRunId": { "$ref": "common-v1.schema.json#/$defs/publicId" },
|
|
29
|
+
"agentOperationId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
30
|
+
"toolCallId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"expectedRevisions": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": [
|
|
37
|
+
"runtimeRevision",
|
|
38
|
+
"taskRevision",
|
|
39
|
+
"controlRevision",
|
|
40
|
+
"approvalRevision",
|
|
41
|
+
"treePrecondition"
|
|
42
|
+
],
|
|
43
|
+
"properties": {
|
|
44
|
+
"runtimeRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
45
|
+
"taskRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
46
|
+
"controlRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
47
|
+
"approvalRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
48
|
+
"treePrecondition": {
|
|
49
|
+
"anyOf": [
|
|
50
|
+
{ "type": "null" },
|
|
51
|
+
{ "$ref": "#/$defs/treePrecondition" }
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"treePrecondition": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"required": ["workspaceRevision", "indexRevision", "preimageDigest"],
|
|
60
|
+
"properties": {
|
|
61
|
+
"workspaceRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
62
|
+
"indexRevision": { "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken" },
|
|
63
|
+
"preimageDigest": { "$ref": "common-v1.schema.json#/$defs/digest" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"nullableLongDisplayText": {
|
|
67
|
+
"anyOf": [
|
|
68
|
+
{ "$ref": "#/$defs/boundedRedactedPreview" },
|
|
69
|
+
{ "type": "null" }
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"boundedRedactedPreview": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"maxLength": 4000,
|
|
75
|
+
"pattern": "^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"
|
|
76
|
+
},
|
|
77
|
+
"oneTimeDecisionToken": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"minLength": 32,
|
|
80
|
+
"maxLength": 160,
|
|
81
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
82
|
+
},
|
|
83
|
+
"safeUrlOrigin": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 8,
|
|
86
|
+
"maxLength": 255,
|
|
87
|
+
"pattern": "^https?://(?:[A-Za-z0-9-]+\\.)*[A-Za-z0-9-]+(?::[0-9]{1,5})?$"
|
|
88
|
+
},
|
|
89
|
+
"approvalActionKind": {
|
|
90
|
+
"enum": [
|
|
91
|
+
"external-provider-action",
|
|
92
|
+
"filesystem-write",
|
|
93
|
+
"filesystem-delete",
|
|
94
|
+
"workspace-patch",
|
|
95
|
+
"source-stage",
|
|
96
|
+
"source-unstage",
|
|
97
|
+
"source-revert"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"preconditionClass": {
|
|
101
|
+
"enum": [
|
|
102
|
+
"runtime-only",
|
|
103
|
+
"workspace-tree",
|
|
104
|
+
"workspace-index"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"targetEvidence": {
|
|
108
|
+
"oneOf": [
|
|
109
|
+
{
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"required": ["state", "reasonCode"],
|
|
113
|
+
"properties": {
|
|
114
|
+
"state": { "const": "provided" },
|
|
115
|
+
"reasonCode": { "type": "null" }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": ["state", "reasonCode"],
|
|
122
|
+
"properties": {
|
|
123
|
+
"state": { "const": "redacted" },
|
|
124
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"approvalAction": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": [
|
|
133
|
+
"kind",
|
|
134
|
+
"preconditionClass",
|
|
135
|
+
"toolName",
|
|
136
|
+
"actionDigest",
|
|
137
|
+
"canonicalization",
|
|
138
|
+
"previewPolicy",
|
|
139
|
+
"commandPreview",
|
|
140
|
+
"parameterPreview",
|
|
141
|
+
"targetEvidence",
|
|
142
|
+
"cwdRef",
|
|
143
|
+
"cwdDisplay",
|
|
144
|
+
"targetRefs",
|
|
145
|
+
"targetPaths",
|
|
146
|
+
"targetSummaries",
|
|
147
|
+
"providerRef",
|
|
148
|
+
"urlOrigin",
|
|
149
|
+
"requestedScope",
|
|
150
|
+
"reason",
|
|
151
|
+
"riskClass",
|
|
152
|
+
"consequences",
|
|
153
|
+
"redaction"
|
|
154
|
+
],
|
|
155
|
+
"properties": {
|
|
156
|
+
"kind": { "$ref": "#/$defs/approvalActionKind" },
|
|
157
|
+
"preconditionClass": { "$ref": "#/$defs/preconditionClass" },
|
|
158
|
+
"toolName": { "$ref": "common-v1.schema.json#/$defs/publicId" },
|
|
159
|
+
"actionDigest": { "$ref": "common-v1.schema.json#/$defs/digest" },
|
|
160
|
+
"canonicalization": { "const": "digest-bound-action-v1" },
|
|
161
|
+
"previewPolicy": { "const": "redacted-no-secrets-v1" },
|
|
162
|
+
"commandPreview": { "$ref": "#/$defs/nullableLongDisplayText" },
|
|
163
|
+
"parameterPreview": { "$ref": "#/$defs/boundedRedactedPreview" },
|
|
164
|
+
"targetEvidence": { "$ref": "#/$defs/targetEvidence" },
|
|
165
|
+
"cwdRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
166
|
+
"cwdDisplay": { "$ref": "common-v1.schema.json#/$defs/nullableSafeDisplayPath" },
|
|
167
|
+
"targetRefs": {
|
|
168
|
+
"type": "array",
|
|
169
|
+
"maxItems": 32,
|
|
170
|
+
"uniqueItems": true,
|
|
171
|
+
"items": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" }
|
|
172
|
+
},
|
|
173
|
+
"targetPaths": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"maxItems": 32,
|
|
176
|
+
"uniqueItems": true,
|
|
177
|
+
"items": { "$ref": "common-v1.schema.json#/$defs/safeDisplayPath" }
|
|
178
|
+
},
|
|
179
|
+
"targetSummaries": {
|
|
180
|
+
"type": "array",
|
|
181
|
+
"maxItems": 32,
|
|
182
|
+
"items": { "$ref": "common-v1.schema.json#/$defs/nonEmptyDisplayText" }
|
|
183
|
+
},
|
|
184
|
+
"providerRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
|
|
185
|
+
"urlOrigin": {
|
|
186
|
+
"anyOf": [
|
|
187
|
+
{ "$ref": "#/$defs/safeUrlOrigin" },
|
|
188
|
+
{ "type": "null" }
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"requestedScope": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
192
|
+
"reason": { "$ref": "common-v1.schema.json#/$defs/nonEmptyDisplayText" },
|
|
193
|
+
"riskClass": { "enum": ["low", "medium", "high", "critical"] },
|
|
194
|
+
"consequences": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"additionalProperties": false,
|
|
197
|
+
"required": ["allow", "deny"],
|
|
198
|
+
"properties": {
|
|
199
|
+
"allow": { "$ref": "common-v1.schema.json#/$defs/nonEmptyDisplayText" },
|
|
200
|
+
"deny": { "$ref": "common-v1.schema.json#/$defs/nonEmptyDisplayText" }
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"redaction": { "$ref": "common-v1.schema.json#/$defs/redaction" }
|
|
204
|
+
},
|
|
205
|
+
"allOf": [
|
|
206
|
+
{
|
|
207
|
+
"if": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"targetEvidence": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": { "state": { "const": "provided" } },
|
|
213
|
+
"required": ["state"]
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"required": ["targetEvidence"]
|
|
217
|
+
},
|
|
218
|
+
"then": {
|
|
219
|
+
"anyOf": [
|
|
220
|
+
{ "type": "object", "properties": { "targetRefs": { "type": "array", "minItems": 1 } } },
|
|
221
|
+
{ "type": "object", "properties": { "targetPaths": { "type": "array", "minItems": 1 } } },
|
|
222
|
+
{ "type": "object", "properties": { "targetSummaries": { "type": "array", "minItems": 1 } } }
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"else": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"properties": {
|
|
228
|
+
"targetRefs": { "type": "array", "maxItems": 0 },
|
|
229
|
+
"targetPaths": { "type": "array", "maxItems": 0 },
|
|
230
|
+
"targetSummaries": { "type": "array", "maxItems": 0 }
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"if": {
|
|
236
|
+
"properties": {
|
|
237
|
+
"kind": { "const": "external-provider-action" }
|
|
238
|
+
},
|
|
239
|
+
"required": ["kind"]
|
|
240
|
+
},
|
|
241
|
+
"then": {
|
|
242
|
+
"properties": {
|
|
243
|
+
"preconditionClass": { "const": "runtime-only" }
|
|
244
|
+
},
|
|
245
|
+
"anyOf": [
|
|
246
|
+
{
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": { "providerRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" } }
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"type": "object",
|
|
252
|
+
"properties": { "urlOrigin": { "$ref": "#/$defs/safeUrlOrigin" } }
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"if": {
|
|
259
|
+
"properties": {
|
|
260
|
+
"kind": {
|
|
261
|
+
"enum": [
|
|
262
|
+
"filesystem-write",
|
|
263
|
+
"filesystem-delete",
|
|
264
|
+
"workspace-patch",
|
|
265
|
+
"source-revert"
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"required": ["kind"]
|
|
270
|
+
},
|
|
271
|
+
"then": {
|
|
272
|
+
"properties": {
|
|
273
|
+
"preconditionClass": { "const": "workspace-tree" }
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"if": {
|
|
279
|
+
"properties": {
|
|
280
|
+
"kind": {
|
|
281
|
+
"enum": ["source-stage", "source-unstage"]
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"required": ["kind"]
|
|
285
|
+
},
|
|
286
|
+
"then": {
|
|
287
|
+
"properties": {
|
|
288
|
+
"preconditionClass": { "const": "workspace-index" }
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
"approvalRequest": {
|
|
295
|
+
"type": "object",
|
|
296
|
+
"additionalProperties": false,
|
|
297
|
+
"required": [
|
|
298
|
+
"schemaVersion",
|
|
299
|
+
"version",
|
|
300
|
+
"recordType",
|
|
301
|
+
"approvalRef",
|
|
302
|
+
"decisionToken",
|
|
303
|
+
"identity",
|
|
304
|
+
"action",
|
|
305
|
+
"expectedRevisions",
|
|
306
|
+
"state",
|
|
307
|
+
"requestedAt",
|
|
308
|
+
"expiresAt",
|
|
309
|
+
"executor",
|
|
310
|
+
"directExecution"
|
|
311
|
+
],
|
|
312
|
+
"properties": {
|
|
313
|
+
"schemaVersion": { "const": 1 },
|
|
314
|
+
"version": { "const": "piagent-webui-approval-v1" },
|
|
315
|
+
"recordType": { "const": "request" },
|
|
316
|
+
"approvalRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
317
|
+
"decisionToken": { "$ref": "#/$defs/oneTimeDecisionToken" },
|
|
318
|
+
"identity": { "$ref": "#/$defs/approvalIdentity" },
|
|
319
|
+
"action": { "$ref": "#/$defs/approvalAction" },
|
|
320
|
+
"expectedRevisions": { "$ref": "#/$defs/expectedRevisions" },
|
|
321
|
+
"state": { "const": "waiting" },
|
|
322
|
+
"requestedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
323
|
+
"expiresAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
324
|
+
"executor": { "const": "pi-guard" },
|
|
325
|
+
"directExecution": { "const": false }
|
|
326
|
+
},
|
|
327
|
+
"allOf": [
|
|
328
|
+
{
|
|
329
|
+
"if": {
|
|
330
|
+
"properties": {
|
|
331
|
+
"action": {
|
|
332
|
+
"type": "object",
|
|
333
|
+
"properties": {
|
|
334
|
+
"preconditionClass": { "const": "runtime-only" }
|
|
335
|
+
},
|
|
336
|
+
"required": ["preconditionClass"]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"required": ["action"]
|
|
340
|
+
},
|
|
341
|
+
"then": {
|
|
342
|
+
"properties": {
|
|
343
|
+
"expectedRevisions": {
|
|
344
|
+
"type": "object",
|
|
345
|
+
"properties": {
|
|
346
|
+
"treePrecondition": { "type": "null" }
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"if": {
|
|
354
|
+
"properties": {
|
|
355
|
+
"action": {
|
|
356
|
+
"type": "object",
|
|
357
|
+
"properties": {
|
|
358
|
+
"preconditionClass": { "const": "workspace-tree" }
|
|
359
|
+
},
|
|
360
|
+
"required": ["preconditionClass"]
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"required": ["action"]
|
|
364
|
+
},
|
|
365
|
+
"then": {
|
|
366
|
+
"properties": {
|
|
367
|
+
"expectedRevisions": {
|
|
368
|
+
"type": "object",
|
|
369
|
+
"properties": {
|
|
370
|
+
"treePrecondition": { "$ref": "#/$defs/treePrecondition" }
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"if": {
|
|
378
|
+
"properties": {
|
|
379
|
+
"action": {
|
|
380
|
+
"type": "object",
|
|
381
|
+
"properties": {
|
|
382
|
+
"preconditionClass": { "const": "workspace-index" }
|
|
383
|
+
},
|
|
384
|
+
"required": ["preconditionClass"]
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
"required": ["action"]
|
|
388
|
+
},
|
|
389
|
+
"then": {
|
|
390
|
+
"properties": {
|
|
391
|
+
"expectedRevisions": {
|
|
392
|
+
"type": "object",
|
|
393
|
+
"properties": {
|
|
394
|
+
"treePrecondition": {
|
|
395
|
+
"allOf": [
|
|
396
|
+
{ "$ref": "#/$defs/treePrecondition" },
|
|
397
|
+
{
|
|
398
|
+
"type": "object",
|
|
399
|
+
"properties": {
|
|
400
|
+
"indexRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" }
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
},
|
|
412
|
+
"approvalDecision": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"additionalProperties": false,
|
|
415
|
+
"required": [
|
|
416
|
+
"schemaVersion",
|
|
417
|
+
"version",
|
|
418
|
+
"recordType",
|
|
419
|
+
"approvalRef",
|
|
420
|
+
"decisionId",
|
|
421
|
+
"decisionToken",
|
|
422
|
+
"identity",
|
|
423
|
+
"actionDigest",
|
|
424
|
+
"expectedRevisions",
|
|
425
|
+
"decision",
|
|
426
|
+
"reason",
|
|
427
|
+
"decidedAt",
|
|
428
|
+
"expiresAt",
|
|
429
|
+
"decisionSurface",
|
|
430
|
+
"executor",
|
|
431
|
+
"directExecution"
|
|
432
|
+
],
|
|
433
|
+
"properties": {
|
|
434
|
+
"schemaVersion": { "const": 1 },
|
|
435
|
+
"version": { "const": "piagent-webui-approval-v1" },
|
|
436
|
+
"recordType": { "const": "decision" },
|
|
437
|
+
"approvalRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
438
|
+
"decisionId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
439
|
+
"decisionToken": { "$ref": "#/$defs/oneTimeDecisionToken" },
|
|
440
|
+
"identity": { "$ref": "#/$defs/approvalIdentity" },
|
|
441
|
+
"actionDigest": { "$ref": "common-v1.schema.json#/$defs/digest" },
|
|
442
|
+
"expectedRevisions": { "$ref": "#/$defs/expectedRevisions" },
|
|
443
|
+
"decision": { "enum": ["allow", "deny"] },
|
|
444
|
+
"reason": { "$ref": "common-v1.schema.json#/$defs/nullableDisplayText" },
|
|
445
|
+
"decidedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
446
|
+
"expiresAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
447
|
+
"decisionSurface": { "const": "webui" },
|
|
448
|
+
"executor": { "const": "pi-guard" },
|
|
449
|
+
"directExecution": { "const": false }
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"receiptRevisions": {
|
|
453
|
+
"type": "object",
|
|
454
|
+
"additionalProperties": false,
|
|
455
|
+
"required": ["runtimeRevision", "taskRevision", "controlRevision", "approvalRevision"],
|
|
456
|
+
"properties": {
|
|
457
|
+
"runtimeRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
458
|
+
"taskRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
459
|
+
"controlRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
460
|
+
"approvalRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" }
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"permitNotIssued": {
|
|
464
|
+
"type": "object",
|
|
465
|
+
"additionalProperties": false,
|
|
466
|
+
"required": ["status", "issuedAt", "consumedAt", "reasonCode"],
|
|
467
|
+
"properties": {
|
|
468
|
+
"status": { "const": "not-issued" },
|
|
469
|
+
"issuedAt": { "type": "null" },
|
|
470
|
+
"consumedAt": { "type": "null" },
|
|
471
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
"permitProvisional": {
|
|
475
|
+
"type": "object",
|
|
476
|
+
"additionalProperties": false,
|
|
477
|
+
"required": ["status", "issuedAt", "consumedAt", "reasonCode"],
|
|
478
|
+
"properties": {
|
|
479
|
+
"status": { "const": "provisional" },
|
|
480
|
+
"issuedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
481
|
+
"consumedAt": { "type": "null" },
|
|
482
|
+
"reasonCode": { "type": "null" }
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"permitConsumed": {
|
|
486
|
+
"type": "object",
|
|
487
|
+
"additionalProperties": false,
|
|
488
|
+
"required": ["status", "issuedAt", "consumedAt", "reasonCode"],
|
|
489
|
+
"properties": {
|
|
490
|
+
"status": { "const": "consumed" },
|
|
491
|
+
"issuedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
492
|
+
"consumedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
493
|
+
"reasonCode": { "type": "null" }
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"permitCancelled": {
|
|
497
|
+
"type": "object",
|
|
498
|
+
"additionalProperties": false,
|
|
499
|
+
"required": ["status", "issuedAt", "consumedAt", "reasonCode"],
|
|
500
|
+
"properties": {
|
|
501
|
+
"status": { "enum": ["cancelled", "expired"] },
|
|
502
|
+
"issuedAt": {
|
|
503
|
+
"anyOf": [
|
|
504
|
+
{ "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
505
|
+
{ "type": "null" }
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
"consumedAt": { "type": "null" },
|
|
509
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
"permit": {
|
|
513
|
+
"oneOf": [
|
|
514
|
+
{ "$ref": "#/$defs/permitNotIssued" },
|
|
515
|
+
{ "$ref": "#/$defs/permitProvisional" },
|
|
516
|
+
{ "$ref": "#/$defs/permitConsumed" },
|
|
517
|
+
{ "$ref": "#/$defs/permitCancelled" }
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
"approvalReceipt": {
|
|
521
|
+
"type": "object",
|
|
522
|
+
"additionalProperties": false,
|
|
523
|
+
"required": [
|
|
524
|
+
"schemaVersion",
|
|
525
|
+
"version",
|
|
526
|
+
"recordType",
|
|
527
|
+
"approvalRef",
|
|
528
|
+
"decisionId",
|
|
529
|
+
"identity",
|
|
530
|
+
"actionDigest",
|
|
531
|
+
"state",
|
|
532
|
+
"decision",
|
|
533
|
+
"winnerSurface",
|
|
534
|
+
"resolutionReason",
|
|
535
|
+
"resolvedAt",
|
|
536
|
+
"preRevisions",
|
|
537
|
+
"postRevisions",
|
|
538
|
+
"permit",
|
|
539
|
+
"deduplicated",
|
|
540
|
+
"auditRef",
|
|
541
|
+
"executor",
|
|
542
|
+
"directExecution"
|
|
543
|
+
],
|
|
544
|
+
"properties": {
|
|
545
|
+
"schemaVersion": { "const": 1 },
|
|
546
|
+
"version": { "const": "piagent-webui-approval-v1" },
|
|
547
|
+
"recordType": { "const": "receipt" },
|
|
548
|
+
"approvalRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
549
|
+
"decisionId": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
|
|
550
|
+
"identity": { "$ref": "#/$defs/approvalIdentity" },
|
|
551
|
+
"actionDigest": { "$ref": "common-v1.schema.json#/$defs/digest" },
|
|
552
|
+
"state": { "enum": ["resolved", "expired", "cancelled"] },
|
|
553
|
+
"decision": {
|
|
554
|
+
"anyOf": [
|
|
555
|
+
{ "enum": ["allow", "deny"] },
|
|
556
|
+
{ "type": "null" }
|
|
557
|
+
]
|
|
558
|
+
},
|
|
559
|
+
"winnerSurface": { "enum": ["webui", "terminal", "runtime-expiry", "runtime-control", "runtime-restart"] },
|
|
560
|
+
"resolutionReason": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" },
|
|
561
|
+
"resolvedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
562
|
+
"preRevisions": { "$ref": "#/$defs/expectedRevisions" },
|
|
563
|
+
"postRevisions": { "$ref": "#/$defs/receiptRevisions" },
|
|
564
|
+
"permit": { "$ref": "#/$defs/permit" },
|
|
565
|
+
"deduplicated": { "type": "boolean" },
|
|
566
|
+
"auditRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
567
|
+
"executor": { "const": "pi-guard" },
|
|
568
|
+
"directExecution": { "const": false }
|
|
569
|
+
},
|
|
570
|
+
"allOf": [
|
|
571
|
+
{
|
|
572
|
+
"if": { "properties": { "state": { "const": "resolved" } } },
|
|
573
|
+
"then": {
|
|
574
|
+
"properties": {
|
|
575
|
+
"decisionId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
576
|
+
"decision": { "enum": ["allow", "deny"] },
|
|
577
|
+
"winnerSurface": { "enum": ["webui", "terminal"] }
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"if": {
|
|
583
|
+
"properties": {
|
|
584
|
+
"state": { "const": "resolved" },
|
|
585
|
+
"decision": { "const": "deny" }
|
|
586
|
+
},
|
|
587
|
+
"required": ["state", "decision"]
|
|
588
|
+
},
|
|
589
|
+
"then": { "properties": { "permit": { "$ref": "#/$defs/permitNotIssued" } } }
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"if": {
|
|
593
|
+
"properties": {
|
|
594
|
+
"state": { "const": "resolved" },
|
|
595
|
+
"decision": { "const": "allow" }
|
|
596
|
+
},
|
|
597
|
+
"required": ["state", "decision"]
|
|
598
|
+
},
|
|
599
|
+
"then": {
|
|
600
|
+
"properties": {
|
|
601
|
+
"permit": {
|
|
602
|
+
"oneOf": [
|
|
603
|
+
{ "$ref": "#/$defs/permitProvisional" },
|
|
604
|
+
{ "$ref": "#/$defs/permitConsumed" },
|
|
605
|
+
{ "$ref": "#/$defs/permitCancelled" }
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"if": { "properties": { "state": { "const": "expired" } } },
|
|
613
|
+
"then": {
|
|
614
|
+
"properties": {
|
|
615
|
+
"decisionId": { "type": "null" },
|
|
616
|
+
"decision": { "type": "null" },
|
|
617
|
+
"winnerSurface": { "const": "runtime-expiry" },
|
|
618
|
+
"resolutionReason": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
619
|
+
"permit": {
|
|
620
|
+
"allOf": [
|
|
621
|
+
{ "$ref": "#/$defs/permitCancelled" },
|
|
622
|
+
{
|
|
623
|
+
"type": "object",
|
|
624
|
+
"properties": { "status": { "const": "expired" } }
|
|
625
|
+
}
|
|
626
|
+
]
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"if": { "properties": { "state": { "const": "cancelled" } } },
|
|
633
|
+
"then": {
|
|
634
|
+
"properties": {
|
|
635
|
+
"decisionId": { "type": "null" },
|
|
636
|
+
"decision": { "type": "null" },
|
|
637
|
+
"winnerSurface": { "enum": ["runtime-control", "runtime-restart"] },
|
|
638
|
+
"resolutionReason": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
639
|
+
"permit": {
|
|
640
|
+
"allOf": [
|
|
641
|
+
{ "$ref": "#/$defs/permitCancelled" },
|
|
642
|
+
{
|
|
643
|
+
"type": "object",
|
|
644
|
+
"properties": { "status": { "const": "cancelled" } }
|
|
645
|
+
}
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
]
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|